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"
#…
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?
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…
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…
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 …
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 @…
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…
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…
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…
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"
}
#…
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…
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…
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…
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…