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

4
votes
0answers
604 views

WMI query fails with “A security package specific error occurred.” Exception 80070721

Problem In Powershell after executing the following command ... Get-WmiObject Win32_ComputerSystem -Credential second.nl\administrator -ComputerName srv02.second.nl ... the following exception is ...
3
votes
0answers
48 views

Enabling DHCP via PowerShell results in 2 WiFi connections to same network

I have a VM on my network setup as a gateway that I use sometimes, while most of the time I just leave my PCs configured to use DHCP and just have everything go through the router. I had been swapping ...
3
votes
0answers
27 views

Permission to query WMI

I have a project to remove admin rights from our users. An application we use, during upgrades, runs a query against WMI: Namespace: root\Microsoft\sqlserver\computermanagement10 Class: ...
3
votes
0answers
58 views

Complex wmi queries using execquery

In powershell I can do a query like > get-wmiobject -query 'select * from win32_groupuser' | % {[wmi]$_.partcomponent|select domain,name,SID} Which will list for each wmi, the domain, name and ...
3
votes
0answers
132 views

Path too long, but it's not?

I'm trying to run a Get-ChildItem -Recurse against a file share and I'm getting some "path too long" errors. But when I dig into it, some of them aren't. I'm using -ErrorVariable to capture the error ...
3
votes
0answers
143 views

How do I send an already running process to the background in power shell?

In bash, a process that is already running in the foreground can be suspended by hitting control Z. You can then bring it back to the foreground with fg or let it continue running in the background ...
3
votes
0answers
172 views

What are AMT sessions used for?

I'm familiar with Powershell sessions (ie Enter-PSSession) and what they can be used for. I'm attempting to remotely manage power through vPro, so I've been messing around with the IntelvPro module ...
3
votes
0answers
350 views

Windows8 Metro Applications, change PackageUserInformation from Staged to Installed?

Curious problem I'm running into. We have a series of Samsung ATIV Smart PC 700T's that come pre-installed with Windows 8 core. Unfortunately we need these on the domain so we're upgrading them to ...
2
votes
0answers
32 views

Trigger event on certificate renewed, replaced

I am attempting to trigger a task schedule to kick off a powershell script based on when a new certificate is added into the Local Computer\Personal\Certificates store. For testing purposes, the ...
2
votes
0answers
34 views

Powershell hangs on error

I just upgraded from Powershell 3.0 to 4.0 (http://www.microsoft.com/en-nz/download/details.aspx?id=40855) If I now run Powershell and enter a garbage command (e.g. Blah), Powershell will display an ...
2
votes
0answers
456 views

Why is Microsoft.Update.Session so slow? Can I make it faster?

I'm running this script script (as discussed here): $Session = New-Object -ComObject Microsoft.Update.Session $Searcher = $Session.CreateUpdateSearcher() $Searcher.Search("IsInstalled=1").Updates | ...
2
votes
0answers
95 views

In Windows 10 it possible to set a unique wallpaper for each display via command line or powershell?

In Windows 10 I found the feature to allow setting a unique wallpaper per desktop monitor (control /name Microsoft.Personalization /page pageWallpaper), however; I have a need to script this for a ...
2
votes
0answers
421 views

Can Microsoft Edge be launched in “Private Mode” through cmd?

Can Microsoft-Edge be launched in "Private Mode" through the command line? I'm using this shell command to launch it with a specific URL: start microsoft-edge:www.google.com Is there some kind of ...
2
votes
0answers
233 views

PowerShell Script to Rename - Copy - Move

I am trying to write a PowerShell script to do the following. step 1 Rename files in source (FTP folders) directories with it's "current_name_datetime.csv" as per a source file "Source_list.csv" ...
2
votes
0answers
125 views

How to programmatically change permissions on computer objects in Active Directory

I've inherited control of an OU within an enterprise Active Directory domain. All of the computer objects in our OU are owned (and only writeable by) my predecessor. This prevents me from re-adding ...
2
votes
0answers
64 views

Regex expression cuts zero in the end

I have a script with powershell regex in it, and after I upgraded from Windows 7 to 10 it working different. Regex: if ($srv -match '^[0-9]{1,3}\.[0-9]{1,3}$'){$srv = "192.168.$srv"} Expected: ...
2
votes
0answers
285 views

Powershell: Dealing with multiple parameter sets

I have a function worked out that has 2 parameter sets, both of which contain mandatory parameters. I would like to design the function so that the sets can each be used alone, or together. This is ...
2
votes
0answers
731 views

Can't run PowerShell as admin inside of Webstorm

I am trying to figure out how to run PowerShell as an admin embedded in Webstorm. I can run PowerShell as non-admin in Webstorm, but when I try to run PowerShell as admin inside Webstorm I get the ...
2
votes
0answers
190 views

How to rename files in file from lines of a text file

My script PowerShell: $liste = get-content "Y:\Users\H\Documents\D\Game Of Throne\prod\recup.txt" ` |Select-Object -last 1 $liste | ForEach-Object {Write-Host ($i++) $line} get-childItem "...
2
votes
0answers
1k views

Pin a tile (App or shortcut) to a specified position on Startscreen (Windows 8 / Powershell)

The title is nearly the whole question. I am searching a solution to pin an installed app or desktop application to the windows 8 startscreen. I am in an enterprise environment and the purpose is to ...
2
votes
0answers
604 views

PowerShell stops executing commands/programs

Sometimes my PowerShell stops executing programs and I have yet to find out why. In this state, when I enter the name of an EXE file, the PowerShell immediately returns to a command prompt without ...
1
vote
0answers
32 views

Powershell: Can't post to Slack with otherwise working script

I am totally new to Powershell, but I needed an all-Windows solution for a Slack bot that monitors local folders. I am able to use the CLI to post to Slack successfully with the following two ...
1
vote
0answers
18 views

Allow users to restat programs on terminal server

Our TS is locked down so people can't even get onto task manager to restart a process that is hanging. I don't want to compromise the security of the TS but I would like to give users the ability to ...
1
vote
0answers
64 views

Can't initialize VM's on HyperV Windows Server 2012

I'm really stuck with this and I can't understand why I sunddendly can't make ANY VM to start succesfully in my system. I had just one VM, and it was working perfectly, then for some reasons I booted ...
1
vote
0answers
10 views

Detect when a drive is plugged into a Hyper-V host and automatically attach it to a VM as a pass-through disk

I current am using a WS2012R2 file server and it is a VM. I already have a NAS storage for backing the data up on it and now I want to add a offsite USB storage drive as well... While it isnt much ...
1
vote
0answers
116 views

“AuthorizationManager check failed” in PowerShell, fixed after restarting WMI

About once a day, PowerShell scripts will stop working on my computer with an error that looks like this. AuthorizationManager check failed. At line:1 char:3 + . .\matt.ps1 + ~~~~~~~~~~ + ...
1
vote
0answers
69 views

Find AD users with blank Password

Is there any way to find out users on my domain with blank password using powershell? We already have a policy set for this but with too many admin teams managing different parts of domain just want ...
1
vote
0answers
45 views

Java runs in batch but not Powershell

I have a batch file that runs a jar with a few parameters, works fine: @echo off java -cp bulkconfig.020.0005.jar com.hospira.bulkconfig.LoadConfig %* I would like to add some more cababilities ...
1
vote
0answers
40 views

Any way to do Linux-style sort --merge in Windows PowerShell?

In PowerShell, if I have two files that are already sorted and want to merge them into one big sorted file, it seems wasteful and inefficient to do gc file1, file2 | sort-object > newfile, ...
1
vote
0answers
29 views

Automated XP Mode install

I manage a conference lab environment, and one thing we would like to do is install the 1.0 version of our primary software, as a bit of a nostalgia playground. The thing is, this old version really ...
1
vote
0answers
69 views

PowerShell suddenly hangs on executing any command

I'm on Windows 8.1 and have been using this particular Windows installation for about 3 years. I am not a heavy Powershell user per se, but I do some programming and any command line work (git, node) ...
1
vote
0answers
173 views

“git mv *” returns “bad source” in Powershell

When inside a git repository in Powershell or CMD, issuing git mv * whatever will return fatal: bad source, source=*, destination=whatever This works fine when using MSYS (Git Bash).
1
vote
0answers
17 views

Suffix Aliases feature in powershell

I'm looking for ability to run certain cmdlets when calling files with some extensions. For example, when calling PS> .\test.php I want to call Invoke-Php .\test.php. Something like suffix aliases ...
1
vote
0answers
52 views

Storage Spaces unusable read speed

I've created a Storage Space with parity using 10 2TB disks and transferred 10TB onto it. However I am getting appalling read speeds. When I try and copy data off it, it takes ages to get going (...
1
vote
0answers
416 views

Configuring Windows 8/8.1/10 File History via command line

tl;dr: Is there a way to configure windows 8 file history via unattended command-line/some script? long story: I'm configuring a lot of stand-alone (non-domain) PCs and I think some backup is better ...
1
vote
0answers
75 views

How to set Powershell Color scheme permanently

With PowerShell 5.0, there are lot of customization options. Presently I have created my own color scheme. But I couldn't figure it out how to set these color options permanently. Set-...
1
vote
0answers
72 views

How can I grant mailbox permissions with PowerShell so that each member in a group has Full Access to every other member of the group?

I'm faced with the task of granting Full Access and Send As permissions on a large group of customer service representatives. I want each member (of a distribution group) to have Full Access and Send ...
1
vote
0answers
18 views

Can I load Powershell AD Module as another user?

I have a script that I use to automate AD and Office 365 account provisioning. Everything is working just fine. The only "problem" is that I have a regular domain account and another account which is ...
1
vote
0answers
91 views

Running a specific PowerShell command in CMD

Im able to run simple PowerShell commands in cmd such as "LS" for instance this way: PowerShell -Command ls But what I really want to run is: [System.IO.Directory]::GetFiles("\\.\\pipe\\") If I ...
1
vote
0answers
98 views

Identify Hyper-V VM network adapter connected to specific vSwitch

I am trying to identify a specific network adapter connected to the Internal vSwitch, so I can subsequently bind the DHCP server role to that adapter. There are 3 Network Adapters, 2 connected to ...
1
vote
0answers
134 views

Unable to access ElasticSearch on AWS

I am trying to use curl in powershell to access elasticsearch on an AWS instance, with no luck. I can access the instance using putty with no problems, and can successfully run a health check on ...
1
vote
0answers
69 views

How to make program show up on a designated virtual display in Windows 10

So as some of you surely know, in Linux you can open a program directly on a specific display by exporting a variable export DISPLAY=:0.0 and then starting a program. Since Windows 10 also ...
1
vote
0answers
18 views

Get-VM for a hyper-v , what are the differecnes between VMName & Name

I want to get a list of VMS for a Hyper-V server, so I run the following command , to get the VMs details inside hyper-v server named "hyperV01":- PS C:\Windows\system32> Invoke-Command -...
1
vote
0answers
84 views

can't kill installer made with innosetup

For years I have been making installers with innosetup, on Windows XP SP3. I have just installed the latest innosetup, 5.5.6 (u) (for Unicode) on Windows 7 Professional, 64-bit. I made a new installer,...
1
vote
0answers
137 views

Powershell Mouse Moving Script on XP

Add-Type -AssemblyName System.Windows.Forms [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point(500,100) The above code should move the mouse to a specific position (500,100), ...
1
vote
0answers
325 views

Invoke-Command from elevated powershell with non-elevated creds

I'm trying to run a script that requires elevation to set certain registry values to allow CredSSP on local and remote computers and, during this script, I need to access a network share as a non-...
1
vote
0answers
69 views

Compress traffic when copying a lot of files over network between two Windows machine?

The tools under unix/linux, e.g., scp, rsync, etc., support compression when copying files. Does any Windows (Server) tools do the compression when copying? I will need to copy 5TB of text files ...
1
vote
0answers
35 views

Remote PowerShell, which machine is making the incoming connection?

I'm trying to identify the connecting machine within a remote PowerShell session. The reason is so a script can behave differently depending on which machine is connecting. Get-PSSession doesn't ...
1
vote
0answers
1k views

Powershell Copy-Item: Container cannot be copied onto existing leaf item

I have a Powershell script with a line that looks like this: Copy-Item \\[machine 1]\[path 1]\[directory 1]\ \\[machine 2]\[path 2]\ -recurse When my script gets to this line, the following error ...
1
vote
0answers
43 views

Uploading Arduino firmware automatically

I am on Windows 8.1. I have an Arduino Uno kit, that I program with the help of Arduino IDE. The IDE allows me to edit my files, compile them and burn them into the Arduino memory. However, I have ...