Questions tagged [powershell-v6.0]

For issues related to the open source PowerShell 6.0

Resources:

  1. github project
  2. PowerShell Documentation
55 questions
16
votes
1 answer

Is it possible to install the PKI module on Powershell Core?

I'd like to use the various commands from Powershell 5's PKI module: $ Get-Command -module PKI CommandType Name Version Source ----------- ---- …
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
12
votes
1 answer

How to troubleshoot the error [The term 'pwsh.exe' is not recognized as the name of a cmdlet, function, script file, or operable program]?

While creating a new pipeline on Azure DevOps to set up a CI for a .NET project, I set up the following PowerShell script to automate the .NET Core setup. Here is the script: $ErrorActionPreference="Stop" $ProgressPreference="SilentlyContinue" #…
Tdl Matias
  • 173
  • 1
  • 2
  • 11
7
votes
2 answers

Is there any New-WebServiceProxy alternative?

I'm trying to consume a SOAP web service at PowerShell 6. I used to do this task with the New-WebServiceProxy command on early versions but no longer exists on PowerShell 6. Is there any similar command?
6
votes
4 answers

Powershell v5.1 Invoke-RestMethod and bypass proxy

I am currently in Powershell V5.1 and would like to bypass Internet Explorer proxy on a Invoke-RestMethod command. In Powershell V6, there is the -NoProxy option that indicates that the cmdlet will not use a proxy to reach the destination. This is…
Philippe
  • 103
  • 1
  • 1
  • 8
6
votes
2 answers

Powershell determine new URL of a permanently moved (redirected) resource

I'm using Powershell Core v6-beta.5 using AppImage on Linux. Is there a way to find out the "new" location of a 301 redirect? Invoke-WebRequest -Method HEAD http://SomethingThatThrows301.com/ -MaximumRedirection 0 throws an error (Response status…
0fnt
  • 8,211
  • 9
  • 45
  • 62
5
votes
5 answers

Why doesn't Console in PowerShell ISE use the latest installed version of PowerShell?

I have recently installed PowerShell 6.2. If I start a PowerShell 6 (x64) command prompt and run $PSVersionTable.PSVersion this is the result Major Minor Patch PreReleaseLabel BuildLabel ----- ----- ----- --------------- ---------- 6 2 …
5
votes
1 answer

What are PowerShell profile locations on Linux?

On Windows, not counting ISE or x86, there are four (4) profile scripts. AllUsersAllHosts @ C:\Program Files\PowerShell\6\profile.ps1 AllUsersCurrentHost @ C:\Program Files\PowerShell\6\Microsoft.PowerShell_profile.ps1 CurrentUserAllHosts @…
lit
  • 14,456
  • 10
  • 65
  • 119
5
votes
2 answers

How to Elevate PowerShell 6.0 to RunAs Admin

Prior to PowerShell 6.0 to elevate your session you ran the command Start-Process powershell -Verb runAs When trying to run the similar command in PowerShell 6.0 Start-Process pwsh -Verb runAs You get this output: Start-Process : The parameter…
Joshua
  • 139
  • 1
  • 7
4
votes
1 answer

Uploading to an Amazon S3 bucket with PowerShell Core

I have a script that works perfectly to upload to an S3 bucket with Windows PowerShell, but it doesn't work with PowerShell Core. According to Amazon, most of the cmdlets that work in one should work in the other. This is the command I'm…
4
votes
0 answers

How do reference a nuget package in a PowerShell 6 module

I installed a package using nuget in PowerShell: PS > install-package gudusoft.gsqlparser -source https://www.nuget.org/api/v2 Which installed DLL in this…
craig
  • 25,664
  • 27
  • 119
  • 205
3
votes
2 answers

PowerShell, Cannot read data file

I have a PowerShell script that reads a register.psd1 file with contents as below. @{ # Building Zig compiler zig = @{ name = "zig" path = ./python/buildzig.py language = "Python" os = "all" } #…
Amani
  • 16,245
  • 29
  • 103
  • 153
3
votes
3 answers

How to start a new PowerShell session from another PS session, and run a CmdLet with splatted Parameters

The Goal: Is to be able to test to see if PowerShell v6 is installed (which is OK), and if it is, then to invoke that shell for certain CmdLets. This will be invoked within a script running in PowerShell v5.1. I cannot shift fully to v6 as there are…
Swinster
  • 99
  • 3
  • 9
3
votes
2 answers

How are differing path separators handled?

I want to write code that run on all PowerShell platforms. The following code generates output with \ path separators on Windows and / path separators on Linux. Get-ChildItem -File -Recurse | ForEach-Object { $_.FullName } I want to exclude files…
lit
  • 14,456
  • 10
  • 65
  • 119
2
votes
1 answer

PowerShell 6.1.3 doesn't recognize any PackageManagement cmdlets

I've installed PowerShell 6.1.3 and I try to run some commands e.g.: Get-PackageProvider or GetPackage and then I get the following errors: Get-PackageProvider : Unhandled Exception - Message:'The type initializer…
agawa17
  • 315
  • 1
  • 3
  • 10
2
votes
0 answers

PowerShell can't "dot source" profile following system cleaning

I have a problem where PowerShell will no longer run my Microsoft.Powershell_profile.ps1/Profile.ps1 script stating it can't "dot source" the file. This started after I ran a registry cleaner and system optimizer on my machine. Now, I can't figure…
Steven Kanberg
  • 6,078
  • 2
  • 16
  • 35
1
2 3 4