2021-11-21

PowerShell Class

With PowerShell 5 we were given the possibility to create more "real" custom classes.

I have some notes, trials and personal examples in SQLAdmin Github (link).

2021-11-20

Short name of file or directory

 Some situations still require a short name like a 8.3 name of a file. This will often be on not only the name of the object but on the entire path. Back in the days of the Windows Shell we would use the command dir /x.

I have looked into getting the short name in a PowerShell script to make it available in a more complex script. 

Unfortunately .NET does not have such a method to a FileInfo or DirectoryInfo object. So I have used the Win32 function GetShortPathName().

The script is in SQLAdmin Github (link) with some technical notes in the associated markdown file.