I want to download a specific file ("Web/Externals/Settings.txt") in a folder(which is not having git) from my bit bucket repository "TestRepository" with branch name "TestBranch".
Please suggest
Note: I need the file as it is.
function CheckOutDevFile($userName, $password, $CheckOutFilePath, $RepoUrl){ $userNamePaswords = "$($userName):$($password)" $encodedCredentials = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($userNamePaswords)) $authorization = "Basic $encodedCredentials" $Headers = @{ Authorization = $authorization } Invoke-RestMethod -Headers $Headers $RepoUrl -OutFile $CheckOutFilePath}$userName = 'Your User name'$password = 'Your password'$CheckOutFilePath = 'Your out put location with file name'$RepoUrl = 'https://{CompanyRepoUrl}/projects/{PojectName}/repos/{RepoName}/raw/{SpecificFilePath}?at=refs/heads/{BranchName}'CheckOutDevFile $userName $password $CheckOutFilePath $RepoUrl
I have tried that and I get the following error:
Invoke-RestMethod : Unable to connect to the remote server
It looks like you're new here. Sign in or register to get started.