From bdf71e0f66ae889c280ed2b86312c55e2666f503 Mon Sep 17 00:00:00 2001 From: Alex Sarafian Date: Mon, 6 Feb 2017 09:23:22 +0100 Subject: [PATCH] Copy expand cd (#9) * Issue #3 - Added the concept of private functions. - AWS S3 bucker support for Get-ISHPrerequisites and Set-ISHToolAntennaHouseLicense - Some refactoring * #3 Fixed small issues in the Publish-Module.ps1 * #7 - Added `Get-ISHCD` cmdlet - Added `Expand-ISHCD` cmdlet * #7 Small fix * #7 - Optimized Publish automation - Fixed bugs * #7 - Improved the Get-ISHCD ListAvailable functionality - Enhanced the README.MD * Upgrade SDLDevTools to version 0.3 --- Automation/Pester/Test-SDLHeaders.Tests.ps1 | 33 ++-- Automation/Publish-Module.ps1 | 76 ++++---- CHANGELOG.md | 4 + README.md | 24 ++- Source/Modules/ISHServer/Expand-ISHCD.ps1 | 103 ++++++++++ Source/Modules/ISHServer/Get-ISHCD.ps1 | 176 ++++++++++++++++++ .../ISHServer/Get-ISHPrerequisites.ISH12.ps1 | 4 +- .../ISHServer/Get-ISHPrerequisites.ISH13.ps1 | 4 +- Source/Modules/ISHServer/ISHServer.12.psm1 | 5 + Source/Modules/ISHServer/ISHServer.13.psm1 | 5 + .../ISHServer/Private/Get-ISHFTPItem.ps1 | 4 +- .../ISHServer/Private/Get-ISHS3Object.ps1 | 2 +- .../Set-ISHToolAntennaHouseLicense.ps1 | 4 +- .../{0.2 => 0.3}/Get-SDLOpenSourceHeader.ps1 | 0 .../Get-SDLOpenSourceHeaderFormat.ps1 | 0 .../{0.2 => 0.3}/PSGetModuleInfo.xml | Bin 10660 -> 10660 bytes .../SDLDevTools/{0.2 => 0.3}/SDLDevTools.psm1 | 2 +- .../{0.2 => 0.3}/Set-SDLOpenSourceHeader.ps1 | 0 .../{0.2 => 0.3}/Test-SDLOpenSourceHeader.ps1 | 9 +- 19 files changed, 384 insertions(+), 71 deletions(-) create mode 100644 Source/Modules/ISHServer/Expand-ISHCD.ps1 create mode 100644 Source/Modules/ISHServer/Get-ISHCD.ps1 rename Tools/Modules/SDLDevTools/{0.2 => 0.3}/Get-SDLOpenSourceHeader.ps1 (100%) rename Tools/Modules/SDLDevTools/{0.2 => 0.3}/Get-SDLOpenSourceHeaderFormat.ps1 (100%) rename Tools/Modules/SDLDevTools/{0.2 => 0.3}/PSGetModuleInfo.xml (95%) rename Tools/Modules/SDLDevTools/{0.2 => 0.3}/SDLDevTools.psm1 (98%) rename Tools/Modules/SDLDevTools/{0.2 => 0.3}/Set-SDLOpenSourceHeader.ps1 (100%) rename Tools/Modules/SDLDevTools/{0.2 => 0.3}/Test-SDLOpenSourceHeader.ps1 (96%) diff --git a/Automation/Pester/Test-SDLHeaders.Tests.ps1 b/Automation/Pester/Test-SDLHeaders.Tests.ps1 index cbf0179..a51128d 100644 --- a/Automation/Pester/Test-SDLHeaders.Tests.ps1 +++ b/Automation/Pester/Test-SDLHeaders.Tests.ps1 @@ -14,23 +14,28 @@ # limitations under the License. #> -$sourcePath=Resolve-Path "$PSScriptRoot\..\.." +$repositoryPath=Resolve-Path "$PSScriptRoot\..\.." +$modulePath=Resolve-Path "$repositoryPath\Tools\Modules" -Import-Module "$sourcePath\Tools\Modules\SDLDevTools" -Force +Import-Module "$modulePath\SDLDevTools" -Force -# Must convert to array of hash to drive the It -Testcases parameter -$filesToValidate=@() -Get-ChildItem -Path $sourcePath -Recurse -File -Exclude ".git" |Select-Object Name,FullName|ForEach-Object { - $hash=@{ - Name=$_.Name - FullName=$_.FullName - } - $filesToValidate+=$hash -} +$reportToValidate=@() +Test-SDLOpenSourceHeader -ExcludeFolder ".git" -FolderPath $repositoryPath -PassThru | ForEach-Object { + $hash=@{} + $hash.FilePath=$_.FilePath + $hash.Format=$_.Format + $hash.Error=$_.Error + $hash.IsValid=$_.IsValid + $reportToValidate+=$hash +} Describe "Verify open source headers" { - It "Test-SDLOpenSourceHeader " -TestCases $filesToValidate { - param ($Name,$FullName) - Test-SDLOpenSourceHeader -FilePath $FullName + It "Test-SDLOpenSourceHeader " -TestCases $reportToValidate { + param ($FilePath,$Format,$Error,$IsValid) + if(-not $IsValid) + { + Write-Warning "$Error in $FilePath" + } + $IsValid | Should BeExactly $true } } diff --git a/Automation/Publish-Module.ps1 b/Automation/Publish-Module.ps1 index 60319a0..cdb2929 100644 --- a/Automation/Publish-Module.ps1 +++ b/Automation/Publish-Module.ps1 @@ -29,7 +29,6 @@ param( [switch]$ISH13=$false #> ) - $moduleNamesToPublish=@() switch ($PSCmdlet.ParameterSetName) { @@ -157,50 +156,49 @@ foreach($moduleName in $moduleNamesToPublish) } #endregion - if($shouldTryPublish) - { - #region manifest - Write-Debug "Generating manifest" + #region manifest + Write-Debug "Generating manifest" - Import-Module $psm1Path -Force - $exportedNames=Get-Command -Module $moduleName | Select-Object -ExcludeProperty Name - - $psm1Name=$moduleName+".psm1" - $psd1Path=Join-Path $modulePath "$moduleName.psd1" - $guid="c1e7cbac-9e47-4906-8281-5f16471d7ccd" - $hash=@{ - "Author"="SDL plc" - "CompanyName" = "SDL plc" - "Copyright"="SDL plc. All rights reserved." - "RootModule"=$psm1Name - "Description"="Prerequisite automation module for SDL Knowledge Center Content Manager 12.0.* (LiveContent Architect, Trisoft InfoShare)" - "ModuleVersion"=$sourceVersion - "Path"=$psd1Path - "LicenseUri"='https://github.com/Sarafian/ISHServer/blob/master/LICENSE' - "ProjectUri"= 'https://github.com/Sarafian/ISHServer/' - "ReleaseNotes"= 'https://github.com/Sarafian/ISHServer/blob/master/CHANGELOG.md' - "CmdletsToExport" = $exportedNames - "FunctionsToExport" = $exportedNames + Import-Module $psm1Path -Force + $exportedNames=Get-Command -Module $moduleName | Select-Object -ExcludeProperty Name + $psm1Name=$moduleName+".psm1" + $psd1Path=Join-Path $modulePath "$moduleName.psd1" + $guid="c1e7cbac-9e47-4906-8281-5f16471d7ccd" + $hash=@{ + "Author"="SDL plc" + "CompanyName" = "SDL plc" + "Copyright"="SDL plc. All rights reserved." + "RootModule"=$psm1Name + "Description"="Prerequisite automation module for SDL Knowledge Center Content Manager 12.0.* (LiveContent Architect, Trisoft InfoShare)" + "ModuleVersion"=$sourceVersion + "Path"=$psd1Path + "LicenseUri"='https://github.com/Sarafian/ISHServer/blob/master/LICENSE' + "ProjectUri"= 'https://github.com/Sarafian/ISHServer/' + "ReleaseNotes"= 'https://github.com/Sarafian/ISHServer/blob/master/CHANGELOG.md' + "CmdletsToExport" = $exportedNames + "FunctionsToExport" = $exportedNames + } + switch ($moduleName) + { + 'ISHServer.12' { + $hash.Description="Prerequisite automation module for SDL Knowledge Center 2016 Content Manager 12.0.* (LiveContent Architect, Trisoft InfoShare)" + $hash.Guid="469894fc-530e-47dd-9158-ed5148815712" + break } - switch ($moduleName) - { - 'ISHServer.12' { - $hash.Description="Prerequisite automation module for SDL Knowledge Center 2016 Content Manager 12.0.* (LiveContent Architect, Trisoft InfoShare)" - $hash.Guid="469894fc-530e-47dd-9158-ed5148815712" - break - } - 'ISHServer.13' { - $hash.Description="Prerequisite automation module for SDL Knowledge Center Content Manager 13.0.* (LiveContent Architect, Trisoft InfoShare)" - $hash.Guid="c73125ea-0914-4a1c-958b-05eccd6c2c29" - break - } + 'ISHServer.13' { + $hash.Description="Prerequisite automation module for SDL Knowledge Center Content Manager 13.0.* (LiveContent Architect, Trisoft InfoShare)" + $hash.Guid="c73125ea-0914-4a1c-958b-05eccd6c2c29" + break } + } - New-ModuleManifest @hash + New-ModuleManifest @hash - Write-Verbose "Generated manifest" - #endregion + Write-Verbose "Generated manifest" + #endregion + if($shouldTryPublish) + { #region publish Write-Debug "Publishing $moduleName" Write-Progress -Activity $progressActivity -Status "Publishing..." diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b364f9..7157c21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ - `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: + - Downloads a CD from FTP or AWS S3 bucket. + - Returns the available CDs +- New `Expand-ISHCD` cmdlet expands a CD into `C:\ISHCD`. **1.0** diff --git a/README.md b/README.md index 463f3b3..76741fc 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,15 @@ A PowerShell module to help automate installation of prerequisites for **Knowled The module requires elevated privileges for most of its cmdlets. +## Prerequisite and CD sources + +The module can retrieve files from the following type of sources: + +- FTP. +- Amazon Web Services S3 bucket. + +For each different type of credentials are required. + ## Preparation To test if the operating system is compatible execute first `Test-ISHServerCompliance`. @@ -38,10 +47,7 @@ NETFramework2013_4.5_MicrosoftVisualC++Redistributable_(vcredist_x64).exe ``` If you want to manually make the files available to the module then copy them to the location provided by `Get-ISHServerFolderPath`. -As an alternative, the `Get-ISHPrerequisites` cmdlet offers the option to download the files from a known location and will take care of everything. -Current options are: - -- FTP. Just provide the ftp hostname, a relative folder path containing the above files and the credentials. e.g. `Get-ISHPrerequisites -Credential $Credential -FTPFolder $folderPath -FTPHost $host`. +As an alternative, the `Get-ISHPrerequisites` cmdlet offers the option to download the files will take care of everything. ## Installing and configuring @@ -50,6 +56,16 @@ The module is structured in manner that represents the steps described in the pr Understanding the prerequisites and how to configure them will be helpful but it is not a requirement. An example of how to use the sequence the installation and configuration is available in [ISHBootstrap](https://github.com/Sarafian/ISHBootstrap). +## CD Management + +ISHServer offers two cmdlets to download and expand the ISHCD. **Notice that it will not install a CD!** +- `Get-ISHCD` can download a CD or show the ones already downloaded and expanded. +- `Expand-ISHCD` will expand the CD. + +The target path is always `C:\ISHCD\X.0.Z` where `X` is the major version and `Y` the revision. +- For `12.0.1` it's `C:\ISHCD\12.0.1` +- For `12.0.3` it's `C:\ISHCD\12.0.3` + ## Maintenance For installation and maintenance reasons, the module offers a couple of general purpose cmdlets: diff --git a/Source/Modules/ISHServer/Expand-ISHCD.ps1 b/Source/Modules/ISHServer/Expand-ISHCD.ps1 new file mode 100644 index 0000000..6922778 --- /dev/null +++ b/Source/Modules/ISHServer/Expand-ISHCD.ps1 @@ -0,0 +1,103 @@ +<# +# 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 Expand-ISHCD +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [ValidatePattern(".+\.[0-9]+\.0\.[0-9]+\.[0-9]+.*\.exe")] + [string]$FileName, + [Parameter(Mandatory=$false)] + [switch]$Force=$false + ) + + begin + { + . $PSScriptRoot\Private\Test-RunningAsElevated.ps1 + Test-RunningAsElevated -StopCallerPSCmdlet $PSCmdlet + + . $PSScriptRoot\Get-ISHServerFolderPath.ps1 + . $PSScriptRoot\Get-ISHCD.ps1 + } + + process + { + $ishCDPath="C:\IshCD" + + $localPath=Get-ISHServerFolderPath + $cdPath=Join-Path $localPath $FileName + if(-not (Test-Path $cdPath)) + { + Write-Error "$FileName doesn't exist." + return + } + $regEx=".+\.(?[0-9]+)\.0\.(?[0-9]+)\.(?[0-9]+).+\.exe" + if($FileName -notmatch $regEx) + { + Write-Error "$FileName has unknown format." + return + } + + $major=[int]$Matches["Major"] + $build=[int]$Matches["Build"] + $revision=[int]$Matches["Revision"] + + $ishVersion="$($major).0.$($revision)" + Write-Debug "ishVersion=$ishVersion" + $expandPath="$ishCDPath\$ishVersion" + Write-Debug "expandPath=$expandPath" + + if($major -lt 12) + { + Write-Error "Only CD's with major version 12 or higher are supported." + } + if(Get-ISHCD -ListAvailable |Where-Object -Property Name -EQ $FileName|Where-Object -Property IsExpanded -EQ $true) + { + if(-not $Force) + { + Write-Warning "$Filename is already expanded. Skipping ..." + return + } + } + + if($major -eq "12") + { + #CD is compressed with WinRar + $arguments=@("-d$expandPath","-s") + } + else + { + #CD is compressed with 7Zip + $arguments=@( + "-y" + "-gm2" + "-InstallPath=`"$($expandPath.Replace('\','\\'))`"" + ) + } + Write-Debug "arguments=$($arguments -join " ")" + + Write-Debug "Unzipping $cdPath in $expandPath" + Start-Process $cdPath -ArgumentList $arguments -Wait + Write-Verbose "Unzipped $cdPath in $expandPath" + + } + + end + { + + } +} diff --git a/Source/Modules/ISHServer/Get-ISHCD.ps1 b/Source/Modules/ISHServer/Get-ISHCD.ps1 new file mode 100644 index 0000000..601b861 --- /dev/null +++ b/Source/Modules/ISHServer/Get-ISHCD.ps1 @@ -0,0 +1,176 @@ +<# +# 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-ISHCD +{ + [CmdletBinding()] + param( + [Parameter(Mandatory=$true,ParameterSetName="From FTP")] + [string]$FTPHost, + [Parameter(Mandatory=$true,ParameterSetName="From FTP")] + [pscredential]$Credential, + [Parameter(Mandatory=$true,ParameterSetName="From FTP")] + [ValidatePattern(".+\.[0-9]+\.0\.[0-9]+\.[0-9]+.*\.exe")] + [string]$FTPPath, + [Parameter(Mandatory=$true,ParameterSetName="From AWS S3")] + [string]$BucketName, + [Parameter(Mandatory=$true,ParameterSetName="From AWS S3")] + [ValidatePattern(".+\.[0-9]+\.0\.[0-9]+\.[0-9]+.*\.exe")] + [string]$Key, + [Parameter(Mandatory=$false,ParameterSetName="From AWS S3")] + [string]$AccessKey, + [Parameter(Mandatory=$false,ParameterSetName="From AWS S3")] + [string]$ProfileName, + [Parameter(Mandatory=$false,ParameterSetName="From AWS S3")] + [string]$ProfileLocation, + [Parameter(Mandatory=$false,ParameterSetName="From AWS S3")] + [string]$Region, + [Parameter(Mandatory=$false,ParameterSetName="From AWS S3")] + [string]$SecretKey, + [Parameter(Mandatory=$false,ParameterSetName="From AWS S3")] + [string]$SessionToken, + [Parameter(Mandatory=$false,ParameterSetName="From FTP")] + [Parameter(Mandatory=$false,ParameterSetName="From AWS S3")] + [switch]$Expand=$false, + [Parameter(Mandatory=$true,ParameterSetName="List")] + [switch]$ListAvailable + ) + + begin + { + if($PSCmdlet.ParameterSetName -ne "List") + { + . $PSScriptRoot\Private\Test-RunningAsElevated.ps1 + Test-RunningAsElevated -StopCallerPSCmdlet $PSCmdlet + } + + . $PSScriptRoot\Get-ISHServerFolderPath.ps1 + } + + process + { + $localPath=Get-ISHServerFolderPath + switch ($PSCmdlet.ParameterSetName) + { + 'From FTP' { + . $PSScriptRoot\Private\Get-ISHFTPItem.ps1 + + $newItem=Get-ISHFTPItem -FTPHost $FTPHost -Credential $Credential -Path $FTPPath -LocalPath $localPath + if($Expand) + { + . $PSScriptRoot\Expand-ISHCD.ps1 + Expand-ISHCD -FileName $newItem.Name + } + break + } + 'From AWS S3' { + . $PSScriptRoot\Private\Get-ISHS3Object.ps1 + $hash=@{ + BucketName=$BucketName + LocalFolder=$localPath + AccessKey=$AccessKey + ProfileName=$ProfileName + ProfileLocation=$ProfileLocation + Region=$Region + SecretKey=$SecretKey + SessionToken=$SessionToken + } + + $newItem=Get-ISHS3Object -Key $Key @hash + if($Expand) + { + . $PSScriptRoot\Expand-ISHCD.ps1 + Expand-ISHCD -FileName $newItem.Name + } + break + } + 'List' { + function RemoveSDLSegments([string]$path) + { + return $path.Replace(".Test","").Replace(".Prod","") + } + $regEx=".+\.(?[0-9]+)\.0\.(?[0-9]+)\.(?[0-9]+)(\.Test)*(\.Prod)*.+\.exe" + $availableItems=@() + $ishCDPath="C:\IshCD" + Get-ChildItem -Path $localPath -File |Where-Object -Property Name -Match $regEx|ForEach-Object { + $hash=[ordered]@{ + Name=$_.Name + Major=[int]$Matches["Major"] + Minor=0 + Build=[int]$Matches["Build"] + Revision=[int]$Matches["Revision"] + IsExpanded=$false + ExpandedPath=$null + } + + $ishVersion="$($hash.Major).0.$($hash.Revision)" + Write-Debug "ishVersion=$ishVersion" + $expandPath="$ishCDPath\$ishVersion" + Write-Debug "expandPath=$expandPath" + $testPath=Join-Path -Path $expandPath -ChildPath ($_.Name.Replace(".exe","")) + $testPath=RemoveSDLSegments($testPath) + $hash.IsExpanded=Test-Path $testPath -PathType Container + if($hash.IsExpanded) + { + $hash.ExpandedPath=$testPath + } + $availableItems+=New-Object -TypeName PSObject -Property $hash + } + if(Test-Path -Path $ishCDPath -PathType Container) + { + if($PSVersionTable.PSVersion.Major -ge 5) + { + $childItems=Get-ChildItem -Path $ishCDPath -Recurse -Directory -Depth 1 + } + else + { + $childItems=Get-ChildItem -Path $ishCDPath -Recurse -Directory + } + } + else + { + $childItems=$null + } + $childItems |Where-Object -Property Name -Match ($regEx.Replace("\.exe","")) | ForEach-Object { + $directoryName=$_.Name + if($availableItems |Where-Object { + ((RemoveSDLSegments($_.Name).Replace(".exe","")) -eq $directoryName) + }) + { + return + } + $hash=[ordered]@{ + Name=$_.Name + Major=[int]$Matches["Major"] + Minor=0 + Build=[int]$Matches["Build"] + Revision=[int]$Matches["Revision"] + IsExpanded=$true + ExpandedPath=$_.FullName + } + $availableItems+=New-Object -TypeName PSObject -Property $hash + } + $availableItems + break + } + } + } + + end + { + + } +} diff --git a/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH12.ps1 b/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH12.ps1 index feca609..34df612 100644 --- a/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH12.ps1 +++ b/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH12.ps1 @@ -100,7 +100,7 @@ function Get-ISHPrerequisites $filesToDownload | ForEach-Object { $paths+="$FTPFolder$_" } - Get-ISHFTPItem -FTPHost $FTPHost -Credential $Credential -Path $paths -LocalPath $localPath + Get-ISHFTPItem -FTPHost $FTPHost -Credential $Credential -Path $paths -LocalPath $localPath | Out-Null break } 'From AWS S3' { @@ -121,7 +121,7 @@ function Get-ISHPrerequisites $filesToDownload | ForEach-Object { $keys+="$FolderKey$_" } - Get-ISHS3Object -Key $keys @hash + Get-ISHS3Object -Key $keys @hash | Out-Null break } 'No Download' { diff --git a/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH13.ps1 b/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH13.ps1 index c1278da..aca9d14 100644 --- a/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH13.ps1 +++ b/Source/Modules/ISHServer/Get-ISHPrerequisites.ISH13.ps1 @@ -109,7 +109,7 @@ function Get-ISHPrerequisites $filesToDownload | ForEach-Object { $paths+="$FTPFolder$_" } - Get-ISHFTPItem -FTPHost $FTPHost -Credential $Credential -Path $paths -LocalPath $localPath + Get-ISHFTPItem -FTPHost $FTPHost -Credential $Credential -Path $paths -LocalPath $localPath | Out-Null break } 'From AWS S3' { @@ -130,7 +130,7 @@ function Get-ISHPrerequisites $filesToDownload | ForEach-Object { $keys+="$FolderKey$_" } - Get-ISHS3Object -Key $keys @hash + Get-ISHS3Object -Key $keys @hash | Out-Null break } 'No Download' { diff --git a/Source/Modules/ISHServer/ISHServer.12.psm1 b/Source/Modules/ISHServer/ISHServer.12.psm1 index afc0ac4..13eccc7 100644 --- a/Source/Modules/ISHServer/ISHServer.12.psm1 +++ b/Source/Modules/ISHServer/ISHServer.12.psm1 @@ -66,6 +66,11 @@ $exportNames=@( #region License "Set-ISHToolAntennaHouseLicense" #endregion + + #region CD + "Expand-ISHCD" + "Get-ISHCD" + #endregion ) $privateNames=@( diff --git a/Source/Modules/ISHServer/ISHServer.13.psm1 b/Source/Modules/ISHServer/ISHServer.13.psm1 index f89de7a..5c5b69a 100644 --- a/Source/Modules/ISHServer/ISHServer.13.psm1 +++ b/Source/Modules/ISHServer/ISHServer.13.psm1 @@ -63,6 +63,11 @@ $exportNames=@( #region License "Set-ISHToolAntennaHouseLicense" #endregion + + #region CD + "Expand-ISHCD" + "Get-ISHCD" + #endregion ) $privateNames=@( diff --git a/Source/Modules/ISHServer/Private/Get-ISHFTPItem.ps1 b/Source/Modules/ISHServer/Private/Get-ISHFTPItem.ps1 index 4152726..6f4e202 100644 --- a/Source/Modules/ISHServer/Private/Get-ISHFTPItem.ps1 +++ b/Source/Modules/ISHServer/Private/Get-ISHFTPItem.ps1 @@ -38,8 +38,10 @@ function Get-ISHFTPItem { $Path | ForEach-Object { Write-Debug "Path=$_" - Get-FTPItem -Path $_ -LocalPath $LocalPath -Overwrite | Out-Null + Get-FTPItem -Path $_ -LocalPath $LocalPath -Overwrite Write-Verbose "Downloaded $_ to $LocalPath" + $filePath=Join-Path $LocalPath ($_.Substring($_.LastIndexOf('/')+1)) + Get-Item -Path $filePath } } diff --git a/Source/Modules/ISHServer/Private/Get-ISHS3Object.ps1 b/Source/Modules/ISHServer/Private/Get-ISHS3Object.ps1 index c533158..24c70c9 100644 --- a/Source/Modules/ISHServer/Private/Get-ISHS3Object.ps1 +++ b/Source/Modules/ISHServer/Private/Get-ISHS3Object.ps1 @@ -71,7 +71,7 @@ function Get-ISHS3Object $localFile=Join-Path $LocalFolder ($_.Substring($_.LastIndexOf('/')+1)) Write-Debug "key=$_" Write-Debug "localFile=$localFile" - Copy-S3Object -Key $_ -LocalFile $localFile @hash |Out-Null + Copy-S3Object -Key $_ -LocalFile $localFile @hash Write-Verbose "Downloaded $_ to $localFile" } } diff --git a/Source/Modules/ISHServer/Set-ISHToolAntennaHouseLicense.ps1 b/Source/Modules/ISHServer/Set-ISHToolAntennaHouseLicense.ps1 index 596e274..035b467 100644 --- a/Source/Modules/ISHServer/Set-ISHToolAntennaHouseLicense.ps1 +++ b/Source/Modules/ISHServer/Set-ISHToolAntennaHouseLicense.ps1 @@ -77,7 +77,7 @@ function Set-ISHToolAntennaHouseLicense switch ($PSCmdlet.ParameterSetName) { 'From FTP' { - Get-ISHFTPItem -FTPHost $FTPHost -Credential $Credential -Path $FTPPath -LocalPath $antennaHouseFolderPath + Get-ISHFTPItem -FTPHost $FTPHost -Credential $Credential -Path $FTPPath -LocalPath $antennaHouseFolderPath | Out-Null break } 'From AWS S3' { @@ -93,7 +93,7 @@ function Set-ISHToolAntennaHouseLicense SessionToken=$SessionToken } - Get-ISHS3Object -Key $Key @hash + Get-ISHS3Object -Key $Key @hash | Out-Null break } 'Content' { diff --git a/Tools/Modules/SDLDevTools/0.2/Get-SDLOpenSourceHeader.ps1 b/Tools/Modules/SDLDevTools/0.3/Get-SDLOpenSourceHeader.ps1 similarity index 100% rename from Tools/Modules/SDLDevTools/0.2/Get-SDLOpenSourceHeader.ps1 rename to Tools/Modules/SDLDevTools/0.3/Get-SDLOpenSourceHeader.ps1 diff --git a/Tools/Modules/SDLDevTools/0.2/Get-SDLOpenSourceHeaderFormat.ps1 b/Tools/Modules/SDLDevTools/0.3/Get-SDLOpenSourceHeaderFormat.ps1 similarity index 100% rename from Tools/Modules/SDLDevTools/0.2/Get-SDLOpenSourceHeaderFormat.ps1 rename to Tools/Modules/SDLDevTools/0.3/Get-SDLOpenSourceHeaderFormat.ps1 diff --git a/Tools/Modules/SDLDevTools/0.2/PSGetModuleInfo.xml b/Tools/Modules/SDLDevTools/0.3/PSGetModuleInfo.xml similarity index 95% rename from Tools/Modules/SDLDevTools/0.2/PSGetModuleInfo.xml rename to Tools/Modules/SDLDevTools/0.3/PSGetModuleInfo.xml index df5ce3004da1ee0c48d319d91e494e44173e0518..b62b3aab54f5e1d9d283c3dd007260a132668929 100644 GIT binary patch delta 193 zcmZ1yyd-$T874;K&1ad!nI(-FbQug7j2J=~3>i!qte~V3gX!kKthzFcCX*K`=}wMN z5>o{!(g!Qm2eJ%+3e6c5&^1kFRkogdPDzM3)tgzBf3qkeyTBOP1q^x&#z0GqH!Esb QGBO%Z{>Ujhxj@qd086ML3jhEB delta 193 zcmZ1yyd-$T874-f&1ad!nI#PwbQz2p3>iXz*qFhJ!4ybaF&HpdZ2rrtE5m3$d7+Z- z;eWo26F}z2Gh-o S8kUTVMw35sicT)jGywol?I9Nc diff --git a/Tools/Modules/SDLDevTools/0.2/SDLDevTools.psm1 b/Tools/Modules/SDLDevTools/0.3/SDLDevTools.psm1 similarity index 98% rename from Tools/Modules/SDLDevTools/0.2/SDLDevTools.psm1 rename to Tools/Modules/SDLDevTools/0.3/SDLDevTools.psm1 index f868d04..a6a8126 100644 --- a/Tools/Modules/SDLDevTools/0.2/SDLDevTools.psm1 +++ b/Tools/Modules/SDLDevTools/0.3/SDLDevTools.psm1 @@ -16,7 +16,7 @@ <#PSScriptInfo -.VERSION 0.2 +.VERSION 0.3 #> diff --git a/Tools/Modules/SDLDevTools/0.2/Set-SDLOpenSourceHeader.ps1 b/Tools/Modules/SDLDevTools/0.3/Set-SDLOpenSourceHeader.ps1 similarity index 100% rename from Tools/Modules/SDLDevTools/0.2/Set-SDLOpenSourceHeader.ps1 rename to Tools/Modules/SDLDevTools/0.3/Set-SDLOpenSourceHeader.ps1 diff --git a/Tools/Modules/SDLDevTools/0.2/Test-SDLOpenSourceHeader.ps1 b/Tools/Modules/SDLDevTools/0.3/Test-SDLOpenSourceHeader.ps1 similarity index 96% rename from Tools/Modules/SDLDevTools/0.2/Test-SDLOpenSourceHeader.ps1 rename to Tools/Modules/SDLDevTools/0.3/Test-SDLOpenSourceHeader.ps1 index 07cb540..b467b16 100644 --- a/Tools/Modules/SDLDevTools/0.2/Test-SDLOpenSourceHeader.ps1 +++ b/Tools/Modules/SDLDevTools/0.3/Test-SDLOpenSourceHeader.ps1 @@ -50,11 +50,10 @@ Function Test-SDLOpenSourceHeader { { return } - $ExcludeFolder | ForEach-Object { - if($fullName -like "*\$_\*") - { - return - } + if($ExcludeFolder | Where-Object { + $fullName -like "*\$_\*" + }){ + return } Test-SDLOpenSourceHeader -FilePath ($_.FullName) -PassThru:$PassThru -ExpandError:$ExpandError }