Skip to content
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
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
push:
branches: [ main ]
paths-ignore:
- action.yml
- README.md
- LICENSE
- CODEOWNERS
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: smokedlinq/powershell-devops@v0
- uses: powershell-devops/install-module@v1

- name: Install pre-requisites
run: Install-Module Pester -MinimumVersion 5.2.0 -Force
Expand All @@ -43,7 +43,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: smokedlinq/powershell-devops@v0
- uses: powershell-devops/install-module@v1

- name: Publish to PowerShellGallery
run: ./.github/workflows/scripts/publish.ps1
Expand All @@ -63,7 +63,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: smokedlinq/powershell-devops@v0
- uses: powershell-devops/install-module@v0

- name: Unlist from PowerShellGallery
run: ./.github/workflows/scripts/unlist.ps1
109 changes: 2 additions & 107 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,115 +1,10 @@
# powershell-devops

![CI](https://github.com/smokedlinq/powershell-devops/workflows/ci/badge.svg)
![CI](https://github.com/powershell-devops/powershell-devops/workflows/ci/badge.svg)
[![PowerShellGallery](https://img.shields.io/powershellgallery/dt/powershell-devops.svg)](https://www.powershellgallery.com/packages/powershell-devops)

PowerShell module for dealing with commands in Azure DevOps Pipelines and GitHub Workflows.

## GitHub Action

See [action.yml](action.yml) for detailed list of inputs.

Basic:

```yml
steps:
- uses: smokedlinq/powershell-devops@v0
```

Specific version:

```yml
steps:
- uses: smokedlinq/powershell-devops@v0
with:
required-version: 0.0.7
```

Minimum version:

```yml
steps:
- uses: smokedlinq/powershell-devops@v0
with:
minimum-version: 0.0.7
```

Maximum version:

```yml
steps:
- uses: smokedlinq/powershell-devops@v0
with:
maximum-version: 0.0.7
```

## Commands

### Set-EnvironmentVariable

Sets the environment variable for the current process and optionally marks it as a secret.

```powershell
set-env MY_VALUE 'Hello World!'
```

*Note: `set-env` is an alias for `Set-EnvironmentVariable`.*

### Get-EnvironmentVariable

Gets the environment variable for the current process and optionally throws an error if it is not defined.

```powershell
get-env MY_ENV_VALUE -Require
```

*Note: `get-env` is an alias for `Get-EnvironmentVariable`.*

### Add-Path

Prepends the value to the PATH environment.

```powershell
Add-Path $PSScriptRoot
```

### Enter-Group / Exit-Group

Creates an expandable group in the log. Anything you print to the log between the `Enter-Group` and `Exit-Group` commands is nested inside an expandable entry in the log.

```powershell
Enter-Group 'My group'
try {
# .. some other commands ...
} finally {
Exit-Group
}
```

### Utility functions

These functions are helper functions that are used by the module but could also be useful within your script.

#### Test-AdoPipeline

Returns true if running in an Azure DevOps Pipeline, determined by the environment variable `TF_BUILD` having a value.

```powershell
Test-AdoPipeline
```

#### Test-GitHubWorkflow

Returns true if running in a GitHub Workflow, determined by the environment variable `GITHUB_ACTIONS` having a value.

```powershell
Test-GitHubWorkflow
```

## License

The scripts and documentation in this project are released under the [MIT License](LICENSE)

## Contributions

Contributions are welcome!
See [action.yml](/powershell-devops/install-module/action.yml) for more information.
42 changes: 0 additions & 42 deletions action.yml

This file was deleted.