PowerShell: Finding Built-In Cmdlets

In times where cmdlets can originate from all kinds of modules, it sometimes becomes important to find out which cmdlets are truly built into PowerShell and which represent external dependencies. One way of getting a list of built-in cmdlets is to temporarily open another runspace and enumerate its internal cmdlet list: $ps = [PowerShell]::Create() $ps.Runspace.RunspaceConfiguration.Cmdlets…

Continue Reading

PowerShell: Preserving Special Characters in Excel-generated CSV files

When you save Excel spreadsheets to a CSV file, special characters get lost. That’s because Excel is saving the CSV file using very simple ANSI encoding. The following line re-encodes the CSV file and uses UTF8 encoding, making special characters readable for Import-CSV: $Path = “c:\somepathtocsv.csv” (Get-Content $Path) | Set-Content $Path -Encoding UTF8

Continue Reading