Skip to content

Commit

Permalink
Merge pull request #5636 from kc284/master
Browse files Browse the repository at this point in the history
CA-392930: Fixed exception handling which prevents connection
  • Loading branch information
kc284 authored May 17, 2024
2 parents c6ec81b + 88f0b83 commit 011b286
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
5 changes: 4 additions & 1 deletion ocaml/sdk-gen/powershell/autogen/src/Connect-XenServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ protected override void ProcessRecord()
}
catch (WebException e)
{
if (e.InnerException?.InnerException is CertificateValidationException ex)
var inner = e.InnerException?.InnerException ?? //.NET case
e.InnerException; //.NET Framework case

if (inner is CertificateValidationException ex)
{
if (ShouldContinue(ex.Message, ex.Caption))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"profiles": {
"PS-51": {
"commandName": "Executable",
"executablePath": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"commandLineArgs": "-NoLogo -NoExit -Command \"Import-Module '.\\XenServerPowerShell.dll'\"",
"workingDirectory": "$(OutDir)"
},
"PS-7": {
"commandName": "Executable",
"executablePath": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
"commandLineArgs": "-NoLogo -NoExit -Command \"Import-Module '.\\XenServerPowerShell.dll'\"",
"workingDirectory": "$(OutDir)"
}
}
}
12 changes: 0 additions & 12 deletions ocaml/sdk-gen/powershell/autogen/src/XenServerPowerShell.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@
<!-- This propety ensures all DLLs are placed in `bin/` at compile time -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)|$(OS)' == 'Debug|AnyCPU|Windows_NT' And '$(TargetFramework)' == 'net6.0'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<StartAction>Program</StartAction>
<StartProgram>C:\Program Files\PowerShell\7\pwsh.exe</StartProgram>
<StartArguments>-NoLogo -NoExit -Command "Import-Module '.\XenServerPowerShell.dll'"</StartArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)|$(OS)' == 'Debug|AnyCPU|Windows_NT' And '$(TargetFramework)' == 'net45'">
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<StartAction>Program</StartAction>
<StartProgram>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</StartProgram>
<StartArguments>-NoLogo -NoExit -Command "Import-Module '.\XenServerPowerShell.dll'"</StartArguments>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="System.Management.Automation" Version="7.4.1" />
</ItemGroup>
Expand Down

0 comments on commit 011b286

Please sign in to comment.