11. März 2016 10:21
$nstDefaultPath = "C:\Program Files\Microsoft Dynamics NAV\90\Service\"
$nstPath = "C:\NAV Versionen\NAV 2016 CU4 44974 DE\Service\"
$regPath = "HKLM:\SOFTWARE\Microsoft\Microsoft Dynamics NAV\90\Service"
#Switch registry to correct path
set-itemproperty -path $regPath -name "Path" -value $nstPath
New-NAVServerInstance "NEU" -DatabaseName "NEU" -DatabaseServer "MeinSQLServer" -ClientServicesPort 7050 -SOAPServicesPort 7051 -ODataServicesPort 7052 -ManagementServicesPort 7049
#Switch registry to default
set-itemproperty -path $regPath -name "Path" -value $nstDefaultPath
New-NAVServerInstance : The term 'New-NAVServerInstance' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
11. März 2016 11:41
The Microsoft Dynamics NAV 2016 Administration Shell includes cmdlets for administering the Microsoft Dynamics NAV deployment, such as adding and configuring Microsoft Dynamics NAV server instances, databases, and users. Also included are cmdlets for administering extension packages. The Microsoft Dynamics NAV 2016 Administration Shell is installed with the Microsoft Dynamics NAV Server.
The Microsoft Dynamics NAV 2016 Development Shell includes cmdlets for merging and modifying application object files. Also included are cmdlets for creating extension packages. The Microsoft Dynamics NAV 2016 Development Shell is installed with the Microsoft Dynamics NAV Development Environment.
Import-Module 'C:\Program Files\Microsoft Dynamics NAV\90\Service\NavAdminTool.ps1' -WarningAction SilentlyContinue | Out-Null
-Module Microsoft.Dynamics.Nav.Model.Tools, Microsoft.Dynamics.Nav.Apps.Tools, Microsoft.Dynamics.Nav.Apps.Management
11. März 2016 11:47
11. März 2016 12:00
Alternatively to running Microsoft Dynamics NAV 2016 Administration Shell and Microsoft Dynamics NAV 2016 Development Shell from where they are installed, you can import the relevant module into the Windows PowerShell Integrated Scripting Environment (ISE).
$code =
{
Import-Module "${env:ProgramFiles(x86)}\Microsoft Dynamics NAV\90\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.psd1" -WarningAction SilentlyContinue | out-null
Import-Module "C:\Program Files\Microsoft Dynamics NAV\90\Service\NavAdminTool.ps1" -WarningAction SilentlyContinue | Out-Null
Import-Module "${env:ProgramFiles(x86)}\Microsoft Dynamics NAV\90\RoleTailored Client\Microsoft.Dynamics.Nav.Apps.Tools.psd1" -WarningAction SilentlyContinue | Out-Null
}
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Load NAV 2016 CmdLets',$code,$null)
$code =
{
Import-Module "${env:ProgramFiles(x86)}\Microsoft Dynamics NAV\80\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.psd1" -WarningAction SilentlyContinue | out-null
Import-Module "C:\Program Files\Microsoft Dynamics NAV\80\Service\NavAdminTool.ps1" -WarningAction SilentlyContinue | Out-Null
}
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Load NAV 2015 CmdLets',$code,$null)
$code =
{
Import-Module "${env:ProgramFiles(x86)}\Microsoft Dynamics NAV\71\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.psd1" -WarningAction SilentlyContinue | out-null
Import-Module "C:\Program Files\Microsoft Dynamics NAV\71\Service\NavAdminTool.ps1" -WarningAction SilentlyContinue | Out-Null
}
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Load NAV 2013 R2 CmdLets',$code,$null)
$code =
{
Import-Module "${env:ProgramFiles(x86)}\Microsoft Dynamics 365 Business Central\140\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.psd1" -WarningAction SilentlyContinue | out-null
Import-Module "C:\Program Files\Microsoft Dynamics 365 Business Central\140\Service\NavAdminTool.ps1" -WarningAction SilentlyContinue | Out-Null
Import-Module "${env:ProgramFiles(x86)}\Microsoft Dynamics 365 Business Central\140\RoleTailored Client\Microsoft.Dynamics.Nav.Apps.Tools.psd1" -WarningAction SilentlyContinue | Out-Null
}
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('Load BC 14.x CmdLets',$code,$null)
11. März 2016 12:28
11. März 2016 14:14
Kowa hat geschrieben:Wie man dort versionsbezogene Module per Mausklick laden kann, steht hier (für NAV 2015):
Load Dynamics NAV CmdLets in PowerShell ISE with Profiles