functions/Install-IntuneResourcetriggers.ps1

function Install-IntuneResourceTriggers {
    [CmdletBinding()]
    param (
        [Parameter(ValueFromPipelineByPropertyName)]
        [Byte[]]
        $Key,

        [Parameter(ValueFromPipelineByPropertyName)]
        [String]
        $ProfilePath,
        
        [Parameter(ValueFromPipelineByPropertyName)]
        [String]
        $CentralDataPath = "$([System.Environment]::GetFolderPath('CommonApplicationData'))/IntuneResourceLocalization",
        
        [Parameter(ValueFromPipelineByPropertyName)]
        [String]
        $LogPath = "$([System.Environment]::GetFolderPath('CommonApplicationData'))/IntuneResourceLocalization/Logs"
    )
    begin {
        # if (!$Script:Configuration) {
        # throw 'The configuration has not been set yet. Please use the cmdlet "Get-IntuneResourceEnvironment" to initialize'
        # }
        try {
            $ScheduledTaskConfiguration = (Get-IntuneCustomConfiguration).taskSchedulerTasks
        }
        catch {
            throw 'Cannot access the configuration file detailing Scheduled Task information'
        }
    }
    
    process {

        function createScheduledTaskEventTrigger {
            [CmdletBinding()]
            param(
                [PSCustomObject] $TriggerConfig
            )
            
            #$Trigger = New-ScheduledTaskTrigger -AtLogOn
            $CIMTriggerClass = Get-CimClass -ClassName MSFT_TaskEventTrigger -Namespace Root/Microsoft/Windows/TaskScheduler:MSFT_TaskEventTrigger
            $Trigger = New-CimInstance -CimClass $CIMTriggerClass -ClientOnly

            if ($TriggerConfig | Get-Member -MemberType Properties | Where-Object { $_.Name -eq "sourceDataName" }) {
                $Trigger.Subscription = @"
<QueryList>
<Query Id="0" Path="$($TriggerConfig.sourceLog)">
<Select Path="$($TriggerConfig.sourceLog)">
*[System[Provider[@Name='$(($TriggerConfig.sourceLog -split '/')[0])'] and EventID=$($TriggerConfig.sourceEventID)]]
and
*[EventData[Data[@Name='$($TriggerConfig.sourceDataName)'] and (Data='$($TriggerConfig.sourceDataValue)')]]
and
*[EventData[Data[@Name='$($TriggerConfig.sourceHostName)'] and (Data='$($TriggerConfig.sourceHostValue)')]]
</Select>
</Query>
</QueryList>
"@

            }
            else {
                $Trigger.Subscription = @"
<QueryList>
<Query Id="0" Path="$($TriggerConfig.sourceLog)">
<Select Path="$($TriggerConfig.sourceLog)">
*[System[Provider[@Name='$(($TriggerConfig.sourceLog -split '/')[0])'] and EventID=$($TriggerConfig.sourceEventID)]]
</Select>
</Query>
</QueryList>
"@

            }
            $Trigger.Enabled = $True
            return $Trigger
        }

        function createScheduledTaskAtLogonTrigger {
            [CmdletBinding()]
            param(
                [PSCustomObject] $TriggerConfig
            )
            
            $Trigger = New-ScheduledTaskTrigger -AtLogOn # -User ([System.Security.Principal.WindowsIdentity]::GetCurrent().Name)
            # $Trigger.Delay = 'PT10S' # No longer wanted.
            $Trigger.Enabled = $True
            return $Trigger
        }

        function createScheduledTaskAtWorkstationUnlockTrigger {
            [CmdletBinding()]
            param(
                [PSCustomObject] $TriggerConfig
            )

            $CIMTriggerClass = Get-CimClass -ClassName MSFT_TaskSessionStateChangeTrigger -Namespace Root/Microsoft/Windows/TaskScheduler
            $Trigger = New-CimInstance -CimClass $CIMTriggerClass -ClientOnly
            $Trigger.StateChange = 8  # TASK_SESSION_STATE_CHANGE_TYPE.TASK_SESSION_UNLOCK (taskschd.h)
            $Trigger.Enabled = $True
            return $Trigger
        }
        function createScheduledTaskTrigger {
            [CmdletBinding()]
            param(
                [PSCustomObject] $TriggerConfig
            )
            if ($TriggerConfig.triggerType -eq "Event") {

                return createScheduledTaskEventTrigger -TriggerConfig $TriggerConfig
            }
            elseif ($TriggerConfig.triggerType -eq "AtLogon") {

                return createScheduledTaskAtLogonTrigger -TriggerConfig $TriggerConfig
            }
            elseif ($TriggerConfig.triggerType -eq "AtWorkstationUnlock") {

                return createScheduledTaskAtWorkstationUnlockTrigger -TriggerConfig $TriggerConfig
            }
        }

        function createScheduledTaskEncodedCommandFromTemplateAction {
            [CmdletBinding()]
            param(
                [PSCustomObject] $ActionConfig
            )
            
            $ScriptContents = (Get-IntuneScriptTemplates)[$ActionConfig.templateScript]
            If ($ProfilePath) {
                $ScriptContents = $ScriptContents.Replace("`$ProfilePath = ([System.Environment]::GetFolderPath('UserProfile'))", "`$ProfilePath = '$($ProfilePath)'")
            }
            if ($CentralDataPath) {
                $ScriptContents = $ScriptContents.Replace("`$CentralDataPath = (Join-Path -Path ([System.Environment]::GetFolderPath('CommonApplicationData')) -ChildPath 'IntuneResourceLocalization')", "`$CentralDataPath = '$($CentralDataPath)'")
            }
            if ($LogPath) {
                $ScriptContents = $ScriptContents.Replace("`$LogPath = Join-Path -Path ([System.Environment]::GetFolderPath('UserProfile')) -ChildPath `"Documents\WindowsPowerShell\Transcripts`"", "`$LogPath = '$($LogPath)'")
            }
            if ($key) {
                $ScriptContents = $ScriptContents.Replace('$Key = $null', "`$Key = @($($Key -join ','))")
            }
            $scriptBlockString = $ScriptContents.ToString()
            $bytes = [System.Text.Encoding]::Unicode.GetBytes($scriptBlockString)
            $encodedCommand = [Convert]::ToBase64String($bytes)

            # $Action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-NonInteractive -WindowStyle Hidden -EncodedCommand $($encodedCommand)"
            
            # 2023-10-25: changing to .cmd /c start /min "" powershell... to minimize pop-ups
            $encoding = if ($PSVersionTable.PSEdition -eq 'Core') {
                [System.Text.Encoding]::UTF8
            }
            else {
                'UTF8'
            }
            $ScriptContents | Out-File -FilePath (Join-Path -Path $($CentralDataPath) -ChildPath "$($ActionConfig.templateScript).ps1") -Encoding $encoding
            $Action = New-ScheduledTaskAction -Execute "cmd" -Argument "/c start /min """" powershell -WindowStyle Hidden -File ""$(Join-Path -Path $($CentralDataPath) -ChildPath "$($ActionConfig.templateScript).ps1")"""

            # 2023-09: Separate Start-Process to try and hide the window
            # $Action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-WindowStyle Hidden -Command `"& {Start-Process -FilePath 'powershell.Exe' -Wait -NoNewWindow -ArgumentList '-WindowStyle Hidden -EncodedCommand $($encodedCommand)'} `""

            # powershell.exe -Command '& {Start-Process -FilePath ''C:\windows\system32\WindowsPowerShell\v1.0\powershell.Exe'' -ArgumentList ''-EncodedCommand <snip>'' -Wait -WindowStyle Minimized }'


            return $Action
        }
        function createScheduledTaskAction {
            [CmdletBinding()]
            param(
                [PSCustomObject] $ActionConfig
            )
            if ($ActionConfig.actionType -eq "EncodedCommand") {

                return createScheduledTaskEncodedCommandFromTemplateAction -ActionConfig $ActionConfig
            }
        }

        function getUserToRunUnder {
            [CmdletBinding(DefaultParameterSetName = 'User')]
            param(
                [Parameter(Mandatory, ParameterSetName = 'User')]
                [String]$User,

                [Parameter(Mandatory, ParameterSetName = 'Group')]
                [String]
                $Group
            )
            $TaskPrincipalOptions = switch ($PSCmdlet.ParameterSetName) {
                'User' {
                    switch ($User) {
                        'CurrentUser' {
                            @{
                                UserId    = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
                                LogonType = 'Interactive'
                                RunLevel  = 'Limited'
                            }
                        }
                        
                        'LocalSystem' {
                            @{
                                UserId    = 'NT AUTHORITY\SYSTEM'
                                LogonType = 'ServiceAccount'
                                RunLevel  = 'Highest'
                            }
                        }

                        'LastLoggedOn' {
                            $lastLogonEvent = Get-WinEvent -LogName Security -FilterXPath "*[System[EventID=4624]]" | Sort-Object TimeCreated -Descending | Select-Object -First 1
                            $loggedInUser = $lastLogonEvent.Properties[5].Value            
                            @{
                                UserId    = $loggedInUser
                                LogonType = 'Interactive'
                                RunLevel  = 'Limited'
                            }
                        }
                    }
                }
                'Group' {
                    @{
                        GroupId  = $Group
                        RunLevel = 'Limited'
                    }
                }
            }
            New-ScheduledTaskPrincipal @TaskPrincipalOptions
        }
        

        foreach ($ScheduledTask in ($ScheduledTaskConfiguration)) {
            Write-Information "Creating Scheduled Task '$($ScheduledTask.Name)'"

            $Actions = @() + ( $ScheduledTask.actions | ForEach-Object {
                    return createScheduledTaskAction -ActionConfig $_
                })

            $Triggers = @() + ( $ScheduledTask.triggers | ForEach-Object {
                    return createScheduledTaskTrigger -TriggerConfig $_
                })

            $Principal = if ($ScheduledTask.user) {
                getUserToRunUnder -User $ScheduledTask.user
            }
            else {
                getUSerToRunUnder -Group $ScheduledTask.group
            }
            $TaskSettings = @{
                AllowStartIfOnBatteries         = $true
                Compatibility                   = 'Win8'
                DisallowDemandStart             = $false
                DisallowHardTerminate           = $false
                DisallowStartOnRemoteAppSession = $true
                DontStopIfGoingOnBatteries      = $true 
                DontStopOnIdleEnd               = $true
                MultipleInstances               = 'IgnoreNew' # 'Queue' # 'Parallel' # 'IgnoreNew'
                RunOnlyIfIdle                   = $false
            }
            $ScheduledTaskSettings = (New-ScheduledTaskSettingsSet @TaskSettings )
            Register-ScheduledTask -TaskName $ScheduledTask.Name -Action $Actions -Trigger $Triggers -Principal $Principal -Settings $ScheduledTaskSettings -Force

            if ($ScheduledTask.startAfterInstallation) {
                Start-ScheduledTask -TaskName $ScheduledTask.Name
            }

        }
    }
    
    end {
    }
}

# SIG # Begin signature block
# MIIumAYJKoZIhvcNAQcCoIIuiTCCLoUCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCRXxEkdvyEQwLd
# hfORfHQAbP/re1zhQDS5/30vY+Z806CCE/8wggVyMIIDWqADAgECAhB2U/6sdUZI
# k/Xl10pIOk74MA0GCSqGSIb3DQEBDAUAMFMxCzAJBgNVBAYTAkJFMRkwFwYDVQQK
# ExBHbG9iYWxTaWduIG52LXNhMSkwJwYDVQQDEyBHbG9iYWxTaWduIENvZGUgU2ln
# bmluZyBSb290IFI0NTAeFw0yMDAzMTgwMDAwMDBaFw00NTAzMTgwMDAwMDBaMFMx
# CzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMSkwJwYDVQQD
# EyBHbG9iYWxTaWduIENvZGUgU2lnbmluZyBSb290IFI0NTCCAiIwDQYJKoZIhvcN
# AQEBBQADggIPADC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