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

79
votes
5answers
49k 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 ...
49
votes
3answers
135k 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 ...
33
votes
3answers
13k 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 ...
31
votes
5answers
19k 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?
25
votes
8answers
13k 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 ...
24
votes
5answers
37k 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 ...
19
votes
3answers
22k 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 ...
19
votes
5answers
12k 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
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
2answers
9k 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 ...
17
votes
5answers
8k 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
4answers
5k 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 ...
16
votes
2answers
14k 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 ...
16
votes
6answers
14k 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 ...
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.
16
votes
4answers
20k views

Copy and paste in Windows PowerShell

How do I effectively copy and paste input and output in the Windows PowerShell?
16
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, ...
14
votes
10answers
17k views

Bulk convert photos to smaller size?

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
5k 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?
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
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
4answers
5k 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 ...
14
votes
1answer
1k 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
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 ...
13
votes
4answers
9k 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 ...
13
votes
4answers
11k 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
1answer
6k 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 ...
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
2answers
813 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
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 ...
11
votes
2answers
6k 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 ...
10
votes
2answers
28k 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?
10
votes
3answers
5k 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 ...
10
votes
3answers
222 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
3answers
21k 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 ...
10
votes
2answers
4k 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 ...
9
votes
9answers
6k 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 ...
9
votes
2answers
5k 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. ...
9
votes
3answers
1k 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 ...
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
3k 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
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 ...
9
votes
2answers
131 views

How to customize the default CursorSize in Powershell

I set he default CursorSize in $PROFILE file like: [Console]::CursorSize = 10 or $HOST.UI.RawUI.CursorSize = 10 But the cursorSize will reset after using another console in powershell, for ...
8
votes
2answers
6k 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 ...
8
votes
2answers
3k views

Can I set PowerShell as 'default' in Windows 7?

I would like, by default, for PowerShell to be launched instead of Command when, say, running a batch file, or when I "Open Command Window Here", etc. Any suggestions?
8
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 ...
7
votes
3answers
7k views

Where can I download Powershell 2.0 for Windows 7?

I have spent the better part of a day hunting the Internet looking forr a way to download Powershell 2.0 to my already Win7 environment. Windows 7 is supposed to come with PS 2.0 however - I have 1.0. ...
7
votes
4answers
4k views

Windows PowerShell equivalent to Unix/Linux `pwd`?

In follow-up to the cmd.exe question, what is the PowerShell equivalent to echo %cd%, or Linux/Unix pwd?