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
0
votes
1answer
13 views

How can I get notepad++ highlighting working for powershell using the Twilight theme?

So I got started by manually importing the powershell lexertype from stylers.xml to twilight.xml. I knew to do that much. However after going through and matching the coloring as close as i could to ...
1
vote
0answers
35 views

Monitor used USB bandwidth in Win10

There are a lot of threads here about monitoring usb bandwidth, however none of them helped me, so that I post my problem here (device manager doesn't show me the usb bandwidth...): I have a Lenovo ...
0
votes
3answers
32 views

Regex: Select and Delete everything that is framed in the comments html tags

I have this html code. And I want to select/delete everything that falls between the comments <!-- ARTICOL START --> and <!-- ARTICOL FINAL --> except all those <p class=..</p> ...
0
votes
0answers
16 views

How to list all versions available for an AppxProvisionedPackage

How can I view a list of all available versions for a specific provisioned application such as StickyNotes? I know I want to revert to an earlier version, but i'd like to see a list so that I can ...
0
votes
0answers
9 views

Auditing relevant data and then extracting it

I've turned on (and then off again) auditing on our Fileserver (windows 2012r2) We have about 8 directories that are being written to and have about 50 directories in total. I have added auditing onto ...
0
votes
0answers
9 views

Moving synced files from SharePoint Online to local storage via PowerShell

I have synced a OneDrive library using the OneDrive Client in Windows 10 and it is located in C:\users\user\SP_lib. I want to move certain files and directories from that library into local storage. ...
2
votes
1answer
43 views

How to start powershelll and have it execute something right after?

Say I have in my profile Microsoft.PowersShell_profile.ps1 (like .bashrc): Import-Module posh-git Import-Module oh-my-posh Set-PoshPrompt -Theme half-life but I don't want to execute it in regular ...
0
votes
1answer
41 views

Why might PowerShell in Windows 7 return “ 'Export-WindowsDriver' is not recognised”?

Trying to export Windows 7 drivers using PowerShell as recommended by this YouTube video. I set PowerShell, with the rest of the requisite command, from the search box, after having checked this other ...
1
vote
2answers
17 views

PowerShell equivalent of Unix shell buitin 'type'

When working in a POSIX shell, I can use the builtin type to see how an executable, shell function, builtin, or alias is defined. For instance, I have a shell function box, which will draw an ASCII ...
0
votes
0answers
29 views

On the error prompt of PowerShell prompt

When I open Anaconda PowerShell prompt from the start menu, a red font error prompt appears in the command line interface. Take a look at the picture below: I've spent half a day on the Internet ...
0
votes
2answers
23 views

Unable to install/run any PowerShell packages

I'm receiving the error below anytime I try to install a PowerShell module. Install-Module: The 'Install-Module' command was found in the module 'PowerShellGet', but the module could not be loaded. ...
0
votes
3answers
74 views

Start an app with URI

Windows Apps are in C:\Program Files\WindowsApps. Windows Apps are a particular type of app. Not normal Windows' programs. These are newer programs like Mail, Weather, and Calculator. To start them ...
0
votes
0answers
21 views

AzureAD PowerShell - how to read CountryCode, DistinguishedName, middleName, msExchRecipientDisplayType, msRTCSIP-Line and other attributes

We are syncing on-prem AD to Azure AD using AzureADConnect and need to verify that the following attributes from on-prem AD are syncing successfully. Can you please help with the PowerShell commands, ...
0
votes
1answer
64 views

Access denied by Remove-Item

I am using PowerShell of Windows 10. This might be so basic question. I can't delete the folder by Remove-Item. PS C:\Users\whitebear> Remove-Item MQL_Set. + remove-item MQL_Set + ~~~~~~~~~~~~~~~~~...
0
votes
0answers
17 views

ZScalar 'proceed' with download with wget

I am using PowerShell Invoke-WebRequest (alias wget) to download miniconda. When using the Windows 10 GUI, Zscaler will warn me, but I can still click on the "Continue" button to continue ...
-1
votes
2answers
76 views

Powershell - how do I remove lines exceeding X characters?

I have text files that Powershell works fast on, but only when the lines are reasonably short (under 4,000 characters). If I have text files that have more than 8,000 characters on one line anywhere ...
0
votes
0answers
43 views

Windows 10 WSL over Remote PowerShell or SSH

When logged into a Windows 10 computer directly, WSL-2 works without any issue. I can simply run wsl from PowerShell, both elevated and not elevated. The prompt simply changes to the Linux prompt. ...
1
vote
1answer
25 views

How to rename multiple files by deleting a portion of the File name when the characters are not always the same

I was hoping someone might be able to guide me in what I wish to do. I have found a previous post that showed the following PowerShell statement that has worked wonders for me renaming some files I ...
0
votes
1answer
37 views

How does one set a persistent default PowerShell screen buffer height?

I would like to change the default height of the PowerShell screen buffer in Windows 10. (I have not tried to do this on other Windows versions.) It seems like it ought to be very simple. If I right ...
0
votes
1answer
41 views

Need to make a scrolling marquee type message in Powershell, but can't figure out the code

I need to make a scrolling marquee type message to be displayed in a text box where the message is customizable and can be issued via Powershell script. I've tried and tried to no avail as none...I'...
1
vote
1answer
31 views

Copy first n hex of a file

You can output the first n hex bytes of a file in Linux with xdd (xdd -ps, etc) How would one do this on Windows, though? Is there a way?
0
votes
1answer
35 views

PowerShell : Renaming bulk files but can't find the correct date: LastWriteTime vs CreationTime vs?

Screenshot / List of files with dates I am new to PowerShell. I have been digging around but cant seem to solve this one on my own. Does anyone know how to extract the explorer file date? (The first ...
0
votes
1answer
35 views

PowerShell; confirm text not visible, incorrect colour

I have created a custom PowerShell shortcut I use (to set starting folder and run-as admin), but for some reason some colours have also changed from the default. I managed to fix some of them using ...
0
votes
2answers
47 views

In Powershell, is it possible to define a filename that changes every time the command is run?

For a dissertation Im trying to repeatedly download an XML through an API. It has to be done every hour or three hours for a long period of time. I've found a few ways that I can download something ...
0
votes
1answer
27 views

Why do I need an administrator account to mount a network drive via ssh?

I'm trying to mount a network drive over OpenSSH on Windows 10 (authenticated with username and password of a non-admin user). When I use the net use command (via a PowerShell script) to mount a ...
0
votes
0answers
8 views

Exchange Powershell with administrative account from BASTION forest [migrated]

Does anybody know of a way to get the Exchange Powershell module working when using an admin account over a one-way trust? The Exchange server is located in the USER domain and the administrative ...
0
votes
0answers
15 views

How to force enable ICS (Internet Connection Sharing) on certain adapter, overwriting previous ICS settings in Powershell?

I want to automatically enable Internet Connection Sharing to WSL2 virtual switch. I've already found a similar question answered 9 years ago and have written a PowerShell script accordingly (see ...
0
votes
0answers
27 views

NET::ERR_CERT_COMMON_NAME_INVALID for trusted self signed CA cert

I am trying to create a CA certificate (test.local) which can be trusted internally and from that generate multiple server certificates (***.test.local). However, when serving with these certificates ...
0
votes
0answers
65 views

File not found when attempting to run a scheduled task in windows 10

I am attempting to write a powershell script that schedules another powershell script. Here is the code that I currently have: $Action = New-ScheduledTaskAction -Execute 'pwsh.exe' -Argument '-...
0
votes
1answer
37 views

Win10 Reset App

We use a particular APP on our Win-10 machines and upon occasion, the APP fails to work properly. This is the Xodo App if it matters. To fix this my users select "Advanced options" from ...
-1
votes
0answers
27 views

rename multiple folders each with a different name that is in excel list

I have a folder with many other folders in it. i would like to use powershell to rename every folder in the parent folder a different namee. i have an excel with a list of names in the order i would ...
0
votes
3answers
55 views

Chain Powershell commands in batch file? (Windows)

I am running Powershell commands in a batch file to replace text. This works, but it runs an instance of Powershell every time it replaces something: :: Replace foo1 with bar1 start /wait /min ...
0
votes
1answer
42 views

Properties in windows event ID 41

I want to understand the significance of the values for each property in Windows event Log ID 41. Windows System event ID 41 from source Kernel-Power has the following properties - EventData ...
0
votes
1answer
25 views

How to know which Network Adapter is which Physical Port?

I have a Windows Server Core Server 2019 with 9 Network Adapters, split into 3 network cards: [hypervisor05]: PS C:\Users\administrator\Documents> get-netadapter -physical | ft Name ...
0
votes
0answers
5 views

How to use Get-EventLog, Convert-ToHTML and add a javascript search box to filter entries? [migrated]

To describe what I am trying to do. Note: in the meantime, I use ctrl f which is still way quicker than the Windows event viewer on a slow server. I want to use PowerShell's Get-EventLog (done) ...
0
votes
1answer
31 views

Windows 10 - Run a command when connecting to a device, say, a dock or monitor [Automate]

In Windows 10, is there a way to run cmd/powershell commands automatically when PC is connected to a particular device like a dock? (Like connecting a particular device triggers a command) I want to ...
0
votes
1answer
32 views

Keep only lines in txt files that contain a certain word/character (Powershell) (Windows batch file)

I want to keep only the lines that contain the word example and remove all other lines. I thought this would work but it does the opposite to what I am trying to do: PowerShell -Command "gci *....
0
votes
1answer
44 views

Shell command to delete all files in specific range of folders

I'm working on an upgrade to an application and I need to delete all of the files in several folders so that the the files are regenerated when users login. The file path is Master#(where # is the ...
0
votes
1answer
48 views

Windows Subsystem for Linux has no installed distributions for local administrator

I have successfully installed WSL 2 and Ubuntu on my windows machine. If I start PowerShell and type bash it successfully starts bash. However if I run PowerShell as Administrator and type bash I get ...
0
votes
0answers
15 views

How to run wampserver wamp64 with powershell disabled or blocked?

I am running wampserver wamp64 on Windows on a Hewlett Packard (HP) Enterprise. Our company security policy demands that powershell be disabled or blocked. As a result, only 2 out of 3 services are ...
1
vote
0answers
38 views

What is the difference between “Run as administrator” and “Run as Administrator”?

There are two (2) "Run as administrator" menu items. The one at the bottom has a PowerShell icon. The bottom one can change console properties such as font and colors. However, the top one (...
0
votes
2answers
293 views

Connect remotely for terminal use only (headless) RDP

Using Windows 10 Home or Pro connecting to Microsoft Windows Server 2019 Datacenter for remote desktops and sessions, any way to connect to this only for using PowerShell? I don't need to load all ...
0
votes
1answer
38 views

Powershell syntax highlighting overwrites foreground colour

I'm trying to set the colours of my powershell window. In particular, I often have a few different windows open for different purposes, and I want to use the font colour to easily differentiate ...
1
vote
2answers
44 views

Determine to which PSSession a command belongs to?

Good evening Some PowerShell Commands are available online and on-premise, for example, Get-MailContact Is there a way to recognize if the local Server or e.g. Exchange online is answering the call of ...
1
vote
1answer
110 views

How to get system volume level(audio) in windows?

Using nircmd we can set system volume level(audio) but how to get system volume? How can we get system volume using powershell?
0
votes
1answer
45 views

Possible detection of CVE: 2021-04-23 logged in event viewer (23/04/2021 @15:54:16)

A Possible detection of CVE: 2021-04-23 logged in event viewer (23/04/2021 @15:54:16) I am currently scanning my machine, but will Win Defender be able to remove the infection? Randomly I've been ...
0
votes
0answers
49 views

Could anyone please help me create / edit this powershell script

I would like to reset the wsus service and delete the downloaded updates on selectable one or more hosts up to 200 Hosts. I would like to ping the hosts and export into a file : excel with Online and ...
-1
votes
1answer
36 views

Powershell Error Re: M$ Advice Thread (Windows 10 Start Menu Suddenly very slow. Also Firefox (not other browsers) Fresh 'Reset' of Windows

I had to 'Reset' my Windows and I opted to 'keep my files'. I did Disk Cleanup to remove the old.windows files. Before I had the problem, Windows was extremely snappy and quick even after a year or ...
0
votes
0answers
28 views

Replace Powershell 5.1 with Powershell core 7 [duplicate]

We want to update our powershell version to core 7, but due to old, absurd security rules, we cannot use the MSI. We have set up dotnet 5 successfully using the zip and can now run powershell 7 ...
1
vote
1answer
63 views

How to identify which user triggered task?

I would like to have a Scheduled Task that runs as SYSTEM but is triggered by a user action and is on a delay. That part doesn't seem so hard. The hard part is that I want the (PoSh) script that runs ...

1
2 3 4 5
88