Showing results for May 2013 - Page 4 of 11 - Scripting Blog [archived]

May 22, 2013
Post comments count0
Post likes count0

PowerTip: Find Format Data Used by Current PowerShell Session

Doctor Scripto
Doctor Scripto

Summary: Find the Windows PowerShell format data files that are used in your current Windows PowerShell session.  How can I find the format data files that are being used in my current Windows PowerShell session?  Use the Get-FormatData cmdlet in Windows PowerShell 3.0, and to browse this information, pipe the results ...

Scripting Guy!Windows PowerShellPowerTip
May 22, 2013
Post comments count2
Post likes count0

Variable Substitution in a PowerShell Script Block

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about performing variable substitution inside a Windows PowerShell script block.  Hey, Scripting Guy!  I am trying to create a command. The command contains variables that I would like to assign prior to creating the command. However, when I get to the script block portion of my code, it ...

Scripting Guy!Windows PowerShellscripting techniques
May 21, 2013
Post comments count0
Post likes count0

PowerTip: Create a PowerShell Script Block on the Fly

Doctor Scripto
Doctor Scripto

Summary: Create a Windows PowerShell script block on the fly. How can I convert a string into a Windows PowerShell script block? Use the static Create method from the [scriptblock] class:PS C:> [scriptblock]::Create("this is a string") | gm   TypeName: System.Management.Automation.ScriptBlock Name&nbs...

Scripting Guy!Windows PowerShellPowerTip
May 21, 2013
Post comments count0
Post likes count0

PowerShell Hash Tables that Contain Keywords…hmm…

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about dealing with Windows PowerShell hash tables that contain keywords. Dude!  Hey, Scripting Guy! I have a problem in that I want to create a hash table from an array. This is easy enough to do, but if the array contains keywords, then everything goes pear shaped. Any ideas? —GP  ...

Scripting Guy!Windows PowerShellscripting techniques
May 20, 2013
Post comments count0
Post likes count0

PowerTip: Create an XML Representation of a Registry Key with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to create an XML representation of a registry key.  How can I easily create an XML representation of a registry key by using Windows PowerShell?  Use the Get-ChildItem cmdllet and the registry provider to get the registry key, and pipe the results to the Export-CliXML cmdlet: Get-ChildIt...

Scripting Guy!Windows PowerShellPowerTip