Skip to content

Invoke-WebRequest -OutFile "" strange behaviour on windows #19043

@CarloToso

Description

@CarloToso

Prerequisites

Steps to reproduce

Invoke-WebRequest "https://example.com" -Method GET -OutFile ''
--> No error, no outfile

Invoke-WebRequest "https://example.com" -Method GET -OutFile ' '
--> Error

Same behaviour in PS5 and PS7

Expected behavior

Both or none should throw an error

Actual behavior

The two commands have different behaviours

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.2
PSEdition                      Core
GitCommitId                    7.3.2
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-FixedThe issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions