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, ∼2564🔥, 0💬
Popular Posts:
Why I am getting the "Why did my PC restart?" message? After taking the quick setup information, you...
How to remove QLBCTRL.exe from startup program list? If you want to remove QLBCTRL.exe from the star...
What is the startup program "IDT PC Audio - sttray64.exe" on my Windows 8 computer? Can I remove it ...
What are default background services on a Windows 7 Home Premium computer? If you are running a Wind...
How to connect your computer to a DSL line? Here are the steps of how to connect your computer to th...