PowerShell for Windows Admins:

Powershell


November 30, 2019  5:58 AM

Get-Counter

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

The Get-Counter cmdlet returns in PowerShell v7 preview 6. Its only Get-Counter though the Import/Export-Counter cmdlets aren’t available. Get-Counter isn’t experimental feature so its available as soon as you install preview 6. PS> Get-Command Get-Counter -Syntax Get-Counter...

November 26, 2019  12:20 PM

Clipboard cmdlets

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

The clipboard cmdlets return in PowerShell v7 preview 6 Get-Clipboard and Set-Clipboard are back and according to the release notes work cross platform. PS> Get-Command Get-Clipboard -Syntax Get-Clipboard [-Raw] [<CommonParameters>] PS> Get-Clipboard Clipboard test The...


November 25, 2019  10:10 AM

Clear-RecycleBin

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

The Clear-RecycleBin cmdlet returns in PowerShell v7 preview 6 on Windows PS> Get-Command Clear-RecycleBin -Syntax Clear-RecycleBin [[-DriveLetter] <string[]>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>] To use PS> Clear-RecycleBin Will ask for confirmation you...


November 23, 2019  9:47 AM

Fibonacci series

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Today’s date 23 November is 1123 id written as month then day. Those numbers are the start of the Fibonacci series. So as its Fibonacci day here’s a quick PowerShell function to create a Fibonacci series. function new-fibonacci { param ( [int]$numberofelements = 10 ) ## first 2...


November 22, 2019  5:08 AM

PowerShell v7 preview 6

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

PowerShell v7 preview 6 has arrived - https://github.com/PowerShell/PowerShell/releases Its the last preview, as the Release candidate should appear next month, so this...


November 21, 2019  3:17 PM

Get-DnsServerResourceRecord

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DNS, Powershell

You saw how to discover the zones on a DNS server in the first post in this series. Now its time to discover the records in a zone. For that you need Get-DnsServerResourceRecord. The syntax is: Get-DnsServerResourceRecord [-ZoneName] <string> [[-Name] <string>] [-Type]...


November 21, 2019  5:04 AM

Searching Active Directory by email address

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

I was asked recently about searching Active Directory by email address and returning the first and last names of the users. First off I needed to populate the first and last name and email fields as they weren’t set in my test domain Get-ADUser -Filter * -SearchBase...


November 20, 2019  1:48 PM

DNS zones

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
DNS, Powershell

I’m working through the commonly used DNS server cmdlets to determine if everything works in PowerShell core. First up is the cmdlet to get the DNS zones on your DNS server. PS> Get-DnsServerZone | Format-List -Property ZoneName, ZoneType, IsAutoCreated, IsDsIntegrated, IsReverseLookupZone,...


November 19, 2019  7:13 AM

Get-Hotfix

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Get-Hotfix returns to PowerShell in PowerShell v7 preview 5 – at least on Windows. PS> Get-Command Get-HotFix -Syntax Get-HotFix [[-Id] <string[]>] [-ComputerName <string[]>] [-Credential <pscredential>] [<CommonParameters>] Get-HotFix [-Description...


October 31, 2019  2:22 PM

Resolve-Path

Richard Siddaway Richard Siddaway Profile: Richard Siddaway
Powershell

Resolve-Path is a cmdlet I haven’t used much – if at all – so I thought I should have a look at it. At an arbitrary point in the file system: PS> Get-Location Path ---- C:\Scripts\Modules\Coordinates .. Indicates the next level up PS> Get-ChildItem -Path...


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: