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, ∼2820🔥, 0💬
Popular Posts:
How to use "query user" to find out who is logged in to my Windows 7 computer? If you allow remote l...
Can I disable Windows service "ClipBook" to speedup my computer? Windows service "ClipBook" - Enable...
I have a problem wiht the Drivers Video Card, I have a laptop HP dv6448se and the video card are a N...
Error 126: Application Management Service Failed To Start. The Specified Module Could Not Be Found. ...
I don't know if this is a Windows Problem or an HP problem. HP says windows. But anyhow I have a bra...