From 3bad09ea64946e1e6e799809c9f716b140c49011 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Feb 2026 03:47:12 +0000 Subject: [PATCH 1/2] Initial plan From 0d9572dba81b7c24008c27bb8847bd8b30744b70 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Feb 2026 03:51:45 +0000 Subject: [PATCH 2/2] Add PowerShell custom field compatibility shim for non-Ninja environments Co-authored-by: OwenIbarra <156828136+OwenIbarra@users.noreply.github.com> --- ...Active Directory - Active Users Report.ps1 | 2 + ...tory - Domain Controller Health Report.ps1 | 2 + ...ive Directory - Get Inactive Computers.ps1 | 2 + ...Get Last Login Time for all Member PCs.ps1 | 2 + ...rectory - Get Organizational Unit (OU).ps1 | 2 + ... Directory - Join Computer to a Domain.ps1 | 2 + ...tory - Remove Computer from the Domain.ps1 | 2 + ... Directory - Replication Health Report.ps1 | 2 + .../Audit Autopilot Hardware ID.ps1 | 2 + Powershell Scripts/Audit UAC Level.ps1 | 2 + Powershell Scripts/Boot Time Alert.ps1 | 2 + Powershell Scripts/Check Battery Health.ps1 | 2 + ...Check Windows 11 Upgrade Compatibility.ps1 | 2 + .../Collect MSSQL Instances.ps1 | 2 + Powershell Scripts/Create New Local User.ps1 | 2 + Powershell Scripts/Create Windows VPN.ps1 | 2 + .../Credential Guard Status.ps1 | 2 + .../CustomFieldCompatibility.ps1 | 92 +++++++++++++++++++ Powershell Scripts/Deploy Wi-Fi Profile.ps1 | 2 + .../Detect Installed Antivirus.ps1 | 2 + .../Device Uptime Percentage Monitor.ps1 | 2 + Powershell Scripts/Disk Space Alert.ps1 | 2 + Powershell Scripts/Download File From URL.ps1 | 2 + .../Example - Get Custom Field Value.ps1 | 2 + .../Example - Set a Custom Field.ps1 | 2 + Powershell Scripts/Exchange Version Check.ps1 | 2 + .../Failed Password Attempt Report.ps1 | 2 + .../File or Folder Exists Alert.ps1 | 2 + .../Find Certificate with Thumbprint.ps1 | 2 + .../Find File with Extension.ps1 | 2 + Powershell Scripts/Find Registry Key.ps1 | 2 + .../Find Rogue DHCP Servers Using Nmap.ps1 | 2 + .../Firewall - Audit Status.ps1 | 2 + Powershell Scripts/Get Device Description.ps1 | 2 + ...rect Link To ConnectWise ScreenConnect.ps1 | 2 + Powershell Scripts/Get OS Install Date.ps1 | 2 + Powershell Scripts/Get Server Roles.ps1 | 2 + .../Get iSCSI Connection Details.ps1 | 2 + Powershell Scripts/Hash Found Alert.ps1 | 2 + .../Hyper-V - Checkpoint Expiration Alert.ps1 | 2 + ...er-V - Get Host Server Name from Guest.ps1 | 2 + .../Hyper-V - Replication Alert.ps1 | 2 + ...per-V - Shared Volume Disk Space Alert.ps1 | 2 + .../Install Certificate - Windows.ps1 | 2 + .../Installed Remote Access Tools Report.ps1 | 2 + Powershell Scripts/Last Reboot Reason.ps1 | 2 + .../List Browser Extensions.ps1 | 2 + Powershell Scripts/Local Admins Report.ps1 | 2 + .../Local Certificate Expiration Alert.ps1 | 2 + Powershell Scripts/Local Users Report.ps1 | 2 + Powershell Scripts/Locked Out User Report.ps1 | 2 + Powershell Scripts/Microsoft Entra Audit.ps1 | 2 + .../Network Connection Profile Check.ps1 | 2 + .../Orphaned User Profile Report.ps1 | 2 + .../PKFail Vulnerability Check.ps1 | 2 + .../Password Expiration Alert_Report.ps1 | 2 + ...Remote Desktop - Check Status and Port.ps1 | 2 + .../Remove Microsoft Bloatware.ps1 | 2 + Powershell Scripts/Rename Computer.ps1 | 2 + .../Reset an Account Password.ps1 | 2 + .../Save Hard Drive Type to Custom Field.ps1 | 2 + .../Scheduled Task Created Alert.ps1 | 2 + Powershell Scripts/Scheduled Task Report.ps1 | 2 + .../Search DNS Cache Entries.ps1 | 2 + Powershell Scripts/Search Event Log.ps1 | 2 + ...P Connections for Specified IP Address.ps1 | 2 + ...ch for Listening and Established Ports.ps1 | 2 + .../Set Custom Field if Path Exists.ps1 | 2 + .../Start Microsoft MSERT Scan.ps1 | 2 + .../Startup Audit Using Autorunsc.ps1 | 2 + .../System Performance Check.ps1 | 2 + .../System Restore - Check Status.ps1 | 2 + .../System Restore - Restore Point Report.ps1 | 2 + ...leshoot Printers and Clear Print Queue.ps1 | 2 + Powershell Scripts/USB Drive Alert.ps1 | 2 + Powershell Scripts/USB Storage Status.ps1 | 2 + Powershell Scripts/Unsigned Driver Alert.ps1 | 2 + .../Update Group Policy (gpupdate).ps1 | 2 + ...e Location Custom Field based on GeoIP.ps1 | 2 + .../User Must Be Logged In Alert.ps1 | 2 + .../User Profile Size Report.ps1 | 2 + .../User or Group Membership Report.ps1 | 2 + .../Verify running processes are signed.ps1 | 2 + Powershell Scripts/WAN IP Blocklist Check.ps1 | 2 + Powershell Scripts/Wi-Fi Report.ps1 | 2 + .../Windows Update Diagnostic.ps1 | 2 + 86 files changed, 262 insertions(+) create mode 100644 Powershell Scripts/CustomFieldCompatibility.ps1 diff --git a/Powershell Scripts/Active Directory - Active Users Report.ps1 b/Powershell Scripts/Active Directory - Active Users Report.ps1 index ed18e9e..716599f 100644 --- a/Powershell Scripts/Active Directory - Active Users Report.ps1 +++ b/Powershell Scripts/Active Directory - Active Users Report.ps1 @@ -65,6 +65,8 @@ param ( [Switch]$ExcludeDisabledUsers = [System.Convert]::ToBoolean($env:excludeDisabledUsersFromReport) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Tests for administrative rights which is required to get the last logon date. function Test-IsElevated { diff --git a/Powershell Scripts/Active Directory - Domain Controller Health Report.ps1 b/Powershell Scripts/Active Directory - Domain Controller Health Report.ps1 index 967b779..bb436f5 100644 --- a/Powershell Scripts/Active Directory - Domain Controller Health Report.ps1 +++ b/Powershell Scripts/Active Directory - Domain Controller Health Report.ps1 @@ -80,6 +80,8 @@ param ( [String]$wysiwygCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script form variables are used, replace command line parameters with their value. if ($env:wysiwygCustomFieldName -and $env:wysiwygCustomFieldName -notlike "null") { $wysiwygCustomField = $env:wysiwygCustomFieldName } diff --git a/Powershell Scripts/Active Directory - Get Inactive Computers.ps1 b/Powershell Scripts/Active Directory - Get Inactive Computers.ps1 index 0193274..997a9df 100644 --- a/Powershell Scripts/Active Directory - Get Inactive Computers.ps1 +++ b/Powershell Scripts/Active Directory - Get Inactive Computers.ps1 @@ -39,6 +39,8 @@ param ( [String]$WysiwygCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsElevated { $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() diff --git a/Powershell Scripts/Active Directory - Get Last Login Time for all Member PCs.ps1 b/Powershell Scripts/Active Directory - Get Last Login Time for all Member PCs.ps1 index 074c4a7..7ae154e 100644 --- a/Powershell Scripts/Active Directory - Get Last Login Time for all Member PCs.ps1 +++ b/Powershell Scripts/Active Directory - Get Last Login Time for all Member PCs.ps1 @@ -51,6 +51,8 @@ param ( [Switch]$QueryForLastUserLogon ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # CIM timeout $CIMTimeout = 10 diff --git a/Powershell Scripts/Active Directory - Get Organizational Unit (OU).ps1 b/Powershell Scripts/Active Directory - Get Organizational Unit (OU).ps1 index 0f62e03..8c0b8c5 100644 --- a/Powershell Scripts/Active Directory - Get Organizational Unit (OU).ps1 +++ b/Powershell Scripts/Active Directory - Get Organizational Unit (OU).ps1 @@ -38,6 +38,8 @@ param ( [String]$CustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If using script form variables, replace command line parameters with the form variables. if ($env:customFieldName -and $env:customFieldName -notlike "null") { $CustomFieldName = $env:customFieldName } diff --git a/Powershell Scripts/Active Directory - Join Computer to a Domain.ps1 b/Powershell Scripts/Active Directory - Join Computer to a Domain.ps1 index 52c303f..9ad79f3 100644 --- a/Powershell Scripts/Active Directory - Join Computer to a Domain.ps1 +++ b/Powershell Scripts/Active Directory - Join Computer to a Domain.ps1 @@ -47,6 +47,8 @@ param ( [Switch]$NoRestart = [System.Convert]::ToBoolean($env:noRestart) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Get-NinjaProperty { [CmdletBinding()] diff --git a/Powershell Scripts/Active Directory - Remove Computer from the Domain.ps1 b/Powershell Scripts/Active Directory - Remove Computer from the Domain.ps1 index d782838..9446e35 100644 --- a/Powershell Scripts/Active Directory - Remove Computer from the Domain.ps1 +++ b/Powershell Scripts/Active Directory - Remove Computer from the Domain.ps1 @@ -38,6 +38,8 @@ param ( [Switch]$NoRestart = [System.Convert]::ToBoolean($env:noRestart) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Get-NinjaProperty { [CmdletBinding()] diff --git a/Powershell Scripts/Active Directory - Replication Health Report.ps1 b/Powershell Scripts/Active Directory - Replication Health Report.ps1 index 458bf62..80051c8 100644 --- a/Powershell Scripts/Active Directory - Replication Health Report.ps1 +++ b/Powershell Scripts/Active Directory - Replication Health Report.ps1 @@ -115,6 +115,8 @@ param ( [Parameter()] [String]$ExportTXT ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsElevated { $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() diff --git a/Powershell Scripts/Audit Autopilot Hardware ID.ps1 b/Powershell Scripts/Audit Autopilot Hardware ID.ps1 index dc3a7f1..cd8a1f2 100644 --- a/Powershell Scripts/Audit Autopilot Hardware ID.ps1 +++ b/Powershell Scripts/Audit Autopilot Hardware ID.ps1 @@ -28,6 +28,8 @@ param ( $CustomField = "hardwareid" ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:customFieldName -and $env:customFieldName -notlike "null") { $CustomField = $env:customFieldName } diff --git a/Powershell Scripts/Audit UAC Level.ps1 b/Powershell Scripts/Audit UAC Level.ps1 index 34d50c0..f3dbb2d 100644 --- a/Powershell Scripts/Audit UAC Level.ps1 +++ b/Powershell Scripts/Audit UAC Level.ps1 @@ -26,6 +26,8 @@ param ( [String]$CustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:customFieldName -and $env:customFieldName -notlike "null") { $CustomField = $env:customFieldName } diff --git a/Powershell Scripts/Boot Time Alert.ps1 b/Powershell Scripts/Boot Time Alert.ps1 index 0ef73a1..aeeb2be 100644 --- a/Powershell Scripts/Boot Time Alert.ps1 +++ b/Powershell Scripts/Boot Time Alert.ps1 @@ -51,6 +51,8 @@ param ( [String]$BootCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:bootCustomField -and $env:bootCustomField -notlike "null") { $BootCustomField = $env:bootCustomField diff --git a/Powershell Scripts/Check Battery Health.ps1 b/Powershell Scripts/Check Battery Health.ps1 index c608e20..32d5e1b 100644 --- a/Powershell Scripts/Check Battery Health.ps1 +++ b/Powershell Scripts/Check Battery Health.ps1 @@ -142,6 +142,8 @@ param ( [String]$WYSIWYGCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script form variables are used, replace the commandline parameters with their value. if ($env:wysiwygCustomFieldName -and $env:wysiwygCustomFieldName -notlike "null") { $WYSIWYGCustomField = $env:wysiwygCustomFieldName } diff --git a/Powershell Scripts/Check Windows 11 Upgrade Compatibility.ps1 b/Powershell Scripts/Check Windows 11 Upgrade Compatibility.ps1 index be82afa..c34bf3f 100644 --- a/Powershell Scripts/Check Windows 11 Upgrade Compatibility.ps1 +++ b/Powershell Scripts/Check Windows 11 Upgrade Compatibility.ps1 @@ -28,6 +28,8 @@ param ( [String]$CustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:customFieldName -and $env:customFieldName -notlike "null") { $CustomFieldName = $env:customFieldName } diff --git a/Powershell Scripts/Collect MSSQL Instances.ps1 b/Powershell Scripts/Collect MSSQL Instances.ps1 index 067aff0..88c0fbc 100644 --- a/Powershell Scripts/Collect MSSQL Instances.ps1 +++ b/Powershell Scripts/Collect MSSQL Instances.ps1 @@ -60,6 +60,8 @@ param ( [String]$WysiwygCustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsElevated { $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() diff --git a/Powershell Scripts/Create New Local User.ps1 b/Powershell Scripts/Create New Local User.ps1 index 5d9517c..7a2cd51 100644 --- a/Powershell Scripts/Create New Local User.ps1 +++ b/Powershell Scripts/Create New Local User.ps1 @@ -71,6 +71,8 @@ param ( [Switch]$AddToLocalAdminGroup = [System.Convert]::ToBoolean($env:addToLocalAdminGroup) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Retrieve script form variables and replace the parameters with them, handling 'null' values. if ($env:usernameToAdd -and $env:usernameToAdd -notlike "null") { $Username = $env:usernameToAdd } diff --git a/Powershell Scripts/Create Windows VPN.ps1 b/Powershell Scripts/Create Windows VPN.ps1 index c29e9f7..c426233 100644 --- a/Powershell Scripts/Create Windows VPN.ps1 +++ b/Powershell Scripts/Create Windows VPN.ps1 @@ -149,6 +149,8 @@ param ( [Parameter()] [Switch]$SkipSleep ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { Add-Type -AssemblyName System.Drawing diff --git a/Powershell Scripts/Credential Guard Status.ps1 b/Powershell Scripts/Credential Guard Status.ps1 index e7855af..5c8c914 100644 --- a/Powershell Scripts/Credential Guard Status.ps1 +++ b/Powershell Scripts/Credential Guard Status.ps1 @@ -38,6 +38,8 @@ param ( [string]$TextCustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:TextCustomFieldName -and $TextCustomFieldName -ne 'null'){ $TextCustomFieldName = $env:TextCustomFieldName diff --git a/Powershell Scripts/CustomFieldCompatibility.ps1 b/Powershell Scripts/CustomFieldCompatibility.ps1 new file mode 100644 index 0000000..e3fc797 --- /dev/null +++ b/Powershell Scripts/CustomFieldCompatibility.ps1 @@ -0,0 +1,92 @@ +if (-not (Get-Command Ninja-Property-Set -ErrorAction SilentlyContinue)) { + if (-not $script:WorkflowCustomFieldStore) { + $script:WorkflowCustomFieldStore = @{} + } + + function Get-WorkflowCustomFieldStoreKey { + param( + [Parameter()] + [String]$Name, + [Parameter()] + [String]$DocumentName, + [Parameter()] + [String]$AttributeName + ) + + if ($AttributeName) { + if ($DocumentName) { + return ("doc:{0}:{1}" -f $DocumentName, $AttributeName) + } + + return "doc:$AttributeName" + } + + return "field:$Name" + } + + function Ninja-Property-Set { + param( + [Parameter(Mandatory = $true)] + [String]$Name, + [Parameter(Mandatory = $true)] + $Value + ) + + $script:WorkflowCustomFieldStore[(Get-WorkflowCustomFieldStoreKey -Name $Name)] = $Value + $Value + } + + function Ninja-Property-Get { + param( + [Parameter(Mandatory = $true)] + [String]$Name + ) + + $script:WorkflowCustomFieldStore[(Get-WorkflowCustomFieldStoreKey -Name $Name)] + } + + function Ninja-Property-Options { + param( + [Parameter(Mandatory = $true)] + [String]$Name + ) + + @() + } + + function Ninja-Property-Docs-Set { + param( + [Parameter(Mandatory = $true)] + [String]$AttributeName, + [Parameter(Mandatory = $true)] + $AttributeValue, + [Parameter()] + [String]$DocumentName + ) + + $script:WorkflowCustomFieldStore[(Get-WorkflowCustomFieldStoreKey -AttributeName $AttributeName -DocumentName $DocumentName)] = $AttributeValue + $AttributeValue + } + + function Ninja-Property-Docs-Get { + param( + [Parameter(Mandatory = $true)] + [String]$AttributeName, + [Parameter()] + [String]$DocumentName + ) + + $script:WorkflowCustomFieldStore[(Get-WorkflowCustomFieldStoreKey -AttributeName $AttributeName -DocumentName $DocumentName)] + } + + function Ninja-Property-Docs-Options { + param( + [Parameter(Mandatory = $true)] + [String]$AttributeName, + [Parameter()] + [String]$DocumentName + ) + + @() + } +} diff --git a/Powershell Scripts/Deploy Wi-Fi Profile.ps1 b/Powershell Scripts/Deploy Wi-Fi Profile.ps1 index fbe4599..af0dc1c 100644 --- a/Powershell Scripts/Deploy Wi-Fi Profile.ps1 +++ b/Powershell Scripts/Deploy Wi-Fi Profile.ps1 @@ -47,6 +47,8 @@ param ( [Switch]$Overwrite = [System.Convert]::ToBoolean($env:overwrite) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script form variables are used replace the command line parameters. if ($env:ssid -and $env:ssid -notlike "null") { $SSID = $env:ssid } diff --git a/Powershell Scripts/Detect Installed Antivirus.ps1 b/Powershell Scripts/Detect Installed Antivirus.ps1 index 5c5aa00..7b491a0 100644 --- a/Powershell Scripts/Detect Installed Antivirus.ps1 +++ b/Powershell Scripts/Detect Installed Antivirus.ps1 @@ -59,6 +59,8 @@ param ( [String]$DefinitionDateAndStatusCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script form variables are used, replace the command line parameters with their value. if ($env:daysConsideredOutdated -and $env:daysConsideredOutdated -notlike "null") { $DaysUntilConsideredOutdated = $env:daysConsideredOutdated } diff --git a/Powershell Scripts/Device Uptime Percentage Monitor.ps1 b/Powershell Scripts/Device Uptime Percentage Monitor.ps1 index 8c9b4f4..298a3ed 100644 --- a/Powershell Scripts/Device Uptime Percentage Monitor.ps1 +++ b/Powershell Scripts/Device Uptime Percentage Monitor.ps1 @@ -143,6 +143,8 @@ param ( [Switch]$EstimateUnexpectedShutdown = [System.Convert]::ToBoolean($env:estimateUnexpectedShutdownTime) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:uptimeForThePastXDays -and $env:uptimeForThePastXDays -notlike "null") { $Days = $env:uptimeForThePastXDays } if ($env:startDay -and $env:startDay -notlike "null") { $StartDay = $env:startDay } diff --git a/Powershell Scripts/Disk Space Alert.ps1 b/Powershell Scripts/Disk Space Alert.ps1 index 527c2c2..e025cef 100644 --- a/Powershell Scripts/Disk Space Alert.ps1 +++ b/Powershell Scripts/Disk Space Alert.ps1 @@ -124,6 +124,8 @@ param ( [String]$AlertOnlyCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script form variables are used, replace the command line parameters with their value. if ($env:systemVolumeMinimumPercentageFree) { $SystemVolumeMinFreePercent = $env:systemVolumeMinimumPercentageFree } diff --git a/Powershell Scripts/Download File From URL.ps1 b/Powershell Scripts/Download File From URL.ps1 index 513f9c4..59658db 100644 --- a/Powershell Scripts/Download File From URL.ps1 +++ b/Powershell Scripts/Download File From URL.ps1 @@ -57,6 +57,8 @@ param ( [Switch]$Overwrite = [System.Convert]::ToBoolean($env:overwrite) ) # Helper functions and input validation +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Get-NinjaProperty { [CmdletBinding()] diff --git a/Powershell Scripts/Example - Get Custom Field Value.ps1 b/Powershell Scripts/Example - Get Custom Field Value.ps1 index 54786b8..f31d8ad 100644 --- a/Powershell Scripts/Example - Get Custom Field Value.ps1 +++ b/Powershell Scripts/Example - Get Custom Field Value.ps1 @@ -65,6 +65,8 @@ param ( [Switch]$ExcludeDisabledUsers = [System.Convert]::ToBoolean($env:excludeDisabledUsersFromReport) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Tests for administrative rights which is required to get the last logon date. function Test-IsElevated { diff --git a/Powershell Scripts/Example - Set a Custom Field.ps1 b/Powershell Scripts/Example - Set a Custom Field.ps1 index f9f1bf9..07915d3 100644 --- a/Powershell Scripts/Example - Set a Custom Field.ps1 +++ b/Powershell Scripts/Example - Set a Custom Field.ps1 @@ -44,6 +44,8 @@ param ( [String]$Value ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Grab parameters from dynamic script variables. if ($env:customFieldName -and $env:customFieldName -notlike "null") { $CustomFieldName = $env:customFieldName } diff --git a/Powershell Scripts/Exchange Version Check.ps1 b/Powershell Scripts/Exchange Version Check.ps1 index 58258c8..5a502b6 100644 --- a/Powershell Scripts/Exchange Version Check.ps1 +++ b/Powershell Scripts/Exchange Version Check.ps1 @@ -52,6 +52,8 @@ param ( [String]$CheckboxCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsElevated { $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() diff --git a/Powershell Scripts/Failed Password Attempt Report.ps1 b/Powershell Scripts/Failed Password Attempt Report.ps1 index c4fdc10..6afd924 100644 --- a/Powershell Scripts/Failed Password Attempt Report.ps1 +++ b/Powershell Scripts/Failed Password Attempt Report.ps1 @@ -47,6 +47,8 @@ param ( [String]$WysiwygCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:usernameToCheck -and $env:usernameToCheck -notlike "null") { $UserName = $env:usernameToCheck } diff --git a/Powershell Scripts/File or Folder Exists Alert.ps1 b/Powershell Scripts/File or Folder Exists Alert.ps1 index a22f363..c1e9ffa 100644 --- a/Powershell Scripts/File or Folder Exists Alert.ps1 +++ b/Powershell Scripts/File or Folder Exists Alert.ps1 @@ -54,6 +54,8 @@ param ( [String]$CustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Set parameters using dynamic script variables. if ($env:searchPath -and $env:searchPath -notlike "null") { $SearchPath = $env:searchPath } diff --git a/Powershell Scripts/Find Certificate with Thumbprint.ps1 b/Powershell Scripts/Find Certificate with Thumbprint.ps1 index 85569cb..d9518af 100644 --- a/Powershell Scripts/Find Certificate with Thumbprint.ps1 +++ b/Powershell Scripts/Find Certificate with Thumbprint.ps1 @@ -57,6 +57,8 @@ param ( [string]$CustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsElevated { $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() diff --git a/Powershell Scripts/Find File with Extension.ps1 b/Powershell Scripts/Find File with Extension.ps1 index 082d934..293a3ad 100644 --- a/Powershell Scripts/Find File with Extension.ps1 +++ b/Powershell Scripts/Find File with Extension.ps1 @@ -50,6 +50,8 @@ param ( [Parameter()] [Switch]$ScanAllDrives = [System.Convert]::ToBoolean($env:scanAllDrives) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Set parameters using dynamic script variables. if ($env:fileExtension -and $env:fileExtension -notlike "null") { $Extensions = $env:fileExtension } diff --git a/Powershell Scripts/Find Registry Key.ps1 b/Powershell Scripts/Find Registry Key.ps1 index 2ff6ba7..1fbc4ed 100644 --- a/Powershell Scripts/Find Registry Key.ps1 +++ b/Powershell Scripts/Find Registry Key.ps1 @@ -79,6 +79,8 @@ param ( [Switch]$Value = [System.Convert]::ToBoolean($env:searchForMatchingKeyValues) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:rootKeyToSearch -and $env:rootKeyToSearch -notlike "null") { $RootKey = $env:rootKeyToSearch } if ($env:searchPath -and $env:searchPath -notlike "null") { $SearchPath = $env:searchPath } diff --git a/Powershell Scripts/Find Rogue DHCP Servers Using Nmap.ps1 b/Powershell Scripts/Find Rogue DHCP Servers Using Nmap.ps1 index 2076daf..a7dab54 100644 --- a/Powershell Scripts/Find Rogue DHCP Servers Using Nmap.ps1 +++ b/Powershell Scripts/Find Rogue DHCP Servers Using Nmap.ps1 @@ -51,6 +51,8 @@ param ( [String]$AllowedServersField = "allowedDHCPServers" ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script variables are used set them here diff --git a/Powershell Scripts/Firewall - Audit Status.ps1 b/Powershell Scripts/Firewall - Audit Status.ps1 index 1c5c75a..34ae6d3 100644 --- a/Powershell Scripts/Firewall - Audit Status.ps1 +++ b/Powershell Scripts/Firewall - Audit Status.ps1 @@ -48,6 +48,8 @@ param ( [Parameter()] [String]$CustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script form variables are used, replace the command-line parameters with their values. if ($env:firewallStatusCustomFieldName -and $env:firewallStatusCustomFieldName -notlike "null") { $CustomField = $env:firewallStatusCustomFieldName } diff --git a/Powershell Scripts/Get Device Description.ps1 b/Powershell Scripts/Get Device Description.ps1 index f4bffb6..a922ff1 100644 --- a/Powershell Scripts/Get Device Description.ps1 +++ b/Powershell Scripts/Get Device Description.ps1 @@ -26,6 +26,8 @@ param ( [String]$CustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:nameOfCustomField -and $env:nameOfCustomField -notlike "null") { $CustomField = $env:nameOfCustomField } diff --git a/Powershell Scripts/Get Direct Link To ConnectWise ScreenConnect.ps1 b/Powershell Scripts/Get Direct Link To ConnectWise ScreenConnect.ps1 index 7dda0ce..5d45cb5 100644 --- a/Powershell Scripts/Get Direct Link To ConnectWise ScreenConnect.ps1 +++ b/Powershell Scripts/Get Direct Link To ConnectWise ScreenConnect.ps1 @@ -50,6 +50,8 @@ param ( [String]$CustomField = "screenconnectUrl" ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:screenconnectDomain -and $env:screenconnectDomain -notlike "null") { $ScreenConnectDomain = $env:screenconnectDomain } if ($env:sessionGroup -and $env:sessionGroup -notlike "null") { $SessionGroup = $env:sessionGroup } diff --git a/Powershell Scripts/Get OS Install Date.ps1 b/Powershell Scripts/Get OS Install Date.ps1 index 68ad201..2a1301c 100644 --- a/Powershell Scripts/Get OS Install Date.ps1 +++ b/Powershell Scripts/Get OS Install Date.ps1 @@ -30,6 +30,8 @@ param ( [string]$CustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { $Epoch = [DateTime]'1/1/1970' if ($env:customFieldName -and $env:customFieldName -notlike "null") { $CustomField = $env:customFieldName } diff --git a/Powershell Scripts/Get Server Roles.ps1 b/Powershell Scripts/Get Server Roles.ps1 index 40c2668..10f1ea2 100644 --- a/Powershell Scripts/Get Server Roles.ps1 +++ b/Powershell Scripts/Get Server Roles.ps1 @@ -42,6 +42,8 @@ param ( $CustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:customfield -notlike "null" -and $env:customfield) { $CustomField = $env:customfield diff --git a/Powershell Scripts/Get iSCSI Connection Details.ps1 b/Powershell Scripts/Get iSCSI Connection Details.ps1 index a512431..c21d1a0 100644 --- a/Powershell Scripts/Get iSCSI Connection Details.ps1 +++ b/Powershell Scripts/Get iSCSI Connection Details.ps1 @@ -27,6 +27,8 @@ param( [String] $WYSIWYGCustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:wysiwygCustomFieldName -notlike "null") { diff --git a/Powershell Scripts/Hash Found Alert.ps1 b/Powershell Scripts/Hash Found Alert.ps1 index 29a9396..6dac28d 100644 --- a/Powershell Scripts/Hash Found Alert.ps1 +++ b/Powershell Scripts/Hash Found Alert.ps1 @@ -59,6 +59,8 @@ param ( [String]$CustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Set parameters using dynamic script variables. if ($env:hash -and $env:hash -notlike "null") { $Hash = $env:hash } diff --git a/Powershell Scripts/Hyper-V - Checkpoint Expiration Alert.ps1 b/Powershell Scripts/Hyper-V - Checkpoint Expiration Alert.ps1 index d0fbf4e..58ca160 100644 --- a/Powershell Scripts/Hyper-V - Checkpoint Expiration Alert.ps1 +++ b/Powershell Scripts/Hyper-V - Checkpoint Expiration Alert.ps1 @@ -57,6 +57,8 @@ param ( [Parameter()] [String]$FromCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:ageLimit -and $env:ageLimit -notlike "null") { $OlderThan = $env:ageLimit } if ($env:retrieveAgeLimitFromCustomField -and $env:retrieveAgeLimitFromCustomField -notlike "null") { $FromCustomField = $env:retrieveAgeLimitFromCustomField } diff --git a/Powershell Scripts/Hyper-V - Get Host Server Name from Guest.ps1 b/Powershell Scripts/Hyper-V - Get Host Server Name from Guest.ps1 index 47abc40..f8cc117 100644 --- a/Powershell Scripts/Hyper-V - Get Host Server Name from Guest.ps1 +++ b/Powershell Scripts/Hyper-V - Get Host Server Name from Guest.ps1 @@ -34,6 +34,8 @@ param ( [string]$TextCustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsElevated { $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() diff --git a/Powershell Scripts/Hyper-V - Replication Alert.ps1 b/Powershell Scripts/Hyper-V - Replication Alert.ps1 index 7605053..4cea57b 100644 --- a/Powershell Scripts/Hyper-V - Replication Alert.ps1 +++ b/Powershell Scripts/Hyper-V - Replication Alert.ps1 @@ -77,6 +77,8 @@ param ( [Parameter()] [Switch]$IncludePaused = [System.Convert]::ToBoolean($env:includePausedReplications) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:allowedToFailForXMinutes -and $env:allowedToFailForXMinutes -notlike "null") { $FailedFor = $env:allowedToFailForXMinutes } diff --git a/Powershell Scripts/Hyper-V - Shared Volume Disk Space Alert.ps1 b/Powershell Scripts/Hyper-V - Shared Volume Disk Space Alert.ps1 index ababc63..9839bd3 100644 --- a/Powershell Scripts/Hyper-V - Shared Volume Disk Space Alert.ps1 +++ b/Powershell Scripts/Hyper-V - Shared Volume Disk Space Alert.ps1 @@ -78,6 +78,8 @@ param ( [string]$CustomFieldParam ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsElevated { $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() diff --git a/Powershell Scripts/Install Certificate - Windows.ps1 b/Powershell Scripts/Install Certificate - Windows.ps1 index cc4438d..2faa293 100644 --- a/Powershell Scripts/Install Certificate - Windows.ps1 +++ b/Powershell Scripts/Install Certificate - Windows.ps1 @@ -54,6 +54,8 @@ param ( [switch]$OverwriteCertificateIfExisting ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsSystem { diff --git a/Powershell Scripts/Installed Remote Access Tools Report.ps1 b/Powershell Scripts/Installed Remote Access Tools Report.ps1 index 580a866..6619240 100644 --- a/Powershell Scripts/Installed Remote Access Tools Report.ps1 +++ b/Powershell Scripts/Installed Remote Access Tools Report.ps1 @@ -92,6 +92,8 @@ param ( [Switch]$ShowNotFound = [System.Convert]::ToBoolean($env:includeToolsThatWereNotFound) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { #DISCLAIMER: This script is provided as a best effort for detecting remote access software installed on an agent, but it is not guaranteed to be 100% accurate. #Some remote access software may not be detected, or false positives may be reported. Use this script at your own risk and verify its results with other methods where possible. diff --git a/Powershell Scripts/Last Reboot Reason.ps1 b/Powershell Scripts/Last Reboot Reason.ps1 index 3687396..d24cf74 100644 --- a/Powershell Scripts/Last Reboot Reason.ps1 +++ b/Powershell Scripts/Last Reboot Reason.ps1 @@ -78,6 +78,8 @@ param ( [String]$WysiwygCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script form variables are used, replace the command line parameters with their value. if ($env:lastRebootReasonTextCustomField -and $env:lastRebootReasonTextCustomField -notlike "null") { $TextCustomField = $env:lastRebootReasonTextCustomField } diff --git a/Powershell Scripts/List Browser Extensions.ps1 b/Powershell Scripts/List Browser Extensions.ps1 index 39192e1..e8bcc16 100644 --- a/Powershell Scripts/List Browser Extensions.ps1 +++ b/Powershell Scripts/List Browser Extensions.ps1 @@ -65,6 +65,8 @@ param ( [String]$WysiwygCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Replace parameters with the dynamic script variables. if ($env:multilineCustomFieldName -and $env:multilineCustomFieldName -notlike "null") { $MultilineCustomField = $env:multilineCustomFieldName } diff --git a/Powershell Scripts/Local Admins Report.ps1 b/Powershell Scripts/Local Admins Report.ps1 index a26bccb..603d73c 100644 --- a/Powershell Scripts/Local Admins Report.ps1 +++ b/Powershell Scripts/Local Admins Report.ps1 @@ -37,6 +37,8 @@ param ( [String]$Delimiter = ', ' ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:customFieldName -and $env:customFieldName -notlike "null") { $CustomField = $env:customFieldName } if ($env:delimiter -and $env:delimiter -notlike "null") { $Delimiter = $env:delimiter } diff --git a/Powershell Scripts/Local Certificate Expiration Alert.ps1 b/Powershell Scripts/Local Certificate Expiration Alert.ps1 index 5247f06..735d8bf 100644 --- a/Powershell Scripts/Local Certificate Expiration Alert.ps1 +++ b/Powershell Scripts/Local Certificate Expiration Alert.ps1 @@ -60,6 +60,8 @@ param ( [Parameter()] [Switch]$IgnoreSelfSignedCerts = [System.Convert]::ToBoolean($env:ignoreSelfSignedCerts) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Retrieve script variables from the dynamic script form. if ($env:expirationFromCustomFieldName -and $env:expirationFromCustomFieldName -notlike "null") { $ExpirationFromCustomField = $env:expirationFromCustomFieldName } diff --git a/Powershell Scripts/Local Users Report.ps1 b/Powershell Scripts/Local Users Report.ps1 index 36bcf94..a8f2c27 100644 --- a/Powershell Scripts/Local Users Report.ps1 +++ b/Powershell Scripts/Local Users Report.ps1 @@ -36,6 +36,8 @@ param ( [String]$WysiwygCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script form variables are used, replace the command line parameters with their value. if ($env:wysiwygCustomFieldName -and $env:wysiwygCustomFieldName -notlike "null") { $WysiwygCustomField = $env:wysiwygCustomFieldName } diff --git a/Powershell Scripts/Locked Out User Report.ps1 b/Powershell Scripts/Locked Out User Report.ps1 index bdbe729..4c0f716 100644 --- a/Powershell Scripts/Locked Out User Report.ps1 +++ b/Powershell Scripts/Locked Out User Report.ps1 @@ -60,6 +60,8 @@ param ( [String]$ExportTXT ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:usersToCheck -and $env:usersToCheck -notlike "null") { $Users = $env:usersToCheck } if ($env:exportCsvResultsToThisCustomField -and $env:exportCsvResultsToThisCustomField -notlike "null") { $ExportCSV = $env:exportCsvResultsToThisCustomField } diff --git a/Powershell Scripts/Microsoft Entra Audit.ps1 b/Powershell Scripts/Microsoft Entra Audit.ps1 index abe7fb2..57176f4 100644 --- a/Powershell Scripts/Microsoft Entra Audit.ps1 +++ b/Powershell Scripts/Microsoft Entra Audit.ps1 @@ -36,6 +36,8 @@ param ( [String]$TenantInfoCustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Retrieve custom field name from dynamic script form if ($env:joinTypeCustomFieldName -and $env:joinTypeCustomFieldName -notlike "null") { $DeviceStateCustomFieldName = $env:joinTypeCustomFieldName } diff --git a/Powershell Scripts/Network Connection Profile Check.ps1 b/Powershell Scripts/Network Connection Profile Check.ps1 index 8fd96d4..1ead165 100644 --- a/Powershell Scripts/Network Connection Profile Check.ps1 +++ b/Powershell Scripts/Network Connection Profile Check.ps1 @@ -30,6 +30,8 @@ param ( [String]$CustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script form variables are used, replace the command the command line parameters with their value. if ($env:networkProfileCustomFieldName -and $env:networkProfileCustomFieldName -notlike "null") { $CustomField = $env:networkProfileCustomFieldName } diff --git a/Powershell Scripts/Orphaned User Profile Report.ps1 b/Powershell Scripts/Orphaned User Profile Report.ps1 index d4d8369..4704009 100644 --- a/Powershell Scripts/Orphaned User Profile Report.ps1 +++ b/Powershell Scripts/Orphaned User Profile Report.ps1 @@ -33,6 +33,8 @@ param ( [String]$CustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Set parameters using dynamic script variables. if ($env:wysiwygCustomFieldName -and $env:wysiwygCustomFieldName -notlike "null") { diff --git a/Powershell Scripts/PKFail Vulnerability Check.ps1 b/Powershell Scripts/PKFail Vulnerability Check.ps1 index 64996a6..882ea45 100644 --- a/Powershell Scripts/PKFail Vulnerability Check.ps1 +++ b/Powershell Scripts/PKFail Vulnerability Check.ps1 @@ -41,6 +41,8 @@ param ( [String]$CustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Set-NinjaProperty { [CmdletBinding()] diff --git a/Powershell Scripts/Password Expiration Alert_Report.ps1 b/Powershell Scripts/Password Expiration Alert_Report.ps1 index f8e60f3..f519d4e 100644 --- a/Powershell Scripts/Password Expiration Alert_Report.ps1 +++ b/Powershell Scripts/Password Expiration Alert_Report.ps1 @@ -84,6 +84,8 @@ param ( [String]$CustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script form variables are used, replace the command line parameters with their value. if ($env:daysUntilPasswordExpiration -and $env:daysUntilPasswordExpiration -notlike "null") { $DaysUntilExpiration = $env:daysUntilPasswordExpiration } diff --git a/Powershell Scripts/Remote Desktop - Check Status and Port.ps1 b/Powershell Scripts/Remote Desktop - Check Status and Port.ps1 index a3fedbf..8ad13d6 100644 --- a/Powershell Scripts/Remote Desktop - Check Status and Port.ps1 +++ b/Powershell Scripts/Remote Desktop - Check Status and Port.ps1 @@ -33,6 +33,8 @@ param ( [String]$RdpStatusCustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Set-NinjaProperty { [CmdletBinding()] diff --git a/Powershell Scripts/Remove Microsoft Bloatware.ps1 b/Powershell Scripts/Remove Microsoft Bloatware.ps1 index f5a09a0..4e941bd 100644 --- a/Powershell Scripts/Remove Microsoft Bloatware.ps1 +++ b/Powershell Scripts/Remove Microsoft Bloatware.ps1 @@ -55,6 +55,8 @@ param ( [String]$OverrideWithCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Replace parameters with dynamic script variables. if ($env:appsToRemove -and $env:appsToRemove -notlike "null") { $AppsToRemove = $env:appsToRemove } diff --git a/Powershell Scripts/Rename Computer.ps1 b/Powershell Scripts/Rename Computer.ps1 index f4136e5..6339fba 100644 --- a/Powershell Scripts/Rename Computer.ps1 +++ b/Powershell Scripts/Rename Computer.ps1 @@ -55,6 +55,8 @@ param ( [Switch]$Reboot = [System.Convert]::ToBoolean($env:reboot) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script forms are used overwrite the params with those values. if ($env:newComputerName -and $env:newComputerName -notlike "null") { $NewName = $env:newComputerName } diff --git a/Powershell Scripts/Reset an Account Password.ps1 b/Powershell Scripts/Reset an Account Password.ps1 index 09ba269..c7ddf4e 100644 --- a/Powershell Scripts/Reset an Account Password.ps1 +++ b/Powershell Scripts/Reset an Account Password.ps1 @@ -48,6 +48,8 @@ param ( [String]$PasswordExpireOption ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Replace preset parameters with script variables. if ($env:resetUsername -and $env:resetUsername -notlike "null") { $Username = $env:resetUsername } diff --git a/Powershell Scripts/Save Hard Drive Type to Custom Field.ps1 b/Powershell Scripts/Save Hard Drive Type to Custom Field.ps1 index 5bb7333..f075056 100644 --- a/Powershell Scripts/Save Hard Drive Type to Custom Field.ps1 +++ b/Powershell Scripts/Save Hard Drive Type to Custom Field.ps1 @@ -48,6 +48,8 @@ param ( [String]$CustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsElevated { $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() diff --git a/Powershell Scripts/Scheduled Task Created Alert.ps1 b/Powershell Scripts/Scheduled Task Created Alert.ps1 index 14af07c..6d002cf 100644 --- a/Powershell Scripts/Scheduled Task Created Alert.ps1 +++ b/Powershell Scripts/Scheduled Task Created Alert.ps1 @@ -41,6 +41,8 @@ param ( [Parameter()] [switch]$EnableEventLog ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Check which Script Variables are used diff --git a/Powershell Scripts/Scheduled Task Report.ps1 b/Powershell Scripts/Scheduled Task Report.ps1 index 9789c2f..13220cd 100644 --- a/Powershell Scripts/Scheduled Task Report.ps1 +++ b/Powershell Scripts/Scheduled Task Report.ps1 @@ -40,6 +40,8 @@ param ( [String]$CustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Get CustomFieldName value from Dynamic Script Form. if ($env:customFieldName -and $env:customFieldName -notlike "null" ) { $CustomFieldName = $env:customFieldName } diff --git a/Powershell Scripts/Search DNS Cache Entries.ps1 b/Powershell Scripts/Search DNS Cache Entries.ps1 index f657e6c..01a509a 100644 --- a/Powershell Scripts/Search DNS Cache Entries.ps1 +++ b/Powershell Scripts/Search DNS Cache Entries.ps1 @@ -38,6 +38,8 @@ param ( [String]$MultilineCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { $ExitCode = 0 function Set-NinjaProperty { diff --git a/Powershell Scripts/Search Event Log.ps1 b/Powershell Scripts/Search Event Log.ps1 index 36d8821..af493b1 100644 --- a/Powershell Scripts/Search Event Log.ps1 +++ b/Powershell Scripts/Search Event Log.ps1 @@ -82,6 +82,8 @@ param ( [String]$WysiwygCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Set parameters using dynamic script variables. if ($env:eventLogName -and $env:eventLogName -notlike "null") { $EventLogName = $env:eventLogName } diff --git a/Powershell Scripts/Search TCP_UDP Connections for Specified IP Address.ps1 b/Powershell Scripts/Search TCP_UDP Connections for Specified IP Address.ps1 index d8965ad..04b0ff9 100644 --- a/Powershell Scripts/Search TCP_UDP Connections for Specified IP Address.ps1 +++ b/Powershell Scripts/Search TCP_UDP Connections for Specified IP Address.ps1 @@ -49,6 +49,8 @@ param ( [String]$CustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsElevated { $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() diff --git a/Powershell Scripts/Search for Listening and Established Ports.ps1 b/Powershell Scripts/Search for Listening and Established Ports.ps1 index c172050..b8753ba 100644 --- a/Powershell Scripts/Search for Listening and Established Ports.ps1 +++ b/Powershell Scripts/Search for Listening and Established Ports.ps1 @@ -46,6 +46,8 @@ param ( [String]$CustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsElevated { $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() diff --git a/Powershell Scripts/Set Custom Field if Path Exists.ps1 b/Powershell Scripts/Set Custom Field if Path Exists.ps1 index 43a458b..22efe92 100644 --- a/Powershell Scripts/Set Custom Field if Path Exists.ps1 +++ b/Powershell Scripts/Set Custom Field if Path Exists.ps1 @@ -27,6 +27,8 @@ param ( [Parameter(Mandatory = $false)][String]$NotExist = "No" ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:filePath) { $Path = $env:filePath diff --git a/Powershell Scripts/Start Microsoft MSERT Scan.ps1 b/Powershell Scripts/Start Microsoft MSERT Scan.ps1 index 6a403b6..70b8f94 100644 --- a/Powershell Scripts/Start Microsoft MSERT Scan.ps1 +++ b/Powershell Scripts/Start Microsoft MSERT Scan.ps1 @@ -75,6 +75,8 @@ param ( [String]$DownloadURL = "https://go.microsoft.com/fwlink/?LinkId=212732" ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Set parameters using dynamic script variables. if($env:scanType -and $env:scanType -notlike "null"){ $ScanType = $env:scanType } diff --git a/Powershell Scripts/Startup Audit Using Autorunsc.ps1 b/Powershell Scripts/Startup Audit Using Autorunsc.ps1 index ebb94de..1ba5bab 100644 --- a/Powershell Scripts/Startup Audit Using Autorunsc.ps1 +++ b/Powershell Scripts/Startup Audit Using Autorunsc.ps1 @@ -146,6 +146,8 @@ param ( [Switch]$SkipSleep = [System.Convert]::ToBoolean($env:skipSleep) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If Script Forms are used replace the parameters diff --git a/Powershell Scripts/System Performance Check.ps1 b/Powershell Scripts/System Performance Check.ps1 index df36053..5d85bcc 100644 --- a/Powershell Scripts/System Performance Check.ps1 +++ b/Powershell Scripts/System Performance Check.ps1 @@ -224,6 +224,8 @@ param ( [Switch]$DisplayUserMessage = [System.Convert]::ToBoolean($env:displayUserMessage) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script form variables are used, replace command line parameters with their values. if ($env:daysSinceLastReboot -and $env:daysSinceLastReboot -notlike "null") { $DaysSinceLastReboot = $env:daysSinceLastReboot } diff --git a/Powershell Scripts/System Restore - Check Status.ps1 b/Powershell Scripts/System Restore - Check Status.ps1 index 1f41387..819cfbb 100644 --- a/Powershell Scripts/System Restore - Check Status.ps1 +++ b/Powershell Scripts/System Restore - Check Status.ps1 @@ -33,6 +33,8 @@ param ( [String]$CustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Set-NinjaProperty { [CmdletBinding()] diff --git a/Powershell Scripts/System Restore - Restore Point Report.ps1 b/Powershell Scripts/System Restore - Restore Point Report.ps1 index 7036336..7950d2c 100644 --- a/Powershell Scripts/System Restore - Restore Point Report.ps1 +++ b/Powershell Scripts/System Restore - Restore Point Report.ps1 @@ -49,6 +49,8 @@ param ( [String]$WysiwygCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsElevated { $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() diff --git a/Powershell Scripts/Troubleshoot Printers and Clear Print Queue.ps1 b/Powershell Scripts/Troubleshoot Printers and Clear Print Queue.ps1 index 947d7f8..6ae3af0 100644 --- a/Powershell Scripts/Troubleshoot Printers and Clear Print Queue.ps1 +++ b/Powershell Scripts/Troubleshoot Printers and Clear Print Queue.ps1 @@ -25,6 +25,8 @@ param ( [string]$CustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsElevated { $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() diff --git a/Powershell Scripts/USB Drive Alert.ps1 b/Powershell Scripts/USB Drive Alert.ps1 index b9d5a3d..f8b3162 100644 --- a/Powershell Scripts/USB Drive Alert.ps1 +++ b/Powershell Scripts/USB Drive Alert.ps1 @@ -39,6 +39,8 @@ param ( [String]$CustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Grab CustomFieldName from dynamic script form if ($env:customFieldName -and $env:customFieldName -notlike "null") { $CustomFieldName = $env:customFieldName } diff --git a/Powershell Scripts/USB Storage Status.ps1 b/Powershell Scripts/USB Storage Status.ps1 index 43d4f05..5da1ada 100644 --- a/Powershell Scripts/USB Storage Status.ps1 +++ b/Powershell Scripts/USB Storage Status.ps1 @@ -30,6 +30,8 @@ param ( [String]$CustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:customFieldName -and $env:customFieldName -notlike "null") { $CustomField = $env:customFieldName } diff --git a/Powershell Scripts/Unsigned Driver Alert.ps1 b/Powershell Scripts/Unsigned Driver Alert.ps1 index 2caa5e3..048cb8e 100644 --- a/Powershell Scripts/Unsigned Driver Alert.ps1 +++ b/Powershell Scripts/Unsigned Driver Alert.ps1 @@ -30,6 +30,8 @@ param ( [String]$WYSIWYGCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If using script form variables, replace command line parameters with the form variables. if ($env:wysiwygCustomFieldName -and $env:wysiwygCustomFieldName -notlike "null") { $WYSIWYGCustomField = $env:wysiwygCustomFieldName } diff --git a/Powershell Scripts/Update Group Policy (gpupdate).ps1 b/Powershell Scripts/Update Group Policy (gpupdate).ps1 index 9edf5d6..9b04642 100644 --- a/Powershell Scripts/Update Group Policy (gpupdate).ps1 +++ b/Powershell Scripts/Update Group Policy (gpupdate).ps1 @@ -116,6 +116,8 @@ param ( [Switch]$LogoutAllUsers = [System.Convert]::ToBoolean($env:logoutAllUsers) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script variables are used overwrite their parameter if ($env:customFieldName -and $env:customFieldName -notlike "null") { $CustomFieldName = $env:customFieldName } diff --git a/Powershell Scripts/Update Location Custom Field based on GeoIP.ps1 b/Powershell Scripts/Update Location Custom Field based on GeoIP.ps1 index 092ee21..4de29a9 100644 --- a/Powershell Scripts/Update Location Custom Field based on GeoIP.ps1 +++ b/Powershell Scripts/Update Location Custom Field based on GeoIP.ps1 @@ -29,6 +29,8 @@ param ( [String]$CustomFieldName ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # Check if Script Variables are being used if ($env:googleApiKey -and $env:googleApiKey -notlike "null") { diff --git a/Powershell Scripts/User Must Be Logged In Alert.ps1 b/Powershell Scripts/User Must Be Logged In Alert.ps1 index a50c6c5..9a06601 100644 --- a/Powershell Scripts/User Must Be Logged In Alert.ps1 +++ b/Powershell Scripts/User Must Be Logged In Alert.ps1 @@ -38,6 +38,8 @@ param ( [Switch]$ActiveOnly = [System.Convert]::ToBoolean($env:userMustBeActive) ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script variables are used overwrite the existing variables. if ($env:usersToCheckFor -and $env:usersToCheckFor -notlike "null") { $UsersToCheckFor = $env:usersToCheckFor } diff --git a/Powershell Scripts/User Profile Size Report.ps1 b/Powershell Scripts/User Profile Size Report.ps1 index 2e26846..a64a146 100644 --- a/Powershell Scripts/User Profile Size Report.ps1 +++ b/Powershell Scripts/User Profile Size Report.ps1 @@ -34,6 +34,8 @@ param ( [String]$CustomField = "TotalUsersProfileSize" ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:sizeInGbToAlertOn -and $env:sizeInGbToAlertOn -notlike "null") { $Max = $env:sizeInGbToAlertOn } if ($env:customFieldName -and $env:customFieldName -notlike "null") { $CustomField = $env:customFieldName } diff --git a/Powershell Scripts/User or Group Membership Report.ps1 b/Powershell Scripts/User or Group Membership Report.ps1 index ca97af5..c0bc964 100644 --- a/Powershell Scripts/User or Group Membership Report.ps1 +++ b/Powershell Scripts/User or Group Membership Report.ps1 @@ -71,6 +71,8 @@ param ( [String]$CustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If script variables are used replace the parameters if ($env:usernames -and $env:usernames -notlike "null") { diff --git a/Powershell Scripts/Verify running processes are signed.ps1 b/Powershell Scripts/Verify running processes are signed.ps1 index ede1376..4cf5add 100644 --- a/Powershell Scripts/Verify running processes are signed.ps1 +++ b/Powershell Scripts/Verify running processes are signed.ps1 @@ -118,6 +118,8 @@ param ( [String]$SaveResultsToWysiwygCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsElevated { $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() diff --git a/Powershell Scripts/WAN IP Blocklist Check.ps1 b/Powershell Scripts/WAN IP Blocklist Check.ps1 index 4e75677..77c4f1c 100644 --- a/Powershell Scripts/WAN IP Blocklist Check.ps1 +++ b/Powershell Scripts/WAN IP Blocklist Check.ps1 @@ -47,6 +47,8 @@ param ( [String]$CustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { # If using script form variables, replace command line parameters with them. if($env:multilineCustomFieldName -and $env:multilineCustomFieldName -notlike "null") { $CustomField = $env:multilineCustomFieldName } diff --git a/Powershell Scripts/Wi-Fi Report.ps1 b/Powershell Scripts/Wi-Fi Report.ps1 index bd38a43..0d26aca 100644 --- a/Powershell Scripts/Wi-Fi Report.ps1 +++ b/Powershell Scripts/Wi-Fi Report.ps1 @@ -52,6 +52,8 @@ param ( $DebugHtml ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { function Test-IsElevated { $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() diff --git a/Powershell Scripts/Windows Update Diagnostic.ps1 b/Powershell Scripts/Windows Update Diagnostic.ps1 index bfd15ea..ebce78b 100644 --- a/Powershell Scripts/Windows Update Diagnostic.ps1 +++ b/Powershell Scripts/Windows Update Diagnostic.ps1 @@ -37,6 +37,8 @@ param ( [string]$ResultsCustomField ) +. "$PSScriptRoot/CustomFieldCompatibility.ps1" + begin { if ($env:Days) { $Days = $env:Days