All Questions
Tagged with windows-10 powershell
860
questions
67
votes
2
answers
70k
views
How do you create a new symlink in windows 10 using powershell (not mklink.exe)?
If there's docs on it, I'll take that. Any web searches for "symlink" "symbolic link" "windows [10]" "powershell" returns everything except the base command.
Even the powershell docs site returns ...
1
vote
2
answers
5k
views
Script to disable/enable PnP Device using InstanceID's - but the ID's change upon reboot
I have a working script to disable 4 usb joysticks using their respective InstanceID's
$pnpIds = 'HID\VID_0079&PID_0006\7&1699A0E&198&0000', 'HID\VID_0079&PID_0006\7&5438EB5&...
0
votes
0
answers
2k
views
How can I gracefully stop the Windows Search service via console?
I use the following PowerShell cmdlets to stop the Windows Search service:
Set-Service -Name WSearch -StartupType Disabled
Stop-Service -Name WSearch
But if I do that while the Windows Search service ...
2
votes
2
answers
5k
views
PowerShell Get-Appx -AllUsers fails with "The trust relationship between this workstation and the primary domain failed
I am trying to list all Appx packages on a domestic Win 10 laptop with Powershell (with a view to completely removing many of them to create space in C:\Program Files\WindowsApps) but when I try to ...
2
votes
2
answers
2k
views
Why are Windows Terminal and PowerShell so very inefficient compared to cmd.exe, and how to make them fast?
I run PHP CLI on Windows 10. I have installed Windows Terminal via winget. For several reasons, I have long tried to switch from using cmd.exe to using either PowerShell or Windows Terminal for my PHP ...
1
vote
2
answers
2k
views
RunOnce key which starts elevated .ps1 file
so for few days I'm working on the automation script in powershell which starts elevated -> changes pc name -> creates the RunOnce reg file with this line as Value (program changes it ...
1
vote
0
answers
2k
views
Export all trusted certificates on Windows from the command line as PEM or DER
I need to export all trusted certificates with certutil from the following stores:
My
Root
Trust
CA
AuthRoot
However I have trouble understanding the documentation and I am not an expert with ...
0
votes
2
answers
3k
views
What is the equivalent PowerShell command for 'Network Reset' UI option on Windows 10?
There's an option on the network settings called "Network Reset" that allows the admin of the device to "Reset" all network configs, is there an equivalent for this but done via ...
2
votes
1
answer
2k
views
Change performance & mouse settings via powershell (Show windows contents while dragging)
I have a Powershell script that lets me workaround most of the annoyances with my VDI/Virtual Machine, which resets every morning - it opens all the apps I need, the directories, tools, etc... but ...
1
vote
0
answers
127
views
Program, run as admin, can't write log file to folder with admin-only ACLs
I have a folder set up on all of our computers for random log files, configs, etc., deployed with the following PowerShell:
#Create directory if it does not already exist
$path = "C:\Wagner"
...
1
vote
1
answer
15k
views
Uninstall "Microsoft Edge Update" permanently
There are three programs related to Microsoft Edge that come installed by default in Windows 11:
Microsoft Edge
Microsoft Edge WebView
Microsoft Edge Update
– I was able to uninstall Microsoft ...
0
votes
0
answers
469
views
"scoop" package manager can't install anything (or I think something's wrong with making secure connections)
I usually use scoop to manage my various packages on Windows. I haven't updated in a while but I recently tried to install an application via scoop and it gave me the following error:
Unable to read ...
5
votes
4
answers
37k
views
Launch powershell as admin when double click on ps1 file
I have read How to open a file for editing in Administrator mode?
I have a .ps1 file which needs to run as administrator. I'm happy to have it that when I double click on any .ps1 file, powershell ...
14
votes
5
answers
13k
views
Clear Screen in PowerShell and Command Line without erasing everything
In using the clear command, the screen clears. Totally. I no longer have access to any of the stuff that was previously on the screen at all.
Is there a way to "clear" the screen (i.e. make ...
0
votes
0
answers
164
views
Windows 10 Scheduled Task Powershell Script Unable to Turn off Monitors
I'm pretty inexperienced when it comes to Windows scripting (I have a linux background), but I attempted to create a Windows version of a udev rule anyway. I cobbled together pieces from various ...
0
votes
1
answer
2k
views
Unable to install Oh-my-posh
I have been following the tutorial in https://ohmyposh.dev/docs/installation/windows so I can get my nice Oh-My-Posh as I've always had. They seem to have changed from installing a module to a ...
1
vote
1
answer
1k
views
'Get-Service' fails to list *all* services due to one causing an issue
As a "normal" UAC-elevated user (i.e. member of the BUILTIN\Administrators alias, but not .\Administrator), how can I list all services using Get-Service and sidestep the issue described ...
1
vote
1
answer
4k
views
Automatic input of user credentials for 802.1X authentication on Windows 10 via registry
I want to automate the configuration settings which are needed in our 802.1X environment. For this I need to pass user credentials.
Therefore I want to build a small GUI which expects the user ...
19
votes
4
answers
76k
views
How do I replace the system shell (explorer.exe) with another process in Windows 10?
This is for Windows 10.
Is there a way to replace explorer.exe with, for example, a powershell script?
I'm looking to start a custom shell application without having to have explorer.exe run in ...
1
vote
2
answers
10k
views
Cannot reinstall Calculator: Microsoft.UI.Xaml.2.0 missing
I managed to screw something up and now Calculator on Windows 10 Pro won't open. It still shows up as an app when I search in the start menu, but is not listed under "Apps and features".
I've tried ...
1
vote
0
answers
182
views
PowerShell start not complete
PowerShell
td;dr PowerShell runs only as Admin
symptome
if I run PowerShell.exe it runs until window is open then stops and just shows:
Windows PowerShell
Copyright (C) Microsoft Corporation. Alle ...
0
votes
2
answers
5k
views
How to create a new PowerShell project from Visual Studio?
How do I install a workload for Visual Studio to work with PowerShell?
From the console:
PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32> code --help
code : The term 'code' is not recognized as ...
3
votes
2
answers
6k
views
Powershell - How to scroll through the output using a keyboard?
I am using Windows 10 - PowerShell to connect to some VPS over ssh.
How can I scroll up/down through the screen buffer (I have 6000 height set in Screen Buffer Size) using only keyboard.
I've already ...
0
votes
0
answers
146
views
Disallow standard Users from generating Resultant Set of Policy data
how to restrict users to see Rsop data
such as
gpresult /r /x
and all data in group policy managements
i mean i want users can't see any Rsop data
i want if users opened group policy managements or ...
5
votes
1
answer
1k
views
Why do I get duplicate network interfaces?
While troubleshooting connectivity issues on my PC, I noticed that I have duplicate of every network interface when issuing Get-NetIPInterface command on PowerShell.
Notice how each interface has a ...
1
vote
2
answers
126
views
Trying to colour code the output of tracert within powershell - not working as expected
I'm trying to colour the lines green, yellow and red within powershell depending on the latency in milliseconds. Our remote workflow dictates that anything over 40ms is bad, so I want this to be ...
4
votes
2
answers
1k
views
Is it possible to modify the WinKey + X menu in Windows 10?
This question is related to codewario's comment on his anwser to this question. I have installed version 7 of PowerShell, and I would like this version to be invoked when clicking on the "Windows ...
0
votes
0
answers
235
views
Apply policy to non-administrative users using PowerShell
I have disable the use of removable media to non-administrator users using MMC console to apply a local policy and setting Removable Disks: Deny read access for non-administrators.
I'd like to set ...
1
vote
1
answer
8k
views
How to know the bluetooth verion in my laptop by CMD or PowerShell
As this answer, I know how to find the version of my built-in Bluetooth device. But could we just by CMD or PowerShell do know such information?
2
votes
1
answer
2k
views
Change color of PowerShell 7 Get-ChildItem result
I am using PowerShell 7 as terminal in PyCharm and the default colors for the commands were not really clear.
I created a profile.ps1 where I set them in this way:
# Set colours
Set-PSReadLineOption -...