Fixed UninstallProgram and SHSPrinterWeb
This commit is contained in:
parent
f02ec5d11d
commit
c3259c33a2
|
|
@ -312,39 +312,34 @@ function FindUSBDevice {
|
|||
$deviceID -match '(?<=PID_)(....)' | Out-Null
|
||||
$p = $Matches[0]
|
||||
}
|
||||
for ($i = 0; $i -lt $usbIDs.Count; $i++) {
|
||||
if ($usbIDs[$i] -match $vid){
|
||||
for ($i = 0; $i -lt $usbIDs.Count; $i++) {
|
||||
if (-not ($usbIDs[$i] -match $vid)){ continue }
|
||||
|
||||
if($usbIDs[$i][0] -eq "`t"){
|
||||
if($usbIDs[$i][0] -eq "`t"){ continue }
|
||||
|
||||
}
|
||||
else{
|
||||
$man = ($usbIDs[$i] -split ' ')
|
||||
$man = $man[2..$man.count] -join ' '
|
||||
|
||||
$man = ($usbIDs[$i] -split ' ')
|
||||
$man = $man[2..$man.count] -join ' '
|
||||
|
||||
for ($y = $i+1; $y -lt $usbIDs.Count; $y++) {
|
||||
if($usbIDs[$y][0] -ne "`t"){
|
||||
return @{
|
||||
Manufacturer = $man
|
||||
Description = $null
|
||||
}
|
||||
}
|
||||
if($usbIDs[$y] -match $p){
|
||||
$dev = ($usbIDs[$y] -split ' ')
|
||||
$dev = $dev[2..$dev.count] -join ' '
|
||||
return @{
|
||||
Manufacturer = $man
|
||||
Description = $dev
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
for ($y = $i+1; $y -lt $usbIDs.Count; $y++) {
|
||||
if($usbIDs[$y][0] -ne "`t"){
|
||||
return @{
|
||||
Manufacturer = $man
|
||||
Description = $null
|
||||
}
|
||||
}
|
||||
if($usbIDs[$y] -match $p){
|
||||
$dev = ($usbIDs[$y] -split ' ')
|
||||
$dev = $dev[2..$dev.count] -join ' '
|
||||
return @{
|
||||
Manufacturer = $man
|
||||
Description = $dev
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return @{
|
||||
Manufacturer = $man
|
||||
Description = $null
|
||||
}
|
||||
}
|
||||
} end {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ function Invoke-PCMonitor {
|
|||
foreach ($comp in $comps) {
|
||||
Write-Progress -Activity "Initializing sessions" -Status $comp -PercentComplete ($dogs.Length/$comps.Length)
|
||||
$dog = [WatchDog]::new($comp)
|
||||
$null = $dog.Update()
|
||||
Write-Host $dog.ReportChange()
|
||||
$dogs += $dog
|
||||
}
|
||||
Write-Progress -Activity "Initializing sessions" -Completed
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ function Get-SHSPrinter {
|
|||
$CMDB_IP = "*CMDB Mismatch - check CMDB*"
|
||||
}
|
||||
|
||||
if ($result.IP -ne $null) {
|
||||
if ($null -ne $result.IP) {
|
||||
|
||||
Write-Progress -Activity "Getting printer details for $name" -Status 'Connecting to printer' -PercentComplete 30 -ParentId 1
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,12 @@ function Invoke-UninstallProgram ($Computer) {
|
|||
foreach ($item in $selection) {
|
||||
Write-Host "Uninstalling $($apps[$item].Name)"
|
||||
$res = $apps[$item].Uninstall()
|
||||
if ($res.ReturnValue) {
|
||||
Write-Warning "$appname failed to uninstall from $Computer with ReturnValue $($res.ReturnValue)"
|
||||
switch ($res) {
|
||||
0 { Write-Host "Successfully Uninstalled $($apps[$item].Name) from $Computer" }
|
||||
1641 { Write-Host "Successfully Uninstalled $($apps[$item].Name) from $Computer"; Write-Warning "Restarting $Computer" }
|
||||
3010 { Write-Host "Successfully Uninstalled $($apps[$item].Name) from $Computer"; Write-Warning "Please restart $Computer to finish uninstall" }
|
||||
3011 { Write-Host "Successfully Uninstalled $($apps[$item].Name) from $Computer"; Write-Warning "Please restart $Computer to finish uninstall" }
|
||||
default { Write-Warning "$appname failed to uninstall from $Computer with ReturnValue $($res.ReturnValue)" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ begin {
|
|||
|
||||
$comp,$msg = Get-Hostname $comp
|
||||
Write-Progress -Activity "Get-PC flags processing" -Status "$comp ($PCID/$NumberofComputers)" -PercentComplete ($PCID*100/$NumberOfComputers) -Id 1
|
||||
if ($msg -and -not $SHSPrinter) {
|
||||
if ($msg -and -not $SHSPrinter -and -not $SHSPrinterWeb) {
|
||||
if ($SoundEnabled) {
|
||||
$oopsSoundPath = Join-Path (get-item $PSScriptRoot).Parent.FullName 'Data\gamblecore.wav'
|
||||
(New-Object Media.SoundPlayer $oopsSoundPath).Play()
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
Patch: 2024-1-17
|
||||
-Fix SHSPrinterWeb bug with site domain names e.g. sagh.int.samhealth.net
|
||||
-Add Better result code handling in UninstallProgram
|
||||
-Add Monitor now reports the initial state of monitored workstations
|
||||
|
||||
Patch: 2024-12-13
|
||||
-Add Powershell input pipeline support, unoptimized
|
||||
-Add CMDB fields now hold Spark warnings rather than printing to console in SCCM and normal queries
|
||||
|
|
|
|||
Loading…
Reference in a new issue