<# FPS:Containers:Make:SC-Changes:ACTIVE #>

 

if (!(Push-NeededFor Changes)) {

    # Remove a prior patch if it already exists

    Remove-Item -Path Function:\Changes

} else {

    # Only load the help line if a prior release is not present, otherwise just keep whats there.

    $genShortcuts = @($genShortcuts

    (ConvertTo-DotFill $global:SCDotLen 'Changes')+"[-Delta n, -Source Runtime/Source ] Displays the changes for the last n days (2=Def)."

    )

}

 

function Changes {

 

<#

 

.DESCRIPTION

Module: Make

Shortcut: SC-Changes.ps1

Has Dependencies: Yes

 

Displays the changes for the last n days for the {fps:containers} directory and the {media:web}.  The default delta is

the last day.

   

.EXAMPLE

if (Push-NeededFor Changes) { . (Get-ActiveFileNm -PS1 Changes) }

changes 10

 

.CC

 

[2025.03.18 JD] Hardcoded the Format-Changes -Source parameter.

[2024.11.16 JD] There was a repeating method that was being used in the prior version. This method was consolidated to

                the CmdLet Format-Changes and implemented within this shortcut.

[2024.11.15 JD] Updated the output for matches against the other value in source or runtime.

[2024.11.07 JD] Original code release

 

.NOTES

As written, just containers and web are searched. If other directories are needed, then they should be added directly to

the code or parameterization made.

 

Since Get-Folder uses a GMT time, everything will be +5 hours on the day span.  We can correct this within the output, but the

search itself will yeild some mysterious results for items updated around day change.  May want to see about updating Get-Folder

to see about more precise time.

 

#>

   

    [CmdletBinding()]

        param(

        [Parameter(Mandatory=$false)] [int]$Delta=2,

        [Parameter(Mandatory=$false)] [string]$Source='Runtime' # Runtime or Source

 

    )

 

    #$Delta,$Source,$overrideSnippet = 3,'Runtime','SC-Changes' # For testing

    . (Get-ActiveFileNm -PS1 Load-Make-Dependencies)

    $overrideSrc = 'CICD' # CICD has a duplicate need for the the locations needed for this shortcut

    . (Get-ActiveFileNm -PS1 Initialize-Make-Locations)

 

    Write-Output ('$Delta = '+$Delta+', $Source = '+$Source)

    Write-Output ' '

 

    if ($Source -eq 'Runtime') {

 

        $title,$ComparePath,$ComplementPath = 'Containers',$makLoc_CICDTargetContainers,$makLoc_CICDSourceContainers

        Format-Changes -Title $title -Delta $Delta -Source Runtime -ComparePath $ComparePath -ComplementPath $ComplementPath

 

        $title,$ComparePath,$ComplementPath = 'MetaData',$makLoc_CICDTargetMetadata,$makLoc_CICDSourceMetadata

        Format-Changes -Title $title -Delta $Delta -Source Runtime -ComparePath $ComparePath -ComplementPath $ComplementPath

 

        $title,$ComparePath,$ComplementPath = 'Web',$makLoc_CICDTargetWebLocal,$makLoc_CICDSourceWebLocal

        Format-Changes -Title $title -Delta $Delta -Source Runtime -ComparePath $ComparePath -ComplementPath $ComplementPath

 

    } else {

 

        $title,$ComparePath,$ComplementPath = 'Containers',$makLoc_CICDSourceContainers,$makLoc_CICDTargetContainers

        Format-Changes -Title $title -Delta $Delta -Source Source -ComparePath $ComparePath -ComplementPath $ComplementPath

 

        $title,$ComparePath,$ComplementPath = 'MetaData',$makLoc_CICDSourceMetadata,$makLoc_CICDTargetMetadata

        Format-Changes -Title $title -Delta $Delta -Source Source -ComparePath $ComparePath -ComplementPath $ComplementPath

 

        $title,$ComparePath,$ComplementPath = 'Web',$makLoc_CICDSourceWebLocal,$makLoc_CICDTargetWebLocal

        Format-Changes -Title $title -Delta $Delta -Source Source -ComparePath $ComparePath -ComplementPath $ComplementPath

 

    }

 

}