次の方法で共有


Microsoft Dynamics NAV Windows PowerShell Cmdlets

Microsoft Dynamics NAV 2018 includes Windows PowerShell cmdlets for administration and for development and file management of application object files and extension packages. The cmdlets are available in two Windows PowerShell modules: Microsoft Dynamics NAV Administration Shell and Microsoft Dynamics NAV Development Shell.

  • The Microsoft Dynamics NAV Administration Shell includes cmdlets for administering the Dynamics NAV deployment, such as adding and configuring Dynamics NAV server instances, databases, and users. Also included are cmdlets for administering extension packages. The Microsoft Dynamics NAV Administration Shell is installed with the Microsoft Dynamics NAV Server.

  • The Microsoft Dynamics NAV Development Shell includes cmdlets for merging and modifying application object files. Also included are cmdlets for creating extension packages. The Microsoft Dynamics NAV Development Shell is installed with the Microsoft Dynamics NAV Development Environment.

The cmdlets are implemented in Windows PowerShell 3.0, which is included with Windows Server 2012 and Windows 8 and later. For other versions of Windows supported for Microsoft Dynamics NAV 2018, you can install it as part of the Windows Management Framework 3.0 on the Microsoft Download Center.

Important

Cmdlets can perform actions that can also be done from the client, such as creating and modifying entities like web services, companies, users, and more. Be aware that cmdlets do not execute code on application objects (such as tables or pages) that are associated with these entities. If you have added logic to these application objects, the logic will be ignored by the cmdlets. For example, if you added logic on table 9900 Web Service Aggregate to control the creation of web services, although this logic will run from the client, it will be ignored when creating web services by using the New-NAVWebService cmdlet.

Starting a Microsoft Dynamics NAV Administration Shell Session

You must run the Microsoft Dynamics NAV Administration Shell as an Administrator. On the computer that is running Microsoft Dynamics NAV Server, choose Start, in the Search box, type Microsoft Dynamics NAV Administration Shell, right-click the related link, and then choose Run as Administrator.

Important

To run the cmdlets in the Microsoft Dynamics NAV Administration Shell, you must be a member of the local Administrator group on the computer where the Microsoft Dynamics NAV Administration Shell is installed.

Starting a Microsoft Dynamics NAV Development Shell Session

On the computer that is running Microsoft Dynamics NAV Development Environment, choose Start, in the Search box, type Microsoft Dynamics NAV Development Shell, and then choose the related link.

Getting Help on Dynamics NAV Cmdlets

To see the cmdlets that are available for Dynamics NAV, type the following at the Windows PowerShell prompt.

Get-Command *NAV*  

To get Help about syntax and options for a specific cmdlet, type the following cmdlet.

Get-Help <cmd name>  

For example, to get Help about the Get-NAVServerInstance cmdlet, type the following.

Get-Help Get-NAVServerInstance  

To get online Help in the MSDN Library for a specific cmdlet, type the following cmdlet.

Get-Help <cmd name> -online  

Note

The cmdlet help for Microsoft Dynamics NAV 2017 is currently not available in the MSDN Library. The -online switch parameter will open the Microsoft Dynamics NAV 2016 version of the help in the MSDN Library instead. For the latest cndlet help, use the cmdlet help in command-line interface (by omitting -online switch parameter).

For more information about Microsoft Dynamics NAV Administration Shell cmdlets, see Administration Cmdlets for Microsoft Dynamics NAV and Administration Cmdlets for Microsoft Dynamics NAV Extensions.

For more information about Microsoft Dynamics NAV Development Shell cmdlets, see Development Cmdlets for Microsoft Dynamics NAV and Development Cmdlets for Microsoft Dynamics NAV Extensions.

For more information about Windows PowerShell, see Windows PowerShell Getting Started Guide.

See Also

Sample Windows PowerShell Scripts for Microsoft Dynamics NAV
Administration
Comparing and Merging Application Object Source Files