Collections:
Other Resources:
Assign Object to Variable in Windows PowerShell Scripts
How to assign an object to a variable in Windows PowerShell scripts?
✍: FYIcenter.com
The output object of a cmdlet can be assigned to a variable using the
assignment operator "=".
Remember, variable names must start with the "$" sign. So here is an example of assign a DateTime object to a variable:
$now = Get-Date $now | format-list -Property TimeOfDay
Running the above script will return something like:
TimeOfDay : 22:06:45.1984174
⇒ Access Object Properties in Windows PowerShell Scripts
⇐ Add Comments in Windows PowerShell Scripts
2016-11-02, ∼2680🔥, 0💬
Popular Posts:
How to remove CLI.exe from startup program list? CLI.exe is a configuration program for the ATI grap...
What is "Microsoft Policy Platform Local Authority" in my Windows 7 service list? And how is "Micros...
I'm trying to upload pictures from my Samsung camera and Windows 8 keep saying "Something went wrong...
How to use sc.exe command to delete an existing service? If you want to delete a service created by ...
What is msdxm.ocx - Windows Media Player 2 ActiveX Control? msdxm.ocx is installed as an ActiveX Con...