Showing results for July 2009 - Page 3 of 4 - Scripting Blog [archived]

Jul 13, 2009
Post comments count0
Post likes count0

Hey, Scripting Guy! How Can I Handle Errors in a Windows PowerShell Script?

ScriptingGuy1
ScriptingGuy1

 Hey Scripting Guy! When I used to write VBScripts, I liked the fact that I could use On Error Resume Next to handle any errors in my scripts. I have tried to find something like this in Windows PowerShell, but I have been unable to do so. Does Windows PowerShell have On Error Resume Next? -- OG Hello OG, When I am scuba diving, one of ...

Scripting Guy!Windows PowerShellscripting techniques
Jul 9, 2009
Post comments count0
Post likes count0

Hey, Scripting Guy! How Do I Create a CSV File from Within Windows PowerShell?

ScriptingGuy1
ScriptingGuy1

  Hey Scripting Guy! I am having a problem trying to create a CSV file from within Windows PowerShell. I thought at first I could use the Write-Host cmdlet to do this. I came up with this command:Write-Host "col1,col2,col3" >> "C:fsotest.csv"But when I go to the test.csv file, it is empty. I am really stuck. I have spent more than 10 hou...

Scripting Guy!Windows PowerShellscripting techniques
Jul 8, 2009
Post comments count0
Post likes count0

Hey, Scripting Guy! How Do I Get Data Out of a Function?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I have been having problems with trying to understand functions in Windows PowerShell. I get that you use the Function keyword to create the function, but I do not know how to get information from the function back to the script. I have been able to make the functions work by using Write-Host from inside the function, but when ...

Scripting Guy!Windows PowerShellscripting techniques
Jul 7, 2009
Post comments count0
Post likes count0

Hey, Scripting Guy! How Can I Both Save Information in a File and Display It on the Screen?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! You know the old commercial that goes, "Sometimes you feel like a nut, sometimes you don't"? Well, sometimes I want to save information from a script to a file, and sometimes I want to see it displayed to the screen. And at other times, I want both. In other words, I want my candy bar, and I want to eat it, too. - NR Hi NR, ...

Scripting Guy!Windows PowerShellscripting techniques