PowerShell Team
Automating the world one-liner at a time…
Latest posts
New-Object PSObject –Property [HashTable]
Gosh that is a horrible looking thing. This is one of the things we fixed with PowerShell V2 so you take a few minutes to learn this so you never have to do that mess again. Let’s get some help: PS> Get-Help New-Object -Parameter Property -Property <hashtable> Sets property values and invokes methods of the new object. Enter a hash table in which the keys are the names of properties or methods and the values are property value s or method arguments. New-Object creates the object and sets each property value and invo...
You Don’t Have to Be An Administrator to Run Remote PowerShell Commands
I was just read blog entry which complained about having to have administrative access to execute PowerShell commands against a remote server. This is not the case. We are “secure by default” which means that if you want to do something that exposes a security risk to your machines, you have to make a conscious decision to do so. We are secure by default so that you can feel confident in putting PowerShell on all your machines. Your risks are a function of the decisions you make after you install PowerShell and we’ll educate you about the risks and benefits of those decisions. (Run ...
Windows PowerShell and the Windows Management Framework
There’s been a lot of great excitement that’s accompanied the release of PowerShell V2 and Windows Remote Management (WinRM) – also known as the Windows Management Framework. We’ve also heard the occasional question on whether it’s possible to install them independently. When we’ve heard this concern, it is usually focused on security. To be clear, Windows Remote Management (WinRM) has been part of Windows since Vista and Server 2008. It does not listen to network connections by default, and must be explicitly activated. Both have advanced greatly during the release of Windows 7 – most notably by working togethe...
PDC09 SVR12 and SVR13 Session Demos
Attached are the demos and slides from the PDC sessions SVR12 and SVR 13 today. Here are the steps you need to do before you can run them 1. Unzip the files and run setup\setup.ps1. This will configure user accounts and initialize some files required 2. Change computers.dat in service\roles\. Set it to the computers that you want to connect to 3. Edit Impersonation\Get-DelegationCredential.ps1 under each folder - Inventory, Service and Employee (Please Note: This script is intended only for demo purposes and is not recommended to be copied for production 4. Set the paths in app.xaml.cs in each of the visual studi...
I Can Do That With 1 Line of PowerShell: Installed Software
Ying Li has a cool PowerShell Script to list installed Software on a local computer HERE. When I looked at it and thought to myself, I can do that with 1 line (if I cheat a little). Here it is: PS> gp HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |Select DisplayName, DisplayVersion, Publisher, InstallDate, HelpLink, UninstallString |ogv Here is what you get for that 1 line of code: I cheated by using OGV (Out-GridView). Ying used Excel and the output is nicer. But when you only want to spend a single line… :-) Experiment!&...
SRV312 TechEd Slides
I just gave the talk, "”Server Management Improvements and Solutions for Windows Server 2008 R2”. It went over rather well. Attached are the slides. I will try to get you the demos but that will be difficult and will take some time. Enjoy! Jeffrey Snover [MSFT] Distinguished Engineer Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx SRV312_Snover.pptx
Windows Server 2008 R2 Rocks!
One of the things I like to say is that, “Microsoft is incapable of sustained error”. By that I mean that Microsoft is an intensely self-conscious culture, fearless about confronting shortcomings and constantly looking for ways to do things better. We beat ourselves up pretty brutally about the shortcomings of Vista and committed ourselves to doing better going forward. This is one of the reasons why Windows Server 2008 was such a good release. We didn’t stop there, we raised the bar for Windows 7 and Windows Server 2008 R2. Part of that was the product itself. Anyone that use...
PowerPack Challenge
Quest Software’s PowerPack Challenge’09 is on... calling all script warriors to show their skills. See the details here - http://powergui.org/powerpackchallenge.jspa Happy Scritping Osama Sajid, Program Manager
Why is Get-ChildItem so Slow?
We get this question fairly frequently when it comes to slow network connections. The performance of directory listings (especially on a laggy network) are limited by the .NET APIs we call to retrieve the directory information. There are two limitations to the current set of APIs: Forced Retrieval of Attributes When we do a directory listing, we show the standard attributes of the file or directory: Mode, LastWriteTime, Length, and Name. The core Windows API is highly optimized for this basic scenario, and returns these attributes by default along with the rest of the file information. However, the .NET Framew...