Showing archive results for 2007

Mar 7, 2007
Post comments count0
Post likes count0

Why Can’t I Pipe Format-Table to Export-Csv (and get something useful)?

PowerShell Team

Ken's PowerShell blog has an entry Remote Services and PowerShell where he wrote a function to get services from a remote machine using WMI. He formatted the data using FT (format-table) and then went on to export the data to CSV. He pointed out that the following would NOT work rget-service remotemachinename netlogon | ft -autosize name,startmod...

FAQ
Mar 6, 2007
Post comments count0
Post likes count0

Invoke-Expression

PowerShell Team

I fixed a bug in Start-Demo (Script attached) that is worth exploring. The heart of Start-Demo is to get a line from file, display it and then run it showing the output. To do this I used Invoke-Expression (For simplicity sakes, I'm going to show you the code assuming that the line to execute is $LINE – the actual code is a bit more complicated) ...

Mar 6, 2007
Post comments count0
Post likes count0

How does the RemoteSigned execution policy work?

PowerShell Team

You might have wondered how the "RemoteSigned" execution policy protects us from running unsigned PowerShell scripts downloaded from the internet.  We use the URL Security Zones API related to "Attachment Execution Service" (AES) introduced in Windows XP SP2 and Windows Server 2003 SP1.  Internet Explorer and Outlook Express are among&nbs...

Mar 6, 2007
Post comments count0
Post likes count0

Managing SQL with PowerShell – PowerSMO

PowerShell Team

Dan Sullivan has been doing some great things using PowerShell to manage SQL. Dan wrote that Addison-Wesley book "A Developer's Guide to SQL Server 2005" along with Bob Beauchemin. He has now started a series of articles on this topic at simple-talk.com. Here are the first two but Dan told me that he'll be writing more so you might want to bookm...

Mar 6, 2007
Post comments count0
Post likes count0

Renaming Files

PowerShell Team

Let's have a little fun with Rename-Item: [3112:0]PS> dir    Directory: Microsoft.PowerShell.Core\FileSystem::C:\temp\jpsMode                LastWriteTime     Length Name----                -------------     ------ -----a---          3/5/2007   4:21 PM        948 a-a---          3/5/2007   4:21 PM       1214 b-a---          3/5/2007   4:21 PM  ...

Mar 5, 2007
Post comments count0
Post likes count0

Improved Start-Demo Script

PowerShell Team

I showed my Start-Demo script to my wife and she wasn't impressed J. She gave me some good ideas about how to make it better so I've updated the script and attached it to this entry. The changes are: Jeffrey Snover [MSFT]Windows PowerShell/MMC ArchitectVisit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShellVisit the Windows...

Mar 5, 2007
Post comments count0
Post likes count0

Windows PowerShell & Microsoft Management Console (MMC) ISV Workshop

PowerShell Team

Dear Valued Microsoft Customer,  You are invited to attend the Windows PowerShell & Microsoft Management Console (MMC) ISV Workshop (Building Next Generation Command Line and GUI Applications on Windows) on April 18th & 19th 2007.  This is a free two-day event, located on the Microsoft Campus, Redmond, WA.  This in-depth briefing on Micros...

Mar 5, 2007
Post comments count0
Post likes count0

Note on Performance

PowerShell Team

Vinicius Canto posted a comment regarding the performance of the QL function that I posted in my Year of the Pig Revisited – the magic of QL blog post. He found that this function was 16x slower than creating an array using the form: @("Pig", "Rat", "Ox"). That is good to know and if you have a script which you need to speed up, this is one area y...

Mar 4, 2007
Post comments count0
Post likes count0

Software Inventory

PowerShell Team

Otto Helweg has started a blog called Management Matters that I think you'll enjoy. He just posted an entry about how to use PSINFO (from SysInternals) and PowerShell to do a quick and dirty software inventory and displaying the results to a screen or storing them in a database. Give it a read – it's cool stuff.  Jeffrey Snover [MSFT]Windows Pow...

Mar 4, 2007
Post comments count0
Post likes count0

Internet Radio Function

PowerShell Team

I found a cool blog entry at http://hung-yuwu.spaces.live.com/Blog/cns!744FB258BF8C8020!1377.entry . I have no idea what it says but I can read the script and I like it. The person has an internet radio site that they like and wrote a simple script to get run it in an IE windows with a fixed size and location and without all the IE adornments. I lo...