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

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 ...
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 ...
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 ...
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 ...
7
votes
2answers
9k 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?
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, ...
35
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 ...
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 ...
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 ...
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.
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 ...
0
votes
5answers
2k 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 ...
7
votes
4answers
8k 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?
5
votes
1answer
5k 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
2k 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 ...
2
votes
1answer
341 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 ...
3
votes
1answer
6k 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
4answers
4k 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 ...
3
votes
2answers
3k 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
2k 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
2answers
244 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
606 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
317 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
365 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 ...
61
votes
3answers
176k 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 ...
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 ...
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 ...
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 ...
8
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 ...
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
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.
7
votes
1answer
3k 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 ...
4
votes
2answers
2k 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 ...
4
votes
2answers
3k 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?
2
votes
1answer
1k views

Windows Powershell: Executing commands via the context menu?

I'm using kramdown to convert my markdown-formatted source files into html. The command I've been using is: kramdown %filename | Out-Clipboard (Out-Clipboard is from the fantastic PSCX. This means ...
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?
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. ...
6
votes
3answers
247 views

Is there something like the GNU locate command in PowerShell?

Is there an equivalent of the GNU locate command in Windows 7/8? locate can take as input a file name and gives as output all the paths where files named similarly to input are, e.g.: locate ...
5
votes
1answer
2k views

Can I customize the color scheme in PowerShell?

For example, I'd like blue to be a little bit lighter, or change red to be a bit more orangeish. Is this possible? I know that I can change the background and foreground colors easily. What about the ...
5
votes
6answers
2k views

Advanced command line editing for Windows?

I'm developer who was "born and bred" on Linux and BSD systems, and I've become accustomed to having advanced tools for the console (posix shells like bash, for example). My career has taken a twist ...
4
votes
1answer
2k views

Equivalent of bash's `source` command in Powershell?

To run a bash script line-by-line (so as to preserve environment variables, for instance), one does the following: $ . myscript.sh Or: $ source myscript.sh I have a PowerShell script that - ...
2
votes
1answer
3k views

Can't remove iis from Windows Server 2012 R2

I'm trying to uninstall IIS from Windows Server R2. I tried Service Manager -> Remove Roles and Features, uninstalling ran, the restart computer, but it's still there. I tried also to do it by ...
2
votes
7answers
16k 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 ...
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 ...
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 ...
7
votes
4answers
5k 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?
5
votes
2answers
3k views

how to set PowerShell as default instead of cmd.exe

I'm trying to get PS to open up instead of cmd.exe when I do a Shift+left-click and select open command window here I changed the %ComSpec% system variable and even added on in my user variable ...
5
votes
1answer
364 views

Too many folder paths in PATH variable?

Is there a cost of having too many folder paths in the folder variable? I mean as you keep on adding paths in to your System Path Environment variable, Is it going to cause Powershell to load slightly ...
4
votes
1answer
8k views

PowerShell to remove built-in Windows 8 apps?

There are the PowerShell commands Get-AppxPackage and Remove-AppxPackage that allow you to remove Metro apps. However, they don't seem to show the built-in apps. I don't use Mail, People, Messaging, ...