The PowerShell range operator '..' can be used to create lists of sequential numbers with an increment (or decrement) of one: This is quite handy. Wouldn't it be even better if it would also support stepwise lists (FIRST, SECOND..LAST similar to Haskell where the step width is determined by the first and the second list … Continue reading Extending the PowerShell range operator
Month: March 2015
Work with files and folders that have paths longer than 260 characters in PowerShell using AlphaFS
If you try to use one of the built-in 'item' cmdlets (i.e. Get-Command *item* -Module Microsoft.PowerShell.Management) on the FileSystem provider with a path that is longer than 260 characters (actually > 248 characters on a folder and > 260 on a file), you will not be able to do it. For example running the line … Continue reading Work with files and folders that have paths longer than 260 characters in PowerShell using AlphaFS
How to convert Excel 97-03 (.xls) to new format (.xlsx) using office file converter (ofc.exe)
Usually one would use something like the code below in order to convert Excel 97-03 (.xls) files to the new format (.xlsx) via PowerShell through the Excel COM Interop interface: In my case since I've switched to Excel 2013 the above method (and actually all excel automation via COM Interop) is much slower than compared … Continue reading How to convert Excel 97-03 (.xls) to new format (.xlsx) using office file converter (ofc.exe)
PowerShell Format-Table Views
Format views are defined inside the *format.ps1xml files and represent named sets of properties per type which can be used with any of the Format-* cmdlets. In this post I will focus mainly on the views for the Format-Table cmdlet: Retrieving the format views for a particular type can be accomplished by pulling out the … Continue reading PowerShell Format-Table Views
PowerShell Property Sets
What are PowerShell Property sets and how can they be used? Property sets are named groups of properties for certain types that can be used through Select-Object. The property sets are defined in the *types*.ps1xml files that can be found in the $pshome directory. Most of the types have default property sets defined as DefaultDisplayPropertertySet … Continue reading PowerShell Property Sets
Improve PowerShell commandline navigation
This post is about improving PowerShell in order to ease navigation on the commandline. There are some pretty cool solutions out there which I have added to my profile to be able to move around quicker: Jump-Location Go-Shell bd (Quickly Go Back To A Directory) Another one, that I came up with is in order … Continue reading Improve PowerShell commandline navigation