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, 1655🔥, 0💬
Popular Posts:
How to make my presentation beautiful by applying a built-in theme provided by Office PowerPoint 200...
What is the startup program "IDT PC Audio - sttray64.exe" on my Windows 8 computer? Can I remove it ...
How to increase the remote login limit on Windows 10? By default, Windows 10 only allows 1 remote lo...
What files are stored in the "C:\Users\<userid >\AppData\LocalLo w"folder? Can I delete...
What is "Windows Connect Now - Config Registrar" in my Windows 7 service list? And how is "Windows C...