Showing results for April 2009 - Scripting Blog [archived]

Apr 29, 2009
0
0

Hey, Scripting Guy! How Can I Use the Do…While…Loop in Windows PowerShell?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I frequently work with arrays in my scripts. The way I write scripts, I end up using Do…While…Loop frequently. I know that you like using the For…Each…Next for arrays, but to me Do…While…Loop seemed easier and more flexible. I looked and cannot find an example of how to use Do…While…Loop in Windows PowerShell. ...

Scripting Guy!Windows PowerShellscripting techniques
Apr 28, 2009
0
0

Hey, Scripting Guy! How Can I Use the Windows PowerShell Equivalent of the VBScript While…Wend Loop?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I have been using VBScript for a long time. One of my favorite language statements in VBScript is the While…Wend loop. It is easy to use and easy to understand. Is there an equivalent command in Windows PowerShell?- HS Hi HS, WE never did use the While…Wend loop very much. WE generally used the Do…While…Loop ...

Scripting Guy!Windows PowerShellscripting techniques
Apr 27, 2009
0
0

Hey, Scripting Guy! How Can I Write and Run a Windows PowerShell Script?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I appreciate the command-line stuff you are showing, but to be honest, I am not interested in returning to the DOS days to administer my network. I am not a UNIX administrator-I am a Windows guy. If I wanted to do UNIX kinds of things, I would download the latest *nix distro, obtain a silly haircut, grow facial hair, and be a ...

Scripting Guy!Windows PowerShellscripting techniques
Apr 23, 2009
0
0

Hey, Scripting Guy! How Can I Work with Directories, Files, and Folders by Using Windows PowerShell?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! This may not sound too exciting, but I do a lot of work with files and folders. I constantly have to create folders and files, move files, and move folders. This was easy to do by using VBScript, but nevertheless it always required at least six lines of code to do anything. Is it possible to simplify this process by using ...

Scripting Guy!Windows PowerShellscripting techniques
Apr 22, 2009
0
0

Hey, Scripting Guy! How Can I Identify and Delete an Instance of a Process?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I want to do a query for a process, and if the process is running, I want to delete that process. I know I could write a script by using WMI, but is there something native to Windows PowerShell that I can use to find and to delete the process? Next question: what if there is more than one process I have to delete? Can I find ...

Scripting Guy!Windows PowerShellscripting techniques