Showing archive results for April 2015

Apr 3, 2015
Post comments count0
Post likes count0

PowerTip: Look at Most Recent Error in PowerShell

Doctor Scripto

Summary: Learn how to see the most recent error in Windows PowerShell.  I ran a script that fails. How can I use Windows PowerShell to find the most recent error?  Use $error, and to see the most recent error, look at error 0: $error[0]

Scripting Guy!Windows PowerShellscripting techniques
Apr 3, 2015
Post comments count0
Post likes count1

Catch PowerShell Errors Related to Reading the Registry

Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Try, Catch, Finally blocks to catch Windows PowerShell errors related to reading the registry.  Hey, Scripting Guy! Yesterday you posted Update or Add Registry Key Value with PowerShell. Would it be easy to use Try, Catch, Finally blocks to know if I need to create the registry key...

Scripting Guy!Windows PowerShellscripting techniques
Apr 2, 2015
Post comments count0
Post likes count0

PowerTip: Use PowerShell to Read Registry Key Property Value

Doctor Scripto

Summary: Use Windows PowerShell to read a registry key property value.  How can I use Windows PowerShell to read a registry key property value so I can find the version of a particular software package?  Use the Get-ItemProperty cmdlet, for example: Get-ItemProperty -Path HKCU:\Software\ScriptingGuys\Scripts -Name version

Scripting Guy!Windows PowerShellscripting techniques
Apr 2, 2015
Post comments count2
Post likes count3

Update or Add Registry Key Value with PowerShell

Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to update or add a registry key value.  Hey, Scripting Guy! I am having a problem trying to update the registry. I am using the New-ItemProperty cmdlet, but it fails if the registry key does not exist. I added the –Force parameter, but it still will not cre...

Scripting Guy!Windows PowerShellscripting techniques
Apr 1, 2015
Post comments count0
Post likes count0

PowerTip: Use PowerShell to Get File Hash

Doctor Scripto

Summary: Learn how to use Windows PowerShell to get a file hash.  How can I use Windows PowerShell to get a hash of a file?  Use the Get-FileHash cmdlet, for example: (Get-FileHash C:\fso\myfile.txt).hash

Scripting Guy!Windows PowerShellPowerTip