Skip to content

Commit

Permalink
Merge pull request #23 from Sarafian/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Sarafian authored Oct 20, 2016
2 parents 406373c + da311af commit d26677c
Show file tree
Hide file tree
Showing 15 changed files with 521 additions and 166 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.Examples.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Examples Change log

## pre-release v0.3

**20161020**

- Adaptations in the scripts, json structure and how to topic to match the main codebase.

## Before pre-release v0.2

**20161017**

- Due to ISHDeploy's upcoming cmdlet renaming and tutorial changes the `Set-ISHUIFeatures.ps1` was split into
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Change log

## pre-release v0.3

**20161020**

- Changes in module **xISHServer**
- Use new cmdlet `Get-ISHPrerequisites` for one of the following functions:
- Download the necessary files.
- Initial supported method is with FTP.
- Get the file names of the necessary files.
- The cmdlet `Install-ISHToolAntennaHouse.ps1` will not set the license.
- To add or update the Antenna House Formatter license use cmdlet `Set-ISHToolAntennaHouseLicense.ps1`
- Changes in scripts folder **xISHServer**
- To seed the **xISHServer** module folder with the prerequisites:
- Use **new** script `Get-ISHServerPrerequisites.ps1` and the **xISHServer** module will download the files.
- Use **updated** script `Upload-ISHServerPrerequisites.ps1`. Script uses the `Get-ISHPrerequisites` to know which files to copy.
- Use **new** script `Set-ISHAntennaHouseLicense.ps1` to set the Antenna House Formatter license.

## Before pre-release v0.2

**20161011**

- Major code refactoring. **Before** this all code expected to access and execute remote code without specifying crendetial. This worked for domain credentials.
Expand Down
21 changes: 10 additions & 11 deletions Examples/Copy-ISHCD.Released.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ $ishVersion=Get-ISHBootstrapperContextValue -ValuePath "ISHVersion"

. "$cmdletsPaths\Helpers\Invoke-CommandWrap.ps1"

$ftpHost=Get-ISHBootstrapperContextValue -ValuePath "FTP.Host"
$ftpIp=Get-ISHBootstrapperContextValue -ValuePath "FTP.Ip"
$ftpUser=Get-ISHBootstrapperContextValue -ValuePath "FTP.User"
$ftpPassword=Get-ISHBootstrapperContextValue -ValuePath "FTP.Password"
$ftpCDFolder=Get-ISHBootstrapperContextValue -ValuePath "FTP.ISHCDFolder"
$ftpCDFileName=Get-ISHBootstrapperContextValue -ValuePath "FTP.ISHCDFileName"
$ftp=Get-ISHBootstrapperContextValue -ValuePath "FTP" -DefaultValue $null
$ftpHost=$ftp.Host
$ftpCredential=Get-ISHBootstrapperContextValue -ValuePath "FTP.CredentialExpression" -Invoke
$ftpAlternateHost=$ftp.AlternativeHost
$ftpCDFolder=$ftp.ISHCDFolder
$ftpCDFileName=$ftp.ISHCDFileName

$copyBlock= {
$targetPath="C:\IshCD\$ishVersion"
Expand All @@ -27,12 +27,11 @@ $copyBlock= {

if(-not (Test-Connection $ftpHost -Quiet))
{
Write-Warning "Using $ftpIp instead of $ftpHost"
$ftpHost=$ftpIp
Write-Warning "Using alternate host $ftpAlternateHost instead of $ftpHost"
$ftpHost=$ftpAlternateHost
}

$sdlCredentials=New-Object System.Management.Automation.PSCredential($ftpUser,(ConvertTo-SecureString $ftpPassword -AsPlainText -Force))
Set-FTPConnection -Server $ftpHost -Credentials $sdlCredentials -UseBinary -KeepAlive -UsePassive | Out-Null
Set-FTPConnection -Server $ftpHost -Credentials $ftpCredential -UseBinary -KeepAlive -UsePassive | Out-Null
$ftpUrl="$ftpCDFolder$ftpCDFileName"
$localPath=$env:TEMP

Expand Down Expand Up @@ -65,7 +64,7 @@ try
& "$scriptsPaths\Helpers\Test-Administrator.ps1"
}

Invoke-CommandWrap -ComputerName $computerName -Credential $credential -ScriptBlock $copyBlock -BlockName "Copy and Extract ISH.$ishVersion" -UseParameters @("ishVersion","ftpHost","ftpIp","ftpUser","ftpPassword","ftpCDFolder","ftpCDFileName")
Invoke-CommandWrap -ComputerName $computerName -Credential $credential -ScriptBlock $copyBlock -BlockName "Copy and Extract ISH.$ishVersion" -UseParameters @("ishVersion","ftpHost","ftpAlternateHost","ftpCredential","ftpCDFolder","ftpCDFileName")
}
finally
{
Expand Down
60 changes: 52 additions & 8 deletions Examples/Initialize-ISHServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ $cmdletsPaths="$sourcePath\Cmdlets"
$scriptsPaths="$sourcePath\Scripts"

. "$PSScriptRoot\Cmdlets\Get-ISHBootstrapperContextValue.ps1"
. "$cmdletsPaths\Helpers\Invoke-CommandWrap.ps1"

$computerName=Get-ISHBootstrapperContextValue -ValuePath "ComputerName" -DefaultValue $null
$credential=Get-ISHBootstrapperContextValue -ValuePath "CredentialExpression" -Invoke
if(-not $computerName)
Expand All @@ -15,7 +17,6 @@ if(-not $computerName)
}

$osUserCredential=Get-ISHBootstrapperContextValue -ValuePath "OSUserCredentialExpression" -Invoke
$prerequisitesSourcePath=Get-ISHBootstrapperContextValue -ValuePath "PrerequisitesSourcePath"
$ishVersion=Get-ISHBootstrapperContextValue -ValuePath "ISHVersion"
$ishServerVersion=($ishVersion -split "\.")[0]
$installOracle=Get-ISHBootstrapperContextValue -ValuePath "InstallOracle" -DefaultValue $false
Expand All @@ -25,8 +26,35 @@ if(-not $isSupported)
{
return
}
$unc=Get-ISHBootstrapperContextValue -ValuePath "UNC" -DefaultValue $null
$ftp=Get-ISHBootstrapperContextValue -ValuePath "FTP" -DefaultValue $null
if($ftp)
{
$ftpHost=$ftp.Host
$ftpCredential=Get-ISHBootstrapperContextValue -ValuePath "FTP.CredentialExpression" -Invoke
$ftpISHServerFolder=$ftp.ISHServerFolder
$testHostBlock={
Test-Connection $ftpHost -Quiet
}
$testHost=Invoke-CommandWrap -ComputerName $computerName -Credential $credential -ScriptBlock $testHostBlock -BlockName "Test $ftpHost" -UseParameters @("ftpHost")
if(-not $testHost)
{
$ftpAlternateHost=$ftp.AlternativeHost
Write-Warning "Using alternate host $ftpAlternateHost instead of $ftpHost"
$ftpHost=$ftpAlternateHost
}
}

if($unc)
{
$prerequisitesSourcePath=$unc.ISHServerFolder
& $scriptsPaths\xISHServer\Upload-ISHServerPrerequisites.ps1 -Computer $computerName -Credential $credential -PrerequisitesSourcePath $prerequisitesSourcePath -ISHServerVersion $ishServerVersion
}
if($ftp)
{
& $scriptsPaths\xISHServer\Get-ISHServerPrerequisites.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -FTPHost $ftpHost -FTPCredential $ftpCredential -FTPFolder $ftpISHServerFolder
}

& $scriptsPaths\xISHServer\Upload-ISHServerPrerequisites.ps1 -Computer $computerName -Credential $credential -PrerequisitesSourcePath $prerequisitesSourcePath -ISHServerVersion $ishServerVersion
& $scriptsPaths\xISHServer\Install-ISHServerPrerequisites.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -InstallOracle:$installOracle

if($computerName)
Expand All @@ -37,32 +65,48 @@ if($computerName)
if($useFQDNWithCredSSP)
{
$fqdn=[System.Net.Dns]::GetHostByName($computerName)| FL HostName | Out-String | %{ "{0}" -f $_.Split(':')[1].Trim() };
& $scriptsPaths\xISHServer\Initialize-ISHServerOSUser.ps1 -Computer $fqdn -Credential $credential -ISHServerVersion $ishServerVersion -OSUser ($osUserCredential.UserName) -CredSSP
& $scriptsPaths\xISHServer\Initialize-ISHServerOSUser.ps1 -Computer $fqdn -Credential $credential -ISHServerVersion $ishServerVersion -OSUser ($osUserCredential.UserName) -CredSSP
}
else
{
$sessionOptionsWithCredSSP=Get-ISHBootstrapperContextValue -ValuePath "SessionOptionsWithCredSSPExpression" -Invoke
& $scriptsPaths\xISHServer\Initialize-ISHServerOSUser.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -SessionOptions $sessionOptionsWithCredSSP -OSUser ($osUserCredential.UserName) -CredSSP
& $scriptsPaths\xISHServer\Initialize-ISHServerOSUser.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -SessionOptions $sessionOptionsWithCredSSP -OSUser ($osUserCredential.UserName) -CredSSP
}
}
else
{
& $scriptsPaths\xISHServer\Initialize-ISHServerOSUser.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -OSUser ($osUserCredential.UserName)
& $scriptsPaths\xISHServer\Initialize-ISHServerOSUser.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -OSUser ($osUserCredential.UserName)
}
& $scriptsPaths\xISHServer\Initialize-ISHServerOSUserRegion.ps1 -Computer $computerName -OSUserCredential $osUserCredential -ISHServerVersion $ishServerVersion
& $scriptsPaths\xISHServer\Initialize-ISHServerOSUserRegion.ps1 -Computer $computerName -OSUserCredential $osUserCredential -ISHServerVersion $ishServerVersion
}
else
{
& $scriptsPaths\xISHServer\Initialize-ISHServerOSUser.ps1 -ISHServerVersion $ishServerVersion -OSUser ($osUserCredential.UserName)
Write-Warning "Cannot execute $scriptsPaths\xISHServer\Initialize-ISHServerOSUserRegion.ps1 locally."
}
& $scriptsPaths\IIS\New-IISSslBinding.ps1 -Computer $computerName -Credential $credential
& $scriptsPaths\IIS\New-IISSslBinding.ps1 -Computer $computerName -Credential $credential

if($unc)
{
if($unc.AntennaHouseLicensePath)
{
& $scriptsPaths\xISHServer\Set-ISHAntennaHouseLicense.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -FilePath $unc.AntennaHouseLicensePath
}
}
if($ftp)
{
if($ftp.AntennaHouseLicensePath)
{
& $scriptsPaths\xISHServer\Set-ISHAntennaHouseLicense.ps1 -Computer $computerName -Credential $credential -ISHServerVersion $ishServerVersion -FTPHost $ftpHost -FTPCredential $ftpCredential -FTPPath $ftp.AntennaHouseLicensePath
}
}


if($computerName)
{
& $scriptsPaths\Helpers\Invoke-Restart.ps1 -Computer $computerName -Credential $credential
}
else
{
Write-Host "Please restart the computer before continuing ..."
Write-Warning "Please restart the computer before continuing ..."
}
63 changes: 63 additions & 0 deletions Source/Modules/xISHServer/Get-ISHPrerequisites.ISH12.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
. $PSScriptRoot\Get-ISHServerFolderPath.ps1
. $PSScriptRoot\Get-ISHOSInfo.ps1

function Get-ISHPrerequisites
{
param(
[Parameter(Mandatory=$true,ParameterSetName="From FTP")]
[string]$FTPHost,
[Parameter(Mandatory=$true,ParameterSetName="From FTP")]
[pscredential]$Credential,
[Parameter(Mandatory=$true,ParameterSetName="From FTP")]
[string]$FTPFolder,
[Parameter(Mandatory=$true,ParameterSetName="No Download")]
[switch]$FileNames
)
#
$filesToDownload=@(
#Common for 12 and 13
"MSXML.40SP3.msi"
"jdk-8u60-windows-x64.exe"
"jre-8u60-windows-x64.exe"
"javahelp-2_0_05.zip"
"htmlhelp.zip"
"V6-2-M9-Windows_X64_64E.exe"
"V6-2-M9-Windows_X64_64E.exe.iss"
"V6-2-M9-Windows_X64_64E.exe.vcredist_x64.exe"
"V6-2-M9-Windows_X64_64E.exe.vcredist_x86.exe"
"ODTwithODAC121012.zip"
"ODTwithODAC121012.rsp"

#Specific for 12
"NETFramework2013_4.5_MicrosoftVisualC++Redistributable_(vcredist_x64).exe"
)
$osInfo=Get-ISHOSInfo
if($osInfo.IsCore)
{
$filesToDownload+="vbrun60sp6.exe"
}

switch ($PSCmdlet.ParameterSetName)
{
'From FTP' {
Import-Module PSFTP -ErrorAction Stop
$localPath=Get-ISHServerFolderPath
Set-FTPConnection -Server $FTPHost -Credentials $Credential -UseBinary -KeepAlive -UsePassive | Out-Null
$filesToDownload | ForEach-Object {
$ftpUrl="$FTPFolder$_"

Write-Debug "ftpUrl=$ftpUrl"
Get-FTPItem -Path $ftpUrl -LocalPath $localPath -Overwrite | Out-Null
Write-Verbose "Downloaded $ftpUrl"
}
break
}
'No Download' {
if($FileNames)
{
$filesToDownload
}
break
}
}
}
73 changes: 73 additions & 0 deletions Source/Modules/xISHServer/Get-ISHPrerequisites.ISH13.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
. $PSScriptRoot\Get-ISHServerFolderPath.ps1
. $PSScriptRoot\Get-ISHOSInfo.ps1

function Get-ISHPrerequisites
{
param(
[Parameter(Mandatory=$true,ParameterSetName="From FTP")]
[string]$FTPHost,
[Parameter(Mandatory=$true,ParameterSetName="From FTP")]
[pscredential]$Credential,
[Parameter(Mandatory=$true,ParameterSetName="From FTP")]
[string]$FTPFolder,
[Parameter(Mandatory=$true,ParameterSetName="No Download")]
[switch]$FileNames
)
#
$filesToDownload=@(
#Common for 12 and 13
"MSXML.40SP3.msi"
"jdk-8u60-windows-x64.exe"
"jre-8u60-windows-x64.exe"
"javahelp-2_0_05.zip"
"htmlhelp.zip"
"V6-2-M9-Windows_X64_64E.exe"
"V6-2-M9-Windows_X64_64E.exe.iss"
"V6-2-M9-Windows_X64_64E.exe.vcredist_x64.exe"
"V6-2-M9-Windows_X64_64E.exe.vcredist_x86.exe"
"ODTwithODAC121012.zip"
"ODTwithODAC121012.rsp"

#Specific for 13
"NETFramework2015_4.6_MicrosoftVisualC++Redistributable_(vc_redist.x64).exe"
)

$osInfo=Get-ISHOSInfo

if($osInfo.Server -eq "2016")
{
}
else
{
$filesToDownload+="NETFramework2015_4.6.1.xxxxx_(NDP461-KB3102436-x86-x64-AllOS-ENU).exe"
}

if($osInfo.IsCore)
{
$filesToDownload+="vbrun60sp6.exe"
}

switch ($PSCmdlet.ParameterSetName)
{
'From FTP' {
Import-Module PSFTP -ErrorAction Stop
$localPath=Get-ISHServerFolderPath
Set-FTPConnection -Server $FTPHost -Credentials $Credential -UseBinary -KeepAlive -UsePassive | Out-Null
$filesToDownload | ForEach-Object {
$ftpUrl="$FTPFolder$_"

Write-Debug "ftpUrl=$ftpUrl"
Get-FTPItem -Path $ftpUrl -LocalPath $localPath -Overwrite | Out-Null
Write-Verbose "Downloaded $ftpUrl"
}
break
}
'No Download' {
if($FileNames)
{
$filesToDownload
}
break
}
}
}
8 changes: 0 additions & 8 deletions Source/Modules/xISHServer/Install-ISHToolAntennaHouse.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,4 @@ function Install-ISHToolAntennaHouse
Write-Debug "Installing $filePath using $issFilePath and logging to $logFile"
Start-Process $filePath -ArgumentList $arguments -Wait -Verb RunAs
Write-Verbose "Installed $fileName"

$fileName="AHFormatter.lic"
$filePath=Join-Path (Get-ISHServerFolderPath) $fileName
$targetPath=Join-Path $env:ProgramFiles "Antenna House\AHFormatterV62\"
Write-Debug "Copying License $filePath"
Copy-Item $filePath $targetPath
Write-Verbose "License copied $fileName"

}
Loading

0 comments on commit d26677c

Please sign in to comment.