pwsh-script icon indicating copy to clipboard operation
pwsh-script copied to clipboard

Demo

Open amis92 opened this issue 4 years ago • 59 comments

There's a slash-command available to try out the action. Simply comment on this issue with /demo in the first line and a PowerShell script in the following lines. If your comment will contain a code-block (fenced or not), contents of it will be executed instead of whole comment body - and it'll look better! :)

For example, comment with:

/demo

```powershell
return (1 + 1)
```

You should get a result (and/or an error) in a comment that will follow.

ℹ Please note, for security $github.token is not available in the demo script. It's available all right in normal action executions. :)

amis92 avatar Jun 11 '20 10:06 amis92

/demo

return (1 + 1)

Workflow run

amis92 avatar Jun 11 '20 11:06 amis92

result output:

2

error output:


github-actions[bot] avatar Jun 11 '20 11:06 github-actions[bot]

/demo

1 + 1 Workflow run

amis92 avatar Jun 11 '20 11:06 amis92

result output:

2

error output:


github-actions[bot] avatar Jun 11 '20 11:06 github-actions[bot]

/demo

$github.repository $github.repository = "changed" $github.repository Workflow run

amis92 avatar Aug 24 '20 17:08 amis92

result output:

[
  "Amadevus/pwsh-script",
  "changed"
]

error output:


github-actions[bot] avatar Aug 24 '20 17:08 github-actions[bot]

/demo

echo $github.actor Workflow run

pberthonneau avatar Feb 17 '21 23:02 pberthonneau

result output:

amis92

error output:


github-actions[bot] avatar Feb 17 '21 23:02 github-actions[bot]

/demo

echo $github.workspace Workflow run

lzinga avatar Apr 04 '21 02:04 lzinga

result output:

/home/runner/work/pwsh-script/pwsh-script

error output:


github-actions[bot] avatar Apr 04 '21 02:04 github-actions[bot]

/demo

Get-Date

Workflow run

AjayKMehta avatar Jul 13 '21 05:07 AjayKMehta

result output:

"2021-07-13T05:36:32.3956555+00:00"

error output:


github-actions[bot] avatar Jul 13 '21 05:07 github-actions[bot]

/demo

Set-ActionOutput testout igottest Workflow run

amis92 avatar Sep 16 '21 16:09 amis92

result output:


error output:


github-actions[bot] avatar Sep 16 '21 16:09 github-actions[bot]

/demo

return (1 + 1)

Workflow run

craigforneris avatar Dec 06 '21 19:12 craigforneris

result output:

2

error output:


github-actions[bot] avatar Dec 06 '21 19:12 github-actions[bot]

/demo Write-Output 'Hi' Workflow run

planetacomputer avatar Jan 08 '22 14:01 planetacomputer

result output:

Hi

error output:


github-actions[bot] avatar Jan 08 '22 14:01 github-actions[bot]

result output:


error output:


github-actions[bot] avatar Apr 03 '22 02:04 github-actions[bot]

/demo Workflow run

Pride7K avatar May 13 '22 23:05 Pride7K

result output:


error output:


github-actions[bot] avatar May 13 '22 23:05 github-actions[bot]

/demo

Set-Culture -CultureInfo pt-BR

Workflow run

Pride7K avatar May 13 '22 23:05 Pride7K

result output:


error output:

The term 'Set-Culture' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

github-actions[bot] avatar May 13 '22 23:05 github-actions[bot]

/demo

Set-Culture -CultureInfo pt-BR

Workflow run

Pride7K avatar May 14 '22 00:05 Pride7K

result output:


error output:

The term 'Set-Culture' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

github-actions[bot] avatar May 14 '22 00:05 github-actions[bot]

/demo

return (1+1)

Workflow run

maniac-en avatar Jun 14 '22 11:06 maniac-en

result output:

2

error output:


github-actions[bot] avatar Jun 14 '22 11:06 github-actions[bot]

/demo

Write-ActionDebug $github.run_number
Write-ActionDebug "Test"

Workflow run

SupremeOverlordTheFirst avatar Oct 14 '22 09:10 SupremeOverlordTheFirst

result output:


error output:


github-actions[bot] avatar Oct 14 '22 09:10 github-actions[bot]

/demo

return ($github.run_number) 

Workflow run

SupremeOverlordTheFirst avatar Oct 14 '22 09:10 SupremeOverlordTheFirst