ps1

Getting Real Paths

PowerShell uses virtual drives, which sometimes have a close mapping to the "real" drives you see in Windows Explorer. However, sometimes...

read more

Deleting Things

To delete things in the file system, you normally use a command like "del", which is an alias and points to Remove-Item in PowerShell:...

read more

Secret -Force Switch

PowerShell automatically displays all object properties when you output the object to the console. Here is an example: Get-WmiObject win32_bios...

read more

List Local Groups

If you'd like to get a list of all local Groups on your computer, you can use this line: Get-WMIObject Win32_Group -filter...

read more

Deleting Shares

If you'd like to get rid of a file share, such as the one you created via WMI in our last tip, this is how you can do it: (Get-WMIObject...

read more

Finding CD-ROM Drives

You can find out whether a system has CD-Drives by using a little function that returns all drive letters from all CD Drives in your system:...

read more

Cloning Objects

As a rule of thumb, PowerShell creates real copies when you copy variables. So in the next example, changing the array in $a will not affect the...

read more

Expanding Group Results

Group-Object is perfect for grouping objects based on one or more properties. Once you group objects, you can then filter, or sort, based on their...

read more

Sort With PS Code

Sort-Object is a great and versatile cmdlet to sort anything you want. Simply specify the property or properties you want to use for sorting: Dir...

read more

Ejecting CDs

PowerShell can still use COM libraries. Simply use New-Object -comObject and provide the COM library name to load it. With this approach, you can do...

read more