Windows PowerShell is a command line shell and scripting language for Windows that supersedes the CMD.exe shell and batch language. PowerShell is also an automation engine for Windows that provides functionality similar to Windows Script Host and VBScript.

learn more… | top users | synonyms

93
votes
7answers
68k views

Native alternative to wget in Windows PowerShell?

I know I can download and install the aformentioned library (wget for Windows), but my question is this: In Windows PowerShell, is there a native alternative to wget? I need wget simply to retrieve ...
61
votes
3answers
177k views

How to enable execution of PowerShell scripts?

When I try to execute my PowerShell script I get this error: File C:\Common\Scripts\hello.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help ...
36
votes
4answers
15k views

Turning off the cmd window beep sound

Is there a way to essentially mute the Beeping function of the Windows command shell? I'm working on a PowerShell script right now which ends up printing several lines of text to the screen. I'm ...
34
votes
5answers
26k views

PowerShell equivalent of curl

Is there an equivalent of curl in PowerShell? Does it have some similar built-in capability or is there a 3rd party cmdlet?
32
votes
10answers
19k views

Equivalent of Linux `touch` to create an empty file with PowerShell?

In PowerShell is there an equivalent of touch? For instance in Linux I can create a new empty file by invoking: touch filename On Windows this is pretty ackward -- usually I just open a new ...
25
votes
4answers
46k views

how to run a powershell script as administrator

On my Windows 7 Desktop, I have script.ps1, which needs admin privileges (it starts a service). I want to click on this script and run it with admin privileges. What's the easiest way to ...
25
votes
5answers
31k views

Copy and paste in Windows PowerShell

How do I effectively copy and paste input and output in the Windows PowerShell?
24
votes
3answers
29k views

have Powershell get-childitem return files only

I'd like to use get-childitem recursively, but only have it return files not directories. The best solution I have just doesn't seem natural: gci . *.* -rec | where { $_.GetType().Name -eq ...
22
votes
2answers
26k views

How do I run multiple commands on one line in Powershell?

In cmd prompt, you can run two commands on one line like so: ipconfig /release & ipconfig /renew When I run this command in PowerShell, I get: Ampersand not allowed. The & operator is ...
22
votes
5answers
7k views

Cannot change powershell default font to Lucida Console

This is a trivial problem, but it annoys me that I can't get to the bottom of it: I'm running Windows 8, Powershell version 3.0. By right-clicking on the title bar I can go into the Properties and ...
20
votes
5answers
16k views

How to copy text from PowerShell

Sometimes I want to copy a command from Powershell to paste in a document, or I want to copy the output? How can I select and copy text in Powershell? At least I know a way how to paste a text (or a ...
19
votes
2answers
11k views

How can I mount an ISO via PowerShell/programmatically?

How can I mount and dismount ISO images from PowerShell in Windows 8 without 3rd party programs? This question's original revision got me wondering if it's possible to mount an ISO via PowerShell in ...
19
votes
4answers
6k views

Powershell equivalent to unix `which` command?

Does powershell have an equivalent to the which command found in most (if not all) unix shells? There are a number of times I'd like to know the location of something I'm running from the command ...
19
votes
2answers
2k views

Where does Windows 8 store the estimated data usage over Wifi?

I accidentally discovered that in Windows 8, if you right-click a previously connected wireless network from the Start screen interface, there's an option to show estimated data usage. Where's ...
18
votes
6answers
12k views

How to enable Internet Connection Sharing using command line?

I can do it manually by right-clicking on a network connection, opening the Sharing tab and clicking on the "Allow other network users to connect through this computer's Internet connection" check ...
17
votes
7answers
17k views

Linux “Top” command for Windows Powershell?

I am looking for a PowerShell cmdlet that can provide similar functionality to the Linux Top app. Something that refreshes at some given interval and displays the process list with CPU % util. I have ...
17
votes
5answers
3k views

Good PowerShell guide, getting started through more advanced usage

Does anyone have a really good tutorial or getting started guide for Microsoft's PowerShell? I'm a long time Linux/Unix user, and very familiar with scripting languages, command-line usage with bash, ...
16
votes
3answers
6k views

What is Windows' equivalent of the “which” command in Unix? Is there an equivalent PowerShell command?

In Linux, we have the "which" command to find out the path of an executable. What is its Windows equivalent? Is there any PowerShell command for doing that?
16
votes
3answers
4k views

How do I modify the Powershell console settings in Windows 7?

I go to properties and change the font and buffer size, and when I press okay, I get: Unable to modify the shortcut. I checked to make sure it has not been deleted or renamed.
15
votes
5answers
1k views

free cmd/powershell replacement with normal copy paste

I don't know why, but I hate pressing ctrl+v and getting ^V in the powershell and cmd windows. I always do it and then I have to back space it, out find my mouse, then right click, and select paste. ...
14
votes
10answers
20k views

Bulk convert photos to smaller size? [closed]

I have about 500 photos - each about 5MB in size. I'd like to bulk convert them to a smaller size, suitable for email and web-hosting. Tools at my disposal - Windows 7 Powershell 2 A free tool I ...
14
votes
3answers
3k views

Quake/Doom like command prompt for Windows [closed]

I'm after a Doom-like command prompt, whereby I can could press a keyboard shortcut like CTRL Tab and the command prompt will scroll down from the top like Doom, Quake, etc. Also if it works with ...
14
votes
4answers
12k views

Setting $HOME in PowerShell

How do I change my default home directory to "C:\Users\khornsby" for every time I open powershell? I am running Windows 7. Below is info about the state of my environment. Windows PowerShell ...
14
votes
1answer
7k views

How do I get get-childitem to filter on multiple file types?

I'm trying to get a list of all the XSL and XSLT files in a directory. dir -recurse -filter *.xsl,*.xslt -name But the following error: Get-ChildItem : Cannot convert 'System.Object[]' to the ...
14
votes
3answers
2k views

What is Windows PowerShell?

What is it for? How do I use it? How is it different from the regular Command Prompt? Is there anything I should know before starting to use it? Any awesome things you can do with it that a super ...
14
votes
1answer
2k views

How to find and open previous versions of a folder programmatically (using PowerShell, WMI, etc)?

I am running Windows 8 Enterprise x64. When I open \\localhost\c$ as a network folder, and then using a context menu open the Properties window of a subfolder (e.g. \\localhost\c$\Deploy as in the ...
13
votes
4answers
12k views

Keyboard shortcut to paste in Windows command prompt

Is there a keyboard shortcut to paste in the Windows command prompt (or at least powershell)? I'm aware that you can right click, but it would be handy if it was possible without touching the mouse.
13
votes
2answers
4k views

Is PowerShell a complete replacement for console/cmd?

Right now I'm using the Windows console (cmd.exe) for some easy tasks (as checking my ip configuration or running some applications). But now I heard that there is PowerShell which actually is way ...
13
votes
2answers
7k views

Default PowerShell to emitting UTF-8 instead of UTF-16?

By default, PowerShell in Windows seems to be outputting UTF-16 (e.g., if I do a simple echo hello > hi.txt, then hi.txt ends up in UTF-16). I know that I can force this to my desired text ...
13
votes
1answer
5k views

How can I get “Open PowerShell Here” in my context menu?

In XP I was used to having the "Open Command Window Here" option in my context menu for folders. In Vista, it's hidden by default, but I know that I can hold shift when right clicking to see that ...
12
votes
11answers
10k views

Is there a better, more UNIX-like command line shell for Windows?

I'm sure this has been asked before, but I haven't found it after an hour or so of searching... I've been using Unix and Mac OS for a while, but I'm a Windows user at heart. This #1 things that I've ...
12
votes
3answers
24k views

Why setting Powershell to set-executionpolicy remotesigned fails?

Using Win7-32bit and Powershell ISE I tried to run a just saved script (let's say containing a simple cls). I got the error, that execution of scripts is forbidden with the usual "get-help ...
12
votes
1answer
3k views

Configure Powershell to be conemu's default shell

Is it possible to configure Powershell to be conemu's default shell? I know I can add additional "tasks" to conemu but I want it to default to use Powershell instead of cmd.exe so that, for example, ...
12
votes
2answers
1k views

How can I create a new user account on Windows 8 associated with a Microsoft email account?

How can I create a new local user account on Windows 8 associated with a Microsoft email account (e.g. MicrosoftAccount\someone@live.com) programmatically, using PowerShell or another scripting ...
11
votes
2answers
32k views

How can one show the current directory in PowerShell?

I'd like to have the current working directory show on the powershell command line, as would be done in a (for example) CMD prompt. How can I do so?
11
votes
3answers
7k views

Show human-readable file sizes in the default PowerShell ls command

How can I modify the default ls (Get-ChildItem) in PowerShell so that it displays human-readable file sizes, like ls -h on a *nix machine? ls -lh does simple logic with the file size, so that it ...
11
votes
2answers
5k views

tmux/screen alternative for powershell

Is there an alternative to tmux/screen that would work on Windows with Powershell? I'm aware of Powerscreen, but it seems dead for a long time. Cygwin wouldn't work with Powershell, would it? Console2 ...
10
votes
3answers
337 views

Equivalent of cmd's “where” in powershell

I can't seem to find anything about a Powershell equivalent of the where command from cmd. Should I just call it from cmd or is there something more elegant in PS?
10
votes
2answers
7k views

Run Python scripts in PowerShell directly

I'm using Windows PowerShell. Let's say I have a script called test.py that prints a few things. If I do: PS D:\>.\test.py then it opens a CMD window which prints a few things and then closes. ...
10
votes
3answers
2k views

PowerShell: history enhancements (readline)?

Some of the things I like in Bash and would love to know how to do in PowerShell: In Bash, I have history scrolling set up so that it only scrolls commands that begin with the same prefix as the ...
10
votes
1answer
302 views

What does “C:2\” in a windows path string mean?

I got this pop-up from the Windows firewall. What is "C:2\" in the path? The real path is D:\Steam\SteamApps\common\... I tried cd /d C:2\ in cmd and got "The system cannot find the path ...
9
votes
2answers
4k views

Why does Powershell silently convert a string array with one item to a string

Consider the following Powershell script, which searches for folders in C:\ with a 'og' in their name: PS C:\> (ls | %{$_.Name} | ?{$_.Contains("og")}) PerfLogs Program Files setup.log Now I ...
9
votes
2answers
8k views

Programatically associate file extensions with application on Windows

I've just recently reinstalled Windows and in setting up my environment I've noticed that all my associations for the various programming languages I edit in Notepad++ have gone (naturally). I am ...
9
votes
1answer
6k views

How can I get a property of an object in powershell without using parentheses?

I often find that I have to surround a command in parentheses and then use the property access to operator (dot-syntax) to get the value of a property. This is rather annoying since I have to go back ...
9
votes
2answers
1k views

Set Powershell as the default shell of Far Manager?

Can I set Powershell as the default shell of Far Manager?
9
votes
1answer
4k views

PowerShell vs. the Unix Shell

I've heard some things about the features of the PowerShell. Some of it seems like typical features of Unix shells. So it seems Powershell includes piping and the commandlets, similar to shell ...
9
votes
3answers
2k views

Can PowerShell be used within the Windows Recovery Environment?

I have tried to access PowerShell from the Command Prompt in Windows Recovery Environment with no success. I am able to run VBScripts there without a problem, and I am now wondering if there is some ...
9
votes
1answer
5k views

tee for Windows?

Does Windows provide the basic tee facility for copying standard input to an arbitrary set of files and then back out to standard output? I generally download a generic tee program, but curious if ...
9
votes
4answers
1k views

How to embed PowerShell into Explorer or Explorer-like tool?

I typically find myself using both Windows Explorer (for navigation and viewing) and PowerShell (for commands). Is there any way to embed the PowerShell console into Windows Explorer? Or is there any ...
9
votes
2answers
2k views

How to open a PowerShell in the current folder?

This keyboard shortcut Shift + Menu, W, Enter opens the command prompt. Scott Hanselman points to an app that does the same for PowerShell and says it's builtin in Windows 7. The tool doesn't seem to ...