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, ∼2989🔥, 0💬
Popular Posts:
What is the best way to remove programs from the startup application list? There are a number of way...
Can I disable Windows service "ASP.NET State Service" to speedup my computer? Windows service "ASP.N...
Can I disable Windows service "Smart Card Helper" to speedup my computer? Windows service "Smart Car...
Whenever I try to open the mail app I get a white screen with a grey banner that says Mail Can't Ope...
What is Apache server? Apache server is an open-source free Web server software that runs websites. ...