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

138
votes
7answers
129k 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 ...
15
votes
10answers
26k 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 ...
22
votes
7answers
24k 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 ...
16
votes
2answers
17k 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 ...
26
votes
3answers
10k 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?
8
votes
5answers
10k views

How to do a Powershell (or other) script to change screen resolution?

How can I script a screen resolution change, for example to 1024*768?
-1
votes
1answer
62 views

How to set up Windows on VM using Powershell (Hyper-V)

I know how to create a VM and I know how to start that VM on Hyper-V using the script of Powershell but it's the first use of the VM so I need to set up Windows and I don't know how using the ...
33
votes
8answers
14k 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 ...
8
votes
2answers
12k views

Is there a ln symlink command in Windows 7 [duplicate]

Possible Duplicate: Does window have the ln -s or equivalent? Is there an equivalent ln command to create symlinks in Windows?
5
votes
7answers
25k views

How can I permanently assign drive letters to my USB devices in Windows?

I have several customers with different PCs (Windows XP, Windows Vista and Windows 7). Unlike DOS 6.22, where you can permanently assign drive letter designations (e.g. Drive C: = Hard Disk Bootable ...
5
votes
4answers
6k views

How can I delete a folder with “illegal” characters?

I plugged my USB flash memory stick into a Mac and it gained some unwanted hidden folders. (See the question Prevent MacOS from making .* and ._* files for prevention.) I'd now like to remove these ...
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, ...
43
votes
4answers
20k 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
86k 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 ...
21
votes
7answers
28k 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 ...
19
votes
2answers
12k 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
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 ...
8
votes
2answers
4k views

Configure the Windows Powershell to display only the current folder name in the shell prompt

I'm using Powershell in Windows 7. How to configure Powershell so that it only displays the current folder name (instead of the full path) in the shell prompt? For example, Instead of ...
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 ...
2
votes
6answers
3k views

PowerShell not displaying Unix colors

I use various Linux programs on my Windows machine; some of them have colorized output. GnuWin32 and so forth. However, Windows PowerShell does not support Linux colors; it gets a message like ...
22
votes
3answers
6k 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.
6
votes
1answer
8k views

Rename multiple files as “Modified Date/Time” using cmd or Powershell

I have hundreds of JPG files in a folder. I want to rename each file so that the file name is replaced with "Modified Date/Time" of that file, namely DD.MM.RRRR.HH.MM.jpg. For example, Before ...
4
votes
1answer
3k views

How to append netsh firewall rules, not just replace

I am using a script to set firewall rules in netsh. netsh.exe advfirewall firewall set rule name="Block External IP's" new remoteip="$($ipArray[0])" I thought that set was used so that it would ...
3
votes
5answers
6k views

How do I set the Powershell default font to Consolas?

I would like to have the Consolas font set as default for Powershell on Windows 7, no matter how I launch it. I've found very few explanations on the web for doing this, and none were really clear to ...
2
votes
1answer
581 views

How to use Powershell Remote across the internet?

I know that Powershell can be used on local network. But what if the computer that I want to manage is not on the same Lan as mine? We are each on a seperate LAN and both are behind a firewall. How ...
1
vote
1answer
141 views

More than one 'Open xxxxx here as Administrator'

I want the option to open a Command window or Powershell window as Administrator from the drive and directory context menus in Windows. I can have either by creating and populating the special ...
4
votes
1answer
13k views

Office 2013 Click to Run - Primary Interop Assemblies

Given that the Office 2013 click-to-run installer allows no customisation of the installation, whatsoever, how can I install, or where can I find an installer for the Primary Interop Assemblies/.NET ...
3
votes
2answers
4k views

Keep outlook 2010 open [duplicate]

Possible Duplicate: How to make Outlook 2010 minimize when I try to close it? I want to "disable" the ability to close Outlook2010. I always "close" it instead of minimizing it. What are ...
2
votes
1answer
3k views

How do I leverage Bitlocker cmdlets?

This article hints at being able to unlock a bitlocked drive using: Unlock-BitLocker -MountPoint -Password However, I know diddly squat about Powershell and how to use the Powershell cmdlets to do ...
1
vote
1answer
343 views

Unable to SSH to my virtual machine via Windows Power Shell ISE

I have a Linux VM guest running in my vmWare host that I want to access using Windows PowerShell ISE. I normally can SSH to my VM, but I cannot with Windows PowerShell ISE. When I try to do SSH to my ...
1
vote
2answers
430 views

Opening PowerShell at the current working directory from the registry

This question is prompted by a problem I faced while writing this answer. I am invoking PowerShell like this from the registry: C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -NoExit ...
1
vote
2answers
1k views

Batch create folders?

I'm looking for a way to batch create a folder followed by sub-folders. I'm looking at something like c:\users\user\desktop\sample\1 c:\users\user\desktop\sample\2 etc. Any ideas? I'd prefer ...
0
votes
1answer
495 views

How do I renaming files in a batch with a counter?

I have 14,000 picture sorted into files by year and month but taken with multiple cameras. I want the file name to reflect the date the photo was taken. For example, all pictures taken on October ...
0
votes
1answer
449 views

Powershell, Task Scheduler or loop and sleep

I have a job that needs to go off every minute or so, it loads a DLL i have written in C# that retrieves state for an SQL Server Mirror (Primary, Mirror and witness) for a number of databases; it ...
99
votes
4answers
305k 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 ...
55
votes
11answers
42k 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 awkward -- usually I just open a new ...
20
votes
2answers
20k 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 ...
22
votes
7answers
52k views

Delete all files from a folder and its sub folders

I want to remove all files from a folder structure, so I'm left with an empty folder structure. Can this be achieved in either batch or VBScript scripting? I have tried a very basic batch command, ...
39
votes
5answers
72k views

Copy and paste in Windows PowerShell

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

What are the PowerShell consoles for Windows?

Linux is known for having lots of terminals and consoles that are built upon GTK, Qt, GNOME, KDE or X to run the shell (like bash). PowerShell on Windows runs with the Windows console (the same as ...
59
votes
2answers
65k 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 ...
17
votes
2answers
12k views

Powershell equivalent of `grep -r -l` (--files-with-matches)

In Powershell, how do I list all files in a directory (recursively) that contain text that matches a given regex? The files in question contain really long lines of incomprehensible text, so I don't ...
11
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 ...
14
votes
3answers
7k 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 ...
17
votes
7answers
22k views

Powershell font too small on Windows 8.1 - how to adjust?

Question: On my Windows 8.1 machine, I need powershell to configure office web apps. When I start powershell, for a blink of a second, it shows as it should, but then it gets resized, and the font ...
16
votes
12answers
20k 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 ...
13
votes
4answers
15k 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.
9
votes
5answers
23k views

How to rename multiple files in multiple folders with one command

We want to rename our *.html files to *.php but (sadly enough) have not enough knowledge to do it with a cmd prompt command and/or batch file. The problem is that each file is in separate folder – ...
7
votes
2answers
6k views

PowerShell zip file synchronously

In a PowerShell script, I want to zip a folder before deleting the folder. I run the following (I don't remember where I found the snippet): function Compress-ToZip { param([string]$zipfilename) ...
4
votes
2answers
5k views

Silent Java update check

How to have automatic Java updates without jusched.exe process running all the time in the background and with control when a check for the update should occur?