Questions tagged [powershell-7]
19 questions
3
votes
0 answers
Cannot use SSH using Powershell 7
When I am trying to use ssh using powershell 7 it throws and error:
ssh: The term 'ssh' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the…

Adnan Bin Zahir
- 51
- 3
3
votes
1 answer
How to disable suggestion while typing in powershell
While executing commands in PowerShell it's automatically suggesting texts
How can I disable these suggestions and also in future if I want to enable the suggestions how can I do it?

Udesh
- 2,415
- 2
- 22
- 32
2
votes
1 answer
ConvertFrom-Json unpacks arrays with 1 item and behaves oddly with empty object
I am trying to figure out how to stop ConvertFrom-Json from unpacking array types if they have one or zero items.
I have read these related posts:
ConvertTo-JSON an array with a single item
How to prevent ConvertFrom-Json from collapsing nested…

Braiden Cutforth
- 188
- 2
- 7
2
votes
1 answer
How can I get all pipeline elements at a time?
I created this very simple PowerShell script:
using namespace System.IO
[CmdletBinding(SupportsShouldProcess)]
param
(
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)][FileInfo[]]$Files
)
$Files.Length
$Files | Sort-Object…

AxD
- 2,714
- 3
- 31
- 53
1
vote
0 answers
Login Web with Invoke-WebRequest not working
I'm trying to automate a login into a webpage via invokewebrequest.
$urlLogin =…

Daniziz
- 88
- 7
1
vote
1 answer
Set the Location where Update-Help Installs Help Files in PowerShell?
I just installed PowerShell 7 and ran Update-Help -Force -UICulture en-us to install all the help files. This all works well enough, only I then noticed that it installed them in C:/Users//OneDrive/Documents/PowerShell/Help. I do not want the…

LemongrabThree
- 37
- 4
1
vote
0 answers
How to handle System. assemblies that no longer exist in Powershell 6+?
I have a module (Impersonation) written by Joel Bennett that allows me to change the active credentials so that I can access file shares on a remote machine, for example. It works within Windows PowerShell 5.1. But, it does not work in Powershell…

Roman
- 344
- 1
- 6
- 19
1
vote
0 answers
SqlServer PowerShell Core Module - Could not load type 'Microsoft.SqlServer.Server.SqlContext' from assembly 'System.Data, Version 4.0.0.0
I am trying to run a local development environment setup script for my solution that includes the use of the SqlServer module to make changes. It has started failing. When I use the following commands to connect to the default SQL…

Thomas Parikka
- 472
- 5
- 17
0
votes
1 answer
Hash key and value do not compare equally
Why is an integer hash key not an integer? The key is of type KeyCollection even though it was created from a constant integer.
The script to produce this output is below. I will show only the last three (3) command lines. Why is the key not some…

lit
- 14,456
- 10
- 65
- 119
0
votes
0 answers
run .exe as administrator on a vm with Invoke-VMScript Powershell 7
I need to be able to launch command by shell console or powershell having the administrator window in powershell 7.
I have launched several commands with Start-Process but none of them returned the desired value. I was getting back that I needed an…

alex
- 1
0
votes
1 answer
Powershell - Trying to Create Directories of 6 Files Each. Files aren't being Moved
I'm trying to take files in existing sub-directories and create new directories, each containing six files within their current subdirectory. This is for use with a batch analysis tool that can only currently handle six files reliably and can only…

Christopher Gass
- 1
- 1
0
votes
0 answers
Where-Object inside Foreach-object -parallel
I have two datatables $dtA and $dtB. table $dtA contains about 10,000 rows. At any given point in time, table $dtB can have 1 - say 80 rows in it, which are logically linked via key column named dtKeyColumn. I am not able to filter out $dtA inside a…

Amit Singh
- 23
- 5
0
votes
0 answers
Possible cookie problem / access to chart2.php from Powershell v7 in Zabbix v6 LTS
we are using Zabbix version 5 LTS and have reporting through Powershell which, among others, retrieve graphs as PNG files.
Basically, we are authenticating on Zabbix server like this
(we used this, but customized, script:…

goran.q
- 1
- 2
0
votes
0 answers
Prevent PowerShell expression from clearing output
My PowerShell scripts executes towards its end an external executable using Invoke-Expression.
Invoke-Expression "$($config._resguy) $mapname -missing"
However, this clears from the console any previous output. How can I prevent that?

Mat
- 833
- 1
- 5
- 20
0
votes
0 answers
Powershell to Print Duplex Paper of PDF File
(Sorry for my grammar because I used a translator.)
I have tried many solutions searched from this forum as well as from Google to write a PowerShell code for duplex printing of PDF files.
Thank you!
I tried to execute the command "Start-Process…

Học Lê
- 1