change sccm ps module path
This commit is contained in:
parent
39c72fc2b9
commit
75243c95c4
|
@ -44,10 +44,9 @@ $ProgressPreference = "SilentlyContinue"
|
||||||
Try {
|
Try {
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
$module = ${env:ProgramFiles} + "\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1"
|
$modulePath = ${env:SMS_ADMIN_UI_PATH}
|
||||||
If (-Not (Test-Path $module)) {
|
$modulePath = $modulePath.Substring(0, $modulePath.lastIndexOf("\"))
|
||||||
$module = ${env:ProgramFiles(x86)} + "\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1"
|
$module = $modulePath + "\ConfigurationManager.psd1"
|
||||||
}
|
|
||||||
Import-Module $module
|
Import-Module $module
|
||||||
|
|
||||||
New-PSDrive -Name SCCMDrive -PSProvider "AdminUI.PS.Provider\CMSite" -Root $env:COMPUTERNAME -Description "SCCM Site" | Out-Null
|
New-PSDrive -Name SCCMDrive -PSProvider "AdminUI.PS.Provider\CMSite" -Root $env:COMPUTERNAME -Description "SCCM Site" | Out-Null
|
||||||
|
|
|
@ -44,10 +44,9 @@ $ProgressPreference = "SilentlyContinue"
|
||||||
Try {
|
Try {
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
$module = ${env:ProgramFiles} + "\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1"
|
$modulePath = ${env:SMS_ADMIN_UI_PATH}
|
||||||
If (-Not (Test-Path $module)) {
|
$modulePath = $modulePath.Substring(0, $modulePath.lastIndexOf("\"))
|
||||||
$module = ${env:ProgramFiles(x86)} + "\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1"
|
$module = $modulePath + "\ConfigurationManager.psd1"
|
||||||
}
|
|
||||||
Import-Module $module
|
Import-Module $module
|
||||||
|
|
||||||
New-PSDrive -Name SCCMDrive -PSProvider "AdminUI.PS.Provider\CMSite" -Root $env:COMPUTERNAME -Description "SCCM Site" | Out-Null
|
New-PSDrive -Name SCCMDrive -PSProvider "AdminUI.PS.Provider\CMSite" -Root $env:COMPUTERNAME -Description "SCCM Site" | Out-Null
|
||||||
|
|
Loading…
Reference in New Issue