Quantcast
Channel: PowerShell Magazine » tips
Browsing all 5 articles
Browse latest View live

#PSTip How to get only files – the PowerShell 3.0 way!

The traditional or PowerShell 2.0 way of retrieving only files is: Get-ChildItem $env:windir | Where-Object { ! $_.PSIsContainer } The new parameter -File of the Get-ChildItem cmdlet simplifies the...

View Article



Image may be NSFW.
Clik here to view.

#PSTip Adding extended types – the PowerShell 3.0 way!

PowerShell 3.0 introduced important changes to the Update-TypeData cmdlet which includes specifying the dynamic type data. Using these new features of Update-TypeData cmdlet, we can add extended types...

View Article

#PSTip Modifying WMI Object properties using Get-WmiObject cmdlet

Get-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. $vol = Get-WmiObject...

View Article

Image may be NSFW.
Clik here to view.

#PSTip Optimizing WMI object retrieval

Whenever we use WMI cmdlets to query either local or remote machines, we need to keep the following points in mind: Don’t ever pipe the WMI objects to Where-Object cmdlet to filter the WMI output...

View Article

Image may be NSFW.
Clik here to view.

#PSTip Get all writeable properties of a WMI class

Not 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. Now, how do we retrieve properties of a WMI...

View Article

Browsing all 5 articles
Browse latest View live


Latest Images