To use the Windows PowerShell scripts discussed in "Use the .NET WebClient Class in PowerShell Scripts to Access Web Data," you need to run them from a location in the PowerShell command search path, which means a folder that PowerShell checks when you specify a command name that it can't identify as a known alias, cmdlet, or function. Here's a basic procedure you can follow to add a custom folder to the Windows search path. Any scripts or binaries you want Windows to be able to find by name you can stick in that folder. The steps are as follows:
These are the folders that Windows automatically searches for external command files, separated by semicolons. Simply add another semicolon and the path to the folder you created. If it was C:\bin and you already had the simple path just given, your system path should look like this when you're done:
Now PowerShell can find the custom binaries and scripts you save to that folder.
C:\Windows\system32;C:\Windows;C:\Windows\system32\wbem
C:\Windows\system32;C:\Windows;C:\Windows\System32\wbem;C:\bin
Adding a Folder to the Windows Command Search Path
0 comments
Hide comments