-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare RestSetAcls for PowerShellGallery publish (#218)
* Add github actions * Add psd1 file * Rework file structure for publishing * Fix dev build tools
- Loading branch information
1 parent
c3a04a1
commit 557bd6c
Showing
18 changed files
with
415 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Test RestSetAcls | ||
on: | ||
push: | ||
paths: | ||
- ".github/workflows/RestSetAcls.yml" | ||
- "RestSetAcls/**" | ||
pull_request: | ||
paths: | ||
- ".github/workflows/RestSetAcls.yml" | ||
- "RestSetAcls/**" | ||
|
||
jobs: | ||
pester-test: | ||
name: Pester test | ||
runs-on: windows-latest | ||
defaults: | ||
run: | ||
working-directory: .\RestSetAcls | ||
shell: pwsh | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Run all Pester tests | ||
run: | | ||
.\init.ps1 | ||
.\test.ps1 | ||
Check-manifest: | ||
name: Check .psd1 manifest file | ||
runs-on: windows-latest | ||
defaults: | ||
run: | ||
working-directory: .\RestSetAcls | ||
shell: pwsh | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Check .psd1 file with Test-ModuleManifest | ||
run: | | ||
.\init.ps1 | ||
.\check-manifest.ps1 | ||
lint-with-PSScriptAnalyzer: | ||
name: Install and run PSScriptAnalyzer | ||
runs-on: windows-latest | ||
defaults: | ||
run: | ||
working-directory: .\RestSetAcls | ||
shell: pwsh | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Lint with PSScriptAnalyzer | ||
run: | | ||
.\init.ps1 | ||
.\lint.ps1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
# | ||
# Module manifest for module 'RestSetAcls' | ||
# | ||
# Generated by: Microsoft Corporation | ||
# | ||
# Generated on: 5/8/2024 | ||
# | ||
|
||
@{ | ||
|
||
# Script module or binary module file associated with this manifest. | ||
RootModule = 'RestSetAcls.psm1' | ||
|
||
# Version number of this module. | ||
ModuleVersion = '0.1.1' | ||
|
||
# Supported PSEditions | ||
# CompatiblePSEditions = @() | ||
|
||
# ID used to uniquely identify this module | ||
GUID = '1b9ea644-06b1-47d4-8da4-f8758a43fc49' | ||
|
||
# Author of this module | ||
Author = 'Microsoft Corporation' | ||
|
||
# Company or vendor of this module | ||
CompanyName = 'Microsoft Corporation' | ||
|
||
# Copyright statement for this module | ||
Copyright = '(c) Microsoft Corporation. All rights reserved.' | ||
|
||
# Description of the functionality provided by this module | ||
Description = 'Set file permissions on an Azure Files share using REST API' | ||
|
||
# Minimum version of the PowerShell engine required by this module | ||
PowerShellVersion = '5.1' | ||
|
||
# Name of the PowerShell host required by this module | ||
# PowerShellHostName = '' | ||
|
||
# Minimum version of the PowerShell host required by this module | ||
# PowerShellHostVersion = '' | ||
|
||
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. | ||
# DotNetFrameworkVersion = '' | ||
|
||
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. | ||
# ClrVersion = '' | ||
|
||
# Processor architecture (None, X86, Amd64) required by this module | ||
# ProcessorArchitecture = '' | ||
|
||
# Modules that must be imported into the global environment prior to importing this module | ||
RequiredModules = @( | ||
@{ | ||
ModuleName = "Az.Storage" | ||
GUID = "dfa9e4ea-1407-446d-9111-79122977ab20" | ||
ModuleVersion = "6.0.0" | ||
} | ||
) | ||
|
||
# Assemblies that must be loaded prior to importing this module | ||
# RequiredAssemblies = @() | ||
|
||
# Script files (.ps1) that are run in the caller's environment prior to importing this module. | ||
# ScriptsToProcess = @() | ||
|
||
# Type files (.ps1xml) to be loaded when importing this module | ||
# TypesToProcess = @() | ||
|
||
# Format files (.ps1xml) to be loaded when importing this module | ||
# FormatsToProcess = @() | ||
|
||
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess | ||
# NestedModules = @() | ||
|
||
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. | ||
FunctionsToExport = @( | ||
"Set-AzureFilesAclRecursive" | ||
) | ||
|
||
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. | ||
CmdletsToExport = @() | ||
|
||
# Variables to export from this module | ||
VariablesToExport = '*' | ||
|
||
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. | ||
AliasesToExport = @() | ||
|
||
# DSC resources to export from this module | ||
# DscResourcesToExport = @() | ||
|
||
# List of all modules packaged with this module | ||
# ModuleList = @() | ||
|
||
# List of all files packaged with this module | ||
# FileList = @() | ||
|
||
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. | ||
PrivateData = @{ | ||
|
||
PSData = @{ | ||
|
||
# Tags applied to this module. These help with module discovery in online galleries. | ||
# See: https://learn.microsoft.com/en-us/powershell/gallery/concepts/publishing-guidelines?view=powershellget-3.x#tag-your-package-with-the-compatible-pseditions-and-platforms | ||
Tags = @( | ||
"Azure", | ||
"Storage", | ||
"ACL", | ||
"PSEdition_Desktop", # Packages that are compatible with Windows PowerShell | ||
"PSEdition_Core", # Packages that are compatible with PowerShell 6 and higher | ||
"Windows" # Packages that are compatible with the Windows Operating System | ||
) | ||
|
||
# A URL to the license for this module. | ||
LicenseUri = 'https://raw.githubusercontent.com/Azure-Samples/azure-files-samples/master/LICENSE.md' | ||
|
||
# A URL to the main website for this project. | ||
ProjectUri = 'https://github.com/Azure-Samples/azure-files-samples' | ||
|
||
# A URL to an icon representing this module. | ||
# IconUri = '' | ||
|
||
# ReleaseNotes of this module | ||
# ReleaseNotes = '' | ||
|
||
# Prerelease string of this module | ||
# Prerelease = '' | ||
|
||
# Flag to indicate whether the module requires explicit user acceptance for install/update/save | ||
# RequireLicenseAcceptance = $false | ||
|
||
# External dependent modules of this module | ||
# ExternalModuleDependencies = @() | ||
|
||
} # End of PSData hashtable | ||
|
||
} # End of PrivateData hashtable | ||
|
||
# HelpInfo URI of this module | ||
# HelpInfoURI = '' | ||
|
||
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. | ||
# DefaultCommandPrefix = '' | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This file lists out development requirements for the module. | ||
# For the runtime requirements, see the module manifest. | ||
@{ | ||
PSDependOptions = @{ | ||
Target = 'bin\Dependencies' | ||
Install = $true | ||
AddToPath = $true | ||
} | ||
|
||
Pester = 'latest' | ||
PSScriptAnalyzer = 'latest' | ||
'Az.Storage' = '6.0.0' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Test-ModuleManifest -Path $PSScriptRoot\RestSetAcls\RestSetAcls.psd1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Write-Host "Checking if PSDepend is installed" -ForegroundColor White | ||
$installed = $null -ne (Get-Module PSDepend -ListAvailable) | ||
|
||
if ($installed) { | ||
Write-Host "Already installed" | ||
} else { | ||
Write-Host "Not installed" | ||
Write-Host "`nInstalling PSDepend" -ForegroundColor White | ||
Install-Module -Name PSDepend -Repository PSGallery -Force | ||
Write-Host "Done" | ||
} | ||
|
||
Write-Host "`nInstalling build dependencies" -ForegroundColor White | ||
Invoke-PSDepend -Path $PSScriptRoot\build.depend.psd1 -Force | ||
Write-Host "Done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Invoke-ScriptAnalyzer -Path $PSScriptRoot\RestSetAcls -Severity Warning -Recurse -Outvariable issues | ||
$errors = $issues.Where({$_.Severity -eq 'Error'}) | ||
$warnings = $issues.Where({$_.Severity -eq 'Warning'}) | ||
if ($errors) { | ||
Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total." -ErrorAction Stop | ||
} else { | ||
Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total." | ||
} |
Oops, something went wrong.