@@ -15,6 +15,38 @@ Import-Module -Name (
1515}
1616<#
1717. SYNOPSIS
18+ GitHub Actions - Clear File Command
19+ . DESCRIPTION
20+ Clear the file commands.
21+ . PARAMETER Type
22+ Types of the file commands.
23+ . OUTPUTS
24+ [Void]
25+ #>
26+ Function Clear-FileCommand {
27+ [CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_clear-githubactionsfilecommand#Clear-GitHubActionsFileCommand' )]
28+ [OutputType ([Void ])]
29+ Param (
30+ [Parameter (Mandatory = $True , Position = 0 )][Alias (' Types' )][GitHubActionsFileCommandTypes ]$Type
31+ )
32+ If (($Type -band [GitHubActionsFileCommandTypes ]::EnvironmentVariable) -ieq [GitHubActionsFileCommandTypes ]::EnvironmentVariable) {
33+ Remove-Item - LiteralPath $Env: GITHUB_ENV - Confirm:$False - ErrorAction ' Continue'
34+ }
35+ If (($Type -band [GitHubActionsFileCommandTypes ]::Output) -ieq [GitHubActionsFileCommandTypes ]::Output) {
36+ Remove-Item - LiteralPath $Env: GITHUB_OUTPUT - Confirm:$False - ErrorAction ' Continue'
37+ }
38+ If (($Type -band [GitHubActionsFileCommandTypes ]::Path) -ieq [GitHubActionsFileCommandTypes ]::Path) {
39+ Remove-Item - LiteralPath $Env: GITHUB_PATH - Confirm:$False - ErrorAction ' Continue'
40+ }
41+ If (($Type -band [GitHubActionsFileCommandTypes ]::State) -ieq [GitHubActionsFileCommandTypes ]::State) {
42+ Remove-Item - LiteralPath $Env: GITHUB_STATE - Confirm:$False - ErrorAction ' Continue'
43+ }
44+ If (($Type -band [GitHubActionsFileCommandTypes ]::StepSummary) -ieq [GitHubActionsFileCommandTypes ]::StepSummary) {
45+ Remove-Item - LiteralPath $Env: GITHUB_STEP_SUMMARY - Confirm:$False - ErrorAction ' Continue'
46+ }
47+ }
48+ <#
49+ . SYNOPSIS
1850GitHub Actions (Private) - Format Command Parameter Value
1951. DESCRIPTION
2052Format the command parameter value characters that can cause issues.
@@ -60,38 +92,6 @@ Set-Alias -Name 'Format-CommandContent' -Value 'Format-CommandValue' -Option 'Re
6092Set-Alias - Name ' Format-CommandMessage' - Value ' Format-CommandValue' - Option ' ReadOnly' - Scope ' Local'
6193<#
6294. SYNOPSIS
63- GitHub Actions - Remove File Command
64- . DESCRIPTION
65- Remove the file commands.
66- . PARAMETER Type
67- Types of the file commands.
68- . OUTPUTS
69- [Void]
70- #>
71- Function Remove-FileCommand {
72- [CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_remove-githubactionsfilecommand#Remove-GitHubActionsFileCommand' )]
73- [OutputType ([Void ])]
74- Param (
75- [Parameter (Mandatory = $True , Position = 0 )][Alias (' Types' )][GitHubActionsFileCommandTypes ]$Type
76- )
77- If (($Type -band [GitHubActionsFileCommandTypes ]::EnvironmentVariable) -ieq [GitHubActionsFileCommandTypes ]::EnvironmentVariable) {
78- Remove-Item - LiteralPath $Env: GITHUB_ENV - Confirm:$False - ErrorAction ' Continue'
79- }
80- If (($Type -band [GitHubActionsFileCommandTypes ]::Output) -ieq [GitHubActionsFileCommandTypes ]::Output) {
81- Remove-Item - LiteralPath $Env: GITHUB_OUTPUT - Confirm:$False - ErrorAction ' Continue'
82- }
83- If (($Type -band [GitHubActionsFileCommandTypes ]::Path) -ieq [GitHubActionsFileCommandTypes ]::Path) {
84- Remove-Item - LiteralPath $Env: GITHUB_PATH - Confirm:$False - ErrorAction ' Continue'
85- }
86- If (($Type -band [GitHubActionsFileCommandTypes ]::State) -ieq [GitHubActionsFileCommandTypes ]::State) {
87- Remove-Item - LiteralPath $Env: GITHUB_STATE - Confirm:$False - ErrorAction ' Continue'
88- }
89- If (($Type -band [GitHubActionsFileCommandTypes ]::StepSummary) -ieq [GitHubActionsFileCommandTypes ]::StepSummary) {
90- Remove-Item - LiteralPath $Env: GITHUB_STEP_SUMMARY - Confirm:$False - ErrorAction ' Continue'
91- }
92- }
93- <#
94- . SYNOPSIS
9595GitHub Actions - Write Command
9696. DESCRIPTION
9797Write command to communicate with the runner machine.
@@ -163,7 +163,7 @@ Function Write-FileCommand {
163163 }
164164}
165165Export-ModuleMember - Function @ (
166- ' Remove -FileCommand' ,
166+ ' Clear -FileCommand' ,
167167 ' Write-Command' ,
168168 ' Write-FileCommand'
169169)
0 commit comments