PowerShell for Windows Admins:

Powershell


October 13, 2019  10:04 AM

Hidden files

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

If you suspect there are hidden files in a folder you can use the Attributes parameter to discover them: PS> Get-ChildItem -Path c:\test -Attributes H OR PS> Get-ChildItem -Path c:\test -Attributes h OR PS> Get-ChildItem -Path c:\test -Hidden If you want to see all files...

September 29, 2019  4:03 AM

Receive-Job Keep parameter

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

The Receive-Job Keep parameter is required if you want the data contained in the job to remain available. if you don’t use the –Keep parameter (a switch) the data will be deleted. Its a pain to remember to use the Keep parameter. I’ve been working with jobs a lot just recently and the...


September 29, 2019  3:40 AM

PowerShell Day UK 2019 slides and code

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Had a great day at PowerShell Day UK 2019. The PowerShell Day UK 2019 slides and code for my session are available at https://github.com/RichardSiddaway/PSDay2019.


September 26, 2019  8:52 AM

UK PowerShell day is Saturday

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

The UK PowerShell day is Saturday – 28 September  - two days away. If you want to be there tickets are still available - https://psday.uk/ If you’re going – say hello See you there  


September 25, 2019  1:38 PM

Ternary operator

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

PowerShell v7 preview 4 adds a Ternary operator to PowerShell. A ternary operator is a way to provide shortened coding for a simple if-else block. Its an operator that takes three operands rather than the usual two hence the name ternary. for example PS> $a = 5 PS> $b = 3 PS> if...


September 24, 2019  9:03 AM

Get-ExecutionPolicy

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

I’ve used Get-ExecutionPolicy since PowerShell v1 and never stopped to think about it. The cmdlet normally returns just the current policy PS> Get-ExecutionPolicy RemoteSigned However, if you dig a little deeper PS> Get-ExecutionPolicy -List Scope ExecutionPolicy -----...


September 23, 2019  1:54 PM

PowerShell v6.2.3

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

PowerShell v6.2.3 is available from https://github.com/PowerShell/PowerShell/releases It fixes a debugging performance issue and updates the .NET SDK and runtime framework...


September 9, 2019  10:25 AM

Hyper-V VM IP address

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Hyper-V, Powershell

Saw a question about getting the Hyper-V VM IP address. One thing with Hyper-V is that the VM has to be running for you to retrieve the IP address. Once you VM is running you can get the IP address PS> Get-VM -Name W19ND01 | select -ExpandProperty NetworkAdapters | select VMname, Name,...


August 31, 2019  11:43 AM

Pet peeves

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Back in July I mentioned the using ? instead of Where-Object was a pet peeve. I’ve been asked a few times since for other pet peeves. The order of peevishness changes over time but these three will probably be always near the top. In no particular order. Peeve – the use of aliases in...


August 30, 2019  10:39 AM

Foreach-Object -parallel

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

The introduction of Foreach-Object -parallel in PowerShell v7 preview 3 brings some much needed parallelisation options back into PowerShell. PowerShell workflows are available in Windows PowerShell but are quirky (to be kind) and can be difficult to use. Workflows were removed in PowerShell...


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: