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

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 ...
2
votes
1answer
70 views

Prevent powershell from changing title of command window

I've got a batch file that sets the title of the command window and then runs various commands. One of them is a powershell script which is launched something like: powershell -file "scipt.ps1" ...
0
votes
1answer
228 views

Windows Explorer Does Not Include Hidden Files' Size When Calculating Folder Size

It seems Windows Explorer does not include the sizes of "hidden" files when calculating the parent folder size, even when I check "Show hidden files, folders, and drives" in the "Folder and Search ...
0
votes
3answers
1k views

Powershell very slow to open/respond

I am having an issue running PowerShell 3.0 on Windows 7 64-bit. It takes a very long time to open/start when run it. It is also quite sluggish in response to just about anything. I believe this may ...
3
votes
1answer
158 views

Get-ChildItem | tree gives me a wierdly formatted tree

The following input: PS STG:\> Get-ChildItem | tree Gives me Folder PATH listing for volume Data Volume serial number is 6576-C540 D:. ÃÄÄÄAPK ÃÄÄÄAssets ³ ÃÄÄÄAnimations ³ ³ ...
1
vote
1answer
1k views

Azure PowerShell - Create VM in existing service

I use a powershell script to create a virtual machine in azure. The script goes like this : $serviceName = 'nameOfTheService' $vmName = 'nameOfTheVM' $osDiskName = 'nameOfTheDisk' $config = ...
0
votes
1answer
103 views

robocopy /mir not duplicating folder structure

I'm using the following script to archive everything prior to Jaunary 1, 2013: foreach ($i in Get-ChildItem "O:\Projects” -Force -Recurse) { if ($i.LastWriteTime -gt ($(Get-Date).AddDays(-649))) ...
0
votes
1answer
69 views

Using Get-ChildItem but only look at the 2nd level down

This is probably really simple but I can't seem to find the answer. I'm looking for a way to only look in the second level down of a folder for a file. i.e. C:\Data C:\Data\Level1 ...
-1
votes
2answers
30 views

Powershell Stop-process with spaces in name, non exe extension

In powershell how can I stop a process that has .dat extension and spaces in name In task manager I see process name: "my portable app.dat" Stop-process -processname my portable app (doesn't work) ...
0
votes
0answers
29 views

Setting up SQL Express on Azure VM

I'm trying to set up SQL express on an Azure VM. I already have SSMS 2012 installed but I cannot access .\SQLEXPRESS. This MSDN discussion says: run powershell script "ConfigureSQLExpress.ps1" ...
1
vote
1answer
60 views

powershell foreach loop fails as it increments count by first test

I have been asked to monitor c:\temp on windows servers. I need to know how many folders are there and if they are there greater than 1, 2 and 3 minutes. This reporting works in a basic form but not ...
1
vote
1answer
100 views

Use PowerShell to Retrieve Volume Label of Locked BitLocker Drive

I have a USB hard drive encrypted with BitLocker: While it's yet unlocked, in PowerShell I want to retrieve the drive's volume label, so I run a command like this: Get-WmiObject -Class ...
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 ...
0
votes
1answer
21 views

How to make tee not break lines at window width in powershell?

Currently I'm doing the following command to look through all files in a folder for a string, and then tee that line to a file: ls -r [folder] | sls "dummy text" | tee dummy.file These lines of ...
0
votes
0answers
23 views

wmic inside a bat script

I've been searching for a long time for a solution for this, but no success. I have to say I am not very familiar with BAT scripting. Anyway, I am trying to check if a process is running and if so, ...
0
votes
1answer
187 views

Download folders from dev server to local drive

I am developing a .net web application on a local environment. I have a dev server that the application is installed on. Within the web application on the dev server I have four folders that I dont ...
2
votes
1answer
298 views

Troubles running Azure powershell

I'm trying to install Azure Powershell, following the instructions on this page. The installation seems to run fine and proceeds without errors. However, once it's finished, I can't manage to find ...
4
votes
2answers
84 views

How to invoke actions from an executable in PowerShell?

I am using Powershell 2.0 on Windows 7 SP1, but any answers covering versions 1.0-4.0 would be nice. I know that this command opens Paint via PowerShell: & "C:\Windows\system32\mspaint.exe" ...
2
votes
4answers
740 views

A decent remote shell from UNIX to Windows? [closed]

I'm on Linux and develop on a Windows 7 box virtualized via VirtualBox. My usual way of developing consists in editing source files from Linux via nautilus/SMB (smb://192.168.1.4/...) then when I'm ...
1
vote
2answers
605 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
0answers
68 views

Add line to text file after specific line with PowerShell

I have to edit remotely a file called nsclient.ini on hundreds of computers, the file contains some command definitions. For example: [/settings/external scripts/scripts] check_event="C:\Program ...
2
votes
1answer
63 views

how to open internet explorer with powershell in window xp

expect to open a link in internet explorer and refresh it automatically every 5 seconds but it can not open after try powershell with administrator Set-ExecutionPolicy remotesigned powershell ...
1
vote
1answer
70 views

Get first name in an array of key-value pairs in PowerShell

While trying to write some maintenance scripts for our Exchange 2013 deployment, one of the ones I need is a script that will determine which server a database is currently active on, versus which one ...
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 ...
0
votes
0answers
16 views

Powershell support for VT100 escape sequences [duplicate]

Is there a module which adds support for VT100 in PowerShell? I know these go by many names, some of which are VT100 and ANSI, and they look like ←[0m in the console if you lack support. There's much ...
1
vote
2answers
162 views

Set UAC Level with PowerShell

I'm looking for a way to set the UAC Level with Powershell/Command prompt. I'm aware the 'EnableLUA' value in the registry, but this won't set the level. It's just true or false. Is there a way to ...
0
votes
0answers
48 views

WinRM or PowerShell Server?

I would like to be able to remote into my Windows machines with a command line only interface, to PowerShell. It must be secure. It seems like there are two options for doing this. One is the ...
0
votes
1answer
1k views

How to programatically allow a Windows 8 app to run background tasks?

When you run a Windows 8 modern UI (previously called Metro) app that has background tasks, you must explicitly choose if it is allowed to run background tasks. Is there a way to automate this? I ...
1
vote
1answer
96 views

adding file size of two or more files in powershell

Why is the following snippet only adding the byte-size of the last file to 0 and not the size of all files matching? $sizeOfVhds = 0 (Get-Item "\\blahhh.com\foo\bar\*.vhd") | ForEach-Object { ...
-1
votes
2answers
40 views

Find folders called SS, return size of folder

I am able to find all folders called "SS" (superseded) in a hierarchy and list out the location of each one. I have been using this code to pipe out the list. DIR /AD /B "SS" /S > SS_Folder_List.txt ...
1
vote
1answer
2k views

Change to home directory in PowerShell

At the cmd command prompt, this command will take me to my home directory: cd %UserProfile% At the PowerShell command prompt, the same command produces this error: Set-Location : Cannot find path ...
0
votes
1answer
28 views

How to bring vim back to foreground in Powershell

launch vim from powershell hit control+z (you are dropped back to powershell, vim is in background) ??? How do you bring Vim back to foreground? EDIT: I have tried fg
0
votes
1answer
44 views

Powershell is installed but winrm is not found

one of my servers is win 2003 and has powershell 2.0 installed, but I don't see winrm service there and can't thus run "Winrm quickconfig". It says "command not found". As a result, I can't call ...
-1
votes
1answer
58 views

NullReferenceException error in powershell

I am a newb in power-shell, i have written an script that stops process according to parameters in commandline. the problem is when i run the script in power shell it works but when i try to run it ...
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?
0
votes
1answer
22 views

MS Surface / Windows PC - Wipe Between Users

As a company we have a few devices like MS Surfaces and some netbooks that are used for open access within social spaces. The problem being sometimes these devices are abused and wallpapers changed ...
1
vote
1answer
23 views

Where is the default location of the directory in which PowerShell scripts are ran?

I ran a script in Powershell that was suppose to do some file analysis and create a csv. It looks like it ran, and I didn't encounter any errors. My problem now is that I don't know where the file ...
1
vote
1answer
85 views

Internet Explorer: Set homepage for all users without GPO

I'm looking for a way to set the homepage of Internet Explorer (and possibly other browsers) for all Users through command line/Powershell, or any other method that doesn't use the domain policies ...
3
votes
2answers
6k views

Why can't Excel open a file when run from task scheduler?

I wrote a powershell script that opens an excel workbook and runs a macro. When I run that script from PS console, or even from command line using powershell.exe script.ps1, it jus works. When I set ...
0
votes
1answer
9 views

Inspect Exchange items

I would like to inspect mail and calendar items stored in an Exchange mailbox, by id, to see all their properties that are stored for them. Is there a way to do this (in powershell or the like)?
1
vote
1answer
139 views

PowerShell ISE doesn't flush stdout

I'm having a little problem when running a console program in PowerShell ISE: when the program writes out a line in portions using flush, PowerShell won't show the line until the program writes a line ...
1
vote
1answer
42 views

Powershell script to open a number of files located inside subdirectories

How does one open (say, using notepad.exe) multiple files ending in _dc.txt, each one of which is located in a number of subdirectories of C:\Data\Test? My script below gets stuck on -Recurse, with ...
0
votes
1answer
48 views

Way to list and cat all files that contain string X in powershell

Currently, when I'm looking through a bunch of files for a string in powershell I use the following: PS: C:\> ls -r | Select-String "dummy" | ls -r And that lists all files that have that string ...
1
vote
1answer
86 views

Running powershell scripts or functions using unix-like pipeline syntax

I want to run multiple custom processing steps using the pipeline in powershell. In linux I could do something like this: listServers.sh | <some commands to filter servers> | ...
0
votes
2answers
56 views

Renaming files with a previous date

I am running a program that creates 50 reports for different clients in pdf format on the first of every month. I need the file name to reflect the previous month and current year in the file name ...
1
vote
0answers
262 views

Why does FFmpeg append blank black video to the end of my MP4 files when compressed from MOV?

I have several large MOV files that I want to compress to MP4. Unfortunately, when I use FFmpeg, it appends lots of black (blank) video at the end. (The destination file is longer than the source ...
1
vote
3answers
9k views

Reset Bluetooth Components Without Having to Reboot

Sometimes the bluetooth on my laptop fails to connect properly (either not at all, or sometimes with terrible quality) to a pair of stereo headphones. Often times I've been able to recover normal ...
2
votes
1answer
67 views

Taskill vs. Tskill

I've seen both of these used to end processes. It is to my understanding that tskill is the older taskkill Microsoft Windows XP Documentation while the newer taskkill is capable of closing several ...
1
vote
2answers
36 views

Return two (or more) properties as a table with a single PowerShell command

I have the following PowerShell command which returns all sorts of properties about disk drives attached to the system: Get-WmiObject -Class Win32_Volume | Where-Object {$_.DeviceID -like "\\?\*"} ...
0
votes
0answers
19 views

Why am I getting conflicting results when checking Maven version in Windows PowerShell and cmd64 (Environment variables issue)

I'm looking at Maven for the first time, trying to get everything up and running. I've been going through the tutorials here and up until now everything has been going smoothly. I've added all the ...