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 […]
Archive for November, 2017
Windows update module
Posted by: richardsiddaway | November 28, 2017 Comments Off on Windows update module |A Windows Update module is available on Windows versions 1709 and later. This includes Windows 10 Fall Creators Update, Windows Server 1709 and Windows Insider previews (Server and Client) post the 1709 release. The module supplies the following cmdlets Get-WUAVersion Get-WUIsPendingReboot Get-WULastInstallationDate Get-WULastScanSuccessDate Install-WUUpdates Start-WUScan The module is a CDXML module based on the root/Microsoft/Windows/WindowsUpdate/MSFT_WUOperations […]
Get an AD user’s manager
Posted by: richardsiddaway | November 27, 2017 Comments Off on Get an AD user’s manager |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 […]
PowerShell v6: #5 Get-Uptime
Posted by: richardsiddaway | November 23, 2017 Comments Off on PowerShell v6: #5 Get-Uptime |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 : 106260000000 TotalDays : 0.122986111111111 TotalHours : 2.95166666666667 TotalMinutes : 177.1 TotalSeconds : 10626 […]
PowerShell v6: #4 profiles
Posted by: richardsiddaway | November 23, 2017 Comments Off on PowerShell v6: #4 profiles |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 ———– —- Current User, Current Host $Home\[My ]Documents\WindowsPowerShell\Profile.ps1 Current User, All Hosts $Home\[My ]Documents\Profile.ps1 All Users, […]
PowerShell v6: #3 Release Candidate
Posted by: richardsiddaway | November 20, 2017 Comments Off on PowerShell v6: #3 Release Candidate |The PowerShell team have announced the availability of the PowerShell v6 release candidate. https://blogs.msdn.microsoft.com/powershell/2017/11/17/powershell-core-6-release-candidate/ A release candidate is just about done with only bugs to resolve – in other words about what you can expect in the final delivery. Some work is still required – https://github.com/PowerShell/PowerShell/issues?q=is%3Aopen+is%3Aissue+milestone%3A6.0.0-GA The full release of PowerShell 6.0 […]
Cannot verify the file SHA256 when installing package
Posted by: richardsiddaway | November 18, 2017 Comments Off on Cannot verify the file SHA256 when installing package |I’m doing some work requiring containers and decided to use Server 1709 as it has some significant changes when compared to Server 2016. The documentation – https://docs.microsoft.com/en-us/virtualization/windowscontainers/about/ – just gives options for Windows Server 2016 and Windows Server Insider Preview. As 1709 is the shipping version of the Insider Preview I decided that should work. […]
Windows update change in Server 1709
Posted by: richardsiddaway | November 17, 2017 Comments Off on Windows update change in Server 1709 |When Windows Server 2016 was introduced a very nice CIM class was provided to work with Windows Updates. If you wanted to scan for available updates you could do something like this: $ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession <br>$result = $ci | Invoke-CimMethod -MethodName ScanForUpdates -Arguments @{SearchCriteria=”IsInstalled=0″;OnlineScan=$true} <br>$result.Updates Unfortunately, if you try this […]
When is PowerShell not PowerShell?
Posted by: richardsiddaway | November 14, 2017 Comments Off on When is PowerShell not 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 Windows 10.0.17035 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 Now try […]
PowerShell version
Posted by: richardsiddaway | November 14, 2017 Comments Off on PowerShell version |Depending on the version of Windows you’re running you could be using PowerShell version 1 through version 5.1 (admittedly I suspect there are very few people, if any, still running PowerShell v1). This is complicated by the various versions of Windows Management Framework that are available for download and the large number of alpha and […]
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