Microsoft® Windows PowerShell Step by Step by Ed Wilson

Microsoft® Windows PowerShell Step by Step by Ed Wilson

Author:Ed Wilson [Ed Wilson]
Language: eng
Format: epub
Tags: COMPUTERS / Programming / Microsoft Programming
ISBN: 9780735643673


The code block to run, if the condition occurs, should print out a message stating that an error has occurred. It should also print out the CategoryInfo and Invocationinfo properties from the current $error variable. The code to do this is shown here:

{"An error occurred during the operation. Details follow:" $error[0].categoryInfo $error[0].invocationinfo $error[0].tostring()}

Save and run your script. You should see an error generated (due to a duplicate attempt to create MyTestOU).

Change the OU name to MyTestOU1 and run the script. You should not see an error generated. The revised line of code is shown here:

$StrOUName = "ou=MyTestOU1"



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.