PowerShell for Windows Admins:

April, 2019


April 30, 2019  3:06 PM

PowerShell SSH

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

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 you need to install OpenSSH -

April 30, 2019  1:48 PM

Count

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

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 1 returned PS> $x = 1 PS>...


April 30, 2019  7:01 AM

Where-Object options

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

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 classic way to use Where-Object is to use...


April 29, 2019  1:52 PM

Opposing Automation

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Philosophy, Powershell

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 “you’ll never automate anything here”. Needless to say our relationship...


April 29, 2019  12:36 PM

File rename

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

File rename is a topic that seems to keep recurring. The simple answer is that you use Rename-Item PS> Rename-Item -Path C:\test\Newoutdata01.txt -NewName OldData01.txt   If for whatever bizarre reason you have a character such as [ in your file name the rename won’t...


April 27, 2019  9:09 AM

What’s new in PowerShell v6.2

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

The What’s new in PowerShell v6.2 is available at - 0 Comments     RSS Feed     Email a friend


April 27, 2019  4:29 AM

CIM_Component class

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
CIM, Powershell

I saw a question about the CIM_Component class and wondered what it was. So I tried it PS> Get-CimInstance -Namespace root\CIMV2 -ClassName CIM_Component | select -f 1 | fl * GroupComponent : Win32_Directory (Name = "<directory path>") PartComponent : CIM_DataFile (Name = "<file...


April 20, 2019  10:46 AM

PowerShell version incompatibilities

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

There are incompatibilities between Powershell versions – you can’t use classes in Windows PowerShell v4 and there are differences between Windows PowerShell v5.1 and v6.x. One way to deal with PowerShell version incompatibilities is described in the recent post from the PowerShell team -


April 18, 2019  1:07 PM

File times

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

There are three pairs of file times that are available on files on Windows PS> Get-ChildItem -Path C:\test\Newoutdata01.txt | select *time* CreationTime      : 14/04/2019 17:28:41 CreationTimeUtc   : 14/04/2019 16:28:41 LastAccessTime    : 14/04/2019 17:28:41 LastAccessTimeUtc...


April 16, 2019  10:06 AM

Get wireless networks

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

I saw a question on how to get wireless networks which got me thinking about string handling and working with legacy command line utilities. I also wanted to compare the options available in Windows PowerShell and PowerShell Core. First up is a relatively brute force approach. This approach...


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: