-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
- Loading branch information
Showing
19 changed files
with
384 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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=".+\.(?<Major>[0-9]+)\.0\.(?<Build>[0-9]+)\.(?<Revision>[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 | ||
{ | ||
|
||
} | ||
} |
Oops, something went wrong.