How do you pass login info using powershell

Michael Dingas
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 5, 2018

Below is part of the script that I'm running. Note that sometimes the code produces a Word document without a usename/password but more often than not, it generates the page "Not authorized access to this page" HTML output.

The intent of the script is to extract a specific JIRA issue and convert the HTML format to MSWord format. $JiraIssue is determined in other code so I've hardcoded it below as an example.

I would also be most interested if there is a different solution that does not require a username/password.

$JiraIssue = "issue-1"
$JiraIssueFullPath = "http://zeus/8085/si/jira.issueviews:issue-word/$JiraIssue/$JiraIssue"
$wdDocumentFormat = 16
$SavePathObject =C:\MYPATH\MyIssue.doc"
$Word = new-object -comObject "Word.Application"
$Doc = $Word.documents.Open("$JiraIssueFullPath ")
$Doc.SaveAs ([ref] $SavePathObject, [ref] $wdDocumentFormat)
$Word.quit()

 

0 answers

Suggest an answer

Log in or Sign up to answer