PowerShell for Windows Admins:

Powershell


December 13, 2017  9:51 AM

Using the Where method

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

You don’t usually see people using the where method. A recent question on the forums highlighted using the where method. PowerShell deals in collections and will automatically create a collection of objects if the are multiple objects returned for instance $procs = Get-Process Iterating...

December 6, 2017  9:19 AM

PowerShell v6: #7 Module paths

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

There is a very significant gap between the functionality available in PowerShell v6 as opposed to PowerShell v5.1. In part this is due to the underlying version of .NET but mainly to the defined module paths in the two versions. In PowerShell v5.1 I have: PS> $env:PSModulePath -split...


December 5, 2017  3:23 PM

PowerShell v6: #6 Windows compatibility

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

PowerShell v1 through v5.1 have been based on the full .NET framework. PowerShell v6 is based on .NET core which is a cross platform subset of .NET that’s available for Windows, Linux and mac. This has meant that Powershell v6 on Windows is a poor relation of PowerShell v5.1 in terms of the...


December 2, 2017  4:52 AM

Hyper-V VM start time

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

Its fairly easy to see how long a VM has been running – but how do you know the Hyper-V VM start time? In Hyper-V the VM uptime is easy to find

PS> Get-VM | where State -eq 'Running'

Name        State CPUUsage(%) MemoryAssigned(M) Uptime          Status             Version
----   ...


November 29, 2017  10:21 AM

Get Folder sizes

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

One problem that comes up quite often is how do you get folder sizes. One option is use Measure-Object but the problem with that approach is that its going to be a pretty slow process if you have a lot of folders. PowerShell doesn't have a method of directly getting the folder size and you have to...


November 27, 2017  12:10 PM

Get an AD user’s manager

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Active Directory, Powershell

Interesting question on the forum about finding the manager for a given user in AD – assuming the Manager field is populated of course. If you’ve not worked with the AD cmdlets this is a good introduction to some of their quirks. This is how you get an AD user’s manager. You need the...


November 23, 2017  11:04 AM

PowerShell v6: #5 Get-Uptime

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

One new feature of PowerShell v6 (its actually been available since alpha 13 but I’d missed it) is the Get-Uptime cmdlet

PS C:\scripts> Get-Uptime

Days              : 0
Hours             : 2
Minutes           : 57
Seconds           : 6
Milliseconds      : 0
Ticks             :...


November 23, 2017  9:09 AM

PowerShell v6: #4 profiles

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Windows PowerShell (v1-v5.1) has always used profiles to configure your PowerShell session. You need execution policy set to something other than restricted so that the profile script can run. You can have up to 4 profiles:

Description                   Path
 -----------                 ...


November 20, 2017  1:05 PM

PowerShell v6: #3 Release Candidate

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

The PowerShell team have announced the availability of the PowerShell v6 release candidate. 0 Comments     RSS Feed     Email a friend


November 14, 2017  8:59 AM

When is PowerShell not PowerShell?

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

When is PowerShell not PowerShell? When its PowerShell v6. This applies to beta 9 and later Check a v6 instance

PS C:\Program Files\PowerShell\6.0.0-beta.9> $PSVersionTable

Name Value
 ---- -----
 PSVersion 6.0.0-beta.9
 PSEdition Core
 GitCommitId v6.0.0-beta.9
 OS Microsoft...


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: