Comments (3)
You should be able to configure this in the interpreters config for .ps1
files https://www.puppet.com/docs/bolt/latest/bolt_transports_reference.html#interpreters
from bolt.
@donoghuc I had no idea about this. Thank you!
Is it expected that if a task input_method
is powershell that you cannot define interpreters? If I set this to stdin it actually runs in pwsh.exe instead of powershell.exe.
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
from bolt.
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.
from bolt.
Related Issues (20)
- release bolt version with latest facter HOT 1
- [FR] Ability to set `mode`/`group`[/`owner`] in `write_file()` and `upload_file()` functions
- "custom_facts.rb" fails to launch on some targets if Puppet has been installed on the target using the system package manager
- Can bolt resolve non-forge dependencies in the ``metadata.json``? HOT 1
- Ship bolt packages with updated built in module content
- Declare experimental features as stable
- json schema on forge return 404 HOT 8
- Debian 12 packages are missing
- Please provide Ubuntu 24.04 packages
- Please make the packaging/build pipelines public
- Provide Debian 11 aarch64 packages
- Provide documentation for bolt-server
- Add `file::delete()` function
- apply HOT 1
- unable to use _catch_errors for apply_prep function in puppet plan HOT 3
- Analytics collection is not feasible with some plan functions HOT 1
- Add a way to mock a Puppet/Bolt function while testing a plan with BoltSpec HOT 2
- Puppetdb Client *ALWAYS* uses token header even when cert/key is configured HOT 4
- BoltSpec's `expect_plan()` doesn't match `_catch_error` parameter HOT 3
- Add a way to selectively disable `run_command` & co output to `stdout` on `bolt plan`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bolt.