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
409 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
44 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
109 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
103 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
161 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
346 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
31 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
350 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
86 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
334 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
193 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
97 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
61 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
256 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
540 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
175 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
590 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
5 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
44 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
39 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
27 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
34 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
17 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
46 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
93 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
16 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
47 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
219 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
44 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. ...
1
vote
0answers
37 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
16 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
77 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
70 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
117 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
17 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
70 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 ...
1
vote
0answers
128 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
294 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 ...
1
vote
0answers
67 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
34 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
40 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 ...
1
vote
0answers
194 views

Enumerate remote SMB shares with PowerShell on non-Windows system using WIndows 7

I need a way to enumerate the SMB shares of a remote, non-Windows system while using PowerShell on my Windows 7 system. The file server I'm checking is not running a Windows OS. However, I need to ...
1
vote
0answers
144 views

Why is Powershell able to change registry values regardless of registry permissions?

Using Windows 8.1 Enterprise. Through Regedit I removed permissions from Administrators and even System for the key HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings. I was under the ...
1
vote
0answers
255 views

get-command : Object reference not set to an instance of an object

I have PowerShell 4 on a Windows 7 laptop. I just installed PowerGUI, and discovered I am getting this error: get-command : Object reference not set to an instance of an object. Powershell_ISE, ...
1
vote
0answers
126 views

How do I use the Python commands in PowerShell?

I work in a GIS department and I'm trying to learn Python to automate something boring. I started using "Learn Python the Hard Way", but I can't figure out how to run Python scripts from PowerShell. I ...
1
vote
0answers
110 views

Set printer preferences

I am writing a script setting up printers and drivers. One of the driver I install, contains a bug for old printers used with platforms further than Windows Vista. I need to update the preferences of ...
1
vote
0answers
87 views

Want to send automatic mails from email server, That To addres has to read from email that i received.?

I want to send multiple mail automatically. I will receive mail as FROM: abc@domain1.com TO: 123@domain2.com BODY: mail contains (username@domain3.com) What I want to is take the ...
1
vote
0answers
135 views

Properly extracting from an array

I have a CSV with one column, numbers formatted as 111-0000, that I'm reading in to process one at a time. I'm trying to import the column of information from the CSV, but I'm having trouble figuring ...