Skip to content

Commit

Permalink
RestSetAcls v0.1.2 (#240)
Browse files Browse the repository at this point in the history
* Fix type of storage context for compatibility with newer Az.Storage

* Fix contributing instructions

* Add publishing instructions

* Bump RestSetAcls to 0.1.2
  • Loading branch information
MaximeKjaer authored Nov 6, 2024
1 parent 988271b commit c36a135
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 11 deletions.
35 changes: 28 additions & 7 deletions RestSetAcls/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<api-key>"
```
## 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:
Expand Down
2 changes: 1 addition & 1 deletion RestSetAcls/RestSetAcls/RestSetAcls.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'RestSetAcls.psm1'

# Version number of this module.
ModuleVersion = '0.1.1'
ModuleVersion = '0.1.2'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
6 changes: 3 additions & 3 deletions RestSetAcls/RestSetAcls/RestSetAcls.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "",
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions RestSetAcls/publish-psgallery.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c36a135

Please sign in to comment.