Microsoft have released the first preview of the new Windows Terminal to the Windows store -...
RSiddaway
PowerShell 7 roadmap
It was recently announced that the next version of PowerShell core will be 7.0 not 6.3. The PowerShell 7 roadmap is available at...
Start Jobs with &
You usually start background jobs using Start-Job. Now you can start jobs with &. As of PowerShell v6.0 putting & at the end of a pipeline...
Install-Module and Update-Module Scope parameter
I’ve written a couple of times this year on the problems around the PowerShellGet module and the Scope (Allusers or CurrentUsers). The situation is...
Get-Date -UFormat
The Get-Date -UFormat parameter formats the date using Unix format. The full list of format specifiers are in the Notes section of the Get-Date help...
Exclusive OR
PowerShell has a number of logical operators - - -and, –or, –not (or !). One I’ve really thought about is the exclusive OR operator –xor. With...
Useful constants
PowerShell provides easy access to some useful constants. I often see people calculating these values rather than using the constants. PowerShell...
Articles published in 2019
I’ve had the following articles published in 2019...
Stable sort
In Windows PowerShell if you do something like this: PS> (1..20 | Sort-Object -Property {$_ % 3}) -join ' ' 9 6 12 15 3 18 19 16 13 10 4...
OpenSSH installation
OpenSSH installation has got a lot simpler in Windows 10 1809; Windows Server 2019 and Windows Server 1809. OpenSSH is available as an optional...
Create a symbolic link
I recently had to create a symbolic link to overcome a bug in OpenSSH whereby OPENSSH won’t work with the path C:Program FilesPowerShell6pwsh.exe...
PowerShell Core v6.2.1
PowerShell Core v6.2.1 has been released - https://github.com/PowerShell/PowerShell/releases as has v6.1.4 The new versions are to primarily fix the...
Windows Server 2019 updates with CIM
Windows Server 2019 updates with CIM remain the same as all server versions post Windows Server 2016. This code will check for and install any...
WSL improvements
Windows Subsystem for Linux - WSL improvements have been recently announced - https://devblogs.microsoft.com/commandline/ WSL 2 is on the way which...
Modifying hashtables
Saw a question about modifying hashtables. The suggested code seemed like overkill. The starting point is this hashtable: $record =...
PowerShell SSH
PowerShell SSH support is available by default in PowerShell v6.0 and later. The big thing for PowerShell v6.0 was SSH based remoting. On Windows 10...
Count
Count is a property on arrays PS> $x = 1..10 PS> $x.Count 10 The same information is available through Length (which is the property in the...
Where-Object options
You have a few Where-Object options when you want to filter data. Remember that Where-Object filters objects based on property values and...
Opposing Automation
Opposing Automation – no I don’t mean that you should oppose it. The sad fact is that there are very many administrators opposed to automation....
File rename
File rename is a topic that seems to keep recurring. The simple answer is that you use Rename-Item PS> Rename-Item -Path C:testNewoutdata01.txt...
What’s new in PowerShell v6.2
The What’s new in PowerShell v6.2 is available at -...
CIM_Component class
I saw a question about the CIM_Component class and wondered what it was. So I tried it PS> Get-CimInstance -Namespace rootCIMV2 -ClassName...
PowerShell version incompatibilities
There are incompatibilities between Powershell versions – you can’t use classes in Windows PowerShell v4 and there are differences between...
File times
There are three pairs of file times that are available on files on Windows PS> Get-ChildItem -Path C:testNewoutdata01.txt | select *time*...