Invoke-AsCurrentUser_WithArgs.psd1
|
@{ # Script module file associated with this manifest RootModule = 'Invoke-AsCurrentUser_WithArgs.psm1' # Version number ModuleVersion = '1.1.0' # Supported PSEditions CompatiblePSEditions = @('Desktop', 'Core') # ID used to uniquely identify this module GUID = 'f7a3b2c1-8d4e-4f6a-9b5c-1e2d3f4a5b6c' # Author Author = 'Harze2k' # Company or vendor CompanyName = 'Community' # Copyright statement Copyright = '(c) 2025-2026. All rights reserved.' # Description Description = 'Execute PowerShell scriptblocks in the context of the currently logged-in user from a SYSTEM context. Ideal for Intune deployments, SCCM task sequences, and scheduled tasks. Supports argument passing, transcript capture, stream capture, and configurable timeouts.' # Minimum PowerShell version required PowerShellVersion = '5.1' # Functions to export from this module FunctionsToExport = @( 'Invoke-AsCurrentUser_WithArgs', 'Serialize-Object', 'Deserialize-Object', 'Get-RunAsUserCSharpSource' ) # Cmdlets to export CmdletsToExport = @() # Variables to export VariablesToExport = @() # Aliases to export AliasesToExport = @() # Private data to pass to the module PrivateData = @{ PSData = @{ # Tags applied to this module for module discovery Tags = @('RunAsUser', 'Intune', 'SCCM', 'SYSTEM', 'UserContext', 'Deployment', 'Windows') # License URI LicenseUri = 'https://github.com/Harze2k/Shared-PowerShell-Modules/blob/main/LICENSE' # Project URI ProjectUri = 'https://github.com/Harze2k/Shared-PowerShell-Modules/Invoke-AsCurrentUser_WithArgs' # Icon URI # IconUri = '' # Release notes ReleaseNotes = @' ## Version 1.1.0 - Replaced all throw statements with Write-Error and graceful return patterns to prevent script termination - Improved error handling: functions now return $null on failure instead of throwing - Added consistent ExecutionSuccess property to all result output paths - Stream capture results (StdOut, StdErr, Warnings, Verbose) now always present when -CaptureStreams is used (empty string instead of missing) - Improved parameter validation error messages with Write-Error instead of silent Write-Warning - Updated function descriptions and synopsis for clarity - Fixed WorkingDirectory parameter validation to handle empty strings properly - Added error result output on Add-Type compilation failure - Improved timeout handling to return structured error objects instead of throwing - Backup log file naming now uses timestamp instead of random number for easier troubleshooting ## Version 1.0.0 - Initial release - Execute scriptblocks as currently logged-in user - Pass arguments/variables to scriptblocks - Capture transcript and execution results - Support for PowerShell 5.1 and 7+ - Configurable timeout handling - Optional stream capture (stdout/stderr) '@ # Prerelease string # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update RequireLicenseAcceptance = $false # External dependent modules ExternalModuleDependencies = @() } } # Help info URI HelpInfoURI = 'https://github.com/Harze2k/Shared-PowerShell-Modules/Invoke-AsCurrentUser_WithArgs/wiki' } |