Skip to content

CLI: -STA and -MTA are mistaken for a -File parameter value #4350

Closed

Description

Note: -STA and -MTA are not supported in Core, but for consistency with Windows PowerShell, they should still be recognized, and either an error or a warning should be reported.

Here you can see that checking for -STA and -MTA is simply bypassed in Core.

Steps to reproduce

powershell -sta

Expected behavior

An error or a warning about how -STA and -MTA are not supported in PowerShell Core.

Actual behavior

-sta is misinterpreted as an (implied) -File parameter value; an error message is reported, and the session is exited.

The argument '-sta' to the -File parameter does not exist. Provide the path to an existing '.ps1' file as an argument to the -File parameter.

Environment data

PowerShell Core v6.0.0-beta.4 on macOS 10.12.5
PowerShell Core v6.0.0-beta.4 on Ubuntu 16.04.2 LTS
PowerShell Core v6.0.0-beta.4 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)

Activity

  1. changed the title [-]CLI: -STA and -MTA are mistaken for a -File argument[/-] [+]CLI: -STA and -MTA are mistaken for a -File parameter value[/+] on Jul 26, 2017
  2. SteveL-MSFT commented on Jul 26, 2017

    @SteveL-MSFT
    Member

    Agree that we should error out so that existing Windows PowerShell scripts fail more gracefully

  3. removed
    Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors
    on Aug 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions