Skip to content
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

Refactoring powershell task #12

Merged
merged 2 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Tasks/powershell/runcommand.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
param(
[Parameter()]
[string]$command
)

# We are adding this file as an additional layer
# between the devbox.yaml file invoking this task
# and the actual execution of the command.
# The main goal is to ensure we do any additional
# I/O and security checks here ahead of running
# the command on the metal.
iex $command
9 changes: 9 additions & 0 deletions Tasks/powershell/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This is a simple powershell command execution task for Dev Box.

name: powershell
command: ".\\runcommand.ps1 {{command}}"
inputs:
command:
type: string
defaultValue: ""
required: true
6 changes: 0 additions & 6 deletions powershell/Powershell.ps1

This file was deleted.

7 changes: 0 additions & 7 deletions powershell/task.yaml

This file was deleted.