Execute as Script with Parameters doesn't detect parameter if script not opened

Issue #146 new
Former user created an issue

Steps to reproduce: 1. Create the following script:

[CmdletBinding()]
param (
    [Parameter(Mandatory = $true, Position = 0)]
    [string]
    $StringParameter
)

$StringParameter
  1. Right click script in solutions explorer and select "Execute as Script with Parameters" with script open - dialog box includes StringParameter

  2. Close script. Right click in Solution Explorer and select "Execute as Script with Parameters" - dialog box shows only Common Parameters,

Visual Studio 2019 V. 16.1.5

Powershell Tools Version 4.8.2

Name                           Value                                                                                                                                                   
----                           -----                                                                                                                                                   
PSVersion                      5.1.18362.145                                                                                                                                           
PSEdition                      Desktop                                                                                                                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                 
BuildVersion                   10.0.18362.145                                                                                                                                          
CLRVersion                     4.0.30319.42000                                                                                                                                         
WSManStackVersion              3.0                                                                                                                                                     
PSRemotingProtocolVersion      2.3                                                                                                                                                     
SerializationVersion           1.1.0.1         

Comments (0)

  1. Log in to comment