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, ∼2611🔥, 0💬
Popular Posts:
Can I disable Windows service "Distributed Link Tracking Client" to speedup my computer? Windows ser...
How do I copy the user ratings for my files to my new computer? You can ensure that the user ratings...
How to download and install Alexa Toolbar for Internet Explorer (IE) 7 browser? Alexa Toolbar offers...
How to remove DLG.exe from the startup application list to gain performance and reduce security risk...
Can I disable Windows service "EvtEng" to speedup my computer? Windows service "EvtEng" - Intel Even...