Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
987 changes: 987 additions & 0 deletions Autowaiver.csv

Large diffs are not rendered by default.

10,370 changes: 10,370 additions & 0 deletions ExitCodes.csv

Large diffs are not rendered by default.

5,410 changes: 5,410 additions & 0 deletions ManualValidationPipeline.cs

Large diffs are not rendered by default.

309 changes: 309 additions & 0 deletions ManualValidationPipeline.csv

Large diffs are not rendered by default.

1,166 changes: 1,166 additions & 0 deletions ManualValidationPipeline.json

Large diffs are not rendered by default.

7,564 changes: 7,564 additions & 0 deletions ManualValidationPipeline.ps1

Large diffs are not rendered by default.

189 changes: 189 additions & 0 deletions ManualValidationProfile.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
$VM = 0
$build = 149
$ipconfig = (ipconfig)
$remoteIP = ([ipaddress](($ipconfig | select-string "Default Gateway") -split ": ")[1]).IPAddressToString
#$remoteIP = ([ipaddress](($ipconfig[($ipconfig | select-string "vEthernet").LineNumber..$ipconfig.length] | select-string "IPv4 Address") -split ": ")[1]).IPAddressToString
Write-Host "VM$VM with remoteIP $remoteIP version $build"

$MainFolder = "\\$remoteIP\ManVal"
$homePath = "C:\Users\User\Desktop"
Set-Location $homePath

$runPath = "$MainFolder\vm\$VM"
$writeFolder = "\\$remoteIP\write"
$statusFile = "$writeFolder\status.csv"
# $statusFile = "$writeFolder\status\$VM.csv"
$SharedFolder = $writeFolder

if ($VM -eq 0) {
$VM = (gc "$MainFolder\vmcounter.txt")-1
}
$NewProfile = (Get-Content "\\$remoteIP\ManVal\vm\0\profile.ps1") -split "`n"
if ($NewProfile) {
"`$VM = $VM" | Out-File $profile
($NewProfile[1..999]) -join "`n" | Out-File $profile -append
}

Function Send-SharedError {
param(
[switch]$Approved,
[switch]$Feedback,
$Clip = (Get-Clipboard)
)
if ($Clip.length -gt 0) {
Write-Host "Writing $($Clip.length) lines."
$Clip -join "`n" | Out-File "$writeFolder\err.txt"
if ($Feedback) {
Get-TrackerVMSetStatus "SendStatus-Feedback"
} else {
if ($Approved) {
Get-TrackerVMSetStatus "SendStatus-Approved"
} else {
Get-TrackerVMSetStatus "SendStatus-Complete"
} #end if Approved
} #end if Feedback
}
}

function Get-ARPTable {
Param(
$DisplayName
)
#SandboxTest.ps1 copypasta - https://github.com/microsoft/winget-pkgs/blob/01d110895592f8775f7a3e9c1e4b50a8bd3dc698/Tools/SandboxTest.ps1#L703
$registry_paths = @('HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*','HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*', 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*', 'HKCU:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*')
$out = Get-ItemProperty $registry_paths -ErrorAction SilentlyContinue |
Where-Object { $_.DisplayName -and (-not $_.SystemComponent -or $_.SystemComponent -ne 1 ) } |
Select-Object DisplayName, DisplayVersion, Publisher, @{N='ProductCode'; E={$_.PSChildName}}, @{N='Scope'; E={if($_.PSDrive.Name -eq 'HKCU') {'User'} else {'Machine'}}}
if ($DisplayName) {
$out = $out | where {$_.DisplayName -match $DisplayName}
}
return $out
}

Function Get-TrackerVMSetStatus {
param(
[ValidateSet("AddVCRedist","Approved","CheckpointComplete","Checkpointing","CheckpointReady","Completing","Complete","Disgenerate","DoesntRun","Feedback","LongRunning","FileScan1","FileScan2","FileScan1Pause","FileScan2Pause","Generating","Installing","Prescan","Prevalidation","Ready","Rebooting","Regenerate","Restoring","Revert","Scanning","SendStatus","SendStatus-Approved","SendStatus-Complete","SendStatus-Feedback","Setup","SetupComplete","Starting","Unhealthy","Updating","ValidationCompleted")]
$Status = "Complete",
[string]$Package,
[int]$PR
)
$out = Get-TrackerVMStatus
if ($Status) {
($out | where {$_.vm -match $VM}).Status = $Status
}
if ($Package) {
($out | where {$_.vm -match $VM}).Package = $Package
}
if ($PR) {
($out | where {$_.vm -match $VM}).PR = $PR
}
$out | ConvertTo-Csv -NoTypeInformation | Out-File $StatusFile
Write-Host "Setting $vm $Package $PR state $Status"
}

Function Get-TrackerVMRunValidation {
param(
$fileName = "cmds.ps1"
)
Get-EventLog -LogName * | ForEach { Clear-EventLog $_.Log }
Copy-Item $runPath\$fileName $homePath\$fileName
& $homePath\$fileName
}

Function Get-TrackerVMStatus{
param(
[int]$vmNum,
[ValidateSet("AddVCRedist","Approved","CheckpointComplete","Checkpointing","CheckpointReady","Completing","Complete","Disgenerate","DoesntRun","Feedback","LongRunning","FileScan1","FileScan2","FileScan1Pause","FileScan2Pause","Generating","Installing","Prescan","Prevalidation","Ready","Rebooting","Regenerate","Restoring","Revert","Scanning","SendStatus","SendStatus-Approved","SendStatus-Complete","SendStatus-Feedback","Setup","SetupComplete","Starting","Unhealthy","Updating","ValidationCompleted")]
$Status,
$Option = "status",
$out = (Get-Content $StatusFile | ConvertFrom-Csv | where {$_.status -notmatch "ImagePark"})
)
if ($vmNum) {
$out = ($out | where {$_.vm -eq $vmNum}).$Option
}
if ($Status) {
$out = ($out | where {$_.status -eq $Status}).vm
}
$out
}

Function Get-InstalledVersions {
Param(
$file = (gc C:\Users\User\Desktop\ChangedFiles.txt | where {$_ -match "Links"} | where {$_ -match "exe"}),
$cmdstring = "version",
$ArpName = (($file -split "\\")[-1] -split "\.")[0]
)
if ($file) {
Write-Host "Reading $ArpName"
$ArpData = Get-ARPTable $ArpName
$FileData = &"$file" "--$cmdstring"
if ($null -eq $FileData){
$FileData = &"$file" "$cmdstring"
}
$shouldsend = $false
($FileData -replace ":"," " -replace "v","" -split " ") |%{if ($ArpData.DisplayVersion -match $_ ) {$shouldsend = $true}}
if ($shouldsend){
Send-SharedError -Status Approved -Clip $FileData
}
}
}

<#
Registry:
$a = gci HKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | select DisplayName,DisplayVersion
$a += gci HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | select DisplayName,DisplayVersion
$a | where {$_.displayname} | sort displayname -Unique

#Clear event logs.

# Commands
$n = 15;$t = $n;while ($n -gt 0) {$n--;$r = $t - $n;Write-Progress -Activity "Build latch" -Status "Seconds remaining: $r/$t" -PercentComplete ((1-$n/$t)*100);sleep 1}; Get-NetAdapter|Disable-NetAdapter -confirm:$false;Get-NetAdapter|Enable-NetAdapter;sleep 30;Import-Module $Profile -Force;Import-Module $Profile -Force;cls;Write-Host "VM$VM with remoteIP $remoteIP version $build"; Get-TrackerVMSetStatus CheckpointReady; $n = 15;$t = $n;while ($n -gt 0) {$n--;$r = $t - $n; Write-Progress -Activity "Run latch" -Status "Seconds remaining: $r/$t" -PercentComplete ((1-$n/$t)*100);sleep 1};Write-Host "Waiting for Network...";Get-TrackerVMRunValidation


# Reset display window
$vm = 0;notepad $profile;cls;Write-Host "VM$VM with remoteIP $remoteIP version $build"

# Close Notepad
Get-Process Notepad|Stop-Process;

# Reboot
shutdown -r -t 05

# Setup: ExecutionPolicy, Uninstall, Enable WinGet settings.
Set-ExecutionPolicy Unrestricted
winget uninstall Microsoft.Teams
winget uninstall Microsoft.Teams.Free
winget uninstall Microsoft.OneDrive
winget uninstall Microsoft.MSIXPackagingTool_8wekyb3d8bbwe
winget settings --enable LocalManifestFiles;winget settings --enable LocalArchiveMalwareScanOverride;

# Files
Logs file: C:\Users\user\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
Programs: C:\Users\user\AppData\Local\Programs\
Download: C:\Users\user\AppData\Local\Temp\WinGet\
Portable: C:\Users\user\AppData\Local\Microsoft\WinGet\Packages\
Symlinks: C:\Users\user\AppData\Local\Microsoft\WinGet\Links\

New VM:
- Open Quick Create, create VM
- Connect, power on, use [email protected] to skip login.
- User username, easy to type password, security questions.
- Keyboard layout and locale, maybe a few other questions, then skip everything else.
- Do something else during initial setup.
- Install all store, winget, windows, and defender updates. Reboot as necessary.
ImageVMMove here at any point.
- Open PowerShell and run IPConfig, get switch IP.
- Connect to \\ip\ManVal\, open \vm\0\profile.ps1
- Run few setup and uninstall commands
- Copy to local profile.
- Set up PowerShell window sizes
- Enter commands in windows
ImageVMStop
- Wait for image to cool
PipelineVMGenerate
- VM is in system.

gci HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
gci HKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

#>
91 changes: 91 additions & 0 deletions ManualValidationSchema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"PR": {
"Number": {
"description": "The pull request number",
"type": [ "integer", "null" ],
"minLength":5,
"maxLength":6,
"pattern": "[0-9]{5,6}",
},
"Title": {
"description": "The pull request title",
"type": "string",
"minLength":6,
"maxLength":128,
"pattern": "[a-zA-Z0-9]",
},
},
"VM": {
"Number": {
"description": "The virtual machine number",
"type": "integer",
"minLength":4,
"maxLength":4,
"pattern": "[0-9]{4}",
}
},
"CovertReview": {
"IPv4": {
"description": "IPv4 address",
"type": [ "string", "null" ],
"minLength":7,
"pattern": "(((?!25?[6-9])[1]\\d|[1-9])?\\d\\.?\\b){4}",
},
"IPv6": {
"description": "IPv6 address",
"type": [ "string", "null" ],
"minLength":2,
"pattern": "(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))",
},
"Transforms": {
"description": "Transforms instalelr switch",
"type": [ "string", "null" ],
"minLength":10,
"pattern": "TRANSFORMS",
},
"Patch": {
"description": "Patch instalelr switch",
"type": [ "string", "null" ],
"minLength": 5,
"pattern": "PATCH",
},
"Msp": {
"description": "MSI Patch file extension",
"type": [ "string", "null" ],
"minLength":3,
"pattern": "[.]msp",
},
},
"General": {
"WordFilterList": {
"description": "List of words which block PR merging without an ApprovalUrl",
"type": [ "string", "null" ],
"minLength": 4,
"maxLength":38,
"enum": [
"accept_gdpr ",
"accept-licenses",
"accept-license",
"eula",
"downloadarchive.documentfoundation.org",
"paypal"
],
},
"SkipToContent": {
"description": "First line of the GitHub manifest page",
"type": [ "string", "null" ],
"minLength": 15,
"maxLength":15,
"enum": [
"Skip to content"
],
},
"manifests": {
"description": "First word of the last half of a manifest file URL",
"type": [ "string", "null" ],
"minLength": 16,
"maxLength":1024,
"pattern": "^manifests/",
}
}
}
Loading
Loading