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, ∼2539🔥, 0💬
Popular Posts:
How to connect your computer to a DSL line? Here are the steps of how to connect your computer to th...
What is a wireless router? A wireless router is a special network router that connects workstations ...
How to stop a Windows XP service getting started automatically at system startup time, or disabling ...
What is "ActiveX Installer (AxInstSV)" in my Windows XP service list? And how is "ActiveX Installer ...
How to play music files with Windows Media Center? If you have Windows Media Center setup correctly,...