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