init commit 2

This commit is contained in:
iFlip721
2025-04-16 10:06:55 -04:00
parent a03209dc9e
commit a7f9f1799f
6 changed files with 76 additions and 150 deletions

View File

@@ -2,8 +2,8 @@
[CmdLetBinding()]
Param (
[Alias('env')]
[ValidateSet('DCMA_DEV', 'DCMA_Sustainment', 'DCMA_TEST', 'DCMA_PROD', 'ACP-DCMA-CDE-DEV', 'ACP-DCMA-CDE-PROD')]
[string]$Environment = 'DCMA_DEV',
[ValidateSet('DEV', 'STAGING', 'TESTING')]
[string]$Environment = 'DEV',
$Path = (Get-Location).Path,
[Alias('m')]
[switch]$Managed,
@@ -12,7 +12,7 @@
[Alias('sn')]
[switch]$SolutionName
)
begin {
$Path = @{
@@ -26,10 +26,10 @@
sourceConfig = (Join-Path -Path $PSScriptRoot -ChildPath 'source\config.ps1')
sourceIgnore = (Join-Path -Path $PSScriptRoot -ChildPath 'source\.gitignore')
}
$config = (Get-Content $Path.pathConfig | ConvertFrom-Json)
$env = ($config.env | ?{$_.name -eq $Environment})
function ConfiguredEnvironments () {
if (!$env) {
do {
@@ -44,7 +44,7 @@
return ($config.env | ?{$_.id -eq $environmentId})
}
}
function NameThatSolution () {
#Write-Host "┌───────────────────────────────────────────────────────────────┐" -ForegroundColor Green
#Write-Host "│" -ForegroundColor Green -NoNewLine; Write-Host "`t`t`tNAME THAT SOLUTION`t`t`t" -ForegroundColor Cyan -NoNewline; Write-Host "│" -ForegroundColor Green
@@ -64,7 +64,7 @@
#$Path.leaf = $solutionNewName
return $solutionNewName
}
function GetAvailablePatches () {
#Write-Host "┌───────────────────────────────────────────────────────────────┐" -ForegroundColor Green
#Write-Host "│" -ForegroundColor Green -NoNewLine; Write-Host "`t`t`tAVAILABLE PATCHES`t`t`t" -ForegroundColor Cyan -NoNewline; Write-Host "│" -ForegroundColor Green
@@ -100,11 +100,11 @@
}
}
process {
$pacAuthResponse = & $Global:pptConfig.pacPath auth list
switch ($pacAuthResponse) {
{$_ -match 'No profiles were found on this computer'} {
@@ -126,15 +126,15 @@
$IsAuth = $false
}#>
}
{$_ -match '\*'} {
Write-Host "[ Info ] " -ForegroundColor Green -nonewline
write-host "Authentication profile found" -ForegroundColor Cyan
& $Global:pptConfig.pacPath org select -env $env.env_id
$IsAuth = $true}
#Default {Write-Warning -Message "Unhandled exception"; return}
}
Switch($Patch) {
@@ -162,18 +162,18 @@
Write-Host "[ Info ] " -ForegroundColor Green -nonewline; write-host "Building $(If($Managed){'managed'}else{'unmanaged'}) solution" -ForegroundColor Cyan
& $Global:pptConfig.pacPath solution export --name $Path.leaf -ow --path $Path.path $(if($Managed){'--managed'})
& $Global:pptConfig.pacPath solution unpack --zipfile "$($Path.leaf)$(If($Managed){'_managed'}).zip" --folder $Path.path -pca --packagetype $(If($Managed){'Managed'}else{'Unmanaged'}) --errorLevel Verbose
} else {
Write-Host '[ Error ] ' -ForegroundColor Yellow -nonewline; write-host 'Fatal exception' -ForegroundColor Red
return
}
}
}
}
end {
If($SolutionName) {