Every so often I find a new cmdlet in PowerShell. This was the case with Clear-RecycleBin that I’ve just found. It appears to have been introduced with PowerShell 5.0 BUT isn’t available in PowerShell 6.0 With pretty simple syntax PS> Get-Command Clear-RecycleBin -Syntax Clear-RecycleBin [[-DriveLetter] <string[]>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>] Its easy to use PS> […]
Archive for January, 2018
Documentation can be wrong!
Posted by: richardsiddaway | January 31, 2018 Comments Off on Documentation can be wrong! |We rely on vendor documentation to help us solve problems. Documentation is produced by people and people make mistakes so Documentation can be wrong! As an example: The CIM class Win32_OperatingSystem has a Description property. According to the documentation the Description property is “ Description of the Windows operating system. Some user interfaces for […]
PowerShell use tends to be very interactive. You run a command at the console and get some results. You run a script and get some results. How do you make PowerShell sleep? There’s a few ways you can make PowerShell code sleep. First there’s Start-Sleep PS> for ($i=0; $i -le 10; $i++){ >> if […]
PowerShell –f string
Posted by: richardsiddaway | January 28, 2018 Comments Off on PowerShell –f string |A PowerShell –f string is used to format the data inside a string. –f is usually referred to as the format operator. The operation of the format operator is best explained by examples. At its simplest you create fields in the string using {} and the arguments to the right of the –f operator are assigned to those […]
The PowerShell team have posted an update on what’s happening with DSC. https://blogs.msdn.microsoft.com/powershell/2018/01/26/dsc-planning-update-january-2018/ The interesting thing is the decoupling of the Local Configuration Manager from Windows. A new LCM that can use resources written in multiple languages sounds good – DSC on Linux can finally have custom written resources. LCM will be open source […]
PowerShell v6.0.1 is available from https://github.com/PowerShell/PowerShell/releases This release upgrades PowerShell to use .NET core v2.0.5 which addresses a couple of security vulnerabilities. The release also addresses upgrade issues on some Linux distributions due to version numbers being misunderstood. Also available is the v1.0.0 beta for OpenSSH https://github.com/PowerShell/Win32-OpenSSH/releases. This version supplies one of my […]
Iron Scripter prequels
Posted by: richardsiddaway | January 25, 2018 Comments Off on Iron Scripter prequels |One of the new things for Summit 2018 is the iron Scripter competition on the last afternoon. As a warm up for the competition we’re running a number of Iron Scripter prequels. A puzzle will be published every week – first 2 are on powershell.org. A forum exists to discuss the solutions in […]
PowerShell v6 GA and beyond
Posted by: richardsiddaway | January 25, 2018 Comments Off on PowerShell v6 GA and beyond |PowerShell v6 achieved General Availability on 10 January 2018. https://blogs.msdn.microsoft.com/powershell/2018/01/10/powershell-core-6-0-generally-available-ga-and-supported/ Why do these things always happen when I’m in a plane over the Atlantic? GA is a tremendous milestone but its not the end by any means. Work has already begun on v6.1 https://blogs.msdn.microsoft.com/powershell/2018/01/24/powershell-core-6-1-roadmap/ Note a service release at the end of […]
Way back in this post https://richardspowershellblog.wordpress.com/2008/03/27/start-and-end-of-week/ I showed how to find the start of the week. I recently had a question about how to restrict the display to just the date. PowerShell uses the .NET datetime class for working with dates so there will always be time information even if its set to 0. […]
Relevance of Scripts
Posted by: richardsiddaway | January 4, 2018 Comments Off on Relevance of Scripts |I had a sudden thought today about the relevance of scripts – PowerShell Scripts – today. PowerShell v6 can’t run some of the modules that we’ve come to rely on – for instance the AD cmdlets. The Windows Compatibility Pack (see previous post) enables access to some of the underlying .NET classes that enable […]
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