mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-25 14:44:43 +02:00
change sccm ps module path
This commit is contained in:
parent
dbcbe4c2b9
commit
97f8b98ff7
@ -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…
x
Reference in New Issue
Block a user