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
0answers
6 views

Filter a list of strings in powershell by a regex, then group and sort by one of the capture groups

I'm looking for a way to filter a list of strings in powershell by a regex, then group and sort by one of the capture groups. Imagine my list is like this: bogus0 ACBXYZ-0000 hello bogus1 ACBXYZ-...
3
votes
2answers
40 views

What does psexec -d do?

SS64 says it means Don’t wait for the application to terminate. Only use for non-interactive applications. But I don't understand this. I'm trying to run some non-interactive system calls but, ...
-1
votes
0answers
15 views

Windows DHCP Server - Script to remove duplicate leases to the same hostname

I’m looking at creating a script that clears out duplicate DHCP leases from our Windows Server 2008 R2 based DHCP server. I’ve found out that you can’t do this natively in PowerShell, but you can use ...
0
votes
1answer
22 views

Customize the start menu tiles without any other program

I want to customize my Windows 10 start menu, with my own tiles. I tested already TileCreator, problem here is that it always pops up for around 0.5 seconds, before the actual program starts. Thats ...
1
vote
1answer
13 views

how to delete reserved URL in Powershell?

how to delete reserved URL in Powershell? I am attempting to delete all the reserved reporting related URLs by using powershell because Report Server Webservice is not properly configured and I need ...
0
votes
1answer
18 views

Show middle hierarchy in Excel treemap?

I have a CSV with filesystem data; file paths and size. I've created a treemap chart from this data, but the problem is that the treemap doesn't seem to take hierarchy into account. Each data point, ...
2
votes
0answers
27 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 ...
0
votes
0answers
23 views

Import file associations on established users (Windows 10)

Using the DISM on PowerShell you can easily export file associations on a xml file: Dism /Online /Export-DefaultAppAssociations:C:\FILENAME.xml You can import this file on a Windows image: Dism /...
0
votes
1answer
26 views

windows - Why does my executable shortcut (*.lnk) not behave like the program it points to?

I have a shortcut that points to ant.bat (apache ant). Executing that shortcut always returns the fail error ("build.xml does not exists"), while executing the ant.bat directly with full path does not....
3
votes
0answers
46 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 ...
0
votes
1answer
25 views

Install-WindowsFeature -ConfigurationFilePath from UNC path is denied

I have a role template here (XML file) that I created to set up many IIS Servers at once. The template is on a UNC share that has Read access to the same user account that I am running remote ...
-4
votes
0answers
19 views

how long does it take to setup hot folders and is powershell the best to use?

I am hoping any experts out there in the field of powershell can help me. I have 0 experience in scripting but i need scripts to be made to execute as follows : I need folders to be made as ...
0
votes
2answers
23 views

Windows 10 PowerShell setting up split tunneling

I am trying to enable split tunneling on my laptop (Windows 10), I learned one has to use PowerShell to do it in Windows 10: Windows 10 split tunneling But when I type that command: set-...
2
votes
2answers
35 views

Better Way to Export Data from MS SQL server

[TL:DR] I need to be able to export ad-hoc data from a MS SQL Server DB to a file on my local machine using a predetermined format with *Latin1 encoding. I wasn't sure if SSMS had a way to create a ...
-1
votes
0answers
22 views

Powershell script to Output System hardware and software specs to Excel [migrated]

I'm attempting to incorporate the results of a powershell program (Get-IS) that lists installed software and software versions into another powershell program that creates an excel spreadsheet from ...
1
vote
1answer
33 views

How do I shift the execution of a batch file from one CMD to another CMD?

This is my batch file script: ::opens new cmd in admin mode powershell.exe -Command "Start-Process cmd -Verb RunAs" ::this needs to execute in the previously, newly opened cmd wmic product where ...
2
votes
1answer
28 views

DNS browsing history by date

I found this Powershell script online, @echo off Powershell -noexit "ipconfig /displaydns | select-string 'Record Name' | foreach-object { $_.ToString().Split(' ')[-1] } | Sort | Out-Gridview" Is ...
3
votes
1answer
38 views

Start-Process always generates error “A positional parameter cannot be found that accepts argument '$null'”

On server 2012 R2, I'm mounting SQLServer media as a drive (works), but every time I launch the install using "Start-Process", the error "A positional parameter cannot be found that accepts argument '$...
1
vote
0answers
29 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
1answer
55 views

Do I really need a Windows system in order to maintain Chocolatey packages?

As described in this Q&A I do not have a Windows system anymore. Do I really need a Windows system in order to maintain Chocolatey packages? Concerns Ketarin - will it run on Linux Powershell - ...
0
votes
1answer
43 views

What is “Local System account” in Windows?

And how do I run something as this account ? I am in the administrators group for a server in a Active Directory organization. It is mainly a file server and in the interest of security, all non ...
0
votes
0answers
21 views

bash on windows cannot 'see' mysql server started from Windows environment

I have a WAMP stack running from my Windows environment. But because I much prefer the Unix environment, I issue my symphony commands from within Bash on Windows (the Ubuntu Linux for Windows ...
3
votes
0answers
25 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: ...
4
votes
1answer
94 views

Block a registry key to prevent rewriting or deleting accidentally or intentionally using the command line

I see the post in superuser and i have a similar case, but with a small difference. I created a reg key. "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\wscript.exe" ...
0
votes
1answer
18 views

how do I reset netmon using powershell?

Im using powershell, as Administrator in windows8.1. I give the command Restart-Service netmon but it fails with no service found. ok, how do I restart netmon then?
0
votes
0answers
19 views

create file type and change default application by script/regkey

We have some software which uses the *.opl file format, which isn't recognised by Windows. We can change the file type but when logging off and back on again, the default application is lost, even ...
-1
votes
0answers
20 views

Powershell file Rename increase by 2

get-childitem | foreach { $i++; $new = "{0:D3}" -f $i + $_.Extension; rename-item $_ $new } ; $i=0 how can i make this so it increrase the name by 2 each time? Example would be 002.tif oo4.tif ...
-2
votes
1answer
36 views

Run ps1 with admin privileges and unrestricted policies from a batch file?

I have a test.bat to run a test.ps1 with admin privileges and unrestricted policies, and both are in the same folder (local PC), but the bat does't run ps1. Whats wrong? PowerShell -NoProfile -...
1
vote
1answer
32 views

Can not use command New-ADuser with new created attribute on AD Windows Server 2012

I create the new attribute with the guide here: Youtube link: Add new Attribute in AD I can edit the attribute that I created in "AD User and Computer" in the "Attribute Editor" (Like the clip) But, ...
0
votes
1answer
14 views

Get-Childitem -Include array seperator

That don't work for me, why? What is here the right seperator? The idea is from this question: How do I get get-childitem to filter on multiple file types? $Jetzt = Get-Date $Alterung = "14" $Cache =...
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 ...
0
votes
1answer
57 views

Is their a faster way to copy .vhd and .vhdx files?

Right now I am using Item-Copy in powershell to copy a 20GB .vhdx file. The file sits on an SSD with hardly any services running. One would expect the copy time to take ~2 minutes. The copy took about ...
-1
votes
0answers
20 views

Windows Powershell Copy files into respective folders

I need to copy all the pdf files from a structure of subfolders main folder 1 folder 2 subfolder 1 name1.pdf name2.pdf and take all the pdfs with names matching a list from a .txt and ...
-1
votes
1answer
32 views

delete file-process with powershell using environment variables

I have adapted a powershell script, to delete a file in specific path, but first i must close the process generated by this file, but it has errors (does not recognize route with the environment ...
0
votes
0answers
34 views

Using Workflows In Powershell

I have been using just a standard foreach loop, which executes as it should. However, I have an 8 core processor and 16GB of RAM and thought I would utilize such with a Parallel.foreach loop. Well, ...
0
votes
1answer
11 views

windows server 2008 r2 - Script on server needs interactive user input

i have a small script running which listens for a specific ip to get online in the network. (for a robocopy job) I have split this into two things: If the client is connected via vpn, ask the user if ...
-1
votes
1answer
34 views

Set Firefox as Standard Browser via Powershell

I'm currently creating a deployment image (Win 10 x64). Since I have to use a FOG-Server, I created an Install-user with my powershell script in autostart. The user will be deleted after the script ...
0
votes
1answer
18 views

Download big files with PowerShell

I tried the following Invoke-WebRequest -Uri "https://download.microsoft.com/download/6/4/8/648EB83C-00F9-49B2-806D-E46033DA4AE6/ExchangeServer2016-CU1.iso" -OutFile "Exchange.iso" But this Fails ...
4
votes
1answer
74 views

How can I get useful information from the Search Indexer perfomance counters?

I've been trying to figure out a way to get information on the indexing progress programmatically (how many files to go or "indexing complete"). I stumbled upon the class ...
1
vote
1answer
31 views

How to use PSReadline to have bash style cursor movement

How can I get these shortcuts with PSReadLine: ctrl+a : Move to the beginning of the line ctrl+e : Move to the end of the line ctrl+w : Delete a word backwards ctrl+k : Delete all words backwards ...
0
votes
1answer
13 views

How to reduce PowerShell CPU spikes

On a windows server 2008R2 (VM, only 1CPU), I'm noticing hefty CPU spikes, completely disabling signing in via RDP / freezing connected sessions. Logging shows the ESX CPU demand scratches 3000 points ...
1
vote
1answer
21 views

Powershell Script not firing

I'm pretty new to powershell but im executing the following script in PS ISE: $source = "E:\MEX_Websites\Customer_Hosting\MyFolderB\Reports\" $filter = "*.*" $fsw = New-Object System.IO....
0
votes
0answers
11 views

Visibility of Connectify notification icon on Windows 10

I'm currently needing to frequently connect my Windows 10 (Version 1511, OS Build 10586.318) laptop to the internet via my cable-tethered Samsung Android phone. Every time I've happened to power-cycle ...
-1
votes
1answer
37 views

Chocolatey as non-admin user

I´m starting to use Chocolatey in the network of my hotel for software installs. I have a domain set on Win 2008 and all my users are not admins. So, lets say I have a user JOE that is not an admin ...
1
vote
2answers
44 views

Converting C# Regex To PowerShell

Our Software department has a program that runs SQL scripts from a certain folder. I now need to replicate this functionality in PowerShell. C#: var commands = Regex.Split(sqlFileText, @"^\s*GO\s*$",...
0
votes
0answers
18 views

How to view actions by Windows Shell

I am trying to automate the installation of an number of packages using PowerShell 2.0 in Windows 7. Each set corresponds to a product build (which may be an upgrade or downgrade depending on the ...
0
votes
1answer
18 views

Equivalent of pmset noidle -u on Windows

On OS X one can easily temporarily prevent the Mac from sleeping using the command: pmset noidle -u pmset - manipulates power managment settings noidle - flag stands for sleep prevention method u -...
0
votes
0answers
34 views

Downgrade Windows storage spaces pool from Windows 10 to Windows 8.1

I have a storage spaces pool that was originally on Windows 8.1. When I moved the pool to a Windows 10 system, I unfortunately upgraded the storage spaces pool to the newer 'Windows 10 version'. So ...
-1
votes
1answer
32 views

Do startup scripts in Windows Server run asynchronously?

As I'm debugging a startup script for a remote VM, I'm trying to run some commands that rely on the ones before. The errors I'm getting are inconsistent; sometimes, 2 out of 3 steps will run, ...
0
votes
0answers
36 views

Cancel button not working in form created in powershell

We are creating a powershell script that creates a form window, that accepts a password. Now normally this is rather simple, but we are having it loop 5 times if a wrong password is created. We have ...