Trying to write a script to remove all network printers from a system but leave the other printers / fax alone.
$Printer = Get-WMIObject Win32_Printer | Select-Object ServerName, ShareName
to get the values for $Printer
but cannot get it to change to uppercase.
@{ServerName=\\HBMN-Vbranch; ShareName=HBMN-P5}
is returned but I am trying to do if ($Printer -Like "*\\HBMN-VBRANCH*")
and it never finds the lower case or mixed case.
If I try to do $($Printer.ToString().ToUpper())
no value is returned.
If I try $Printer.ToUpper()
method is not found.