-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to write task in Pwsh 7+ #3234
Comments
You should be able to configure this in the interpreters config for |
@donoghuc I had no idea about this. Thank you! Is it expected that if a task Reproduction: bolt-project.yaml: ---
name: bolt_pwsh_task
modules: [] inventory: config:
local:
interpreters:
".ps1": "C:\\Program Files\\PowerShell\\7\\pwsh.exe" working but no named parameters tasks/init.json: {
"input_method": "stdin",
"parameters": {
"name": {
"description": "Name of user to run command",
"type": "String"
}
}
} always powershell.exe but working named params tasks/init.json: {
"input_method": "powershell",
"parameters": {
"name": {
"description": "Name of user to run command",
"type": "String"
}
}
} tasks/init.ps1: #!/usr/bin/env pwsh
[CmdletBinding()]
param (
[Parameter()]
[string]
$name
)
Write-Host "PSEdition = $($PSEdition)"
$PSVersionTable
Write-Host "Name = $($Name)" Appears to be intentional to not allow overriding bolt/lib/bolt/shell/powershell.rb Lines 273 to 289 in 6ff6505
bolt/lib/bolt/shell/powershell.rb Lines 170 to 179 in 6ff6505
|
I'm closing because I found much more success using Plans + Script Task. I think it's a bit weird powershell.exe is forced on windows, for non-windows management pwsh is great. |
Use Case
The ability to use Pwsh 7 for Bolt Tasks.
Describe the Solution You Would Like
input_type="pwsh" maybe?
Describe Alternatives You've Considered
Using a plan or powershell to call pwsh.
The text was updated successfully, but these errors were encountered: