Closed GitMensch closed 3 years ago
I wasn't able to reproduce the issue on Visual Studio 2019
and Visual Studio 2017
images. Here is some of the tests: https://ci.appveyor.com/project/FeodorFitsner/simple-console/builds/39903719
There could be some changes into PowerShell environment during the build. Could you, perhaps, do a simple repro in a public repository?
Just rechecked, that was running on PS Core, possibly this is the reason?
I've checked with PS Core and it worked as well. Did it work for you with Windows PowerShell?
To tests that I've used a working environment and added the following in appveyor.yml:
on_success:
- pwsh: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
Result in all environments of that build with
image:
- Visual Studio 2015
- Visual Studio 2017
Is the message above, it does work in the VS2019 image (while it previously also worked in the older ones).
What do we do with this information now?
Try using ps
instead of pwsh
for RDP script.
OK, ps
is "Powershell" and pwsh
is "Powershell Core". The script works with both in the VS2019 image but for the others only in "Powershell".
So I assume that the cmdlet Get-NetIPAddress
was added later and the two "older" images have an older version of ps-core that does not support this.
Options:
What do you think?
Actually, all examples in RDP KB use ps
prefix. Indeed, VS 2015 and VS 2017 images have outdated PS Core, so use ps
which guaranteed has that cmdlet.
Hm, would the default workers used for public repos work with $nonat
set? In this case #3692 would solve it.
$nonat
is never set by build workers (I'm not even sure why that variable was introduced at all, maybe for BYOC scenarios), so that fix won't help to the fact that pre 7.x PS Core does not have Get-NetIPAddress
cmdlet.
The idea was to set $nonat, if this would work. Guess it wouldn't...
per https://www.appveyor.com/docs/how-to/rdp-to-build-worker/ I've added
To my build config for failures, it is actually downloaded and executed (as it was before) but now fails to execute:
So either the documentation needs an update or the script... or both.