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

5
votes
4answers
412 views

Color empty files in Windows

I face a need to show empty (0 bytes size) files in color in Windows Explorer. (I get them over sftp and need to know whether they're empty to prevent data loss - an application creates empty files ...
-1
votes
0answers
11 views

The Powershell console hangs after a command execution

From time to time, though rather frequently, my Powershell console hangs after a (both successful and unsuccessful) command execution. I use the Powershell version 2.0.-1.-1 for the Sharepoint 2010 ...
-1
votes
0answers
15 views

Syntax to record the “User Objects” count for iexplorer.exe process

How to record the “User Objects” count for iexplorer.exe process?
0
votes
0answers
10 views

How can I get all urls of pattern x from a paged list of search results?

I'm using Windows 7 SP1, and I'm willing to use powershell or wget or whatever will work. I downloaded powershell today (ps 4) and I've got some scripts working, but I'm having trouble with this one. ...
0
votes
2answers
15 views

Viewing all accessible drives in PowerShell

I noticed that cd \ navigates to the root of my drive. But there are other drives that I can access on my computer. Is there a command in PowerShell that lists all of the drives that I can connect ...
2
votes
0answers
40 views
+100

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 ...
0
votes
2answers
20 views

Powershell script to list folders in all shares

Stupid question but not sure if this is possible. I have a file server hosting 8 separate shares. I was looking for a script to pull a list of the folder names (No subfolders) for all of the shares. ...
0
votes
1answer
185 views

Cannot create a folder because such folder already exists?

Running under Windows 7 Enterprise SP1 x64. When I try to create a folder with a certain name (for reference, let's assume it's X:\MyFolder, I'm getting this: The name I am using does not show as ...
0
votes
1answer
291 views

Execute Backup-SqlDatabase cmdlet remotely

When I run the following script line locally on an SQL Server machine, it executes perfectly: Backup-SqlDatabase -ServerInstance $serverName -Database $sqldbname -BackupFile ...
0
votes
1answer
12 views

Can't run start-process command

I'm trying to run a command found in this answer. The command is start /w %SystemRoot%\system32\pkgmgr.exe /ip /m:Windows6.1-KB2506143-x86.cab Trouble is, it doesn't work for me. Indeed, it ...
0
votes
1answer
15 views

Why does this script prompt me for an InputObject?

I have a script that is supposed to list all the installed programs on a machine. I want it to export it to a file for me. I keep getting the error: Supply Values for the following parameters: ...
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 ...
0
votes
1answer
112 views

Robocopy: copy files preserving folder structure but adding a subfolder

I need to copy a folder which contains subfolders with files to a shared folder on another machine. During that, the script should create a custom subfolder in each destination folder and place files ...
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 ...
1
vote
2answers
3k views

Is Windows Powershell as powerful as terminal of UNIX/Linux? [closed]

I've been wondering if Windows Powershell is as powerful and efficient as Linux' terminal. People offline tell me, without explaining much, that Windows Powershell is an attempt to make UNIX ...
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 ...
1
vote
1answer
34 views

Windows Power Plan automation

I like to keep my Asus ROG G750JZ(laptop) on all the time and I have already automated sleeping at 01:00 in the morning, auto wake-up on opening the lid. However since I am not using the laptop all ...
4
votes
3answers
2k views

How to quickly save what is currently shown in cmd.exe to a file

I am asking if there is a quick way/command to save the current standard output from cmd.exe or powershell to a file. For example, I have run a bunch of commands in cmd.exe which generating like ...
6
votes
2answers
740 views

Monitor hardware change events

I have a laptop that periodically notifies me that some piece of hardware was installed/removed by playing the little ba-dum sound. I have no idea what hardware is changing - I am not adding or ...
0
votes
1answer
25 views

Using PowerShell to Close Firewall Port

I'm doing some end to end testing of an application and I need to be able to close then open a port in Windows Firewall using PowerShell commands. I've found a script that adds a firewall rule to open ...
0
votes
0answers
33 views

Windows PowerShell commands vs linux bash commands “cheat sheet” [closed]

As someone used to using *nix but now being forced to use Windows for work on a variety of windows server flavors (all with PowerShell), I find myself wanting various linux tools that I've grown ...
1
vote
1answer
21 views

Can't install PowerShell 4.0

I'm trying to install PowerShell 4.0 on a Windows 2008R2 server Installed Windows6.1-KB2819745-x64-MultiPkg.msu with no errors or warning But when I run up PowerShell and check the $host.version, ...
3
votes
2answers
1k views

PowerShell File Count Behaviour

I'm new to PowerShell and have a question on the following behaviour. I'm trying to count the number of files in a directory of a certain type. If there are some, I will then copy them elsewhere. ...
1
vote
1answer
32 views

Is it possible to install PowerShell 3 on a Windows Server 2003 or 2003 R2?

On a Windows Server 2003 rig (which already has .NET 4 but no 4.5 on it) that is to be expired before the end of the year, I'd like to run a few PowerShell 3 scripts on a scheduled base as the scripts ...
-2
votes
1answer
52 views

How to connect to a remote Windows computer using Enter-PSSession on PowerShell?

I am trying to connect to a remote windows computer using Enter-PSSession using PowerShell. As a Linux user, I am not very familiar with the inner working of Windows. When just using the command I ...
0
votes
0answers
20 views

How to install a mmc certificate on Windows?

I am not familiar with Windows very much, and I have trouble installing a MMC certificate. I am following this description to use MMC to create a certificate, but I cannot complete the step labeled ' ...
1
vote
1answer
27 views

How does one start the Powershell ISE with no file open?

When I launch powershell_ise.exe, it defaults to having an open file "Untitled.ps1". Is there a mechanism to ask ISE to launch showing only the prompt? That is, at the moment when I launch Powershell ...
1
vote
1answer
23 views

Listing Mapped Drives and Username Powershell Script

It's been a little while since I've touched PowerShell so struggling to get this working as I expect. $computerlist = Get-Content H:\MappedDrive\ListOfMachines.txt ForEach ($computer in ...
4
votes
2answers
1k views

Windows Backup Using Powershell

I wrote the following Powershell Script to perform a one time backup of my Windows Server 2008 R2 machine. The idea is to perform a Weekly backup to a different external drive and schedule the script ...
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 ...
0
votes
1answer
2k views

How to reset TCP/IP on Windows 8.1?

The following netsh command is not working on Windows 8.1. netsh int ipv4 reset It give “Access Denied” error and it is a VERY known issue, many people complaining about it all ove online forums. ...
0
votes
1answer
55 views

(Windows Powershell) How to open a globally defined file with a certain application?

I've added the C:\Windows\System32\Drivers\etc\ directory, which contains the windows hosts-file, to my PATH environment. So if I start the shell at some arbitrary location (C:\ for example) and ...
1
vote
3answers
1k views

Windows 7 SP1 x64 Occasional Powershell Error Message- There is no disk in the drive

Every once in a while when I launch powershell on my Windows 7 SP1 x64 machine I get this error. None of the buttons will get rid of the error, it just comes back, I have to close the broken ...
2
votes
1answer
619 views

How to avoid wordwrap in powershell ise output pane

When I execute a command that gives huge output, infact it is log of a running server, I see that PowerShell ISE output pane is automatically wrapping the text to around half of the screen width when ...
1
vote
4answers
2k views

Running powershell script through Windows Task Scheduler

I'm trying to run a simple PS1 powershell script from the Task Scheduler. The task's Actions settings are Program: powershell and Add arguments: -executionpolicy bypass -file ...
1
vote
2answers
21 views

Get-credential results in “system cannot find the file specified”

I'm trying to write a powershell script that prompts for credentials and opens a webpage as the user. I have start-process -credential (get-credential) -filepath "http://www.microsoft.com" It ...
-2
votes
0answers
16 views

Multiple Directory Creation based on domain username and set file sharing script request

I need a script that will do the following. Create multiple directories labeled by domain usernames (I'm thinking pulling the usernames from AD and add the username to each command.). In a shared ...
1
vote
0answers
25 views

Automation of control panel > Wireless Network settings(802.11 modes) through Powershell or any other automated procedures

I want to automate the "Control Panel\Network and Internet\Manage Wireless Networks" page in Windows through Powershell or any other automated procedures, to change my wireless adapter's mode to all ...
1
vote
1answer
234 views

Powershell mapped network drive doesn't persist

I'm trying to create a script that maps a network drive whenever I connect to a VPN, then disconnects the drive when I disconnect from the VPN, using Task Scheduler to launch the script when the event ...
0
votes
2answers
60 views

move-item or copy-item then remove-item

I have a list of files that I want to move from one folder to another location and retain the folder structure in the new location for example I have the following files 1.txt 2.txt 3.txt located as ...
5
votes
3answers
63 views

Why does the PowerShell ISE not isolate script variables to the script scope?

In PowerShell, scoping is supposed to keep objects (variables, aliases, functions, etc) in scripts from affecting the global environment. This appears to work fine at the command line, but not in the ...
0
votes
0answers
21 views

Windows Symlink & Copy

I am trying so desperately hard to map a drive to sharepoint online with little success. (I have tried everything possible to get this working.) Closest I have got is being able to make a shortcut to ...
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 ...
0
votes
2answers
665 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 ...
0
votes
2answers
660 views

Windows Powershell is taking long time to start the first time after Windows login

I generally use windows powershell instead of command prompt on Windows. I have noticed that when I start it for the first time after Windows is started it takes a long time for the prompt for the ...
3
votes
4answers
973 views

Loading managed Windows PowerShell failed with error 80070002

I get an error when I try to run PowerShell: Internal Windows PowerShell error. Loading managed Windows PowerShell failed with error 80070002. I am running Windows 7 Home Premium (64-bit). This ...
0
votes
1answer
27 views

PowerShell will not start

I am getting this message when trying to run PowerShell Version v4.0.30319 of the .NET Framework is not installed and it is required to run version 3 of Windows PowerShell. I have tried repairing ...
1
vote
2answers
2k views

How do you install .net4 on a Server 2008 r2 machine through psremoting in powershell?

I need to write a script that installs .net 4 remotely using powershell to a group of Server 2008 R2 machines. I based my script off of ...
0
votes
1answer
36 views

How to check whether a specific service exists using Powershell?

Introduction According to this documentation it is possible to check which services have been stopped on Windows by executing the following command: Get-Service | Where-Object {$_.status -eq ...
2
votes
3answers
184 views

Which Powershell Function could check whether a certain port is in LISTENING state on localhost?

Introduction Aim: to check whether a port is in LISTENING state on localhost by using a PowerShell function The following command: New-Object Net.Sockets.TcpClient.Connect("127.0.0.1",10389) ...