functions/Install-IntuneResourcetriggers.ps1

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

        [Parameter(ValueFromPipelineByPropertyName)]
        [String]
        $ProfilePath,
        
        [Parameter(ValueFromPipelineByPropertyName)]
        [String]
        $CentralDataPath,
        
        [Parameter(ValueFromPipelineByPropertyName)]
        [String]
        $LogPath
    )
    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)')]]
</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
# MIIufAYJKoZIhvcNAQcCoIIubTCCLmkCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCJGDSkQUexq4kP
# zBHEb4Pokj8SqdNpj1q78+73KmB5caCCE/8wggVyMIIDWqADAgECAhB2U/6sdUZI
# k/Xl10pIOk74MA0GCSqGSIb3DQEBDAUAMFMxCzAJBgNVBAYTAkJFMRkwFwYDVQQK
# ExBHbG9iYWxTaWduIG52LXNhMSkwJwYDVQQDEyBHbG9iYWxTaWduIENvZGUgU2ln
# bmluZyBSb290IFI0NTAeFw0yMDAzMTgwMDAwMDBaFw00NTAzMTgwMDAwMDBaMFMx
# CzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMSkwJwYDVQQD
# EyBHbG9iYWxTaWduIENvZGUgU2lnbmluZyBSb290IFI0NTCCAiIwDQYJKoZIhvcN
# AQEBBQADggIPADCCAgoCggIBALYtxTDdeuirkD0DcrA6S5kWYbLl/6VnHTcc5X7s
# k4OqhPWjQ5uYRYq4Y1ddmwCIBCXp+GiSS4LYS8lKA/Oof2qPimEnvaFE0P31PyLC
# o0+RjbMFsiiCkV37WYgFC5cGwpj4LKczJO5QO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