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

0
votes
1answer
21 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 ...
1
vote
0answers
20 views

How to create many directories with access control by using powershell 2.0

I am trying to learn the win2008 r2 In the win2008 r2, i create many student users . So i need to create the independent directory for storage file (Read ,write,execute). In dc C:\place\ i create ...
0
votes
0answers
6 views

Read the COM1 output of a Hyper-V guest system

I have a guest O/S that writes debug output to the COM1 UART. This port is virtualized by the Hyper-V host. The Hyper-V Server allows only a redirection to a "named pipe". I want to read what the ...
2
votes
1answer
12 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
3answers
516 views

Delete all Files from Folder and Sub Folders

I'm wanting 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 VBS scripting? I have tried a very basic batch command but ...
-2
votes
0answers
24 views

Win 7. Use the contents of manually updated .xls to create a batch file that deletes files in folder to match spreadsheet?

Win 7.Use the contents of manually updated .xls to create a batch file that deletes files in folder to match spreadsheet? Hi. I have a folder that has a number of subfolders. Each sub contains lots ...
0
votes
1answer
20 views

Get-ChildItem Returns No Files Through Remoting but Works Correctly When Logged In Interactively on Remote System

I have just started working with the remoting features of PowerShell 3.0. My current problem is that I can log in to remote machine "secondmachine" and execute the command gci ...
0
votes
1answer
22 views

PowerShell Create new Active Directory user with password as secure string

Having some trouble creating a command to create a new user in powerShell, the code I'm using is: PS C:\Users\Nicky> New-ADUser -Name johnd -GivenName John -Surname Doe -DisplayName John Doe ...
-1
votes
0answers
15 views

Powershell 4.0 Compatibility issues

I m planning to upgrade powershell to 4.0 for our win 7 clients and some of win 2008 servers. I noticed that there are some Compatibility issues for 4.0 with several OS. System Center 2012 ...
0
votes
0answers
15 views

Best way to deploy Powershell 4.0 on Windows 7 sp1 and server 2008

I am planning to deploy powershell 4.0 on all Win 7 and server 2008 and 2008R2. I did some research about this, but couldn't find the official way to do it. I can just use batch file or GPO to ...
1
vote
1answer
53 views

Need to create a robocopy in Powershell 1.0

My ultimate goal is to mirror a folder and its subdirectories with the restriction of only copying files with the extensions, sln, vcxproj, cs, cpp, hpp, c, and h. There are far too many subfolders ...
0
votes
1answer
22 views

How to set location to a mapped network drive in PowerShell?

I'm trying to set location to mapped network drive Z in PowerShell and it's not working. I have the following drive letters: C, D, E, Z. Where the first three are just local disks, and the Z is of ...
2
votes
1answer
33 views

Get CPU for process in powershell

I want to get the value that is shown in task manager for any process in the CPU column in powershell. I tried using Get-Process ProcessName | Select-Object -Property CPU but it only returns the ...
0
votes
0answers
65 views

Schedule Task through Windows PowerShell

Since the action "Display a message" on Task Scheduler on Win 8 is 'deprecated', thought of creating it through PowerShell, but can't get it to work, any idea where the problem is: $A = ...
0
votes
1answer
24 views

How can I execute WinRAR serially against each archive in a folder?

I have about 100 large RAR files in the same folder, and I'm trying to delete a particular filespec from within each archive. I'm using PowerShell 2.0 on Windows Storage Server 2008 R2. I'm by no ...
0
votes
1answer
22 views

Run script from powershell in the same window

I have installed PHP and PHPUnit in my PC. Both of these files are in same directory and I have added to enviroment variable path. I have also associate .phar extension to run with php.exe ...
0
votes
3answers
66 views

Comparing two multi-dimensional arrays in PowerShell

I am trying to compare two multi-dimensional arrays in PowerShell. Each array has many thousands of elements – a small example follows. In one array I have: $arrOne Username ...
0
votes
1answer
84 views

pip is not recognized as an internal or external command

I have installed pip and distribute, and no errors came up. But when I enter pip into the cmd or windows powershell, it gives me an error. However, when I import pip into python, no errors come up. I ...
1
vote
0answers
21 views

How can I make cygwin commands a priority over built in windows commands?

If I run ls in powershell the windows built in ls function is run. how can I make cygwin ls run instead? I've tried moving cygwin/bin to top begin system path variable, but that didn't work. is ...
0
votes
1answer
23 views

Enable local administrator account for clients from server 2008

I ran into a problem with one of my client , its local administrator account is disable, also I can't log in this machine with its domain user (because of this problem), now I wanna change its ...
0
votes
0answers
37 views

How to copy file names matching a pattern in powershell

I am new to powershell. I need to copy the whole folder structure from source to destination with filenames matching a pattern. I am doing the following. But it just copies the content in the root ...
0
votes
0answers
45 views

Piping with PowerShell in Office 365 Exchange and on-premises AD

We have a local AD domain synced with Exchange Online in Office 365. I am trying to use PowerShell to get information that I need but keep getting an error and can’t seem to get the commands to work ...
1
vote
1answer
31 views

When should I use the “Get” or “Find” verbs in PowerShell?

I've been writing some basic PowerShell scripts for a while now and want to stick to the appropriate naming conventions by starting the name with approved verbs. I can't see the difference between ...
0
votes
0answers
61 views

Adjust Microphone Volume After Launching Application

I currently have a USB headset plugged into my computer and its mic volume is set to 82%. Whenever I launch the game Titanfall, my mic's volume is raised to 100%. I am trying to find a way to ...
1
vote
1answer
48 views

I want to read a value from a text file and compare it with a number

I am using windows powershell. I want to retrieve a number which is stored in a text file and compare it with some other number using a shell script. If I use $x=$(cat value.txt) it says "command not ...
0
votes
1answer
40 views

How should this HTML be formatted when entering it into PowerShell?

We will be moving to Office 365 next month and are in the process of fine-tuning some small Exchange Online related issues. The last problem I am trying to solve is getting our organization's logo ...
1
vote
1answer
47 views

Command Line Parameters in Powershell

I am using a program called sonar-runner that you execute from the commandline, and you can pass optional parameters. For example in the normal windows commandline tool a call may look something like: ...
0
votes
2answers
29 views

Powershell: The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered

I am trying to run a PowerShell script from a windows batch file. This is a SharePoint related script that uses Import-SPData. This works without any issue when using USERA's login. However, if I try ...
0
votes
1answer
35 views

Is there a way to find out if a Windows 7 workstation has updates turned off in the control panel?

I have a domain with a group policy to run updates every night at 3AM. If the computer is turned off, the next time a user logs into the computer, the updates are downloaded. When the users shuts ...
1
vote
0answers
41 views

Can't create a COM object in a powershell script running as a scheduled task

I have a powershell script I'm trying to run as a scheduled task. Its purpose is to perform a nightly export from an Access database, then upload the exported flat files to an SFTP destination. The ...
1
vote
2answers
37 views

Pipe at the command line

In the blog http://blogs.msdn.com/b/zainnab/archive/2007/07/09/grep-and-sed-with-powershell.aspx I found a replacement for sed implemented as PowerShell script. I don't want to depend on the ...
0
votes
0answers
14 views

ovftool library usage in standalone app

I am trying to create an application which will deploy VM on vSphere, right now I am using PowerCLI with ovftool, but sometimes I have deploy from computer which do not have PowerCLI neither ovftool ...
0
votes
1answer
32 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
1answer
55 views

Disable IE 9 Addon on IE startup, w/Powershell and then Enable on IE exit

I know we can disable all addons/exts when we start IE using the "-extoff" switch. But is it possible to disable a single IE addon from a shortcut start or through a script? And then re-enable the ...
1
vote
1answer
51 views

Calling PowerShell functions in another scripts

I have a script with a number of functions (not just functions but also other code). I would like to create another script that uses one of the functions in the main script. Here is a sample of what ...
1
vote
1answer
26 views

Launch Script for Windows7

Hey guys hopefully I can thoroughly explain what I'm trying to do here! LOL I have a dual display Windows 7 PC and what I am trying to do is launch 2 different programs on boot, and I want one to ...
0
votes
1answer
43 views

How can I programmatically copy an incoming VPN connection profile to a Windows 7 computer?

In Windows 7, I can create an incoming VPN connection, essentially turning Windows 7 into a VPN server. Is there any way that I can copy this setup from one Windows 7 PC to another? For instance, if ...
-1
votes
1answer
47 views

Execute command prompt file (.cmd) from within a PowerShell script?

What command do I need to put in a .ps1 file to execute setup.cmd and make it a forced install? I've tried to execute this command in powershell and its working: PS C:\> c:\setup.cmd ...
1
vote
2answers
221 views

Using the Windows 8.1 command prompt to view Windows activation key

I am not able to access my control panel, probably due to some corrupt system files. And to request help from Microsoft, I need to give them my Windows 8.1 product key. So is there any way I can ...
1
vote
1answer
45 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 ...
2
votes
2answers
47 views

Name “wmplayer” is not recognized as an executable file

I cannot run wmplayer from either cmd or PowerShell. My OS is Windows 7 64 bit. I can do it using start wmplayer but I cannot use parameters. Please, help me to handle it.
1
vote
0answers
66 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 ...
0
votes
1answer
63 views

Set proxy settings and proxy authentication

I've asked this question on StackOverflow but it's not getting lots of attention, I thought it would be better to port it here: I'm new to PowerShell, and I'm tired of changing proxy settings and ...
2
votes
2answers
33 views

How to make a single user's calendar private?

We're using Exchange 2010. A few weeks ago I used the following PowerShell script to give everyone access to everyone's calendars: $users = Get-mailbox $users | ForEach-Object ...
0
votes
1answer
26 views

How to add/remove lines from the hosts file

I'd like to add and remove hosts file entries at a regular interval. I believe the easiest way to do this is powershell and task scheduler. So how do you add/remove hosts file entries?
0
votes
1answer
79 views

Call PowerShell script from Excel

Excel 2010 I'm trying to call a PowerShell script from a macro in Excel. I have seen a number of examples along the lines of: retval = Shell("powershell ""C:\MyTest.ps1""", 1) When I try to use this, ...
0
votes
0answers
14 views

Shell hangs after passing STDIN to EDITOR with -w parameter

I want to edit svn's svn:ignore property: svn propedit svn:ignore . This doesn't work: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set, and no 'editor-cmd' run-time ...
1
vote
1answer
43 views

Powershell script with multiple msiexec calls [closed]

I am having problem with multiple msiexec calls in my PS Script msiexec /package $msi1 /l*v $logfolder\log1.log /qn msiexec /x $msi2 /l*v $logfolder\log2.log /qn msiexec /i $msi3 /l*v ...
1
vote
3answers
128 views

Is it possible to log off windows 8.1 on wireless mouse disconnect?

I'm running a laptop with windows 8.1, I often run it in public places where sometimes I leave it for a few minutes and I started to think would it be possible to log off and log on when I switch off ...
1
vote
2answers
91 views

why cant we maximize the command prompt but whereas we can run the powershell maximised

According to this answer windows command prompt cant be maximized, but what makes the windows to view maximizing through powershell, what does the difference while maximizing in windows powershell and ...