header image

Archive for December, 2011

Following on from the previous post I was asked if the bit where we set the case on the file names and extension could be done in a select statement. Simple answer is yes Get-ChildItem | where {-not $_.PSIsContainer} | sort Fullname | select @{N="FullName"; E={$($_.Fullname.ToUpper())}}, @{N="Extension"; E={$($_.Extension.ToLower())}}, Length, LastWriteTime | Format-Table -Autosize Calculated fields […]

under: File System, PowerShell Basics

Formatting file listings

Posted by: | December 29, 2011 | No Comment |

A question was left asking about displaying a file listing with the full name in upper case and the extension in lower case. Its one line of PowerShell Get-ChildItem | where {-not $_.PSIsContainer} | sort Fullname | Format-Table @{N="FullName"; E={$($_.Fullname.ToUpper())}}, @{N="Extension"; E={$($_.Extension.ToLower())}}, Length, LastWriteTime -Autosize

under: File System, PowerShell Basics

Selecting Property order

Posted by: | December 23, 2011 | 1 Comment |

If you run Get-WmiObject -Class Win32_ComputerSystem you get a few properties displayed Domain              : WORKGROUP Manufacturer        : Hewlett-Packard Model               : HP G60 Notebook PC Name                : RSLAPTOP01 PrimaryOwnerName    : Richard TotalPhysicalMemory : 2951139328   Now if you want all properties you need Get-WmiObject -Class Win32_ComputerSystem | fl * or Get-WmiObject -Class Win32_ComputerSystem | select * […]

under: PowerShell Basics

PowerShell workflows

Posted by: | December 23, 2011 | No Comment |

Just as remoting was viewed as the biggest gain in PowerShell v2 it looks like PowerShell workflows will be one of the biggest features on PowerShell v3. Some examples and explanation are available from http://blogs.msdn.com/b/powershell/archive/2011/12/22/another-holiday-gift-from-the-powershell-team-powershell-3-0-ctp2-getting-started-with-windows-powershell-workflow.aspx Enjoy

under: PowerShell V3

Here are the recordings, slides and demo scripts from last weeks two Live Meetings. Introduction to WMI https://skydrive.live.com/?cid=43cfa46a74cf3e96#cid=43CFA46A74CF3E96&id=43CFA46A74CF3E96%212931   WSMAN, WMI and CIM https://skydrive.live.com/?cid=43cfa46a74cf3e96#cid=43CFA46A74CF3E96&id=43CFA46A74CF3E96%212933   Down load and unzip to find all items

under: PowerShell and WMI, PowerShell User Group

WMI LIKEs Wildcards

Posted by: | December 12, 2011 | 2 Comments |

You may hear or read that WMI can’t accept wildcards. WRONG WMI accepts wildcards but not the ones you might expect.   Consider Get-Process p* This gets all the process that begin with the letter p To do something similar with WMI we need to use the –Filter parameter. We can get a single process […]

under: PowerShell and WMI

International WMI week

Posted by: | December 11, 2011 | No Comment |

As far as I am concerned this is International WMI week.  I am delivering a Live Meeting session to the Corpus Christi (Texas) PowerShell group on Tuesday – An Introduction to WMI & PowerShell then on Thursday I am delivering a session to the UK PowerShell group http://msmvps.com/blogs/richardsiddaway/archive/2011/12/04/uk-powershell-group-december-2011.aspx – talking about WMI. WSMAN and the […]

under: PowerShell and WMI

Happy Birthday PowerShell

Posted by: | December 11, 2011 | No Comment |

With all the things happening in the last month – including the release of PowerShell v3 CTP 2 – one thing that seems to have been missed is that PowerShell is 5 years old! Yes – its just over 5 years since the release of PowerShell v1 was announced in Barcelona at the IT Forum […]

under: PowerShell original

Last time we saw that the WMI cmdlets have an Authentication parameter that uses DCOM authentication. It is possible to ignore this Authentication need if the WSMAN or CIM (PS v3 CTP 2) cmdlets are used. If you look at the WSMAN cmdlets then the following cmdlets have an Authentication parameter in PS v2 Test-WSMan […]

under: PowerShell and WMI

Authentication parameters in WMI, WSMAN and the new CIM cmdlets can be confusing. The PowerShell WMI cmdlets have an Authentication parameter that uses DCOM authentication. Using the Authentication parameter with the WMI cmdlets was explained here http://msmvps.com/blogs/richardsiddaway/archive/2011/08/04/authentication-impersonation-and-privileges.aspx   This is not present on the WSMAN cmdlets (in PowerShell v2 and v3 CTP 2) and the […]

under: PowerShell and WMI

Older Posts »

Categories