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
32 changes: 32 additions & 0 deletions .github/workflows/pull_request_create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Pull Request Create

on:
pull_request:
types:
- opened
- synchronize

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Test-ModuleManifest
run: |
Test-ModuleManifest -Path .\PowerAzPlus\PowerAzPlus.psd1
shell: pwsh

- name: Invoke-ScriptAnalyzer
run: |
$result = Invoke-ScriptAnalyzer -Path .\PowerAzPlus -Recurse -Severity Warning,Error
if ($result.Count -ne 0) { Write-Error $result}
shell: pwsh

- name: Test publish to PowerShell Gallery
run: |
$env:PSGalleryApiKey = "${{ secrets.POWERSHELLGALLERY_API_KEY }}"
Publish-Module -Path ./PowerAzPlus -Repository PSGallery -NuGetApiKey $env:PSGalleryApiKey -WhatIf -Verbose
shell: pwsh
6 changes: 0 additions & 6 deletions .github/workflows/pull_request_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ jobs:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3

# Install PowerShell
- name: Set up PowerShell
uses: actions/setup-pwsh@v2

# Publish the module
- name: Publish module to PowerShell Gallery
run: |
$env:PSGalleryApiKey = "${{ secrets.POWERSHELLGALLERY_API_KEY }}"
Expand Down
6 changes: 3 additions & 3 deletions PowerAzPlus/PowerAzPlus.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PowerAzPlus.psm1'

# Version number of this module.
ModuleVersion = '1.0.0'
ModuleVersion = '1.0.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -95,7 +95,7 @@ PrivateData = @{
PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
# Tags = @()
Tags = @('PSEdition_Desktop', 'PSEdition_Core', 'Windows', 'Linux', 'MacOS')

# A URL to the license for this module.
# LicenseUri = ''
Expand All @@ -107,7 +107,7 @@ PrivateData = @{
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = 'Initial 1.0.0 release.'
ReleaseNotes = 'Initial 1.0.0 release with Help.'

# Prerelease string of this module
# Prerelease = ''
Expand Down
41 changes: 40 additions & 1 deletion PowerAzPlus/PowerAzPlus.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
function Export-LogicAppDefinition {
<#
.SYNOPSIS
Exports the definition of an Azure Logic App to a JSON file.

.DESCRIPTION
The `Export-LogicAppDefinition` function retrieves the definition of a specified Azure Logic App and saves it as a JSON file to the specified file path.
If the `FileName` parameter is not provided, a default name is generated based on the Logic App name and the current date/time.

.PARAMETER Name
Specifies the name of the Logic App to export. This parameter accepts input from the pipeline and by property name.

.PARAMETER FilePath
Specifies the directory path where the exported JSON file will be saved. If not provided, the current working directory is used by default.

.PARAMETER FileName
Specifies the name of the JSON file to be created. If not provided, a name will be generated in the format `<LogicAppName>_<Timestamp>.json`.

.EXAMPLE
Export-LogicAppDefinition -Name "MyLogicApp" -FilePath "C:\Exports" -FileName "MyLogicApp.json"

This example exports the definition of the Logic App named "MyLogicApp" to the file `C:\Exports\MyLogicApp.json`.

.EXAMPLE
Get-AzLogicApp | Export-LogicAppDefinition -FilePath "C:\Exports"

This example exports the definitions of all Logic Apps in the current Azure subscription to the `C:\Exports` directory. File names are automatically generated.

.INPUTS
[string]
Accepts the name of the Logic App as a string input, either through direct parameter input or the pipeline.

.OUTPUTS
[PSCustomObject]
Returns a custom object containing the name of the Logic App and the full path of the exported JSON file.

.LINK
https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-overview
#>

[CmdletBinding()]
param(
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] # ValueFromPipeline and ValueFromPipelineByPropertyName allow processing input objects through the pipeline
Expand Down Expand Up @@ -66,4 +105,4 @@ function Export-LogicAppDefinition {
Write-Warning -Message "No Logic Apps found named $Name. Double check your spelling or current subscription context using Get-AzContext."
}
} # End process lbock
}
}
Loading