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

open kdiff3 with 2 files selected from different panels

So, I saw another question that shows how to open multiple files in vim using the line of code ps: & vim @(Get-FarPath -Selected) # But that seems to work only with files selected from the ...
-2
votes
0answers
18 views

Powershell script

How can I give read&write permissions only to files not the folders. I mean a user can delete,modify the file but cannot delete or modify a folder. how can we do it with powershell script.
1
vote
3answers
156 views

Get IpAddresses of hyper-v linux machines

I have Hyper-v on windows server 2012, and in the Hyper-v I have CentOS 6/7 vm. I doing the following command: Get-vm -name "x" | select -ExpandProperty NetworkAdapters output: Name ...
0
votes
0answers
45 views

Invert the direction of the mousepad

I wonder if I can invert the scroll direction of my mousepad. I'd like to scroll upwards and have that action scroll downwards and vice-versa. I tried doing it with Windows PoweShell but got an error. ...
0
votes
1answer
16 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-...
4
votes
2answers
48 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, ...
2
votes
2answers
41 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 ...
3
votes
1answer
4k views

Powershell Script to SFTP New files

I have a script here that SFTP's files from one location to another, the script works fine however I'd like to change the script so that it only copies files that are not already present. Bit of a ...
2
votes
1answer
3k views

Running 'Start-Process' Remotely: How to Display Standard Output?

I have a PowerShell script for installing software on remote computers. To date I have been successfully using the following code: $prog = "ping" $arg = "localhost" $computername = "MACHINE01" ...
2
votes
2answers
54 views

Something in Windows 10 is re-dating all of my archived *.eml files

Background info Between 2003 & 2013 I had the habit of saving important emails out of my email account to my local hard drive as *.eml files. (I no longer do this, relying on the vast backup ...
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
2answers
3k views

How do you install .net4 on a Server 2008 r2 machine through psremoting in powershell?

I need to write a script that installs .net 4 remotely using powershell to a group of Server 2008 R2 machines. I based my script off of http://social.technet.microsoft.com/Forums/en-US/...
0
votes
1answer
24 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
votes
0answers
17 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 ...
1
vote
1answer
14 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
19 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
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 ...
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....
1
vote
1answer
3k views

Setting registry permissions with Powershell

I have a registry key that I need to take ownership of and then set a permission set on. I'm able to take ownership, but when setting the permission, it only applies to the very top level of the ...
2
votes
2answers
5k views

Proxy configuration in powershell

I'm trying to install chocolatey on an windows behind a proxy: @powershell -ExecutionPolicy unrestricted In power shell I'm executing $wc=new-object net.webclient; $wc.Proxy=new-object system.net....
0
votes
1answer
26 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 ...
24
votes
8answers
33k views

Linux “Top” command for Windows Powershell?

I am looking for a PowerShell cmdlet that can provide similar functionality to the Linux Top app. Something that refreshes at some given interval and displays the process list with CPU % util. I have ...
3
votes
1answer
43 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 '$...
12
votes
1answer
396 views

What does “C:2\” in a windows path string mean?

I got this pop-up from the Windows firewall. What is "C:2\" in the path? The real path is D:\Steam\SteamApps\common\... I tried cd /d C:2\ in cmd and got "The system cannot find the path specified."...
-4
votes
0answers
21 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
26 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-...
1
vote
2answers
8k views

How to reset TCP/IP on Windows 8.1?

The following netsh command is not working on Windows 8.1. netsh int ipv4 reset It give “Access Denied” error and it is a VERY known issue, many people complaining about it all ove online forums. ...
4
votes
4answers
13k 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 ...
3
votes
3answers
3k views

Run powershell through winexe/psexec

I'm trying to connect to a Windows 2012 server from Ubuntu. winexe --user <USER> --password <SERVER> //SERVER cmd.exe works just fine. However, winexe --user <USER> --password &...
0
votes
1answer
3k 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
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 ...
2
votes
1answer
32 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 ...
1
vote
1answer
34 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
3answers
10k views

How to execute a .ps1 from another .ps1 file?

I have two PowerShell files. a.ps1 and b.ps1. At a center point in a.ps1 I want to start executing code in b.ps1 and terminate a.ps1 script. How to do it considering that both files are located in ...
1
vote
4answers
2k views

Set UAC Level with PowerShell

I'm looking for a way to set the UAC Level with Powershell/Command prompt. I'm aware the 'EnableLUA' value in the registry, but this won't set the level. It's just true or false. Is there a way to ...
0
votes
1answer
36 views

Choco Install Mongodb throws internal server error 500

I am stuck on installing mongodb with chocolatey. This is the command I use: choco install mongodb I execute it in powershell with administrative rights. This is the error (translated from german)...
1
vote
1answer
61 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 - ...
45
votes
4answers
62k views

have Powershell get-childitem return files only

I'd like to use get-childitem recursively, but only have it return files not directories. The best solution I have just doesn't seem natural: gci . *.* -rec | where { $_.GetType().Name -eq "FileInfo"...
1
vote
2answers
61 views

Powershell to delete all files with a certain file extension

I want to scan a directory (there are no subs) and delete any file with an extension of .avi I tried this syntax, but no errors are thrown, and no files are deleted. This is the code I tried get-...
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 ...
0
votes
1answer
123 views

Parameters with spacebars parsed incorrectly for a powershell script run from a batch file

I have a batch file that runs a powershell script and I need to pass two parameters to the script. In my batch it looks like this: powershell -executionpolicy remotesigned -File "my script.ps1" "my ...
16
votes
3answers
8k views

Is PowerShell a complete replacement for console/cmd?

Right now I'm using the Windows console (cmd.exe) for some easy tasks (as checking my ip configuration or running some applications). But now I heard that there is PowerShell which actually is way ...
4
votes
1answer
97 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
44 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 ...
3
votes
1answer
113 views

Can't list SQL databases like directories with PowerShell

I'm trying to list databases with PowerShell. I'm able to use Inkoke-Sqcmd cmdlet, but I can't list databases with this command: dir SQLSERVER:\SQL\myserver\sqlinstance\Databases Get-ChildItem : No ...
0
votes
0answers
23 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
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: ...
0
votes
1answer
19 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
20 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 ...