Skip to content

Instantly share code, notes, and snippets.

View wise-io's full-sized avatar
🏢
Working remotely

Aaron Stevenson wise-io

🏢
Working remotely
View GitHub Profile
@FriedrichWeinmann
FriedrichWeinmann / Invoke-SystemCommand.ps1
Created January 24, 2023 16:54
Execute a scriptblock as SYSTEM by setting up a temporary scheduled task.
function Invoke-SystemCommand {
<#
.SYNOPSIS
Execute a scriptblock as SYSTEM by setting up a temporary scheduled task.
.DESCRIPTION
Execute a scriptblock as SYSTEM by setting up a temporary scheduled task.
.PARAMETER Name
The name of the task