PSVersion 7.3.10
PSEdition Core
GitCommitId 7.3.10
OS Microsoft Windows 10.0.20348
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Incorrectly tries to do the ipsec route in Windows PS7, which has PSEdition = Core. Adding -or logic. I have submitted a pull request to address PS7 Core.
Does not properly detect the correct subscription in some circumstances. I was getting this output:
Sign-in successful.
Selecting subscription 'd8392f63-30b0-4d4f-9ebb-xxxxxx'...
Subscription selected.
Loading virtual network 'vnet-sql-mi-subscriber' in resource group 'sqlmi-repl-rg'.
Virtual network vnet-sql-mi-subscriber cannot be found.
The subscription string after "Selecting subscription" was the correct and inteded subscription, and yet, it was not finding the virtual network. It was not dropping into the Write-Host "Switching subscription ... block. To solve, outside of the cmdlet, I had to use connect-azaccount and set-azsubscription to set the correct subscription (to the correct and intended subscription that is not the first in my long list of subscriptions). Then, the cmdlet proceeded on. Unclear why this is happening, perhaps a cached version? Perhaps this cmdlet should manually force connect-azaccount.
This powershell script is critical to https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/point-to-site-p2s-configure?view=azuresql#attach-a-vpn-gateway-to-a-virtual-network
Two issues to report in PS7
PS C:\Users\wiassaf> $PSVersionTable
Name Value
PSVersion 7.3.10 PSEdition Core GitCommitId 7.3.10 OS Microsoft Windows 10.0.20348 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0
ipsec
route in Windows PS7, which has PSEdition =Core
. Adding-or
logic. I have submitted a pull request to address PS7 Core.The subscription string after "Selecting subscription" was the correct and inteded subscription, and yet, it was not finding the virtual network. It was not dropping into the
Write-Host "Switching subscription ...
block. To solve, outside of the cmdlet, I had to useconnect-azaccount
andset-azsubscription
to set the correct subscription (to the correct and intended subscription that is not the first in my long list of subscriptions). Then, the cmdlet proceeded on. Unclear why this is happening, perhaps a cached version? Perhaps this cmdlet should manually forceconnect-azaccount
.