AtlassianPS / JiraPS

PowerShell module to interact with Atlassian JIRA
https://AtlassianPS.org/module/JiraPS
MIT License
323 stars 131 forks source link

Support for Centos 7? #347

Closed raymix closed 5 years ago

raymix commented 5 years ago

Context

Module imports on Centos, but most commands don't work

Description

It does not matter which command I use, there is no feedback on success or error. I have followed basic commands from documentation, it works perfectly fine on Windows PowerShell, but not on Centos PowerShell Core. I don't have Ubuntu box available to test PWSH, but I was under impression that the purpose of PowerShell Core was cross platform support, apparently there are some differences?

PS /root> Get-JiraServerInfo
PS /root> Get-JiraSession
PS /root> Get-JiraConfigServer
https://support.xxxx.com
PS /root>
PS /root> get-module -ListAvailable -Name JiraPS

    Directory: /usr/local/share/powershell/Modules

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     2.10.3     JiraPS                              {Add-JiraFilterPermission, Add-JiraGroupMember, Add-JiraIssueAttachm...

PS /root>

Additional Information

EDIT: After some digging in source code I noticed some private functions are using Invoke-Webrequest, I have tried to run it manually and it throws me an SSL error, it goes away if I use skip cert switch and request finishes successfully. I am having trouble finding a way to ignore error without customising JiraPS scripts or even import our CA into PWSH. Any ideas? Could this be the culprit?


Invoke-WebRequest : The remote certificate is invalid according to the validation procedure.
At line:1 char:1
+ Invoke-WebRequest "https://support.xxxx.com"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (Method: GET, Reques\u2026PowerShell/6.2.0
}:HttpRequestMessage) [Invoke-WebRequest], HttpRequestException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
lipkau commented 5 years ago

Please try

$PSDefaultParameterValues["Invoke-WebRequest:SkipCertificateCheck"] = $true
raymix commented 5 years ago

@lipkau Thank you, that works great. I have also added $isLinux check so the same script now works well across both Win and Linux platforms