Category Archives: Powershell

PowerShell approved verbs

PowerShell uses a verb-noun style for naming cmdlets. The list of Powershell approved verbs is available at https://docs.microsoft.com/en-us/powershell/developer/cmdlet/approved-verbs-for-windows-powershell-commands. You should use the approved verbs when writing functions or cmdlets. Import-Module will complain about using unapproved verbs. You can also see … Continue reading

Posted in Powershell | Leave a comment

Running Ping tests

I’ve shown how to discover network information using the get-internetconnection function and how to construct simple Pester tests to ping the IP addresses returned by get-internetconnection. This time I’ll show you how to create a control function for running ping … Continue reading

Posted in Powershell | Leave a comment

Ping tests with Pester

Last time I showed how to test your internet connectivity by retrieving a set of information about your network. This  time I’ll show you how to use that information so that you can run a series of ping tests with … Continue reading

Posted in Powershell | Leave a comment

Testing Internet connectivity

I was working on a troubleshooting module and start to think about how I’d go about testing internet connectivity. First you need to determine the network adapter that’s connected to the internet. You can use the network connection profile to … Continue reading

Posted in Networking, Powershell | Leave a comment

Excellent PowerShell Day

I spent yesterday at the excellent PowerShell Day UK 2018 – https://psday.uk/ I presented the keynote and a technical session on CIM The organisers are to be congratulated for producing an excellent event. The dates haven’t been settled but I’ve … Continue reading

Posted in Powershell | Leave a comment

Copy-Item Container parameter

The Copy-Item Container parameter controls whether the folder structure is also copied. Lets start with the source material – a folder C:\test with a bunch of files. A destination folder C:\D1 also exists PS>  Copy-Item -Path c:\test\* -Destination C:\D1 copies … Continue reading

Posted in Powershell | Leave a comment

-like oddity

Recently saw a question asking why this code worked PS>  $a = ‘aa’ PS>  $b = ‘a’ PS>  $a -like “*$b*” True PS>  Remove-Variable -Name b PS>  $a -like “*$b*” True Set 2 variables and compare using wildcards. The comparison … Continue reading

Posted in Powershell | Leave a comment