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
56 views

Is rm reversible?

On a Windows Server 2012R2 environment, is the PowerShell cmdlet rm undoable? The TechNet manual for Remove-Item states that it deletes an item (multiple types), but no specification about the ...
0
votes
0answers
43 views

need command line to test duplex status on windows NIC cards

this woud be for windows 7 I tried the following powershell command get-wmiobject Win32_NetworkAdapter | foreach-object { get-wmiobject -namespace root/WMI -class MSNdis_macOptions -filter ...
1
vote
0answers
100 views

Get-Command missing in Powershell after installing Version 4

Something must have gone wrong by installing dot net framework 4.5 and Powershell 4.0 I tried repair install of framework 4.5 and even deinstallation and reinstallation, but it doesn't help. PS ...
0
votes
1answer
37 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.
2
votes
3answers
9k views

Renaming computers via command prompt

I am the system admin for a small business (120 employees) and I am looking at an easy way to rename all of the computers in the office to a more uniform naming convention. I have tried playing with ...
3
votes
1answer
2k views

How to remove a drive from a storage pool on Windows 8?

I have 3 drives in a Storage Space on Windows 8. I am running a two way mirror. The drives are 2x2TB and 1x1TB. I want to remove the 1TB drive without replacing it. In other words, I only want the ...
2
votes
3answers
444 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 ...
1
vote
1answer
71 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 ...
0
votes
1answer
115 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
90 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 ...
1
vote
1answer
91 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 ...
2
votes
1answer
36 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 ...
0
votes
1answer
58 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
2answers
97 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
0answers
54 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 ...
0
votes
2answers
89 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
55 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 ...
3
votes
1answer
55 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 ...
5
votes
3answers
2k 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
1answer
200 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 ...
2
votes
2answers
58 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
0answers
54 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
76 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 ...
3
votes
1answer
177 views

Powershell systemroot in $env:path different when AC elevated

I have a strange behavior with the environment variables at my Windows XP SP3. When I logon as Administrator, the %SystemRoot% strings in PATH are substituted to C:\WINDOWS, the value of the variable ...
0
votes
1answer
357 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
83 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
53 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 ...
3
votes
1answer
4k views

Office 2013 Click to Run - Primary Interop Assemblies

Given that the Office 2013 click-to-run installer allows no customisation of the installation, whatsoever, how can I install, or where can I find an installer for the Primary Interop Assemblies/.NET ...
2
votes
1answer
595 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
28 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 ...
2
votes
2answers
2k views

Powershell font too small on Windows 8.1 - how to adjust?

Question: On my Windows 8.1 machine, I need powershell to configure office web apps. When I start powershell, for a blink of a second, it shows as it should, but then it gets resized, and the font ...
0
votes
0answers
42 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 ...
1
vote
3answers
3k views

How can I copy a directory, overwriting its contents if it exists using Powershell?

I have a directory Source with some files in it, which I would like to copy to a folder Destination. Destination may exist, and it may have files in it already. Any files with the same name as those ...
4
votes
1answer
310 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 ...
1
vote
1answer
57 views

Setting the Taskbar buttons to combine when full via PowerShell

Is it possible to set the Taskbar buttons option to Combine when taskbar is full via a powershell command? I've looked at Set “never combine” in Windows 7 using the registry? but I'm after a ...
1
vote
1answer
61 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
41 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
92 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
25 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 ...
0
votes
3answers
446 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 ...
1
vote
1answer
99 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 ...
2
votes
1answer
105 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 ...
1
vote
1answer
204 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 ...
9
votes
2answers
1k views

Set Powershell as the default shell of Far Manager?

Can I set Powershell as the default shell of Far Manager?
0
votes
1answer
1k 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 ...
0
votes
0answers
87 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 = ...
3
votes
1answer
9k views

Where is the known_hosts file for OpenSSH for Windows?

One of the servers I frequently log into via SSH has changed it's IP address. So, now I'm getting man in the middle attack warnings when I try to use SSH via Windows Powershell and OpenSSH for ...
0
votes
1answer
47 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
1answer
48 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 ...
1
vote
2answers
2k views

PowerShell List of distribution groups and members? (Office 365)

I'm looking for a way to export a list of distribution groups along with the members of each group via PowerShell on Office 365. I've found scripts that export a list of users and the groups they ...