|
1 | | -# CreatePowerShellModule |
| 1 | +# Create PowerShell Module GitHub Action |
| 2 | + |
| 3 | +This action creates a PowerShell module from source files. |
| 4 | + |
| 5 | +## Inputs |
| 6 | + |
| 7 | +### `ModuleName` |
| 8 | + |
| 9 | +**Required** The name of the PowerShell module. |
| 10 | + |
| 11 | +### `Source` |
| 12 | + |
| 13 | +**Optional** The source directory containing the module (relative to the workspace). |
| 14 | + |
| 15 | +### `Output` |
| 16 | + |
| 17 | +**Optional** TThe output directory for storing the module (relative to the workspace). |
| 18 | + |
| 19 | +### `Imports` |
| 20 | + |
| 21 | +**Required** Comma-separated list of import folders. |
| 22 | + |
| 23 | +### `Debug` |
| 24 | + |
| 25 | +**Optional** Enable debug mode. The default is `false``. |
| 26 | + |
| 27 | +## Example usage |
| 28 | + |
| 29 | +```yaml |
| 30 | +name: Build PowerShell Module |
| 31 | + |
| 32 | +on: |
| 33 | + push: |
| 34 | + branches: |
| 35 | + - main |
| 36 | + pull_request: |
| 37 | + branches: |
| 38 | + - main |
| 39 | + |
| 40 | +jobs: |
| 41 | + build: |
| 42 | + runs-on: windows-latest |
| 43 | + |
| 44 | + steps: |
| 45 | + - name: Checkout repository |
| 46 | + uses: actions/checkout@v2 |
| 47 | + with: |
| 48 | + path: MySuperModule # Custom path for the checkout |
| 49 | + |
| 50 | + - name: Download PowerShell Manifest |
| 51 | + uses: actions/download-artifact@v2 |
| 52 | + with: |
| 53 | + name: your-module-manifest |
| 54 | + path: ${{ github.workspace }}/artifacts/your-module |
| 55 | + |
| 56 | + - name: Build PowerShell Module |
| 57 | + uses: your-username/your-repo@v1 # Replace with your repository details |
| 58 | + with: |
| 59 | + ModuleName: 'your-module' |
| 60 | + Source: 'MySuperModule' # Use the custom path here |
| 61 | + Imports: 'folder1,folder2' |
| 62 | + Debug: 'true' |
| 63 | + |
| 64 | + - name: Upload PowerShell Module |
| 65 | + uses: actions/upload-artifact@v2 |
| 66 | + with: |
| 67 | + name: your-module-output |
| 68 | + path: ${{ github.workspace }}/output |
0 commit comments