Get-PC/Private/Update-GetPC.ps1

17 lines
563 B
PowerShell
Raw Normal View History

2024-06-11 18:27:55 +00:00
function Update-GetPC {
$GetPCSourcePath = "\\int.samhealth.net\files\TEAM\SHSISDesktopSolutions\Powershell\Get-PC_Update_2023\Prod\Get-PC\"
$desinationPath = ($env:PSModulePath -split ';')[0] + "\Get-PC"
Write-Host "Updating Get-PC..."
Robocopy.exe $GetPCSourcePath $desinationPath /mir | Out-Null
if($LASTEXITCODE -gt 7){
Write-Warning 'An error has occured during update. Please restart powershell and try again'
}
else{
Write-Host 'Update Complete: Please Restart Powershell' -ForegroundColor Green
}
}