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
2answers
95 views

Powershell : Get variables from remote machine and store them in an excel file in local machine

I asked this question before, but I think I didn’t explain it well: I'm working on a project that use powershell scripts: I would like to execute in a remote machine, a file named “Remote” (existed in ...
0
votes
0answers
35 views

Remove site from trusted site

I have a powershell script in place for adding a URL/Site to trusted site as below: Param ( [Parameter(Mandatory=$true,ValueFromPipeline=$true,ParameterSetName="SingleDomain")] ...
0
votes
1answer
55 views

Copy multiple files using Powershell

How can I copy all files of kind:docx from all directories under and including e.g. D:\Doc_Source, to destination E:\Doc_Destination, in batches of e.g. 500, and only when there are none left in ...
1
vote
0answers
89 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).
0
votes
3answers
71 views

How to Delete Folders with Powershell using Remove-Item

I am trying to use powershell to delete a lot of folders. When I try running the command: Remove-Item -Filter Angle -WhatIf I get the error: Supply values for the following parameters Does anyone ...
0
votes
4answers
115 views

Executing a powershell script through batch file

I am trying to execute a powershell script through a batch file, at the moment I am only testing this to get it running so the .ps1 file is simply a hello world script. This ALMOST works fine except ...
-1
votes
1answer
19 views

Converting powershell array into table

I have an array of comma separated data that I need to do operations on. In the past I would write to a file then Import-Csv that file back to a variable. Is there anyway to split the data into ...
1
vote
1answer
41 views

How to use Powershell code to loop through subdirectories and delete specific folders?

If I am in my current working directory, is there a powershell code that I can run which will loop through the subdirectories and delete all folders that are named 400eV, 410eV, 420eV... up to 500eV? ...
1
vote
1answer
56 views

Adding date to the name of multiple files in multiple folders

I have a directory which contains 400+ subfolders. In each of this subfolders a new file appears every day. Each new file has the same name as the file that appeared in the same folder yesterday. Each ...
0
votes
0answers
32 views

Unable to kill a process

With admin rights and Powershell, I want to kill a nasty process. PS D:\_prj> Get-Process someapp* | Stop-Process -Force (or without -Force). That works in 99% of cases. Unfortunately, sometimes ...
0
votes
1answer
103 views

How to fix truncated PowerShell output, even when I've specified -width 300

I'm trying to get a list of all the directories and files on an external hard drive, with one fully-qualified directory/file path per line. I'm using PowerShell on Windows 10 to achieve this. This is ...
0
votes
0answers
43 views

Powershell Start-Process command parameter escaping

I try to open an elevated powershell from within a powershell session. This works: powershell -NoExit -Command "Start-Process PowerShell -ArgumentList @('-NoExit','-NoProfile') -Verb RunAs" This ...
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
votes
1answer
42 views

Powershell: getting computer architecture if computer is offline

I have come across the below line that allows to identify if a computer is 32-bit or 64-bit: $(Get-WmiObject -Class Win32_Processor -ComputerName [name]).AddressWidth It works well if a ...
1
vote
1answer
63 views

How to Concatenate user name and surname while adding users from csv?

I want to add users to AD using the following command in Powershell: (This is a single line command but I am breaking apart it to be more readable) import-csv C:\list.csv | Foreach-Object { ...
2
votes
1answer
100 views

How to install a Windows Feature on Docker container (Windows 2016 Server) that requires a “server restart”?

I try to install the Windows feature "NetworkController" on a docker container on Windows 2016 Server TP4, using Powershell. After I run "Add-WindowsFeature NetworkController", I get the message: ...
0
votes
1answer
116 views

A script keeps popping up on startup?

So, I restarted my entire system two days ago and after installing all the software I need I realized that whenever I turn my PC on there's something running on the start bar. I quickly checked what ...
0
votes
1answer
68 views

Powershell ISE cannot attach to Docker container / Windows Container

I can connect and attach to a docker container / windows container on Windows 2016 Server just fine with Powershell. But when I try the same with Powershell ISE, I get the error below. PS C:\> ...
0
votes
0answers
47 views

What are the reasons of slow (scrolling) behavior of PowerShell?

I came up with this topic at this question: http://stackoverflow.com/questions/35652644/access-windows-2016-server-container-docker-container-via-gui (see comments). It is true that on some computers ...
0
votes
1answer
76 views

How to run determine current directory as parameter and pass to script activated from context menu

not sure the title is entirely adequate so let me explain a little clearer. I have an existing powershell script which deletes backups of specific file types. What I want to be able to do is right ...
0
votes
2answers
57 views

How to download a file from command line?

I tried wget, powershell and betsadmin, but I can't do it. Can someone help me ? The url (which is a live download link if you click on it in a browser) is: ...
3
votes
1answer
26 views

Merging Scripts…Wrong Type of File-Object (Maybe)?

I have a script that I used very frequently to get a list of files and then process them with ffmpeg, the beginning of which read: $files = Get-ChildItem -Path "Season *\*" -Include *.mp4, *.mkv, ...
0
votes
0answers
47 views

How to close a file opened on some network computer, from another computer on the same network?

In my university, we have a domain network, and all the students have their accounts, and some MBs of network storage, which they can login from any computer on the network. So I work on many ...
0
votes
1answer
69 views

Add-WindowsFeature FS-NFS-Services “the name was not found”

I have a fresh installation of Windows Server 2012 and need to create a NFS share. Using these instructions: PS C:\> Import-Module ServerManager this works ok - I'm returned to the prompt. ...
2
votes
2answers
104 views

Powershell - How to use “remove-item” with multiple wildcard selectors?

I have a folder called "test-folder" which contains alot of files with different types. I want to delete all music files. (mp3, mp4, mpeg ...) I know i can delete all mp3 files like this: ...
1
vote
1answer
77 views

Batch file/alias/powershell to activate/deactivate IE 11 proxy server

I would like to have a batchfile/cmd alias/powershell command to switch the useage of a proxy server in IE11 on and off, so basically to check/uncheck the following settings: ...
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 ...
2
votes
1answer
24 views

Auto Wi-Fi connection on Windows

I am looking on how to connect to a WiFi SSID on Windows OS, but I have not been successful. First of all I tried using windows commands like: netsh connect ssid=SSIDNAME name=PROFILENAME This ...
0
votes
1answer
49 views

PowerShell WMI function call with multiple variable [closed]

I want to call a WMI method which is taking one string as input , one integer as input and one integer as output. Here is the Current Example: $obj=Get-WmiObject -class "class1" -namespace "space1" ...
1
vote
0answers
214 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 ...
0
votes
0answers
35 views

Need python or power shell code that configure the network of a Windows VM without accessing the VM inside

I want to configure the network of a Windows VM, and I want to run script from jump station. Since we have to configured network, initially we don't have IP, so I only configure the network via v ...
0
votes
1answer
38 views

Windows 7: Redirect folder from PowerShell?

Is there a way to redirect a folder using PowerShell on Windows 7? Bonus points for being able to do so as an admin to another account. To be very clear, what I want to do is this. I do NOT want to ...
0
votes
0answers
40 views

How to use powershell script to gather lastbootup time from a list of computers and write results into csv file

I am new to powershell. I need to gather lastbootup time of a list of computers and then write the output into a csv file. pclist.txt contains below contents computer1 computer2 output.txt with ...
3
votes
2answers
374 views

Managing LetsEncrypt Certificate expiration and auto-renewals

I've been experimenting with LetsEncrypt SSL certificates and managed to get certificates set up and installed on Windows for use with IIS using the ACMESharp Powershell library. The process to do ...
0
votes
1answer
74 views

Is there any way to add an HTTP Header to every IE request on a computer?

I would like to add a custom HTTP Header to every Internet Explorer request on a computer (or every browser request). I don't know if this is possible whatsoever, if you have heard of anyway to ...
0
votes
0answers
39 views

Changine Region Formats with powershell

When running get-culture on a remote machine the commandlet does it's job just fine however when I tried "set-culture en-US" it doesn't seem to do anything even when run locally. That's on Windows ...
1
vote
2answers
67 views

How do you add a reference to a program in the Windows command prompt?

When I'm in Visual Studio's command prompt, I can for example use nuget.exe by simply calling: nuget -SomeParameter blabla However, when I call this code in the Windows Powershell or command prompt ...
-1
votes
1answer
31 views

how to run my network configuration script on one VM without having IP

but question is how can we put our script on that VM. or how to copy our script to that VM. because we gonna configure network via script. so is there any way to access the VM without having IP or any ...
1
vote
1answer
53 views

How do I enable both PowerShell Remoting and SPN for SQL Server Reporting?

I have tried this question on Stack Exchange - Database Administrators (http://dba.stackexchange.com/q/129286/51925), but I don't get any responses, so I'll try here. I'm struggling with remoting ...
0
votes
1answer
103 views

A task inside my windows task scheduler will cause my server to stop responding

I have the following AppPoolActivation.ps1 file, to call a URL :- [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} $request = ...
0
votes
1answer
54 views

Will BoxStarter's Install-WindowsUpdate reboot the machine?

I use BoxStarter Install-WindowsUpdate to keep my development machines up to date. I run it from the PowerShell commandline. PS C:\Users\Administrator> Install-WindowsUpdate I think I one time ...
4
votes
1answer
764 views

Convert XML to CSV automatically in Powershell

I've got a few thousand xml files with different formats I'm trying to convert to CSV. I've noticed that in Excel you can open an XML file 'as an XML table', and it will create a schema based on the ...
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
1answer
116 views

Windows task schduler keep showing 0x41301

I have wrote the following .ps1 file:- [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} $request = [System.Net.WebRequest]::Create("https://localhost/") $response = ...
1
vote
1answer
40 views

Powershell window drops off the bottom of the screen

I believe this is due to windows scaling, as I have it on 200% (I have a 4k 13" laptop screen). Are there any settings anywhere I can fiddle with so that it doesn't open with half of it off the ...
1
vote
1answer
115 views

How to Create Local Windows Desktop Service Accounts?

Question: In Windows Home / Professional, (Windows 10), what is the recommended way to create a Local Service Account? Is there any documentation for this? (Powershell, GUI, etc). Clarification: ...
1
vote
1answer
66 views

How can I automatically import a certificate to a Windows GPO?

I'm looking for a way to import a root certificate into a specific active directory group policy object. I've tried certutil -dspublish but that would only publish it to a global AD store. How can I ...
3
votes
2answers
156 views

How can I tell if my batch file is running?

I have a batch script which is run from an AT command, and may get run more than once. When it starts, I need it to detect if it already running, and if so, exit (the second one) immediately. It ...
0
votes
1answer
50 views

Use winexe and powershell to configure some service on a Windows

I'm making a script to configure SNMP on a Windows. This script had to be launched from a Centos OS. I'm quite a zero in Windows scripting so i found a PSscript on the Internet : ...
0
votes
1answer
163 views

Windows 10 Powershell - get-smbserverconfiguration - returns this even though I'm not connected to any servers

I am running a new (not upgrade) installation of Windows 10 Home on a desktop at home. This is my personal computer on an AT&T U-Verse connection that I pay for. When I execute the Powershell ...