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.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
9 views

How to get most recent PDF exported? Recent does not show date information of following: 1. accessed 2. acquired 3. created 4. last saved 5. received

How to get the most recent PDF exported? Recent Files of File Explorer does not show date information for the following: accessed acquired created last saved received I need help to confirm if the ...
panes-rubrics's user avatar
-1 votes
1 answer
32 views

Make new folders in parent directory not in directory where script is located

I have been using this quite successfully until someone messed with the file. So I need to hide the file or move it to a hidden folder. The problem I have is it makes the new folders in the directory ...
Alan-53's user avatar
  • 31
0 votes
0 answers
16 views

Is it possible to run CrystalDiskInfo from the command line/powershell?

I want to be able to run CrystalDiskInfo from the cmd to save and analyze the data. I want to do it in a way where I can automatically run CrystalDiskInfo on a remote device and send commands based on ...
Sasha's user avatar
  • 1
0 votes
1 answer
22 views

Get COM Port (Gertec)

I need to locate "COM Port" of Gertec Device. I tried some things that are just below, I used several other things too and I didn't succeed. Using this instruction it returns me Gertec but ...
Júnior's user avatar
6 votes
1 answer
1k views

DLL file support in PowerShell on Linux

How is it that Microsoft PowerShell is able to install DLL files when installing onto a Linux machine and still work? Is there an interface that is built in by Microsoft that people seem to not know ...
Whitequill Riclo's user avatar
0 votes
2 answers
79 views

Recursive directory rename with subfolder level control

My Challenge: Recursively renaming the 3rd subfolder {subf3} and beyond {subf4, 5, 6, ...} of a root path to keep only the first 4 characters of their original folder name. e:\ {rootf} \ {subf1} \ {...
ElmerF's user avatar
  • 23
0 votes
3 answers
74 views

How to delete all contents of a folder without deleting the folder itself

I am in the process of setting up a shared network drive, that gets emptied periodically. Its purpose is to provide an easy file sharing option for the users. Since I can't enforce them to always ...
fraenzz's user avatar
  • 23
0 votes
1 answer
59 views

How to find public ip address in PowerShell from a restricted internet in windows 11

How to find public ip address of a windows 11 pc using powershell or command prompt. Tried ipconfig and gip(powershell) both of them shows different ip compared to ip from the browser. IPv4 displayed ...
Mcore8x's user avatar
  • 111
0 votes
0 answers
19 views

Trouble in saving edited xml file using powershell script [duplicate]

The following is a xml file content: <?xml version="1.0" encoding="utf-8"?> <Topology> <SERVER1 desc="name of server1"></ICONIS_ONLINE_SERVER1> ...
Mohan's user avatar
  • 1
0 votes
1 answer
36 views

PowerShell start-process -argumentlist: does not work with cmd.exe but works fine with notepad.exe

I'm scripting a .bat file for an event scheduler but I'm having a problem. start-process notepad.exe -argumentlist 'C:\test.bat' -verb runas this works start-process cmd.exe -argumentlist 'C:\test.bat'...
근육질푸키's user avatar
0 votes
2 answers
46 views

How to save the XML file using powershell script

I have an XML file with the below content <?xml version="1.0" encoding="utf-8"?> <Topology> <SERVER1 desc="name of server1"></ICONIS_ONLINE_SERVER1&...
Mohan Reddy's user avatar
2 votes
1 answer
73 views

Windows 11 - Update stuck at "downloading 0%" but able to install using PowerShell

I have a Windows 11 (Pro) - 22H2 (OS Build: 22621.1702, Windows Feature Experience Pack 1000.22641.1000.0), for some reason when I run Windows Update in the Settings screen, the updates would show up ...
Spammy's user avatar
  • 21
0 votes
0 answers
41 views

windows event 4647 occurs randomly - windows server 19

we are facing an issue windows server 2019 event 4647 occurs randomly which shuts down a window service app we have written that use that account. at random times, a 4647 windows event is generated ...
Abdul Ali's user avatar
  • 101
0 votes
1 answer
61 views

Windows 10: ssh-ing to a Linux box and getting full xterm-color capabilities?

At the company where I work, we log in to Windows 10, and we do our development work on Linux machines where we connect via ssh login sessions. We have been able to use PuTTY for this up until ...
HippoMan's user avatar
  • 337
1 vote
2 answers
36 views

How to copy files changed in last 20 days to a different location recusively

I found a code here (on this site) which allows copying of files changed in last 20 days. My issue is that I have a folder with many subfolders and some subfolders could be 8 or more levels deeps. I ...
Mohammed Khawaja's user avatar
0 votes
0 answers
20 views

When a file is uploaded via Edge, can PowerShell Script get source location? [closed]

For Edge browser of Windows 10 Enterprise, is it possible for PowerShell to get upload source location? As an example, folders (such as Desktop) in both OneDrive and Local Computer can have same name; ...
panes-rubrics's user avatar
0 votes
0 answers
26 views

Windows task scheduled powershells script that uses powercfg.exe prevents system from sleeping

Long story short, I have a task scheduled to execute a PS script ever 15 minutes that is checking electricity spot price. When it's higher than I want, it sets powercfg.exe -x -standby-timeout-ac 60 ...
red's user avatar
  • 1,828
0 votes
0 answers
18 views

MS Teams: Created team with PS is not visible in admin.teams portal but is in teams app

I create all our teams in powershell. From the 900 there is 1 with problems. It is visible in: teams app endpoint in powershell with get-team -groupid " " not visible in: admin.teams ...
Wim Janssens's user avatar
1 vote
1 answer
54 views

Removing mail accounts from local Windows users via CLI

I am looking for a way to remove linked mail accounts from a local Windows user via a script from the command line, or another way I can reliably schedule. I'm not talking about a Microsoft account, I'...
Mattia Mele's user avatar
0 votes
1 answer
32 views

Windows 10 Edge not fullsceen on startup [closed]

How can I get PowerShell open browser fullsceen (as if you pressed F11)? I am using a PowerShell script which works fine if I execute, I'm also using a program called Autostart tool to automate the ...
NooBle's user avatar
  • 1
0 votes
0 answers
35 views

Windows 11 on 16 core processor reduces CPU utilization when minimizing python processing console window - WHY?

I have a weird issue when doing long term image processing on my 16 core 24 thread i7 13700k processor, on windows 11 pro. My processing lasts for hours so I fire up several python scripts in ...
Erik Groen's user avatar
0 votes
1 answer
59 views

Automating image compression in Chrome with PowerShell and AutoHotkey

I want to automatically compress images I download through Chrome. As a superuser-in-training, I have tried using PowerShell but need further guidance. Additionally, I almost got AutoHotkey to work ...
JohnTry's user avatar
0 votes
0 answers
42 views

Path of automatic script execution at startup

My McAfee system complains execution of the following command at startup: "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass ./TeamsFirewall.ps1 It invokes ...
GioP's user avatar
  • 33
0 votes
1 answer
63 views

windows equivalent to touch [duplicate]

Is there a Windows equivalent to the touch command?
Isaac's user avatar
  • 45
0 votes
0 answers
55 views

How to add languages for OCR recognition in Windows powertoys?

Hello I am trying to figure out the text extractor function in powertoys. From the internet tutorials, I have installed multiple languages for OCR from Windows powershell and restarted powertoys. ...
234ff's user avatar
  • 101
-3 votes
1 answer
57 views

Hide a folder to prevent user access

I have a folder that contains data and I want to hide just this folder. I have managed to do this by locking, but then lose access to the data. The data needs to be available for program / application ...
Alan-53's user avatar
  • 31
0 votes
1 answer
28 views

Powershell script GPO USER LOGON not working WINDOWS SERVER 2019

I created Powershell script to collect mac address and pc name for all my domain users .. Script run correctly on local machine .. but not working via GP $wmifilter = 'PhysicalAdapter=True AND ...
Mohammed atrash's user avatar
0 votes
1 answer
77 views

Powershell making folders and adding files

I have a poweshell file that makes a folder gives it the name of a chosen year then makes 12 folders inside it and labels them 01 April to 12 March. Something I would like to add is the main folder ...
Alan-53's user avatar
  • 31
0 votes
0 answers
51 views

Mouse Wheel scrolling in Screen session via Command Prompt/Powershell

I want to scroll via Mouse Wheel in a screen session I run in the Command Prompt or Powershell. I already uncommented termcapinfo xterm|xterms|xs|rxvt ti@:te@ in my .screenrc. I can scroll when I use ...
Skyy1337's user avatar
1 vote
2 answers
68 views

Test-Path on multiple computers of an AD

I'm trying to find out how to make a Test-Path against a list of computers via PowerShell and receive a "false" or "true" for each computer. For example, to do something like this: ...
Sergio Yepes's user avatar
0 votes
1 answer
25 views

Keep User Instance Signed-in, Signing back in, if signed out

We have a requirement to have an executable running on a specific user's profile to enable our reports to run for some 3rd party software we use. It's fine if the session is 'disconnected'. Auto-boot ...
Anthony's user avatar
-1 votes
2 answers
73 views

How to show clock and battery info in PowerShell terminal?

In Windows 11 using the regedit HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon=> Shell I replaced the desktop with PowerShell. Now when I boot Windows, I only use ...
Олег Паламарчук's user avatar
-1 votes
0 answers
22 views

EventLog Security

To summarize, my goal is to delete Event 4616 from the Windows Event Viewer, specifically a single event. To clarify, this event is generated whenever the date/time of Windows is changed. I have tried ...
gnam's user avatar
  • 1
0 votes
0 answers
41 views

windows powershell ssh asks how would you like to open file

No idea whats going on but ssh on powershell gives me the following When I choose an option it just says could not open ssh because not supported file type. Can someone explain what is going on here?...
Hao S's user avatar
  • 131
-1 votes
0 answers
33 views

Bluetooth not working after running PowerShell script

I pasted the PowerShell script from this post: Can't Remove Bluetooth Device despite no entry in registry appeared one device called Bluetooth and I selected to remove it. Now I don't have ...
Mihai's user avatar
  • 1
0 votes
0 answers
67 views

Wallpaper change doesn't work after Intune Configuration Profile

Currently we have the problem that we set the background images via Intune (Configuration Profiles). This unfortunately prevents the user from changing them themselves. Now we want to replace the ...
guiwhatsthat's user avatar
0 votes
1 answer
87 views

Unblock-File not working as intended

I have a profile.ps1 script that I need to run, which was created by Conda application. I have unblocked the file by running : Unblock-File -Path .\profile.ps1 The command is executed successfully(I ...
Trevor Philip's user avatar
-1 votes
0 answers
29 views

how to convert wma files to mp3 without pop-ups on windows

I have worked up a clumsy process for converting wma files to mp3. I am using vlc command line. The process works, but keeps popping up a command window per file conversion. here are my steps. ...
James Easterling's user avatar
0 votes
1 answer
42 views

Remove-Appxpackage stuck

Windows 11, trying to uninstall preinstalled Dropbox (DropboxOEM) in Elevated PowerShell session: Get-AppxPackage -All *dropbox* | Remove-AppxPackage -AllUsers It gets stuck. When I close the running ...
sudoer's user avatar
  • 1
1 vote
2 answers
126 views

powershell check VPN connection

I am working on a script to suggest the best vpn server for the client I want to know if the vpn server is now Available through powershell Example: ping my.vpnserver.com if errorlevel 1 echo The VPN ...
user21740892's user avatar
0 votes
2 answers
41 views

How to scroll up in PowerShell inside "screen" command?

I'm using Windows 11 Powershell and inside a screen -d -r command that doesn't let me scroll by default. The text inside the screen is too much to fit inside my actual screen! So I'm looking for a way ...
Peyman's user avatar
  • 323
1 vote
2 answers
42 views

Batch remove irregular suffix from folder names

I have a series of folders named in the following fashion: 11.23 John Smith 12.912 Kate Spade 23.34 Alexander McQueen 22.E01 Michael Kors I want to rename the folder names to just: 11.23 12.912 23.34 ...
AustraliaX's user avatar
0 votes
0 answers
49 views

Can't run Start-Process with RunAsUser from .ps1 file

Wrote a script that copies a .exe file to a folder then tries to run it as another user but the Powershel window just closes without running the .exe. The command that runs it works fine if I run it ...
Sagatobs's user avatar
0 votes
2 answers
46 views

Problems in starting a .ps1 script with the -NoNewWindow parameter

I have this powershell script where I simply set some DNS servers and interface metrics: if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([...
Piero.Sgri's user avatar
0 votes
2 answers
82 views

How to replace the string using Powershell with condition text based

I have the following content in a txt file This is the content of Project server This is the absolute of Project server This is not the content of Project server This is not the absolute content of ...
Mohan Reddy's user avatar
0 votes
0 answers
86 views

"Invalid reference format: repository name must be lowercase" when installing via Docker

I'm trying to install SeaDAS via Docker and this should be the code to enter in the windows PowerShell: docker run -v $HOME/ocssw:/root/ocssw-v $HOME/seadasClientServerShared:/root/...
Riccardo Bentivogli's user avatar
0 votes
1 answer
80 views

How to save vpn password on computer using powershell

This is the code I use Add-VpnConnection -Name 'vpn' -ServerAddress 'vpn.server.com' rasdial 'vpn' 'username' 'password' When the VPN disconnects and reconnects, it asks the client to enter the vpn ...
user21740892's user avatar
0 votes
1 answer
55 views

Regedit key is not found

Powershell: $paths = @( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\PnpLockdownFiles\%SystemRoot%/System32/drivers/3ware.sys" ) foreach($path in $paths) { ...
Bugatti's user avatar
0 votes
1 answer
160 views

How to insert a value inside an XML tag in XML file using a PowerShell script?

I have the following XML: <?xml version="1.0" encoding="utf-8"?> <Topology> <MyProjectserver1 desc="name of the server"></MyProjectserver1> &...
Mohan Reddy's user avatar
0 votes
1 answer
31 views

Exercising clean code

I have a script that if kept on the same line, it'll be quite annoying to edit. But at the point at where I want to break line, I get the error when running, -ApplicationParameter : The term '-...
Zero596's user avatar
  • 81

1
2 3 4 5
111