Public/Set-ActiveSetup.ps1

function Set-ActiveSetup
{
    <#
        .DESCRIPTION
            Create an Active Setup registry entry
        
        .PARAMETER Name
            Specify the name of the Active Setup entry

        .PARAMETER Command
            Specify the command the Active Setup entry will run

        .PARAMETER Version
            Specify the version of the Active Setup entry

        .EXAMPLE
            Set-ActiveSetup -Name "VLC_First_Run" -Command "$ENV:ProgramFiles\VideoLAN\VLC\CopyFile.bat" -Version "1.0.0.0"

        .NOTES
            Created by: Jon Anderson
            Modified: 2023-07-10
    #>

    [CmdletBinding()]
    param(   
        [Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()]
        [String]$Name,
        [Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()]
        [String]$Command,
        [Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()]
        [String]$Version
    )

    Write-LogEntry -Value "Creating an Active Setup task: $Name" -Severity 1
    Set-RegistryValue -RegKey "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\$Name" -Name "StubPath" -PropertyType String -Value $Command
    Set-RegistryValue -RegKey "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\$Name" -Name "Version" -PropertyType String -Value $Version
}