From c36a135a24ad17087e63c386491d7a6c7a8f4c90 Mon Sep 17 00:00:00 2001 From: Maxime Kjaer Date: Tue, 5 Nov 2024 20:01:48 -0800 Subject: [PATCH] RestSetAcls v0.1.2 (#240) * Fix type of storage context for compatibility with newer Az.Storage * Fix contributing instructions * Add publishing instructions * Bump RestSetAcls to 0.1.2 --- RestSetAcls/CONTRIBUTING.md | 35 +++++++++++++++++++----- RestSetAcls/RestSetAcls/RestSetAcls.psd1 | 2 +- RestSetAcls/RestSetAcls/RestSetAcls.psm1 | 6 ++-- RestSetAcls/publish-psgallery.ps1 | 1 + 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/RestSetAcls/CONTRIBUTING.md b/RestSetAcls/CONTRIBUTING.md index 20200060..f1dca3b4 100644 --- a/RestSetAcls/CONTRIBUTING.md +++ b/RestSetAcls/CONTRIBUTING.md @@ -4,21 +4,42 @@ > These instructions are only meant for contributors to this project. > If you want to use the script, refer to the README. +## Installing development dependencies + +```powershell +.\init.ps1 +``` + ## Running unit tests -1. Install Pester. You should use Pester 5.x or later. +```powershell +.\test.ps1 +``` - ```powershell - Install-Module -Name Pester -Force - ``` +## Publishing the module locally + +This is a useful test before publishing to the PSGallery. + +```powershell +.\publish-local.ps1 + +Install-Module RestSetAcls -Repository LocalRepo +Uninstall-Module RestSetAcls + +.\unpublish-local.ps1 +``` + +## Publishing the module to the PSGallery -2. Run the tests +1. Bump the version in `RestSetAcls.psd1`. +1. Get your API key from the [PowerShell Gallery](https://www.powershellgallery.com/account/apikeys). +1. Run the following command: ```powershell - .\test.ps1 + .\publish-psgallery.ps1 -apiKey "" ``` -## Setting up a test run +## Setting up an E2E test run 1. Create a new Azure Storage account with a file share. Take note of the storage account key. 1. Define the following in your PowerShell session: diff --git a/RestSetAcls/RestSetAcls/RestSetAcls.psd1 b/RestSetAcls/RestSetAcls/RestSetAcls.psd1 index bceec8d1..f4552828 100644 --- a/RestSetAcls/RestSetAcls/RestSetAcls.psd1 +++ b/RestSetAcls/RestSetAcls/RestSetAcls.psd1 @@ -12,7 +12,7 @@ RootModule = 'RestSetAcls.psm1' # Version number of this module. -ModuleVersion = '0.1.1' +ModuleVersion = '0.1.2' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/RestSetAcls/RestSetAcls/RestSetAcls.psm1 b/RestSetAcls/RestSetAcls/RestSetAcls.psm1 index 552f9b37..d14fe582 100644 --- a/RestSetAcls/RestSetAcls/RestSetAcls.psm1 +++ b/RestSetAcls/RestSetAcls/RestSetAcls.psm1 @@ -172,7 +172,7 @@ function Get-AzureFilesRecursive { [Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel.AzureStorageBase[]]$DirectoryContents, [Parameter(Mandatory=$true)] - [Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext]$Context, + [Microsoft.Azure.Commands.Common.Authentication.Abstractions.IStorageContext]$Context, [Parameter(Mandatory=$false)] [string]$DirectoryPath = "", @@ -222,7 +222,7 @@ function New-AzureFilePermission { [OutputType([string])] param ( [Parameter(Mandatory=$true, HelpMessage="Azure storage context")] - [Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext]$Context, + [Microsoft.Azure.Commands.Common.Authentication.Abstractions.IStorageContext]$Context, [Parameter(Mandatory=$true, HelpMessage="Name of the file share")] [string]$FileShareName, @@ -325,7 +325,7 @@ function Set-AzureFilesAclRecursive { [CmdletBinding()] param ( [Parameter(Mandatory=$true)] - [Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext]$Context, + [Microsoft.Azure.Commands.Common.Authentication.Abstractions.IStorageContext]$Context, [Parameter(Mandatory=$true)] [string]$FileShareName, diff --git a/RestSetAcls/publish-psgallery.ps1 b/RestSetAcls/publish-psgallery.ps1 index cecb7668..aa930fd4 100644 --- a/RestSetAcls/publish-psgallery.ps1 +++ b/RestSetAcls/publish-psgallery.ps1 @@ -12,3 +12,4 @@ Write-Host # This will also run Test-ModuleManifest Write-Host "Publishing" -ForegroundColor White Publish-Module -Path $PSScriptRoot\RestSetAcls -NuGetApiKey $apiKey -WhatIf:$WhatIfPreference +Write-Host "Done" -ForegroundColor Green \ No newline at end of file