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 [[-Counter] <string[]>] [-SampleInterval <int>] [-MaxSamples <long>] [-Continuous] [-ComputerName <string[]>] [<CommonParameters>] Get-Counter [-ListSet] <string[]> [-ComputerName <string[]>] [<CommonParameters>] There’s […]
Archive for November, 2019
Clipboard cmdlets
Posted by: richardsiddaway | November 26, 2019 Comments Off on Clipboard cmdlets |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 Raw parameter makes Get-Clipboard ignore new line characters and get the entire contents of the clipboard. PS> Get-Clipboard […]
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 want to perform the action PS> Clear-RecycleBin -Force or PS> Clear-RecycleBin -Confirm:$false Will bypass the need for confirmation
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 elements $ell1 = 1 $ell1 $ell2 […]
PowerShell v7 preview 6
Posted by: richardsiddaway | November 22, 2019 Comments Off on PowerShell v7 preview 6 |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 version is a good indication of what’ll be available in PowerShell v7. Test-Connection finally works properly and is usable Some graphical based cmdlets are now available Out-GridView Show-Command Get-Help –ShowWindow A […]
Get-DnsServerResourceRecord
Posted by: richardsiddaway | November 21, 2019 Comments Off on Get-DnsServerResourceRecord |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] <ushort> [-ComputerName <string>] [-Node] [-ZoneScope <string>] [-VirtualizationInstance <string>] [-CimSession <CimSession[]>] [-ThrottleLimit <int>] […]
Searching Active Directory by email address
Posted by: richardsiddaway | November 21, 2019 Comments Off on Searching Active Directory by email address |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 ‘OU=UserAccounts,DC=Manticore,DC=org’ | foreach { $names = $_.Name -split […]
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, IsSigned ZoneName : _msdcs.Manticore.org ZoneType : Primary IsAutoCreated : False IsDsIntegrated : True […]
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 <string[]>] [-ComputerName <string[]>] [-Credential <pscredential>] [<CommonParameters>] It still uses the Win32_QuickFixEngineering CIM class under the covers which is why its Windows only. My preferred […]
Categories
- .NET
- Active Directory
- Architecture
- Azure
- Bash
- BITS
- Books
- CDXML
- CIM
- Cloud
- COM
- Containers
- Deep Dive
- Desired State Configuration
- DevOps
- DHCP
- DNS
- DSC
- European Summit
- Events
- Exchange
- File System
- Firewall
- General
- General IT Matters
- Hyper-V
- IIS
- Infrastructure
- IT Community
- IT Security
- Learning PowerShell
- Linux
- Math
- Microsoft
- Modules
- Nano Server
- Networking
- Office 2010
- Office 2013
- Open Source
- Opinion
- Outlook
- Philosophy
- PowerShell
- PowerShell 7
- PowerShell and .NET
- PowerShell and Active Directory
- PowerShell and CIM
- PowerShell and Exchange 2007
- PowerShell and IIS
- PowerShell and SQL Server
- PowerShell and WMI
- PowerShell Basics
- PowerShell original
- PowerShell Summit
- PowerShell User Group
- PowerShell User Group 2
- PowerShell v2
- PowerShell V3
- PowerShell v4
- PowerShell v5
- PowerShell v6
- PowerShell.org
- PowerShellGet
- PowerShellV2
- PSAM
- Rant
- Registry
- Scripting
- Scripting Games
- Scripting Games 2104
- Security
- SQL Server
- Storage
- Strings
- Summit
- Technology
- Uncategorized
- Virtualization
- Windows 10
- Windows 2012 R2
- Windows 7
- Windows 8
- Windows 8 Server
- Windows 8.1
- Windows Server
- Windows server 1709
- Windows Server 2008
- Windows Server 2008 R2
- Windows Server 2012
- Windows Server 2012 R2
- Windows Server 2016
- Windows Server 2019
- WMFv5
- WPF
- WSUS