#PSTip How to expand environment variable contained in a text file
Let’s presume you have a text file that contains the following two lines: My current user profile is $env:USERPROFILE. The system folder is $env:windir\System32.
Read MoreLet’s presume you have a text file that contains the following two lines: My current user profile is $env:USERPROFILE. The system folder is $env:windir\System32.
Read MoreNot all WMI class properties can be modified. Many of these properties are read-only. Take a look at the properties and Win32_ComputerSystem, for example.
Read MoreWhenever we use WMI cmdlets to query either local or remote machines, we need to keep the following points in mind:
Read MoreIn the previous tip we showed you how to modify WMI object properties using Get-WmiObject cmdlet and the Put method. Today I want to show you another streamlined way to do the same using the Set-WmiInstance cmdlet.
Read MoreGet-WmiObject and object modification! Sounds contradictory? Not really. That is the beauty of PowerShell and its object-based nature. Let us see an example to understand this.
Read MoreIn the previous tip, we’ve showed you how to get a function definition using cool and unusual technique. Can we use the Get-Command cmdlet to get the same result?
Read More