Skip to content

Commit

Permalink
Format all RestSetAcls code
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximeKjaer committed Dec 13, 2024
1 parent eb880aa commit d6cb31f
Show file tree
Hide file tree
Showing 7 changed files with 218 additions and 198 deletions.
23 changes: 14 additions & 9 deletions RestSetAcls/RestSetAcls/PrintUtils.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function Ask([Parameter(Mandatory=$false)][string] $question)
{
function Ask([Parameter(Mandatory = $false)][string] $question) {
while ($true) {
$yn = Read-Host "${question} [Y/n]"
$yn = $yn.Trim().ToLower()
if ($yn -eq 'n') {
return $false
} elseif ($yn -eq '' -or $yn -eq 'y') {
}
elseif ($yn -eq '' -or $yn -eq 'y') {
return $true
}
Write-Host "Invalid answer '$yn'. Answer with either 'y' or 'n'" -ForegroundColor Red
Expand Down Expand Up @@ -35,7 +35,8 @@ function Write-DoneHeader {
if (Get-SpecialCharactersPrintable) {
$checkmark = [System.Char]::ConvertFromUtf32([System.Convert]::ToInt32("2713", 16))
Write-Host "($checkmark) Done: " -ForegroundColor Green -NoNewline
} else {
}
else {
Write-Host "Done: " -ForegroundColor Green -NoNewline
}
}
Expand All @@ -44,7 +45,8 @@ function Write-PartialHeader {
if (Get-SpecialCharactersPrintable) {
$cross = [System.Char]::ConvertFromUtf32([System.Convert]::ToInt32("2717", 16))
Write-Host "($cross) Partial: " -ForegroundColor Yellow -NoNewline
} else {
}
else {
Write-Host "Partial: " -ForegroundColor Yellow -NoNewline
}
}
Expand All @@ -53,7 +55,8 @@ function Write-FailedHeader {
if (Get-SpecialCharactersPrintable) {
$cross = [System.Char]::ConvertFromUtf32([System.Convert]::ToInt32("2717", 16))
Write-Host "($cross) Failed: " -ForegroundColor Red -NoNewline
} else {
}
else {
Write-Host "Failed: " -ForegroundColor Red -NoNewline
}
}
Expand All @@ -62,17 +65,18 @@ function Write-WarningHeader {
if (Get-SpecialCharactersPrintable) {
$warning = [System.Char]::ConvertFromUtf32([System.Convert]::ToInt32("26A0", 16))
Write-Host "($warning) Warning: " -ForegroundColor Yellow -NoNewline
} else {
}
else {
Write-Host "Warning: " -ForegroundColor Yellow -NoNewline
}
}

function Write-Failure {
param (
[Parameter(Mandatory=$true, Position=0)]
[Parameter(Mandatory = $true, Position = 0)]
[string]$Overview,

[Parameter(Mandatory=$false)]
[Parameter(Mandatory = $false)]
[string]$Details = $null
)

Expand All @@ -83,3 +87,4 @@ function Write-Failure {
Write-Host $Details -ForegroundColor Red
}
}

191 changes: 96 additions & 95 deletions RestSetAcls/RestSetAcls/RestSetAcls.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -8,141 +8,142 @@

@{

# Script module or binary module file associated with this manifest.
RootModule = 'RestSetAcls.psm1'
# Script module or binary module file associated with this manifest.
RootModule = 'RestSetAcls.psm1'

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

# Supported PSEditions
# CompatiblePSEditions = @()
# Supported PSEditions
# CompatiblePSEditions = @()

# ID used to uniquely identify this module
GUID = '1b9ea644-06b1-47d4-8da4-f8758a43fc49'
# ID used to uniquely identify this module
GUID = '1b9ea644-06b1-47d4-8da4-f8758a43fc49'

# Author of this module
Author = 'Microsoft Corporation'
# Author of this module
Author = 'Microsoft Corporation'

# Company or vendor of this module
CompanyName = 'Microsoft Corporation'
# Company or vendor of this module
CompanyName = 'Microsoft Corporation'

# Copyright statement for this module
Copyright = '(c) Microsoft Corporation. All rights reserved.'
# 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'
# 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'
# Minimum version of the PowerShell engine required by this module
PowerShellVersion = '5.1'

# Name of the PowerShell host required by this module
# PowerShellHostName = ''
# Name of the PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the PowerShell host required by this module
# PowerShellHostVersion = ''
# 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 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 = ''
# 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 = ''
# 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"
}
)
# 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 = @()
# 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 = @()
# 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 = @()
# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()
# 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 = @()
# 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"
)
# 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 = @()
# 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 = '*'
# 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 = @()
# 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 = @()
# DSC resources to export from this module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()
# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()
# 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 = @{
# 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 = @{
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
)
# 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 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 the main website for this project.
ProjectUri = 'https://github.com/Azure-Samples/azure-files-samples'

# A URL to an icon representing this module.
# IconUri = ''
# A URL to an icon representing this module.
# IconUri = ''

# ReleaseNotes of this module
# ReleaseNotes = ''
# ReleaseNotes of this module
# ReleaseNotes = ''

# Prerelease string of this module
# Prerelease = ''
# Prerelease string of this module
# Prerelease = ''

# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false

# External dependent modules of this module
# ExternalModuleDependencies = @()
# External dependent modules of this module
# ExternalModuleDependencies = @()

} # End of PSData hashtable
} # End of PSData hashtable

} # End of PrivateData hashtable
} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''
# HelpInfo URI of this module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}


Loading

0 comments on commit d6cb31f

Please sign in to comment.