Category Archives: Powershell

Articles published in 2019

I’ve had the following articles published in 2019 https://searchwindowsserver.techtarget.com/tutorial/Set-up-users-with-key-PowerShell-Active-Directory-commands https://searchwindowsserver.techtarget.com/feature/Editing-content-with-Windows-PowerShell https://searchwindowsserver.techtarget.com/tip/Windows-Compatibility-module-expands-PowerShell-Core-reach Enjoy Advertisements

Posted in Powershell | Leave a comment

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 Files\PowerShell\6\pwsh.exe because it has a space. The answer is to create a symbolic link which is a file … Continue reading

Posted in Powershell | Leave a comment

Modifying hashtables

Saw a question about modifying hashtables. The suggested code seemed like overkill. The starting point is this hashtable: $record = @{Name=’Joe’; Date=’2019-02-01′; Status=’Pending’} The updated data is: $update = @{Name=’Joe’; Date=’2019-04-01′; Status=’Hired’; City=’York’; Country=’England’} You need to keep the Name … Continue reading

Posted in Powershell | Leave a comment

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 / Server 2019 OpenSSH is available as an optional install. On earlier versions of Windows … Continue reading

Posted in Powershell | Leave a comment

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 System.Array class definition) PS> $x.Length 10 If the variable is a scalar you get … Continue reading

Posted in Powershell | 1 Comment

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 Select-Object filters objects based on object position in the pipeline or array as well as filtering properties. The … Continue reading

Posted in Powershell | Leave a comment

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. Within two hours of starting my last job I was told by my team lead … Continue reading

Posted in Philosophy, Powershell | 1 Comment