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
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 ...
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 ...
79
votes
5answers
51k 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 ...
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 ...
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, ...
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 ...
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 ...
6
votes
2answers
8k 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?
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.
12
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 ...
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 ...
7
votes
4answers
7k 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?
4
votes
1answer
4k 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 ...
2
votes
1answer
245 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 ...
2
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 ...
3
votes
1answer
4k 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
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
4answers
3k 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 ...
1
vote
2answers
179 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
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 ...
0
votes
1answer
279 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
315 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 ...
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 ...
24
votes
5answers
38k 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 ...
7
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
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.
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
1answer
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
969 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 ...
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. ...
6
votes
3answers
233 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 ...
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
7answers
13k 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 ...
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 ...
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?
5
votes
1answer
284 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
4answers
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 ...
3
votes
1answer
536 views

What version of PowerShell comes with Windows 7?

I am attempting to create a solution to launch remote processes in an environment which is very stable, and I know the user base will have Windows 7 - most will have no updates to it though. ...
3
votes
2answers
3k views

How to check if windows has automatic updates waiting from the command line?

If a Windows server (2k3/2k8) is set to "download but not install" updates, is there a way to check from the command line.. perhaps a log file or something I can check with powershell, to see if there ...
3
votes
3answers
6k views

Get the current UNC path from a local path in powershell

Assuming I have a mapped drive M:\ to \\SomeServer\SomeShare and in powershell I'm in the folder M:\SomeFolder how do I convert that to a UNC path, i.e. \\SomeServer\SomeShare\SomeFolder.
2
votes
1answer
741 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
1answer
602 views

Scripting Bitlocker Decryption of a local hard-drive

In summary: I'm attempting to create a script that unlocks (decrypts) a hard-drive on the Windows 7 Ultimate local machine, then execute a couple of programs afterwards. I have a small SSD that ...
2
votes
1answer
894 views

Script to assign and remove arbitrary secondary IPs to an interface

I'm trying to figure out how to write a script that will let me arbitrarily assign and remove a secondary IP address to a system. I'm most comfortable with batch scripting, so I'd rather focus on ...
1
vote
1answer
586 views

Setting user environment variables is very slow

I'm using the GitHub for Windows application. Lately I've noticed that starting a PowerShell console from within the GitHub application takes ages. After some digging I've found that the slow command ...
16
votes
4answers
21k views

Copy and paste in Windows PowerShell

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