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
2answers
273 views

Create Loopback and assign local addresses on Windows 8

I'm usually on OSX where I often add additional IP addresses to lo0 interface to simplify ssh tunnelling to various services on different machines to different local addresses: # Tunnel mysql ...
1
vote
3answers
117 views

Detect if powershell is running as administrator

How can I tell in my scripts if Powershell is running with administrator privileges? I need to know because I'm trying to run a program that requires the ability to open protected ports.
0
votes
1answer
467 views

How to Launch an App in an Existing Session

When a scheduled task runs I would like to open a Powershell window on my desktop to tail the log file and watch the progress. Specifically I would like the task to open the window on my desktop and ...
2
votes
3answers
4k views

Find AD users with specific AD attribute NOT null

I'm looking for a script/Powershell command that will list all AD users that have a value not NULL in the teletexterminalidentifier attribute, so they must have a value set. By default this attribute ...
0
votes
1answer
322 views

Windows 2012 Domain Controller NETLOGON error

We have Sonicwall firewall user authentication System active since last two months. We have Windows 2012 Active directory server setup with around 1400 user account created. These accounts were ...
0
votes
1answer
103 views

PowerShell “.count” method causing incorrect processing

I am creating an array in PowerShell that doesn’t always contain data (sometimes it is empty). I need to verify that the array contains data before trying to do anything to the array objects. When I ...
1
vote
1answer
166 views

Appx package does not show in Start screen

Recently, I decided I want to grab some applications that were originally shipping with Windows 8 and sideload them to Windows 8.1. So I just installed Windows 8 in a virtual machine and then grabbed ...
2
votes
1answer
80 views

GIT via OpenSSH in Powershell is fine, so why can't I connect in plain cmd console?

when I run ssh user@servername01 ...under powershell it connects without a problem, however when I run the same command under a standard cmd prompt I am prompted for a password (no password is set ...
1
vote
1answer
43 views

Copy a list of folder to another folder?

Is there anyway so I can copy a list of folders within a text file to another folder in Windows? I have a text like this: 87312 87313 87314 87315 ... I assume it's possible via Powershell.
0
votes
2answers
86 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 ...
1
vote
0answers
95 views

Powershell - Elevation Loses Current Directory

One problem leads to another! User help just fixed one issue, which led to another as I continued working on this script. My script runs a check to see if the current user is an Administrator as ...
1
vote
2answers
244 views

PowerShell create VHD

I would like to create a VHD (virtual disk). I know this can be done with diskpart create vdisk file C:\w7.vhd maximum 10 However I am trying to do it with PowerShell. I found the New-VHD Cmdlet, ...
1
vote
1answer
190 views

Is there anyway to see when a Windows firewall rule was created/enabled using PowerShell v2 or CMD?

I have been poking around the interwebs but I cannot seem to find a definitive answer to this question. I am forced to work with PowerShell v2. I know that using the following command will give me a ...
0
votes
2answers
126 views

Powershell - Uninstalling a List of Programs Taking Too Long

I am looking for assistance on making a bit of code more efficient. I currently have a simple Powershell script (part of a larger script) that enumerates items from a text file (namely the string used ...
2
votes
1answer
70 views

Use PowerShell to interpret registry values

Consider the following key, as an example HKEY_CLASSES_ROOT\txtfile\shell\open\command and its (Default) value %SystemRoot%\system32\NOTEPAD.EXE %1 This value determines what will happen when ...
2
votes
2answers
110 views

How can I display utf8 in powershell?

So this really has me knocking my head against the wall. I have some XML: <trans-unit id="4" translate="yes" xml:space="preserve"> <source xml:lang="en-US">Customize Forecast ...
2
votes
1answer
995 views

Get computername by username

I am trying to find a computername that is used by certain user. To do it I get a list of computers by Get-ADComputer and then ask all of them if there is a user I am looking for logged on. This is ...
3
votes
1answer
123 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 ³ ³ ...
0
votes
0answers
135 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
1k 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
1answer
157 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 ...
4
votes
1answer
105 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
180 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
73 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 ...
2
votes
1answer
2k 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
29 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 ...
1
vote
0answers
76 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 ...
6
votes
1answer
2k 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 ...
6
votes
3answers
8k 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 ...
0
votes
1answer
62 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
270 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 ...
0
votes
0answers
46 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
178 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 ...
1
vote
1answer
848 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
274 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
164 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
119 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
91 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
2k 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
2k 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
1answer
63 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
707 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
885 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
1answer
305 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
52 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
179 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
78 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
158 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
224 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
546 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 ...