removed unused commented lines

This commit is contained in:
Justin Donnelly
2020-10-20 04:47:52 +00:00
parent 52744c6fc2
commit c72ddc81c0
3 changed files with 10 additions and 53 deletions

View File

@@ -48,14 +48,15 @@ Write-Host "------------------------------------------------------------"
Write-Host " Copy tooling from Cloud Storage Bucket "
Write-Host "------------------------------------------------------------"
$deploy_path = "E:\deploy"
$config = ( Read-GcsObject -Bucket "qliksense" -ObjectName "scripts/config.json" | ConvertFrom-Json )
$deploy_path = $config.deployPath
if (! (Test-Path $deploy_path)) {
New-Item -ItemType Directory -Path $deploy_path
New-Item -ItemType Directory -Path $deploy_path\binaries
New-Item -ItemType Directory -Path $deploy_path\modules
New-Item -ItemType Directory -Path $deploy_path\modules\tf
New-Item -ItemType Directory -Path $deploy_path\modules\ps
# New-Item -ItemType Directory -Path $deploy_path\modules
# New-Item -ItemType Directory -Path $deploy_path\modules\tf
# New-Item -ItemType Directory -Path $deploy_path\modules\ps
}
gsutil -m cp -r gs://qliksense/scripts $deploy_path\
@@ -65,10 +66,6 @@ gsutil -m cp gs://qliksense/binaries/firefox_latest.exe $deploy_path\binaries\
gsutil -m cp gs://qliksense/binaries/ps7.zip $deploy_path\binaries\
# gsutil -m cp -r gs://qliksense/modules 'C:\Program Files\WindowsPowerShell\Modules'
# Invoke-WebRequest -Uri https://github.com/PowerShell/PowerShell/releases/download/v7.0.3/PowerShell-7.0.3-win-x64.zip -OutFile $deploy_path\binaries\ps7.zip
# Invoke-WebRequest -Uri https://aka.ms/win32-x64-user-stable -Outfile $deploy_path\binaries\vscode_stable.exe
# Invoke-WebRequest -Uri "https://download.mozilla.org/?product=firefox-latest-ssl&os=win64&lang=en-US" -Outfile $deploy_path\binaries\firefox_latest.exe
Unblock-File -Path $deploy_path\binaries\*
Unblock-File -Path $deploy_path\scripts\*
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 0 /f
@@ -121,8 +118,8 @@ nfsadmin client start
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce' -Name 'Run' -Value 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -noprofile -sta -WindowStyle Hidden -executionpolicy unrestricted -file E:\deploy\scripts\qsInstall.ps1'
# Tag the GCE metadata that the Node has been bootstrapped, remove startup-script URL.
Set-GceInstance -Name ($env:computername).ToLower() -Zone europe-west1-d -AddTag "bootstrapped"
Set-GceInstance -Name ($env:computername).ToLower() -Zone europe-west1-d -RemoveMetadata "windows-startup-script-url"
Set-GceInstance -Name ($env:computername).ToLower() -Zone $config.zone -AddTag "bootstrapped"
Set-GceInstance -Name ($env:computername).ToLower() -Zone $config.zone -RemoveMetadata "windows-startup-script-url"
Restart-Computer

View File

@@ -9,7 +9,6 @@ $qsAdminUser = $config.qsAdminUser
$centralNode = ($env:COMPUTERNAME).ToLower()
$qlikID = "$centralNode\$qsAdminUser"
$deploy_path = $config.deployPath
# $centralNode = "central-6ccd"
#### Functions
@@ -71,10 +70,6 @@ else {
Invoke-Command -ScriptBlock { Start-Process -FilePath "$deploy_path\binaries\Qlik_Sense_setup.exe" -ArgumentList "-s -log $deploy_path\deploy.log accepteula=1 skipvalidation=1 installdir=$deploy_path\Qlik dbpassword=Qlik1234! hostname=$($env:computername) userwithdomain=$($env:computername)\qservice password=Qlik1234! bundleinstall=dashboard,visualization spc=$deploy_path\scripts\rim.xml" -Wait -PassThru } | Out-Null
# Do other Stuff
# Execute AddRim
Set-Item WSMan:localhost\client\trustedhosts -value * -Force
If (Test-Path "$deploy_path\binaries\Qlik_Sense_update.exe") {

View File

@@ -36,48 +36,13 @@ REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v Consen
# Import-Module Qlik-Cli.psm1
# Export-QlikCertificate -machineNames rim -includeSecretsKey -exportFormat Windows
if ($env:computername -notlike "central-*") {
exit 0
}
$deploy_path = "E:\deploy"
$centralNode = ($env:COMPUTERNAME).ToLower()
# $centralNode = "central-c01c"
$newNode = ($env:COMPUTERNAME).ToLower()
# $newNode = "rim-a8a3"
$qlikID = ".\qlikadmin"
Read-GcsObject -Bucket "qliksense" -ObjectName "certs/rim/client.pfx" -OutFile $deploy_path\certs\rim\client.pfx -Force
Import-PfxCertificate -FilePath $deploy_path\certs\rim\client.pfx -CertStoreLocation Cert:\CurrentUser\My -Exportable
# Connect to Qlik Sense
Get-ChildItem -Path cert:\CurrentUser\My | Where-Object { $_.Issuer -like "*$centralNode*" } | Connect-Qlik -computername https://"$centralNode":4242 -Username $qlikID | Out-Null
Update-QlikUser -id ($(Get-QlikUser -full -filter "name eq 'qlikadmin'") | Where-Object { $_.userDirectory -eq "$centralNode" }).id -roles "RootAdmin"
$proxyId = (Get-QlikVirtualProxy -full | Where-Object description -like "Central*").id
Update-QlikVirtualProxy -id $proxyId -websocketCrossOriginWhiteList "$newNode", "$env:computername"
# Register-QlikNode -hostname $newNode -name $newNode -nodePurpose Both -engineEnabled -proxyEnabled
$password = New-QlikNode -hostname $newNode -name $newNode -nodePurpose Both -engineEnabled -proxyEnabled
$foo = @{__pwd = "$password" }
<#
Using this will allow a silent execution without password prompt
$Username = 'DOMAIN\Administrator'
$Password = 'Password123!'
$pass = ConvertTo-SecureString -AsPlainText $Password -Force
$Cred = New-Object System.Management.Automation.PSCredential -ArgumentList $Username,$pass
Invoke-Command -ComputerName qlikserver2.domain.local -ScriptBlock { Invoke-WebRequest -Uri "http://localhost:4570/certificateSetup" -Method Post -Body $Using:foo } -credential $Cred
#>
# Filter by the name param from line 7
$nodeid = Get-QlikNode -filter "(name eq $newNode)"
Invoke-QlikGet -path /qrs/servernoderegistration/start/$($nodeid.id)
# Invoke-Command -Session $qseCon -ScriptBlock { Invoke-Command -ComputerName $using:newNode -ScriptBlock { Invoke-WebRequest -Uri "http://localhost:4570/certificateSetup" -Method Post -Body $foo } -credential $using:newNode\qlikadmin }
#!/usr/bin/env pwsh
#
# Invoke-WebRequest -Uri https://github.com/PowerShell/PowerShell/releases/download/v7.0.3/PowerShell-7.0.3-win-x64.zip -OutFile $deploy_path\binaries\ps7.zip
# Invoke-WebRequest -Uri https://aka.ms/win32-x64-user-stable -Outfile $deploy_path\binaries\vscode_stable.exe
# Invoke-WebRequest -Uri "https://download.mozilla.org/?product=firefox-latest-ssl&os=win64&lang=en-US" -Outfile $deploy_path\binaries\firefox_latest.exe