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

2
votes
0answers
19 views

Get-ChildItem | tree gives me a wierdly formatted tree

Edit: This is the value of $OutputEncoding: IsSingleByte : True BodyName : iso-8859-1 EncodingName : Western European (Windows) HeaderName : Windows-1252 WebName : ...
0
votes
0answers
16 views

Write a small script to extract ms-exchange audit logs in csv format?

Background I'm using ms-exchange 2013 in my environment, and have a separate siem box which analyze logs produced by different systems (i.e exchange). The logs for exchange are internally stored and ...
0
votes
1answer
34 views

Remove column header from sql query output in powershell

I want to remove column header from sql server query output. I did the search but not found any solution. I have a script. $Database = "temp" $Server = "localhost" $AttachmentPath = "output.csv" # ...
0
votes
0answers
17 views

Error while deploying unity web player application on Parse.com

I have created a game using unity game engine and build it using unity web player.After building i got two files client.html and client.unity3d . Now I am try to deploy these on Parse.com . Initially ...
2
votes
0answers
34 views

Recursive folder rename through command line

I have 500000 plus files in over 3000 directories and need to rename all folders called PHOTOS to Photos. I also need to Rename any Folders call Photos blah blah blah to be called just Photos. It ...
0
votes
1answer
45 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
1answer
22 views

How do you export Windows 7 AQS search to file? [duplicate]

My question is identical to this question that has already been asked back in 2011, but that does not have any answers: Export Windows 7 Advanced Search Results to Text File I'm hoping that someone ...
0
votes
1answer
35 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
24 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
17 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
530 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
25 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
26 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
17 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
16 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
57 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
26 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
37 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
68 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
26 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
23 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
73 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
146 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
22 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
29 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
42 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
52 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
49 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
42 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
49 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
30 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
36 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
43 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
16 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
33 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
58 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
53 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
47 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
50 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
247 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
46 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
50 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
68 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
69 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 ...