Is there a time when you shouldn’t use PowerShell – No Is there a time when there might be better alternatives – Yes I can think of a number of situations where writing a PowerShell script may not be the most effective answer: a simple one off or very infrequent task that can be done […]
Archive for May, 2011
PowerShell Basics: 3 When not to use PowerShell
Posted by: richardsiddaway | May 31, 2011 | No Comment |The utility cmdlets are the glue that we use to bind our actions together on the PowerShell pipeline. We can easily discover the list of utility cmdlets by using Get-Command *-object I split the utility cmdlets into two groups. The first group I use all of the time ForEach-Object Select-Object Sort-Object Where-Object The second […]
Just discovered a typo in the advanced function template I posted. http://msmvps.com/blogs/richardsiddaway/archive/2011/05/24/advanced-function-template.aspx It should be function aaaa-yyyyyy{ [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact="Medium Low High None", DefaultParameterSetName="XXXXX")] param ( [parameter(Position=0, Mandatory=$true, ParameterSetName="YYYYYYYYYY", ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, ValueFromRemainingArguments=$true, HelpMessage="Put your message here" )] [Alias("CN", "ComputerName")] [AllowNull()] [AllowEmptyString()] [AllowEmptyCollection()] [ValidateCount(1,10)] […]
Don’t forget to add the June meeting of the UK PowerShell User group to your calendar. Its June 21 at 7.30pm BST. Details available from http://msmvps.com/blogs/richardsiddaway/archive/2011/05/10/powershell-uk-user-group-june-meeting.aspx
Last year I bought a Lenovo W510 to use as my mobile(ish) Hyper-V lab. I mentioned the initial problems I’d had with core parking – http://msmvps.com/blogs/richardsiddaway/archive/2010/08/06/lenovo-w510-hyper-v-and-bsod.aspx Once those were resolved I haven’t had any other problems with it. I never did get Virtual Machine Manager installed – I tripped over a problem that VMM won’t […]
Discussions at the PowerShell Deep Dive and the entries for the Scripting Games showed me that there is tremendous amount of interest in PowerShell but that there are a lot of people that are still unsure of how to get started on want to take PowerShell a bit further than stringing cmdlets together on the […]
Today, for one day only, get 50% off PowerShell and WMI MEAP or MEAP+ebook. The code is dotd0529cc when you order from www.manning.com The same code can be used for PowerShell in Action – second edition and PowerShell in Practice
A number of the classes in root\wmi return results from more than one class. That sounds odd but it can be explained by an example. The namespace contains a number of classes related to the battery in laptops gwmi -Namespace root\wmi -List *battery* MSBatteryClassEvent BatteryStatusChange BatteryTagChange MSBatteryClass BatteryStaticData BatteryRuntime BatteryCycleCount BatteryTemperature BatteryStatus BatteryFullChargedCapacity We’ll […]
Testing the individual classes in root\wmi is a pain – so its time for some brute force. I’ll select a group of classes and test the selection gwmi -Namespace root\wmi -List system* | fw I can then iterate through them calling get-wmiobject. This is a command line activity so aliases are OK gwmi -Namespace […]
Continuing our exploration of the murky jungle that is the root\wmi namespace we find a number of classes related to system configuration gwmi -Namespace root\wmi -List *system* | fw Of theses the only one I could get a respnse from on Windows 7 or Windows 2008 R2 was MS_SystemInfo. gwmi -Namespace root\wmi -Class MS_SystemInformation […]
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