Questions tagged [powershell-5.0]

For questions specific to Powershell Version 5

PowerShell 5.0 was re-released to web on February 24, 2016, following an initial release with a severe bug. Key features include OneGet PowerShell cmdlets to support Chocolatey's repository-based package management and extending support for switch management to layer 2 network switches.

120 questions
51
votes
8 answers

Powershell to delete all files with a certain file extension

I want to scan a directory (there are no subs) and delete any file with an extension of .avi I tried this syntax, but no errors are thrown, and no files are deleted. This is the code I tried get-childitem 'C:\Users\ramrod\Desktop\Firefly' -include…
user2676140
  • 2,075
  • 7
  • 30
  • 47
48
votes
9 answers

Update Powershell through command line

I want to update a machine's Powershell version. Can this be done through the command line? My present need is to update from PS 4 to PS 5 on a Windows server 2012R2. I guess there is no catch-all solution for all Windows versions and all PS…
LosManos
  • 803
  • 2
  • 9
  • 18
35
votes
1 answer

How to colorize the Powershell prompt?

I always make my prompt to be this color in my linux Then I can find my input in the black command window. But can we make the same color in my Powershell?
yode
  • 683
  • 2
  • 9
  • 19
13
votes
1 answer

Setting window size and position in PowerShell 5 and 6

Problem: We have a large television we use for presentations, that isn't exactly 1920×1080 px. It's off and I can't control it. What I can control is my windows laptop that I connect to it. I have been looking for ways to get whatever I need…
Bewc
  • 318
  • 1
  • 2
  • 8
10
votes
2 answers

filter outputs using select-string pipes

In bash, if I do the following, I will get all the environment variables with wd in them. env | grep "wd" Now, in Powershell, I know I could do get-childitem env:wd* But I want to pipe to select-string as a more generic approach, in order to…
JL Peyret
  • 772
  • 3
  • 15
  • 25
8
votes
1 answer

What does ${$} mean / do in PowerShell?

While learning PowerShell, I executed the command ${$} by mistake and got an output like this: PS C:\Users\myuser> Get-ChildItem Env: | Out-File -FilePath $home\env.txt PS C:\Users\myuser> ${$} $home\env.txt First I believed it was something like…
Allende
  • 253
  • 1
  • 3
  • 9
5
votes
2 answers

Programmatically create machine startup script in local Group Policy: script executes but is not visible in Group Policy Editor

I have managed to programmatically create machine startup Powershell script for Windows 10 Pro and place it in the local Group Policy (see below a powershell script used for creation of startup script). Just to reiterate: I am using local Group…
maoizm
  • 1,043
  • 10
  • 21
5
votes
3 answers

How can I list all members from AD group showing enable and disabled users?

I'm trying get a list of all members from a AD Group showing active \ inactive users. The purpose is get all the members on the groups and list the ones with Admin privileges. I did the following commands: $GROUPNAME = "Domain Admins"…
Marlon
  • 329
  • 3
  • 7
  • 20
4
votes
1 answer

Don't want to display WARNING: ACTIONS REQUIRED: while running powershell script

I have written bitlocker code to backup key after old key has been shared with user. My requirement is that don't want to display WARNING: ACTIONS REQUIRED: while running script $BLV = Get-BitLockerVolume -MountPoint "C:" $KeyProt =…
4
votes
5 answers

PowerShell 64-bit hanging on new machine

I recently got a new computer with plenty of horsepower and its works very fast everywhere except PowerShell. Environment: Dell XPS 8930 (i7-8700K, 32GB RAM, 1TB NVMe SSD) Windows 10 Pro with latest updates (1809/10.0.17763) PowerShell…
3
votes
1 answer

Are Classes defined through P/Invoke not allowed to be executed remotely?

To get it out the way: I understand there are different ways to go about this such as Get-ChildItem. So, I have a custom class I'm defining to get rid of some of the overhead PowerShell cmdlets have, as well as some .Net classes. The function will…
Abraham Zinala
  • 195
  • 2
  • 9
3
votes
1 answer

Run powershell script, as administrator, via batch file with parameter passing

When I run the script, without an administrator, via batch file it passes the parameter, but when I run the script, as an administrator, it does not pass the parameter. I tried the command from the link, but without…
Clamarc
  • 593
  • 1
  • 5
  • 21
3
votes
1 answer

Configure gvim swap, undo, and backup files on windows

I installed vim on windows 10 using chocolatey. When I edit a foo file in powershell, vim leaves behind .foo.un~ or .foo~ files. What are these and how do I stop vim from leaving them around?
Heath Borders
  • 1,210
  • 9
  • 11
3
votes
1 answer

How to get list of CLSIDs along with their associated COM Object names?

Searching for the ways to generate or get the list of CLSIDs, I found this link, that actually does it. But it's rather incomplete in my opinion, the complete list would include CLSIDs with their associated COM Object names, as mentioned in…
3
votes
1 answer

Windows 10 regex. Every occurrence of ci not in the words: associate capacitor cellspacing

Windows 10 64-bit. Powershell 5. Notepad++ v.7 32-bit Regex: Every occurrence of ci not in the words: associate associates associations capacitor cellspacing cig cipher circle circuit circular circumstances cite citi city commercial crucial dcim…
somebadhat
  • 1,172
  • 2
  • 9
  • 24
1
2 3 4 5 6 7 8