This repository has been archived by the owner on Nov 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Install.ps1
33 lines (30 loc) · 1.5 KB
/
Install.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$modulePath = ([Environment]::GetFolderPath([Environment+SpecialFolder]::MyDocuments)) + "\WindowsPowershell\Modules\SCCM"
if((Test-Path $modulePath) -ne $true) {
New-Item $modulePath -ItemType directory > $null
}
try {
Copy-Item -Path ".\SCCM.psd1" -Destination $modulePath -Force
Copy-Item -Path ".\SCCM.psm1" -Destination $modulePath -Force
Copy-Item -Path ".\SCCM_Advertisement.psm1" -Destination $modulePath -Force
Copy-Item -Path ".\SCCM_Client.psm1" -Destination $modulePath -Force
Copy-Item -Path ".\SCCM_Collection.psm1" -Destination $modulePath -Force
Copy-Item -Path ".\SCCM_Computer.psm1" -Destination $modulePath -Force
Copy-Item -Path ".\SCCM_Folder.psm1" -Destination $modulePath -Force
Copy-Item -Path ".\SCCM_Package.psm1" -Destination $modulePath -Force
Copy-Item -Path ".\SCCM_Formats.ps1xml" -Destination $modulePath -Force
Write-Host ">>> SCCM module successfully installed to:" -Foreground green
Write-Host ">>> `t$modulePath" -Foreground green
Write-Host ">>>"
Write-Host ">>> Make sure that $modulePath is part of your PSModulePath"
Write-Host ">>> then try running:"
Write-Host ">>>"
Write-Host ">>> `tImport-Module SCCM"
Write-Host ">>> `tGet-Help SCCM"
Write-Host ">>>"
} catch {
Write-Host ">>> There was a problem when trying to install to:" -Foreground red
Write-Host ">>> `t$modulePath" -Foreground red
Write-Host ">>>"
Write-Host ">>> You might need to perform the installation manually."
Write-Host '>>>'
}