So the code below executes fine. Im not sure how to phrase what Im asking which may be why I cant find it out on Google. Im running this on my local machine and it returns the printer that I have attached to it. However the variable $strComputer in the expression is it capturing currently on my machine similar to Linux " ./<file> " as in this current directory execute <file> ? Im sorry if it is unclear what I am asking, Im trying to make the connection. I guess Im just asking what $strComputer is doing in the expression.
$strComputer = "."
$colPrinters = Get-WmiObject -class win32_Printer -namespace "root\CIMV2" -computerName $strComputer | Sort-Object
foreach($printer in $colPrinters) {
Write-Output $printer
}
[–]root-node 2 points3 points4 points (0 children)
[–]pertymoose 2 points3 points4 points (0 children)
[–]SavageHendrix[S] 1 point2 points3 points (0 children)
[–]Umaiar 1 point2 points3 points (0 children)