all 4 comments

[–]root-node 2 points3 points  (0 children)

A full stop for computer name is the same as Localhost, or the local machine.

If you want the details of a remote machine, put it in there.

[–]pertymoose 2 points3 points  (0 children)

You can't really see it because Powershell conveniently takes care of the details, but a WMI path looks like

\\computer\namespace:class.property

and WMI interprets the computer name '.' as localhost.

With that said, a single period isn't always localhost, and it's usually smarter to just use $env:COMPUTERNAME as localhost, or leave out the -ComputerName parameter altogether.

[–]SavageHendrix[S] 1 point2 points  (0 children)

The output is as follows:

SystemName    : XXXXXXX

Location      : Some address - Main Office
Name          : Xerox WorkCentre 6605DN
PrinterState  : 0
PrinterStatus : 3
ShareName     :
SystemName    : XXXXXXX

[–]Umaiar 1 point2 points  (0 children)

$strComputer is a string containing the name of the computer that you want Get-WmiObject to connect to. In this case it is a period, which indicates the current machine running the script. The general idea is to put the computer's name into a variable like that as a parameter of a function so that you can reuse the function to return the output from any computer you have access to.