PowerShell is a command prompt and a scripting environment designed for Windows system administration.
283
votes
11answers
214k views
How to determine what version of PowerShell is installed?
How can I determine what version of PowerShell is installed on a computer, and indeed if it is installed at all?
201
votes
12answers
52k views
Is PowerShell ready to replace my cygwin shell on Windows?
I'm debating whether I should learn PowerShell, or just stick with Cygwin/Perl Scripts/Unix Shell scripts, etc.
The benefit of PowerShell would be that the scripts could be more easily used by ...
176
votes
17answers
87k views
What's a good alternative Windows console? [closed]
UPDATE (solution)
Months later someone turned me on to an awesome solution to this. If you install Git for Windows, it comes with this console app called Git Bash that does exactly what I descibed. I ...
151
votes
3answers
79k views
How do you comment out code in Powershell?
How do you comment out code in Powershell (1.0 or 2.0)?
This is a basic question, but I couldn't find it on stackoverflow.
134
votes
8answers
40k views
How can I run PowerShell with the .NET 4 runtime?
I am updating a PowerShell script that manages some .NET assemblies. The script was written for assemblies built against .NET 2 (the same version of the framework that PowerShell runs with), but now ...
122
votes
11answers
47k views
What tutorial do you recommend for learning PowerShell? [closed]
I would like to learn PowerShell in my spare time.
I already know a bunch of stuff in that line (Perl, Ruby, Python, bash, cmd.exe) so a tutorial leveraging that would be awesome.
Also, since I am ...
117
votes
5answers
63k views
Setting windows powershell path variable
So I've found out that setting the PATH environment variable affects only the old command prompt, powershell seems to have different environment settings. How do I change the environment variables for ...
92
votes
6answers
61k views
PowerShell “execution of scripts is disabled on this system.”
I am trying to run the a .cmd file that calls a Powershell script from the command prompt and I am getting the below error:
Management_Install.ps1 cannot be loaded because the execution of scripts ...
85
votes
1answer
62k views
powershell 2.0 try catch how to access the exception
This is try catch in powershell 2.0
$urls = "http://www.google.com", "http://none.greenjump.nl", "http://www.nu.nl"
$wc = New-Object System.Net.WebClient
foreach($url in $urls)
{
try
{
...
75
votes
8answers
17k views
How to start PowerShell from Windows Explorer?
Does anyone know of a way to start PowerShell in a specific folder from Windows Explorer, e.g. to right-click in a folder and have an option like "Open PowerShell in this Folder".
It's really ...
71
votes
7answers
9k views
How do I delete all untracked files from my working directory in Mercurial?
Is it possible to delete all untracked files from my working directory? Let's say I added a bunch of files to my working directory, didn't add them via hg add, and now want to get rid of those new ...
65
votes
5answers
31k views
Unix tail equivalent command in Windows Powershell
I have to look at the last few lines of a large file (typical size is 500MB-2GB). I am looking for a equivalent of Unix command tail for Windows Powershell. A few alternatives available on are,
...
63
votes
6answers
69k views
How to run exe in powershell with parameters with spaces and quotes
How do you run this command in powershell:
C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe -verb:sync -source:dbfullsql="Data Source=mysource;Integrated Security=false;User ...
62
votes
7answers
7k views
Equivalent of *Nix 'which' command in Powershell?
Does anyone know how to ask powershell where something is?
For instance "which notepad" and it returns the directory where the notepad.exe is run from according to the current paths.
57
votes
7answers
100k views
How to run a PowerShell script?
Guys and Gals, a really stupid question:
How do I run a PowerShell script?
I have a script named myscript.ps1
I have all the necessary frameworks installed
I set that execution policy thing
I have ...