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, 1851🔥, 0💬
Popular Posts:
Where to find tutorials on using Windows Vista computers? I want to learn how to use Windows Vista m...
Where are services hosted by "svchost.exe -k DcomLaunch" on Windows 7? What is the meaning of "-k Dc...
How to export Windows services to a text file? If you want to export services that are currently con...
What are Mozilla FireFox 2 add-ons? Mozilla FireFox 2 add-ons extend the browser functionalities. So...
Can I remove startup application "tfswctrl.exe - Sonic Drive Letter Access Component" to speedup my ...