Tuesday 15 March 2011

variables - What does "$?" mean in PowerShell -


I am very new in PowerShell while looking for information about handling error, give me "$?" To get access to a lot of references

I know that there is something with errors, but what exactly is it? And where else can I read about it?

All my Google searches have found nothing. From

to:

Errors and debugging: $ last command success Or can you determine the status of failure?

Example:

  & gt; Gate-content file-to-present. Txt hello world & gt; Write - host $? True & gt; The gate-content file- it is not-does not exist. Get T-content: The path 'C: \ file-that-does-exist-exist.txt' can not be found because it does not exist. In line: 1 character: 1+ receiving-content file-that-no-exist. TTIC + ~~~~~~~~~~~~~~~~~~ + Category Information: Object Notaffound: (C: \ File-that-does-does-exist.txt: string) [Get-content] , ItemNotFoundException + FullyQualifiedErrorId: PathNotFound, Microsoft.PowerShell.Commands.GetContentCommand & gt; Write - host $? False    

No comments:

Post a Comment