Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [powershell]

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.

1
vote
0answers
6 views

Mount-DiskImage not recognized cmdlet

Here on Win 7 64x I'm trying to mount an ISO using PowerShell. I have tried several versions of syntax, but they all failed. PowerShell Mount-DiskImage -ImagePath "C:\Users\win7\Desktop\IsoFiles\...
0
votes
0answers
9 views

Start-BitsTransfer - “Cannot find path … because it does not exist” with different credentials to local host

I am typing the following command in a PowerShell prompt: Start-BitsTransfer -Source "\\serverA\c$\test.txt" -Destination . -TransferType Download -cred (get-credential) After typing the credentials ...
0
votes
1answer
18 views

How do I set Windows PowerShell ISE default theme?

Whenever I change the theme in the PowerShell ISE options on Windows 10 to Light on Light it doesn't keep it when I restart, it goes back to the default Dark on Light. How can I set/force Light on ...
0
votes
0answers
18 views

Turn off Win10 display(s) via OpenSSH

There are a lot of solutions to turn off display locally on a Windows10 machine. They all are some form of the following SendMessage line. There's also little executables like nircmd that do this. ...
-1
votes
2answers
41 views

Can't delete file named '…' [duplicate]

For some background, I'm on Windows 10 however with the files I'm going to talk about I've used them in shared folders with Ubuntu VMs before. In a folder on my machine, there is a file named '...' I ...
0
votes
1answer
15 views

How to get the Handle of a specific explorer window in powershell

I'm following this tutorial here: https://blogs.technet.microsoft.com/heyscriptingguy/2015/12/26/weekend-scripter-manage-window-placement-by-using-pinvoke/ They use the code (Get-Process -Name ...
0
votes
2answers
27 views

Setting explorer size in windows using the Custom Set-Window Script in Powershell

I'm trying to use the script given in this answer Setting window size and position in PowerShell 5 and 6 to set the height and size of multiple windows explorer windows. Not the internet explroer.. ...
0
votes
0answers
32 views

Supplementary Multilingual Plane and Windows console

Given this file: U+10480 OSMANYA LETTER ALEF 𐒀 Does any version of Windows have a way to output this correctly via the console (command line)? I have tried with: Windows 10 Windows 8.1 ...
-6
votes
0answers
30 views

Need a powershell script to run [on hold]

I have a .csv file(excel format) which has a column of different applications and each application is assigned with date and their respective cycle number.Usually,eenter image description hereach ...
1
vote
3answers
73 views

Delete content of folders with same name in different subdirectories

I am using Windows 10. I have many same named folders (suppose the name "data") in different subdirectories of a base directory (here "d:\dir"). How can I delete the content (containing only files) ...
1
vote
0answers
41 views

Switching Between Cellular & WiFi [on hold]

I have a device with Cellular & WiFi, but I prefer the Cellular to be my first prior connection and WiFi as secondary. So I need a script which can trigger whenever Cellular is not able to ping ...
0
votes
1answer
26 views

How to use BitsTransfer to download a file from a remote host with domain authentication

I need to be able to download a file from a server (running windows Server 2008 r2) to my client windows 10 computer over a network that uses domain authentication (I will need to provide credentials ...
0
votes
1answer
24 views

How to toggle Win10 bluetooth off and on at startup

I have a Win10 laptop that I move back and forth between home and work. I use identical-but-separate bluetooth mice at each location. Each time I switch locations (and thus switch bluetooth mice), I ...
0
votes
1answer
44 views

Remove all comments and comments block in a Word-Document (.docx) using PowerShell

Is there any way to remove all comments including the comments block in a Word-Document (.docx) using PowerShell? Illustration:
0
votes
1answer
26 views

Powershell Invoke-WebRequest with Method Head allocate too much RAM

Problem found on server with Powershell v 4.0 (server with Powershell 5.1 they do not seem affected by the same problem) This a strange behavior of Invoke-WebRequest command. Take this example: For ...
0
votes
0answers
37 views

Powershell to set default browser

I created a process using PowerShell to install Chrome. What I am looking to do now is to have PowerShell change the registry for the computer and change the default browser to Chrome. I would ...
1
vote
2answers
39 views

Retrieve printer driver version with Powershell PrintManagement cmdlets?

The version numbers in the gui look like 10.0.17134.1 and 3.0.8.0 but their equivalents (?) from the Get-PrinterDriver-cmdlet look at least cryptic: Get-PrinterDriver | Select-Object Name, ...
0
votes
1answer
25 views

How to hide PsExec cmd?

I'm starting the PsExec using Powershell: Start-Process -FilePath "psexec.exe" -ArgumentList "-u user -p pass -accepteula -i -h cmd /c `"powershell.exe -NonInteractive -File myscript.ps1`"" But the ...
0
votes
0answers
16 views

Powershell: open task manager and select PID

I want to monitor the resources used by a script. Is it possible to have it open task manager and preselect its own line in the details tab?
0
votes
0answers
21 views

How to properly specify arguments Start-Process in PowerShell?

I've got this code: $cmdPath = "$PSScriptRoot\letsencrypt\letsencrypt.exe" $cmdArgList = @( "-R" ) Start-Process -FilePath $cmdPath -ArgumentList $cmdArgList -Wait -Verb runAs -PassThru -...
0
votes
1answer
42 views

PsExec treats second remote computer in list as a program name

PsExec behaves very strangely when run on a specific server When I use PsExec to run a program on multiple remote machines in most cases, it works perfectly fine. When I run the same command on one ...
0
votes
0answers
50 views

Random PowerShell scripts in Windows Temp [on hold]

I noticed recently that Sysmon logs an event Powershell creating a file in Windows Temp folder. For example, this is the name of PS Script: C:\\Windows\\Temp\\xgyxfpqs.ilw.ps1 I would like to know ...
0
votes
1answer
48 views

ArchLinux on a virtual Hard Drive - Will creating a desktop install on my real computer or the virtual one?

I have this command for powershell on windows to run arch Linux in QEMU: .\qemu-system-x86_64 -boot d -cdrom E:\archlinux.iso -m 3G -hda linuxMint.img -drive format=raw,file=E:\Data It loads up ...
0
votes
1answer
27 views

Open firefox on top of everything with PowerShell

I´m running two scripts. . C:\path/Set-Window.ps1 Start-Process -FilePath 'C:/Program Files/Mozilla Firefox/firefox.exe' -ArgumentList https://stackoverflow.com Start-Sleep -Seconds 0 Set-Window -...
2
votes
1answer
279 views

New PowerShell as a user with administrator rights

I want to open a new powershell.exe as a user but with the administrator rights (this user is already added to administrator group). To open new powershell.exe as user, I used this command: runas /...
0
votes
2answers
75 views

How to I export filenames, filepath and properties of a directory tree to CSV?

I have a hard drive full of backups that I need to detail on a spreadsheet quickly and in the following specific way. I'm hoping there's an easy way to do what i need via some sort of .bat or .cmd ...
0
votes
0answers
26 views

“open windows powershell” not working from windows 10 file explorer

Not sure what happened, but when I open windows 10 file explorer and goto the menu: File->Open Windows PowerShell->Open Windows Powershell Then it doesn't do anything. Meaning it doesn't ...
0
votes
1answer
30 views

Powershell disable devices in BIOS

I'm looking for a solution which can be applied in Bios on a HP-Device. The Script should disable: WLAN, Bluetooth, Webcam and the microfone. That's what I tried so far:
0
votes
0answers
33 views

Powershell script runs manually in task scheduler but not as schedule task

I installed the PS Scripts on my virtaul machine. My VM is connected to a domain account i have one service account provided. Right now my script is running manually. But when im waiting for the time ...
0
votes
0answers
46 views

PowerShell script running manually but is not as scheduled task

I have a generic PS script that takes screenshots. Basically, it takes a screenshot of the screen and saves it in a folder. It runs fine and takes and saves the ss without problems when activated ...
1
vote
0answers
21 views

Can I get the selected files from an explorer window using powershell?

In Applescript it's pretty easy to get the selected files in a Finder window. tell application "Finder" set finderSelList to selection as alias list end tell Is there an equivalent in Powershell? ...
0
votes
1answer
28 views

Stop openssh from changing window title

I generally have several powershell windows open, with SSH sessions into different remote hosts. It can become a pain easily finding the window I want, so attempted to set the powershell window title ...
2
votes
1answer
59 views

Removing 3D Builder in Windows 10

I type this in PowerShell running as administrator to remove 3D Builder: C:\Windows\System32>get-appxpackage *3dbuilder* | remove-appxpackage It works fine, but how can I write the line in a ...
0
votes
1answer
42 views

How to automate registration of a scheduled task through GPO using PowerShell?

I can manually run the following cmdlet on 10 nodes in AD to register a scheduled task: Register-ScheduledTask ` -TaskName "MyTask" ` -Action $inlinePowershellScript ` -Trigger $...
0
votes
1answer
50 views

Where may setting about last opened window style be stored?

I make an app with Nativefier, and I want it to open minimized on start. Unfortunately, not all app honor the requested style, so either using PowerShell command Start-Process -WindowStyle Minimized ...
0
votes
1answer
76 views

Powershell: compare and match specific part of filename

I have something want to use Powershell to write. Could anyone know it? Thanks. I use powershell to create a list. e.g. $SUID = @("0011", "0012", "0013", "0014", "0015") I have a folder containing ...
0
votes
1answer
31 views

Problems connecting a Windows 10 box to an AS/400 share and getting it to run a batch file

A few weeks ago we had an Windows XP box connected to an AS/400 network share mapped to drive P://. Batch files could be run from a remote call command from the 400. The batch files were called with a ...
0
votes
0answers
83 views

Show a list when a choice is made [migrated]

I'm trying to work around a script Under Windows.Form and I'm a little bit stuck. I'd like to be able a specific list appears depending on the choice made from the first list, which means that at the ...
2
votes
2answers
139 views

Run a program and log to both screen and file in real time

I've written a very simple python program (in reality my program is a lot more complex): from time import sleep for i in range(10): print(i) sleep(1) to print the digits 0-9, 1 each second ...
0
votes
0answers
20 views

PowerCLI Get VMs those fit some conditions

I'm trying to get our some Linux distros from vCenter by using PowerCLI. But I don't want to get Appliance VMs. So I have 2 different successful PowerCLI scripts those can find these machines. I want ...
0
votes
0answers
25 views

Invoke-comand - long executing time

I am working on the powershell script that will remotely turn on/off specific firewall rule on remote machine in local subnet. Here is the code: $pc="PC1" if (Test-Connection -ComputerName $pc -Count ...
2
votes
1answer
50 views

Powershell, pipe list of arguments to a command

I am working on a powershell v3 script to create users in Active Directory. I'm using the new-ADUser comlet for that. I want to execute one command to create the user and set all the options in one ...
-1
votes
0answers
22 views

Can I specify an application that isn't currently installed for a firewall rule?

Essentially, We deploy machines to clients. I want to know if I can pass through a firewall rule for a program that isn't currently installed. At the moment, my preparation script does not work unless ...
0
votes
1answer
99 views

Script on Ending Process according to memory consumption windows 10

I am looking for a batch or powershell script that if memory used by a process is less than 10 MB end that process and restart it.I tried searching a lot,but i could not find a ultimate solution. ...
2
votes
2answers
132 views

PowerShell Email with Text Input

I'm trying to write a script that will throw up four text input boxes and save their entered values into four variables, each representing Username, Phone PIN, Voicemail PIN and Phone extension - Once ...
1
vote
0answers
55 views

how best to locate openssh credentials for powershell script run by SYSTEM

I've got a powershell script in the form $commands = @" echo "1 + 2" | bc "@ $commands | ssh user@1.2.3.4 Right now what I'm doing is setting up ssh keys once ahead of time, but the problem is ...
0
votes
1answer
29 views

Enable NUMLOCK when computer wakes for sleep mode using Task Scheduler

I am from the Netherlands so apologies for my English in advance! I am doing everything that is mentioned in this post:click this link. The Powershell script works because when I go to the file and I ...
0
votes
0answers
57 views

Powershell command: resetting a counter for naming files

I have a thousand jpg file in a folder. I use the following command to name these files as: file-0, file-1, file-2, file-3, .... Dir | %{Rename-Item $_ -NewName ("file-{0}.jpg" -f $nr++)} However, ...
2
votes
1answer
34 views

Is there a Way to Print the Session in PowerShell to a .txt?

We are doing a lot of things in PowerShell in networking and in basic servers and our instructor is having us copy and paste sessions in PowerShell into a .txt file. This is well and fine, but is ...
1
vote
1answer
36 views

PowerShell commands not recognized when called from VisualStudio 2017

I've written a function called Deploy-App which our developers use inside VisualStudio 2017 in Build Events > Post-build event command line to publish their application to a network share. I've ...