Author Archives: richardsiddaway

user logon time

Saw an interesting question about user logon time. How can you tell the logged on user and when they logged on $logon = Get-CimInstance -ClassName Win32_LogonSession | sort StartTime -Descending | select -First 1 $user = Get-CimAssociatedInstance -InputObject $logon -ResultClassName … Continue reading

Posted in PowerShell and CIM, PowerShell and WMI | Leave a comment

Splitting on a \

Splitting strings is usually easy – you use the –split operator or the Split() method.  Occasionally you may hit a problem – for instance splitting on a \ character. Let me demonstrate with an example. PS> Get-CimInstance -ClassName Win32_ComputerSystem | … Continue reading

Posted in Powershell | Leave a comment

PowerShell v6.0.4

PowerShell v6.0.4 is available from https://github.com/PowerShell/PowerShell/releases From the release notes it appears to be just a fix to the mac installer and consolidation of the Nuget packages. This is the second update to PowerShell v6.0 within a month. If you … Continue reading

Posted in PowerShell v6 | Leave a comment

Create a directory with PowerShell

I was recently asked how you can create a directory with PowerShell Using the command prompt you’d do this c:\Scripts> md c:\Test0908 c:\Scripts>dir c:\test*   Volume in drive C has no label.   Volume Serial Number is DAA0-D709 Directory of … Continue reading

Posted in Powershell | Leave a comment

Think outside the box

One of PowerShell’s great strengths is that there are often a number of ways to achieve the same endpoint. It’s also a great weakness as newcomers are confused as to which approach to adopt and “experts” will tell you that … Continue reading

Posted in Powershell | Leave a comment

PowerShell speed

I’ve read and heard a lot about PowerShell speed recently – that is the speed of execution of your scripts and how you can make your code faster. The first thing to think about – and this is the one … Continue reading

Posted in Powershell | 3 Comments

Keynote at PS Day 2018

PSDay is one day PowerShell conference in London. I’m proud, and honoured, to have been asked to provide the Keynote at PS Day 2018. Full details of the event are available at https://psday.uk/ I’ll also be doing a session on … Continue reading

Posted in Powershell | Leave a comment