Questions tagged [powershell-7.0]

21 questions
7
votes
1 answer

How to get GPU usage and GPU memory info of a process by powershell7

I have tried Get-Process and Get-CimInstance Win32_Process to get GPU usage and GPU memory, but both of them can't offer those information. In Windows Task Manager, it can show GPU memory. So, is there a way to get those in powershell
bin381
  • 173
5
votes
2 answers

Does F7 not work in Powershell 7 to show command history?

In Powershell 5.1, one could press F7 and a history of previous entered commands would show up. I just intalled Powershell 7.2 and F7 no longer does anything. F8 still autocompletes based on command history though.
geronimo
  • 153
3
votes
1 answer

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 -Colors @{ Command = "`e[30;107m" Comment…
cicciodevoto
  • 133
  • 3
2
votes
0 answers

Powershell 7 takes 5 seconds to load when there is ANYTHING in the profile

I noticed recently that my powershell 7 prompt takes 5 seconds to load if I have literally anything in my profile. At first I thought it might be my starship prompt but it turns out that it is caused by literally anything being in my profile. If I…
fishman
  • 21
2
votes
1 answer

Powershell 7 can't install modules, have to do it manually (Save-Module)

I recently installed Powershell 7.3.5, being "forced" to move away from 5.1 for PnP / SharepointPnP As an admin, while running it as an admin, regardless of the scope returns : Install-Package: Administrator rights are required to install…
2
votes
1 answer

Set Powershell Predictive Intellisense Off by default

I'm using Powershell 7.3.3 in Windows 11 and the Predictive Intellisense feature is on by default unless I turn it off manually each time I use it. Is there any way to turn it off (or back on) permanently without setting it each time?
Rich
  • 445
2
votes
1 answer

How to let pwsh (powershell 7) use windows terminal color scheme?

I have installed powershell 7, basically pwsh.exe. When I launch powershell 7 inside Windows Terminal App, it uses Windows Terminal Color Theme profile. But when I launch pwsh.exe separately, it doesn't use the color theme, instead it's using the…
sgon00
  • 1,335
1
vote
1 answer

Powershell $env:path changing depending on how it is opened (PowerToys Run)?

I recently started using PowerToys Run and I've noticed that I can no longer use some commands when launching Powershell (7.2.6) via PTR vs just running it out of the start menu. Turns out, my $env:path is different depending on which way I launch…
1
vote
0 answers

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 (and running as the logged in user) cannot. What is the…
lit
  • 909
1
vote
1 answer

Console history single command length limit

I've come to notice, that long multi line commands are not logged to the ConsoleHost_history.txt in PowerShell 7 (unlike in PowerShell 5). How can I change this?
1
vote
1 answer

Windows 10 2004 using powershell-7.0 to update help files

On Windows 10 v2004, within PowerShell 7.0.3 x64, I don't know why it's showing the resource as unavailable: PS > Update-help -UICulture en-US Update-Help: Failed to update Help for the module(s) 'ConfigDefender, PSReadline,…
shirish
  • 499
0
votes
0 answers

Invoke-PnPTenantTemplate -Verbose will raise this error "Acquiring oAuth token for permission scope Group.ReadWrite.All. Access token acquired"

I have 2 office 365 tenants (Source & Destination). I used this command to get the Source communication site template inside my PowerShell 7.0 version 7.3.4:- PS C:\Users\mohan> Connect-PnPOnline -Url "https://source.sharepoint.com/sites/PPM-test/"…
0
votes
0 answers

Having Trouble Upgrading Powershell to 7

People recommend the following command to upgrade Powershell from 5 to 7: winget install --id Microsoft.Powershell --source winget It did not work on my home computer or my work computer (both running Win 11). Current Powershell Versions and info…
0
votes
1 answer

Using "restart-computer" Cmdlet for remote computers using SSH

I want to reboot several computers remotely using PowerShell and wait until the reboot is completed, before continuing the script. I've stumbled across the "restart-computer" cmdlet and its "wait" switch parameter. Sadly, it seems like it's only…
0
votes
1 answer

Why sfc does not run in Windows PowerShell 7.2.7?

PowerShell 7.2.7 sfc /verifyonly Windows Resource Protection could not start the repair service. No problem with running sfc under PowerShell 5 of from cmd.exe
1
2