Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ private Uri CheckProtocol(Uri uri)

private string QualifyFilePath(string path)
{
string resolvedFilePath = PathUtils.ResolveFilePath(path, this, false);
string resolvedFilePath = PathUtils.ResolveFilePath(filePath: path, command: this, isLiteralPath: true);
return resolvedFilePath;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ function ExecuteRequestWithOutFile {
)

$result = [PSObject]@{Output = $null; Error = $null}
$filePath = Join-Path $TestDrive ((Get-Random).ToString() + ".txt")
# We use '[outfile1]' in the file name to check that OutFile parameter is literal path
$filePath = Join-Path $TestDrive ((Get-Random).ToString() + "[outfile1].txt")
try {
if ($cmdletName -eq "Invoke-WebRequest") {
Invoke-WebRequest -Uri $uri -OutFile $filePath
} else {
Invoke-RestMethod -Uri $uri -OutFile $filePath
}
$result.Output = Get-Content $filePath -Raw -ErrorAction SilentlyContinue
$result.Output = Get-Content -LiteralPath $filePath -Raw -ErrorAction SilentlyContinue
} catch {
$result.Error = $_
} finally {
Expand Down