Invoke-NativeApplication
Invoke-NativeApplication copied to clipboard
Errors out in PowerShell 5.1
These functions could be very useful to me. I'm looking forward to using them.
Unfortunately, they failed to work for me completely in PowerShell 5.1:
PS> . .\exec.ps1
PS> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.17763.1852
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.1852
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
PS> exec { .\find.exe }
Write-Verbose : A parameter cannot be found that matches parameter name 'f'.
At C:\Users\DKorobskiy\Workspaces\Scripts\PowerShell\exec.ps1:16 char:79
+ ... se 'Executing native application {0} with parameters: {1}' -f $Script ...
+ ~~
+ CategoryInfo : InvalidArgument: (:) [Write-Verbose], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.WriteVerboseCommand
PS> exec { find.exe }
Write-Verbose : A parameter cannot be found that matches parameter name 'f'.
At C:\Users\DKorobskiy\Workspaces\Scripts\PowerShell\exec.ps1:16 char:79
+ ... se 'Executing native application {0} with parameters: {1}' -f $Script ...
+ ~~
+ CategoryInfo : InvalidArgument: (:) [Write-Verbose], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.WriteVerboseCommand
i think this will be fixed by #7