Business Central includes Windows PowerShell cmdlets for administration and for development and file management of application object files and extension packages. The cmdlets are available in six different modules that you can access from the Business Central Administration Shell and Microsoft Dynamics NAV Development Shell. For information about cmdlets in each module, including the syntax, options, and examples, see the following sections.
Importante
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.
The modules are installed as part of the Business Central Server installation. When the Business Central Server is installed two shortcuts are added to the Windows Start menu:
Business Central Administration Shell shortcut runs the navadmintool.ps1.
Business Central Development Shell shortcut runs the navmodeltools.ps1.
There are two ways to start the Business Central Administration Shell on the computer that's running Business Central Server: from the Windows Start menu or from Windows PowerShell.
Importante
To run the cmdlets in the Business Central Administration Shell, you must be a member of the local Administrator group on the computer where the shell is installed.
From the Start menu
The Start menu is the easiest way, especially if you only have one version Business Central installed. Go to Start, type Business Central Administration Shell in the search box, right-click the link that's found, and then choose Run as Administrator.
From Windows PowerShell
This way is useful when you have more than one Business Central version installed, and you don't have specific shortcuts to the Business Central Administration Shell for each version.
Start Windows PowerShell as an administrator as follows:
Select the Start, type PowerShell in the search box, right-click Windows PowerShell, then select Run as administrator.
Each Business Central Server installation includes a navadmintool.ps1 file for the Business Central Administration Shell. By default, file is located in the "C:\Program Files\Microsoft Dynamics 365 Business Central\<version number>\Service\navadmintool.ps1". Replace <path to navadmintool.ps1> with the path for version of the shell that you want to run, for example:
PowerShell
Import-Module -name"C:\Program Files\Microsoft Dynamics 365 Business Central\190\Service\navadmintool.ps1"
Starting a Business Central Development Shell
Like the Business Central Development Shell, there are two ways to start the Business Central Development Shell: from the Windows Start menu or from Windows PowerShell.
From the Start menu
The Start menu is the easiest way, especially if you only have one version Business Central installed. Go to Start, type Business Central Development Shell in the search box, the select the related link.
From Windows PowerShell
Start Windows PowerShell as an administrator:
Select the Start, type PowerShell in the search box, right-click Windows PowerShell, then select Run as administrator.
At the command prompt, enter the following command:
PowerShell
Import-Module -name <path to navamodeltools.ps1>
Each Business Central Server installation includes a navmodeltools.ps1 file for the administration shell. By default, file is located in the "C:\Program Files\Microsoft Dynamics 365 Business Central\<version number>\Service\navmodeltools.ps1". Replace <path to navmodeltools.ps1> with the path for version of the shell that you want to run, for example:
PowerShell
Import-Module -name"C:\Program Files\Microsoft Dynamics 365 Business Central\190\Service\navmodeltools.ps1"
Este módulo aborda os cmdlets usados para definir configurações relacionadas à Política de Grupo, ao Gerenciador do Servidor, ao Hyper-V e ao IIS (Serviços de Informações da Internet).