-
This article illustrates the use of PowerShell background jobs which is new in PowerShell V2. Some commands just take a long time to execute, so this article shows you have to do it using the PowerShell V2 bits that were recently released at the PDC 2008 along with Windows 7. Read more at: http://thepowershellguy...
-
I'm trying to work out how to specify the Catch values for PowerShell V2 CTP3's Try/Catch stuff. Here's a simple divide by zero error that I'm trying to catch: <# .SYNOPSIS Demonstrates try/catch/finally in V2 .DESCRIPTION Shows a simple example of the try/catch/finally syntax introduced...
-
See this help file: about_Try_Catch_Finally $one=1 $zero=0 try{ $one/$zero } catch [System.DivideByZeroException]{ #"The first Catch script block handles System.DivideByZeroException exceptions" "Attempted to divide by zero" } catch { "the second Catch script block handles any...
-
By Joel 'Jaykul' Bennett Note: WatiN requires Single Threaded Apartment mode, so you need to be using PowerShell 2.0 (currently in CTP3) in order for any of this to work, and you need to pass the -STA parameter to PowerShell. Regardless, I thought I’d throw two ... Read More
-
This is very good info, but I'm lost when it comes to dealing with COM object exceptions inside PowerShell. Some are rather simple, for example, I've registered a DLL (e.g. KiXtart.DLL which comes with KiXtart 4.60). I can invoke the interface as an object in VBScript and JScript fine. It works...
-
Widows 2008 R2 comes with powershell v2 by default. and added with 76 new Ad cmdlets and Ad provders New-ADOrganizationalUnit -Name "OUname" -ProtectedFromAccidentalDeletion $true This command creates new OU under the root. If we wanted created OU in specific path then we have to provide the...
-
#********************************************************************************************* #** This script will read information from a SQL database with the Windows server names #** It will take that list and pass it to a WMI call to get the drive type information #** You need the SQLCommand Script...
-
OK maybe I'm posting my stuff with the wrong tags as I am not getting much responses, hopefully someone out there will see this one I am having trouble outputting the data back to SQL, I am sure it's in my statements at the bottom of the script but I've not figured it out yet, any help appreciated...
-
By Doug Finke I find the PDC09 site a bit frustrating to navigate the sessions I want to attend. So I whipped up this 25 line PowerShell/WPK GUI. Type in the search box to find matching session titles. Click on a title and the browser navigates to ... Read More
-
I'm running the following script and everything works except the last command: #wsus-reregister.ps1 param ($computer) Invoke-Command $computer -scriptblock { $RegPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" $RegProperties = "SusClientID","SusClientIDValidation"...