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, 1647🔥, 0💬
Popular Posts:
How to remove GoogleToolbarNotifier.ex efrom startup program list? If you want to remove GoogleToolb...
Why my Windows XP generates a PIN code for Bluetooth connection? If you try to connect to a new Blue...
How can I tell the number of CPU or logical processors on my Windows Server 2016? To find out how ma...
How to verify IIS configuration for PHP scripts? If you have followed our Configuring IIS for PHP Sc...
How to configure PHP execution environments? If you followed our Downloading PHP Engine tutorial , y...