From cd8cd22e20d60df26dd523ca52f29fcd67810b76 Mon Sep 17 00:00:00 2001 From: Alex Sarafian Date: Mon, 6 Feb 2017 13:45:25 +0100 Subject: [PATCH 1/4] Bumped version to 1.2 --- CHANGELOG.md | 15 +++++++++++---- Source/Modules/ISHServer/metadata.ps1 | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7157c21..250cd8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,20 @@ +**1.2** + **1.1** +Issues: +- GH-3: Amazon Web Services S3 bucket support. +- GH-7: Download and expand ISHCD. + +In detail: - Upgraded the SDLDevTools PowerShell module to version 0.2 -- `Get-ISHPrerequisites` now supports S3 buckets as source. +- `Get-ISHPrerequisites` now supports S3 buckets as source. - `Set-ISHToolAntennaHouseLicense` now supports S3 buckets as source. - `Test-RunningAsElevated` is now a private function in the module. -- New `Get-ISHCD` cmdlet: +- New `Get-ISHCD` cmdlet: - Downloads a CD from FTP or AWS S3 bucket. - - Returns the available CDs -- New `Expand-ISHCD` cmdlet expands a CD into `C:\ISHCD`. + - Returns the available CDs. +- New `Expand-ISHCD` cmdlet expands a CD into `C:\ISHCD`. **1.0** diff --git a/Source/Modules/ISHServer/metadata.ps1 b/Source/Modules/ISHServer/metadata.ps1 index 816552b..7aaffdb 100644 --- a/Source/Modules/ISHServer/metadata.ps1 +++ b/Source/Modules/ISHServer/metadata.ps1 @@ -15,5 +15,5 @@ #> <#PSScriptInfo -.VERSION 1.1 +.VERSION 1.2 #> \ No newline at end of file From e096df2083a044f4adbc67b72d9f82317cdb5bc3 Mon Sep 17 00:00:00 2001 From: Alex Sarafian Date: Mon, 13 Feb 2017 13:40:38 +0100 Subject: [PATCH 2/4] Initialize ish regional doesn't require admin rights (#14) * Fixed issue in Publish flow * #13 Initialize-ISHRegional removed check for elevated permissions --- Automation/Publish-Module.ps1 | 2 +- CHANGELOG.md | 6 ++++++ Source/Modules/ISHServer/Initialize-ISHRegional.ps1 | 3 +-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Automation/Publish-Module.ps1 b/Automation/Publish-Module.ps1 index 1949e8e..e9ad26e 100644 --- a/Automation/Publish-Module.ps1 +++ b/Automation/Publish-Module.ps1 @@ -168,7 +168,7 @@ foreach($moduleName in $moduleNamesToPublish) $guid="c1e7cbac-9e47-4906-8281-5f16471d7ccd" $possition = "None" - $releaseNotes=foreach ($line in $changelogContent) { + $releaseNotes=foreach ($line in $changeLog) { if ($line.StartsWith("**")){ if($possition -eq "None"){ $possition="This Version" diff --git a/CHANGELOG.md b/CHANGELOG.md index 250cd8b..79ea5ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ **1.2** +Issues: +- GH-13: Initialize-ISHRegional should not require elevated permissions. + +In detail: +- `Initialize-ISHRegional` doesn't check for elevated permissions. + **1.1** Issues: diff --git a/Source/Modules/ISHServer/Initialize-ISHRegional.ps1 b/Source/Modules/ISHServer/Initialize-ISHRegional.ps1 index 1d6ee30..fe773c2 100644 --- a/Source/Modules/ISHServer/Initialize-ISHRegional.ps1 +++ b/Source/Modules/ISHServer/Initialize-ISHRegional.ps1 @@ -21,8 +21,7 @@ function Initialize-ISHRegional begin { - . $PSScriptRoot\Private\Test-RunningAsElevated.ps1 - Test-RunningAsElevated -StopCallerPSCmdlet $PSCmdlet + } process From c1dfe9cad21320935a52b77cdf59d2bfe1f200bb Mon Sep 17 00:00:00 2001 From: beutepa Date: Thu, 23 Feb 2017 10:46:07 +0100 Subject: [PATCH 3/4] Add support for Azure file and blob storage #15 * Azure Download support * Azure Download support 2 * Azure Download support (PR comments) * Azure download support - remove Context * Azure download support - Changelog/Readme --- Automation/Publish-Module.ps1 | 5 -- CHANGELOG.md | 4 ++ README.md | 1 + Source/Modules/ISHServer/Get-ISHCD.ps1 | 52 +++++++++++++++ .../ISHServer/Get-ISHPrerequisites.ISH12.ps1 | 51 ++++++++++++++ .../ISHServer/Get-ISHPrerequisites.ISH13.ps1 | 51 ++++++++++++++ Source/Modules/ISHServer/ISHServer.12.psm1 | 4 +- Source/Modules/ISHServer/ISHServer.13.psm1 | 4 +- .../Private/Get-ISHAzureBlobObject.ps1 | 66 +++++++++++++++++++ .../Private/Get-ISHAzureFileObject.ps1 | 66 +++++++++++++++++++ .../Set-ISHToolAntennaHouseLicense.ps1 | 38 +++++++++++ 11 files changed, 335 insertions(+), 7 deletions(-) create mode 100644 Source/Modules/ISHServer/Private/Get-ISHAzureBlobObject.ps1 create mode 100644 Source/Modules/ISHServer/Private/Get-ISHAzureFileObject.ps1 diff --git a/Automation/Publish-Module.ps1 b/Automation/Publish-Module.ps1 index e9ad26e..5a6c035 100644 --- a/Automation/Publish-Module.ps1 +++ b/Automation/Publish-Module.ps1 @@ -49,11 +49,6 @@ switch ($PSCmdlet.ParameterSetName) } } -if((& "$PSScriptRoot\Test-All.ps1") -ne 0) -{ - Write-Warning "Tests failed. Stopping..." - return -} $changeLogPath="$PSScriptRoot\..\CHANGELOG.md" $changeLog=Get-Content -Path $changeLogPath if($publishDebug) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79ea5ac..6a65ac2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,13 @@ Issues: - GH-13: Initialize-ISHRegional should not require elevated permissions. +- GH-15: Azure file and blob storage support. In detail: - `Initialize-ISHRegional` doesn't check for elevated permissions. +- `Get-ISHPrerequisites` now supports Azure file and blob storage as source. +- `Set-ISHToolAntennaHouseLicense` now supports Azure file and blob storage as source. +- `Get-ISHCD` now supports Azure file and blob storage as source. **1.1** diff --git a/README.md b/README.md index 76741fc..f9695b0 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ The module can retrieve files from the following type of sources: - FTP. - Amazon Web Services S3 bucket. +- Azure file and blob storage. For each different type of credentials are required. diff --git a/Source/Modules/ISHServer/Get-ISHCD.ps1 b/Source/Modules/ISHServer/Get-ISHCD.ps1 index 601b861..addb8d2 100644 --- a/Source/Modules/ISHServer/Get-ISHCD.ps1 +++ b/Source/Modules/ISHServer/Get-ISHCD.ps1 @@ -42,8 +42,26 @@ function Get-ISHCD [string]$SecretKey, [Parameter(Mandatory=$false,ParameterSetName="From AWS S3")] [string]$SessionToken, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [string]$ShareName, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [ValidatePattern(".+\.[0-9]+\.0\.[0-9]+\.[0-9]+.*\.exe")] + [string]$Path, + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [string]$ContainerName, + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [ValidatePattern(".+\.[0-9]+\.0\.[0-9]+\.[0-9]+.*\.exe")] + [string]$BlobName, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [string]$StorageAccountName, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [string]$StorageAccountKey, [Parameter(Mandatory=$false,ParameterSetName="From FTP")] [Parameter(Mandatory=$false,ParameterSetName="From AWS S3")] + [Parameter(Mandatory=$false,ParameterSetName="From Azure FileStorage")] + [Parameter(Mandatory=$false,ParameterSetName="From Azure BlobStorage")] [switch]$Expand=$false, [Parameter(Mandatory=$true,ParameterSetName="List")] [switch]$ListAvailable @@ -97,6 +115,40 @@ function Get-ISHCD } break } + 'From Azure FileStorage' { + . $PSScriptRoot\Private\Get-ISHAzureFileObject.ps1 + $hash=@{ + ShareName=$ShareName + LocalFolder=$localPath + StorageAccountName=$StorageAccountName + StorageAccountKey=$StorageAccountKey + } + + $newItem=Get-ISHAzureFileObject -Path $Path @hash + if($Expand) + { + . $PSScriptRoot\Expand-ISHCD.ps1 + Expand-ISHCD -FileName $newItem.Name + } + break + } + 'From Azure BlobStorage' { + . $PSScriptRoot\Private\Get-ISHAzureBlobObject.ps1 + $hash=@{ + ContainerName=$ContainerName + LocalFolder=$localPath + StorageAccountName=$StorageAccountName + StorageAccountKey=$StorageAccountKey + } + + $newItem=Get-ISHAzureBlobObject -BlobName $BlobName @hash + if($Expand) + { + . $PSScriptRoot\Expand-ISHCD.ps1 + Expand-ISHCD -FileName $newItem.Name + } + break + } 'List' { function RemoveSDLSegments([string]$path) { diff --git a/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH12.ps1 b/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH12.ps1 index 34df612..9550bad 100644 --- a/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH12.ps1 +++ b/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH12.ps1 @@ -40,6 +40,19 @@ function Get-ISHPrerequisites [string]$SecretKey, [Parameter(Mandatory=$false,ParameterSetName="From AWS S3")] [string]$SessionToken, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [string]$ShareName, + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [string]$ContainerName, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [string]$FolderPath, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [string]$StorageAccountName, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [string]$StorageAccountKey, [Parameter(Mandatory=$true,ParameterSetName="No Download")] [switch]$FileNames ) @@ -63,6 +76,10 @@ function Get-ISHPrerequisites { $FolderKey+="/" } + if(-not ($FolderPath.EndsWith("/"))) + { + $FolderPath+="/" + } } process @@ -124,6 +141,40 @@ function Get-ISHPrerequisites Get-ISHS3Object -Key $keys @hash | Out-Null break } + 'From Azure FileStorage' { + . $PSScriptRoot\Private\Get-ISHAzureFileObject.ps1 + + $localPath=Get-ISHServerFolderPath + $hash=@{ + ShareName=$ShareName + LocalFolder=$localPath + StorageAccountName=$StorageAccountName + StorageAccountKey=$StorageAccountKey + } + $paths=@() + $filesToDownload | ForEach-Object { + $paths+="$FolderPath$_" + } + Get-ISHAzureFileObject -Path $paths @hash | Out-Null + break + } + 'From Azure BlobStorage' { + . $PSScriptRoot\Private\Get-ISHAzureBlobObject.ps1 + + $localPath=Get-ISHServerFolderPath + $hash=@{ + ContainerName=$ContainerName + LocalFolder=$localPath + StorageAccountName=$StorageAccountName + StorageAccountKey=$StorageAccountKey + } + $blobs=@() + $filesToDownload | ForEach-Object { + $blobs+="$FolderPath$_" + } + Get-ISHAzureBlobObject -BlobName $blobs @hash | Out-Null + break + } 'No Download' { if($FileNames) { diff --git a/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH13.ps1 b/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH13.ps1 index aca9d14..e48e8cb 100644 --- a/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH13.ps1 +++ b/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH13.ps1 @@ -40,6 +40,19 @@ function Get-ISHPrerequisites [string]$SecretKey, [Parameter(Mandatory=$false,ParameterSetName="From AWS S3")] [string]$SessionToken, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [string]$ShareName, + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [string]$ContainerName, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [string]$FolderPath, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [string]$StorageAccountName, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [string]$StorageAccountKey, [Parameter(Mandatory=$true,ParameterSetName="No Download")] [switch]$FileNames ) @@ -63,6 +76,10 @@ function Get-ISHPrerequisites { $FolderKey+="/" } + if(-not ($FolderPath.EndsWith("/"))) + { + $FolderPath+="/" + } } process @@ -133,6 +150,40 @@ function Get-ISHPrerequisites Get-ISHS3Object -Key $keys @hash | Out-Null break } + 'From Azure FileStorage' { + . $PSScriptRoot\Private\Get-ISHAzureFileObject.ps1 + + $localPath=Get-ISHServerFolderPath + $hash=@{ + ShareName=$ShareName + LocalFolder=$localPath + StorageAccountName=$StorageAccountName + StorageAccountKey=$StorageAccountKey + } + $paths=@() + $filesToDownload | ForEach-Object { + $paths+="$FolderPath$_" + } + Get-ISHAzureFileObject -Path $paths @hash | Out-Null + break + } + 'From Azure BlobStorage' { + . $PSScriptRoot\Private\Get-ISHAzureBlobObject.ps1 + + $localPath=Get-ISHServerFolderPath + $hash=@{ + ContainerName=$ContainerName + LocalFolder=$localPath + StorageAccountName=$StorageAccountName + StorageAccountKey=$StorageAccountKey + } + $blobs=@() + $filesToDownload | ForEach-Object { + $blobs+="$FolderPath$_" + } + Get-ISHAzureBlobObject -BlobName $blobs @hash | Out-Null + break + } 'No Download' { if($FileNames) { diff --git a/Source/Modules/ISHServer/ISHServer.12.psm1 b/Source/Modules/ISHServer/ISHServer.12.psm1 index 13eccc7..4d8f344 100644 --- a/Source/Modules/ISHServer/ISHServer.12.psm1 +++ b/Source/Modules/ISHServer/ISHServer.12.psm1 @@ -76,6 +76,8 @@ $exportNames=@( $privateNames=@( "Get-ISHFTPItem" "Get-ISHS3Object" + "Get-ISHAzureFileObject" + "Get-ISHAzureBlobObject" "Test-RunningAsElevated" ) @@ -83,4 +85,4 @@ $privateNames | ForEach-Object {. $PSScriptRoot\Private\$_.ps1 } $exportNames | ForEach-Object {. $PSScriptRoot\$_.ps1 } $exportedMemberNames=$exportNames -replace "\.ISH[0-9]+","" -Export-ModuleMember $exportedMemberNames \ No newline at end of file +Export-ModuleMember $exportedMemberNames diff --git a/Source/Modules/ISHServer/ISHServer.13.psm1 b/Source/Modules/ISHServer/ISHServer.13.psm1 index 5c5b69a..38c97a2 100644 --- a/Source/Modules/ISHServer/ISHServer.13.psm1 +++ b/Source/Modules/ISHServer/ISHServer.13.psm1 @@ -73,6 +73,8 @@ $exportNames=@( $privateNames=@( "Get-ISHFTPItem" "Get-ISHS3Object" + "Get-ISHAzureFileObject" + "Get-ISHAzureBlobObject" "Test-RunningAsElevated" ) @@ -80,4 +82,4 @@ $privateNames | ForEach-Object {. $PSScriptRoot\Private\$_.ps1 } $exportNames | ForEach-Object {. $PSScriptRoot\$_.ps1 } $exportedMemberNames=$exportNames -replace "\.ISH[0-9]+","" -Export-ModuleMember $exportedMemberNames \ No newline at end of file +Export-ModuleMember $exportedMemberNames diff --git a/Source/Modules/ISHServer/Private/Get-ISHAzureBlobObject.ps1 b/Source/Modules/ISHServer/Private/Get-ISHAzureBlobObject.ps1 new file mode 100644 index 0000000..79f978e --- /dev/null +++ b/Source/Modules/ISHServer/Private/Get-ISHAzureBlobObject.ps1 @@ -0,0 +1,66 @@ +<# +# Copyright (c) 2014 All Rights Reserved by the SDL Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#> + +function Get-ISHAzureBlobObject +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [string]$ContainerName, + [Parameter(Mandatory=$true)] + [string[]]$BlobName, + [Parameter(Mandatory=$true)] + [string]$LocalFolder, + [Parameter(Mandatory=$true)] + [string]$StorageAccountName, + [Parameter(Mandatory=$true)] + [string]$StorageAccountKey, + [Parameter(Mandatory=$false)] + [switch]$Force=$false + ) + + begin + { + Import-Module Azure.Storage -ErrorAction Stop + + # Create a Context using StorageAccountName and StorageAccountKey + $Context=New-AzureStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey + } + + process + { + $BlobName | ForEach-Object { + $localFile=Join-Path $LocalFolder ($_.Substring($_.LastIndexOf('/')+1)) + Write-Debug "path=$_" + Write-Debug "localFile=$localFile" + if(-not (Test-Path $localFile) -or $Force) + { + Get-AzureStorageBlobContent -Container $ContainerName -Blob $_ -Destination $localFile -Force -Context $Context | Out-Null + Write-Verbose "Downloaded $_ to $localFile" + } + else + { + Write-Verbose "Skipped $_ already exists at $localFile" + } + Get-Item -Path $localFile + } + } + + end + { + + } +} diff --git a/Source/Modules/ISHServer/Private/Get-ISHAzureFileObject.ps1 b/Source/Modules/ISHServer/Private/Get-ISHAzureFileObject.ps1 new file mode 100644 index 0000000..a8b4946 --- /dev/null +++ b/Source/Modules/ISHServer/Private/Get-ISHAzureFileObject.ps1 @@ -0,0 +1,66 @@ +<# +# Copyright (c) 2014 All Rights Reserved by the SDL Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#> + +function Get-ISHAzureFileObject +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [string]$ShareName, + [Parameter(Mandatory=$true)] + [string[]]$Path, + [Parameter(Mandatory=$true)] + [string]$LocalFolder, + [Parameter(Mandatory=$true)] + [string]$StorageAccountName, + [Parameter(Mandatory=$true)] + [string]$StorageAccountKey, + [Parameter(Mandatory=$false)] + [switch]$Force=$false + ) + + begin + { + Import-Module Azure.Storage -ErrorAction Stop + + # Create a Context using StorageAccountName and StorageAccountKey + $Context=New-AzureStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey + } + + process + { + $Path | ForEach-Object { + $localFile=Join-Path $LocalFolder ($_.Substring($_.LastIndexOf('/')+1)) + Write-Debug "path=$_" + Write-Debug "localFile=$localFile" + if(-not (Test-Path $localFile) -or $Force) + { + Get-AzureStorageFileContent -ShareName $ShareName -Path $_ -Destination $localFile -Force -Context $Context | Out-Null + Write-Verbose "Downloaded $_ to $localFile" + } + else + { + Write-Verbose "Skipped $_ already exists at $localFile" + } + Get-Item -Path $localFile + } + } + + end + { + + } +} diff --git a/Source/Modules/ISHServer/Set-ISHToolAntennaHouseLicense.ps1 b/Source/Modules/ISHServer/Set-ISHToolAntennaHouseLicense.ps1 index 035b467..1bc0a46 100644 --- a/Source/Modules/ISHServer/Set-ISHToolAntennaHouseLicense.ps1 +++ b/Source/Modules/ISHServer/Set-ISHToolAntennaHouseLicense.ps1 @@ -42,6 +42,20 @@ function Set-ISHToolAntennaHouseLicense [string]$SecretKey, [Parameter(Mandatory=$false,ParameterSetName="From AWS S3")] [string]$SessionToken, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [string]$ShareName, + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [string]$ContainerName, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [ValidatePattern(".*AHFormatter\.lic")] + [string]$Path, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [string]$StorageAccountName, + [Parameter(Mandatory=$true,ParameterSetName="From Azure FileStorage")] + [Parameter(Mandatory=$true,ParameterSetName="From Azure BlobStorage")] + [string]$StorageAccountKey, [Parameter(Mandatory=$true,ParameterSetName="Content")] $Content ) @@ -96,6 +110,30 @@ function Set-ISHToolAntennaHouseLicense Get-ISHS3Object -Key $Key @hash | Out-Null break } + 'From Azure FileStorage' { + . $PSScriptRoot\Private\Get-ISHAzureFileObject.ps1 + $hash=@{ + ShareName=$ShareName + LocalFolder=$localPath + StorageAccountName=$StorageAccountName + StorageAccountKey=$StorageAccountKey + } + + Get-ISHAzureFileObject -Path $Path @hash | Out-Null + break + } + 'From Azure BlobStorage' { + . $PSScriptRoot\Private\Get-ISHAzureBlobObject.ps1 + $hash=@{ + ContainerName=$ContainerName + LocalFolder=$localPath + StorageAccountName=$StorageAccountName + StorageAccountKey=$StorageAccountKey + } + + Get-ISHAzureBlobObject -BlobName $Path @hash | Out-Null + break + } 'Content' { Write-Debug "Writing License $antennaHouseLicensePath" if($PSVersionTable.PSVersion.Major -ge 5) From 23942b1c46d19fa1835f632641b186acb5713c18 Mon Sep 17 00:00:00 2001 From: Alex Sarafian Date: Thu, 23 Feb 2017 10:47:58 +0100 Subject: [PATCH 4/4] Initialize-ISHRegional sets incorrect registry key for 'Long Time' format #17 (#18) * Issue #17 Replaced `sLongTime` with `sTimeFormat` * #17 Updated changelog --- CHANGELOG.md | 1 + Source/Modules/ISHServer/Initialize-ISHRegional.ps1 | 2 +- Source/Modules/ISHServer/Initialize-ISHRegionalDefault.ps1 | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a65ac2..a343e64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Issues: - GH-13: Initialize-ISHRegional should not require elevated permissions. - GH-15: Azure file and blob storage support. +- GH-17: Initialize-ISHRegional sets incorrect registry key for 'Long Time' format. In detail: - `Initialize-ISHRegional` doesn't check for elevated permissions. diff --git a/Source/Modules/ISHServer/Initialize-ISHRegional.ps1 b/Source/Modules/ISHServer/Initialize-ISHRegional.ps1 index fe773c2..7ee6af5 100644 --- a/Source/Modules/ISHServer/Initialize-ISHRegional.ps1 +++ b/Source/Modules/ISHServer/Initialize-ISHRegional.ps1 @@ -37,7 +37,7 @@ function Initialize-ISHRegional Set-ItemProperty -Path "HKCU:\Control Panel\International" -Name sShortDate -Value "dd/MM/yyyy" Set-ItemProperty -Path "HKCU:\Control Panel\International" -Name sLongDate -Value "ddddd d MMMM yyyy" Set-ItemProperty -Path "HKCU:\Control Panel\International" -Name sShortTime -Value "HH:mm:ss" - Set-ItemProperty -Path "HKCU:\Control Panel\International" -Name sLongTime -Value "HH:mm:ss" + Set-ItemProperty -Path "HKCU:\Control Panel\International" -Name sTimeFormat -Value "HH:mm:ss" Write-Verbose "Set Formatters" } end diff --git a/Source/Modules/ISHServer/Initialize-ISHRegionalDefault.ps1 b/Source/Modules/ISHServer/Initialize-ISHRegionalDefault.ps1 index 689e479..631eebf 100644 --- a/Source/Modules/ISHServer/Initialize-ISHRegionalDefault.ps1 +++ b/Source/Modules/ISHServer/Initialize-ISHRegionalDefault.ps1 @@ -38,7 +38,7 @@ function Initialize-ISHRegionalDefault Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\International" -Name sShortDate -Value "dd/MM/yyyy" Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\International" -Name sLongDate -Value "ddddd d MMMM yyyy" Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\International" -Name sShortTime -Value "HH:mm:ss" - Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\International" -Name sLongTime -Value "HH:mm:ss" + Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\International" -Name sTimeFormat -Value "HH:mm:ss" Write-Verbose "Set Formatters for DEFAULT account" } end