full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_17_2.ps1
sample_17_2.ps1
# # Module manifest for module 'OCI.PSModules.Waa' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Waa.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '5e9163aa-454b-4b6c-b240-a7136ba9f82a' # 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 Waa 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 = '79.0.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Waa.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-OCIWaaWebAppAcceleration', 'Get-OCIWaaWebAppAccelerationPoliciesList', 'Get-OCIWaaWebAppAccelerationPolicy', 'Get-OCIWaaWebAppAccelerationsList', 'Get-OCIWaaWorkRequest', 'Get-OCIWaaWorkRequestErrorsList', 'Get-OCIWaaWorkRequestLogsList', 'Get-OCIWaaWorkRequestsList', 'Invoke-OCIWaaPurgeWebAppAccelerationCache', 'Move-OCIWaaWebAppAccelerationCompartment', 'Move-OCIWaaWebAppAccelerationPolicyCompartment', 'New-OCIWaaWebAppAcceleration', 'New-OCIWaaWebAppAccelerationPolicy', 'Remove-OCIWaaWebAppAcceleration', 'Remove-OCIWaaWebAppAccelerationPolicy', 'Update-OCIWaaWebAppAcceleration', 'Update-OCIWaaWebAppAccelerationPolicy' # 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','Waa' # 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/3709.ps1
3709.ps1
function Clean-ResourceGroup($rgname) { if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { Remove-AzResourceGroup -Name $rgname -Force } } function Retry-IfException { param([ScriptBlock] $script, [int] $times = 30, [string] $message = "*") if ($times -le 0) { throw 'Retry time(s) should not be equal to or less than 0.'; } $oldErrorActionPreferenceValue = $ErrorActionPreference; $ErrorActionPreference = "SilentlyContinue"; $iter = 0; $succeeded = $false; while (($iter -lt $times) -and (-not $succeeded)) { $iter += 1; try { &$script; } catch { } if ($Error.Count -gt 0) { $actualMessage = $Error[0].Exception.Message; Write-Output ("Caught exception: '$actualMessage'"); if (-not ($actualMessage -like $message)) { $ErrorActionPreference = $oldErrorActionPreferenceValue; throw "Expected exception not received: '$message' the actual message is '$actualMessage'"; } $Error.Clear(); Wait-Seconds 10; continue; } $succeeded = $true; } $ErrorActionPreference = $oldErrorActionPreferenceValue; } function Test-CreateCognitiveServicesAccount { param([string] $rgname, [string] $accountname, [string] $accounttype, [string] $skuname, [string] $loc) $createdAccount = New-AzCognitiveServicesAccount -ResourceGroupName $rgname -Name $accountname -Type $accounttype -SkuName $skuname -Location $loc -Force; Assert-NotNull $createdAccount; Retry-IfException { Remove-AzCognitiveServicesAccount -ResourceGroupName $rgname -Name $accountname -Force; } } function Get-RandomItemName { param([string] $prefix = "pslibtest") if ($prefix -eq $null -or $prefix -eq '') { $prefix = "pslibtest"; } $str = $prefix + ((Get-Random) % 10000); return $str; } function Get-CognitiveServicesManagementTestResourceName { $stack = Get-PSCallStack $testName = $null; foreach ($frame in $stack) { if ($frame.Command.StartsWith("Test-", "CurrentCultureIgnoreCase")) { $testName = $frame.Command; } } $oldErrorActionPreferenceValue = $ErrorActionPreference; $ErrorActionPreference = "SilentlyContinue"; try { $assetName = [Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::GetAssetName($testName, "pstestrg"); } catch { if (($Error.Count -gt 0) -and ($Error[0].Exception.Message -like '*Unable to find type*')) { $assetName = Get-RandomItemName; } else { throw; } } finally { $ErrorActionPreference = $oldErrorActionPreferenceValue; } return $assetName }
combined_dataset/train/non-malicious/Boots Hierarchical Bind.ps1
Boots Hierarchical Bind.ps1
######## CSV DATA ############# # Save the following data to a csv. City,Team "Los Angeles","Lakers" "Los Angeles","Clippers" "New York","Knicks" "New York","Liberty" "Sacramento","Kings" ######## CODE ################# $teams = Import-Csv "C:\\testdata.csv" [array]$cities = $teams | %{$_.City} | Sort -Unique [Object[]]$test = foreach ($city in $cities){ New-Object psobject -Property @{ City = $city Teams = @(foreach($team in $($teams | ?{$_.City -eq $city} | %{$_.Team} | Sort -Unique)){ New-Object psobject -Property @{ Team = $Team IsSelected = "True" } }) } } Import-Module PowerBoots # Xaml layout -- this is where binding is set. $xaml = @" <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="Window"> <Grid> <TreeView Name="treeview1"> <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding Teams}"> <TextBlock Foreground="Green" Text="{Binding City}" /> <HierarchicalDataTemplate.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Team}" /> <CheckBox IsChecked="{Binding IsSelected}" IsEnabled="False"/> </StackPanel> </DataTemplate> </HierarchicalDataTemplate.ItemTemplate> </HierarchicalDataTemplate> </TreeView.ItemTemplate> </TreeView> </Grid> </Window> "@ $MainWindow= New-BootsWindow -Title "Treeview Binding" -Width 100 -Height 150 -SourceTemplate $xaml -Async -Passthru -On_Loaded { Export-NamedElement $treeView1.ItemsSource = $test }
combined_dataset/train/non-malicious/Get-NaNfsExport.ps1
Get-NaNfsExport.ps1
# Glenn Sizemore ~ www . Get-Admin . Com # Example Powershell function to get the NFS Exports from a NetApp Filer # First you'll need to download the OnTap SDK 3.5 : http://communities.netapp.com/docs/DOC-1365 # within the download your interested in .\\manage-ontap-sdk-3.5\\lib\\DotNet\\ManageOntap.dll # Next load the library... # $Path = 'C:\\Users\\glnsize\\Downloads\\manage-ontap-sdk-3.5\\lib\\DotNet\\ManageOntap.dll' # [Reflection.Assembly]::LoadFile($Path) # # Almost there next step create a NaServer connection object # Here we are connecting to the NetApp Filer TOASTER1, and setting the api to V1.8 # $NaServer = New-Object NetApp.Manage.NaServer("TOASTER1",1,8) # Call the setAdminUser Method and supply some credentials # $NaServer.SetAdminUser('root', 'password') # # Now we're ready to go simply call the function passing your NAServer object as a parameter. # Get-NaNfsExport -Server $NaServer # # Get-NaNfsExport -Server $NaServer -Path /vol/vol0 Function Get-NaNfsExport { Param( [NetApp.Manage.NaServer] $Server, [String] $Path ) Begin { $out = @() } Process { trap [NetApp.Manage.NaAuthException] { # Example trap to catch bad credentials Write-Error "Bad login/password". break } #generate a new naelement request $NaOut = New-Object NetApp.Manage.NaElement("nfs-exportfs-list-rules") # $NaServer.InvokeElem($NaOut) -> retrieve the results of the $NaOut request # ..($NaOut).GetChildByName("rules") -> select the rules element from results # ..GetChildByName("rules").getchildren() -> get any child elements under rules. $NaResults = $Server.InvokeElem($NaOut).GetChildByName("rules").getchildren() #ForEach NFS Rule returned, serialize the output into a PSObject. foreach ($NaElement in $NaResults) { $NaNFS = "" | Select-Object Path, ActualPath, ReadOnly, ReadWrite, Root, Security $NaNFS.Path = $NaElement.GetChildContent("pathname") # This is where the OnTap SDK can get a little nuts... # if you perfer XML then simply try $NaElement.ToPrettyString('') switch ($NaElement) { # if Read-Only is present {$_.GetChildByName("read-only")} { # Get all child elements $ReadOnly = ($_.GetChildByName("read-only")).getchildren() #Foreach elm in read-only foreach ($read in $ReadOnly) { # [bool] if exists "all-hosts" If ($read.GetChildContent("all-hosts")) { $roList = 'All-Hosts' } # Else get the name of the export! Elseif ($read.GetChildContent("name")) { $roList += $read.GetChildContent("name") } } # add our new list to the output $NaNFS.ReadOnly = $roList } # if Read-write is present {$_.GetChildByName("read-write")} { $ReadWrite = ($_.GetChildByName("read-write")).getchildren() foreach ($write in $ReadWrite) { If ($write.GetChildContent("all-hosts")) { $rwList = 'All-Hosts' } Elseif ($r.GetChildContent("name")) { $rwList += $write.GetChildContent("name") } } $NaNFS.ReadWrite = $rwList } # if root is present {$_.GetChildByName("root")} { $Root = ($_.GetChildByName("root")).getchildren() foreach ($r in $Root) { If ($r.GetChildContent("all-hosts")) { $rrList = 'All-Hosts' } Elseif ($r.GetChildContent("name")) { $rrList += $r.GetChildContent("name") } } $NaNFS.Root = $rrList } {$_.GetChildByName("sec-flavor")} { $Security = ($_.GetChildByName("sec-flavor")).getchildren() foreach ($s in $Security) { if ($r.GetChildContent("flavor")) { $SecList += $r.GetChildContent("flavor") } } $NaNFS.Security = $SecList } {$_.GetChildByName("actual-pathname")} { $NaNFS.ActualPath = $_.GetChildByName("actual-pathname") } } $out += $NaNFS } } End { If ($Path) { return $out | ?{$_.Path -match $Patch} } else { return $out } } }
combined_dataset/train/non-malicious/sample_35_26.ps1
sample_35_26.ps1
/////////////////////////////////////////////////////////////////////////////// // Helper to set a designer prop /////////////////////////////////////////////////////////////////////////////// function setDesignerProp(tname, ttype, tvalue) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = tvalue; } /////////////////////////////////////////////////////////////////////////////// // Toggle button and gobal state /////////////////////////////////////////////////////////////////////////////// var ct = command.getTrait("state"); if (ct.value == 0) { ct.value = 2; setDesignerProp("showVertexNormals", "bool", true); } else { ct.value = 0; setDesignerProp("showVertexNormals", "bool", false); } // SIG // Begin signature block // SIG // MIInvQYJKoZIhvcNAQcCoIInrjCCJ6oCAQExDzANBglg // SIG // hkgBZQMEAgEFADB3BgorBgEEAYI3AgEEoGkwZzAyBgor // SIG // BgEEAYI3AgEeMCQCAQEEEBDgyQbOONQRoqMAEEvTUJAC // SIG // AQACAQACAQACAQACAQAwMTANBglghkgBZQMEAgEFAAQg // SIG // 8WnjIYTGGZLXQAPNeLf+s8nHbPKRa9IodmxB9XX17/2g // 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/15n8G9bW1qyVJzEw16UM0xghmfMIIZmwIBATCBlTB+ // SIG // MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3Rv // SIG // bjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWlj // SIG // cm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYDVQQDEx9NaWNy // SIG // b3NvZnQgQ29kZSBTaWduaW5nIFBDQSAyMDExAhMzAAAD // SIG // rzBADkyjTQVBAAAAAAOvMA0GCWCGSAFlAwQCAQUAoIGu // SIG // MBkGCSqGSIb3DQEJAzEMBgorBgEEAYI3AgEEMBwGCisG // SIG // AQQBgjcCAQsxDjAMBgorBgEEAYI3AgEVMC8GCSqGSIb3 // SIG // DQEJBDEiBCDYy41hr/tCLcXLHqh+aauCDBgiWBaTtik8 // SIG // /BcZikSWhDBCBgorBgEEAYI3AgEMMTQwMqAUgBIATQBp // SIG // AGMAcgBvAHMAbwBmAHShGoAYaHR0cDovL3d3dy5taWNy // SIG // b3NvZnQuY29tMA0GCSqGSIb3DQEBAQUABIIBAJvP/rN4 // SIG // Rn3FTcLGUKdsDiWQ5wxVElxZttTFTMcXSUHRf2zIIZWM // SIG // utVnPhoqr0C+USChyihCmgqNsAd99+8jQ1XPRp6y1gLK // SIG // xDUYgtzM7e+StaioGQfVcUdiKnB1CXl8JeXqcF1xvY7t // SIG // NjUHXbKoSMwe5cB2DHjV60tQzbOPeD8nXmLxqH8/tEuV // SIG // k51n+eCFQ/6STZTfxJ0O+us9yOuvFnpi5Hhcr7YkAoWZ // SIG // E3Dve2RG02t1o6JSZj/fV94mXhbD92HvYkOupL9ZJvjY // SIG // svIfo4tQc8T3iKBKUW8Uo9ZZLiDa6UuSAQ3KF8G01M0w // SIG // p0zIut0VlL1c3aMvkdy4ZYEEadahghcpMIIXJQYKKwYB // SIG // BAGCNwMDATGCFxUwghcRBgkqhkiG9w0BBwKgghcCMIIW // SIG // /gIBAzEPMA0GCWCGSAFlAwQCAQUAMIIBWQYLKoZIhvcN // SIG // AQkQAQSgggFIBIIBRDCCAUACAQEGCisGAQQBhFkKAwEw // SIG // MTANBglghkgBZQMEAgEFAAQgl0KKpX7fKHVHzI5fuA/B // SIG // 8aPsy7APxE/ccB0d3Ud+vSMCBmXV5UjJRRgTMjAyNDAz // SIG // MDEwMDM1MzkuNDc5WjAEgAIB9KCB2KSB1TCB0jELMAkG // SIG // A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAO // SIG // BgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29m // SIG // dCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9zb2Z0 // SIG // IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYD // SIG // VQQLEx1UaGFsZXMgVFNTIEVTTjowODQyLTRCRTYtQzI5 // SIG // QTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAg // SIG // U2VydmljZaCCEXgwggcnMIIFD6ADAgECAhMzAAAB2o7V // SIG // yVoA0RGxAAEAAAHaMA0GCSqGSIb3DQEBCwUAMHwxCzAJ // SIG // BgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAw // SIG // DgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv // SIG // ZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29m // SIG // dCBUaW1lLVN0YW1wIFBDQSAyMDEwMB4XDTIzMTAxMjE5 // SIG // MDY1OVoXDTI1MDExMDE5MDY1OVowgdIxCzAJBgNVBAYT // SIG // AlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQH // SIG // EwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29y // SIG // cG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVs // SIG // YW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMd // SIG // VGhhbGVzIFRTUyBFU046MDg0Mi00QkU2LUMyOUExJTAj // SIG // BgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZp // SIG // Y2UwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC // SIG // AQCTkAYIdrVRUdY/I0AODQ3/G3Fa10jdPNAjSj0kKO0u // SIG // e7Apz1NBSheO8Ni+qh7cJuBJwpRdnK7lxaf5ez6TEINu // SIG // RO1/MQ5r8a/AQROogEgDwn603m7rwLGVnCWIcu6a4Arg // SIG // X+zonV6YLFtcvKelbO7A9mrqf9Lr3mMXl5SrbD4zAqZR // SIG // 5JNG2vh4C4aNCevCnY4twzNiufcB8vca7bGCvl/Xq2wx // SIG // mdppl9++uWkuUO/7oA8TFYM8o/NMiZ+lC55Jw/YuJFEM // SIG // VYaldXXPwxelAXrs37pJDHne7a81BGTEcpWu6ob8FHkJ // SIG // YMwkIaWY8/s7EIKV5T3M7xndIqq+5QAsH1RqIOaZSM3R // SIG // Mb7dUwPCZnn/NfWkysB9SFRCMGCwOrr0vJEXQOkcbzHG // SIG // //7pTYyLhnHsspDAFxMp1ayxvVbyuK36wrBi9499C5on // SIG // boPqMK3Ao0GoGJqxpNYQcpF4paPWAfEMsuUNSoRrh+uV // SIG // d8xcvGtJMGygUbPFUeB7aD2MPc9Q3XCX2QTtnYc198gD // SIG // IqQhpukpr5r2r0bF4cvNOY4gKQ8jfrNP2+6LNs/IkVhi // SIG // ZOjPbrk9uPd4BVf/SSxoOWCSQiVyPssZDvzl52SbLhrd // SIG // Ps1i3R0uFyFwRte6D7uSrBX0Ux0RJaEdnSOhsGmsSMg8 // SIG // kh2DrbyMnZWu7uJX53wo2P6ikwIDAQABo4IBSTCCAUUw // SIG // HQYDVR0OBBYEFKF8jclRPWYTlYsxFFcITYC/D19FMB8G // SIG // A1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8G // SIG // A1UdHwRYMFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9z // SIG // b2Z0LmNvbS9wa2lvcHMvY3JsL01pY3Jvc29mdCUyMFRp // SIG // bWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBsBggr // SIG // BgEFBQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93 // SIG // d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvY2VydHMvTWlj // SIG // cm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAo // SIG // MSkuY3J0MAwGA1UdEwEB/wQCMAAwFgYDVR0lAQH/BAww // SIG // CgYIKwYBBQUHAwgwDgYDVR0PAQH/BAQDAgeAMA0GCSqG // SIG // SIb3DQEBCwUAA4ICAQC5g1XU7biNIwBLeNTtjjPAlNt+ // SIG // 0xjMoaxq+xcyghBWl8baKpPyDm0K4qtXGh1Ydr8rkNuJ // SIG // 8903Tgb+63LP6pz4zsZ1xS8mT3mli7DbgEVZlFYslWF4 // SIG // 12AeQ8M2lmYEnGPBii+8ho8lq4e/FiVIIe6xNfuVQ+Yd // SIG // P+q7PXQUagMyPX4Wc+7KbI7fL58edFhMWwUkh+632mx3 // SIG // p3aXqm05lv0X3Gk/hhSLE/oNno+8ESiKv0IZ7KBfJqRT // SIG // Tx1dav1iv6xfwoaL5ISTA75arRE1ovexqJTkimpmQvW2 // SIG // IHDyn89vHnduVictdFbUPT+fgv9nTnw2s9UZnjm9uym3 // SIG // oIWtEnz3K4k3zkVb6jw0mt5/Te3YU2O/uPSPHr6GnfYX // SIG // WfAnyDj37cLd8U19kYTGSQlaBZWmx3L32/OK2hTOnM+R // SIG // GJPsdWlRIl7YCukdMZ9cIzFx39AFpUo6kZM70p0SsxbG // SIG // cBJe+FWoZSlYSPgovUU/fuhnNMVsye80CFBRNyYosefu // SIG // yi/AKx3wWPVBS8+LJ26Ce0IqdyAA25FOGS9IkPI/CMa2 // SIG // u2kmH06FHn5nLd3TOvX3+BHodiofTbCooqYefPQKf8Ut // SIG // YxEpa34y/4P2W6GkuXfWtnwOffJrmw7yw+ceTz9++9NL // SIG // 5v2PjyIZqdn077ktrJ3XmQZsk6nFDR0TZgpPp41d5zCC // SIG // B3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUw // SIG // DQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMw // SIG // EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt // SIG // b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRp // SIG // b24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRp // SIG // ZmljYXRlIEF1dGhvcml0eSAyMDEwMB4XDTIxMDkzMDE4 // SIG // MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkGA1UEBhMC // SIG // VVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT // SIG // B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jw // SIG // b3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUt // SIG // U3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUA // SIG // A4ICDwAwggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC // SIG // 0/3unAcH0qlsTnXIyjVX9gF/bErg4r25PhdgM/9cT8dm // SIG // 95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNE // SIG // t6aORmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZT // SIG // fDlhAnrEqv1yaa8dq6z2Nr41JmTamDu6GnszrYBbfowQ // SIG // HJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5 // SIG // LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVV // SIG // mG1oO5pGve2krnopN6zL64NF50ZuyjLVwIYwXE8s4mKy // SIG // zbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9QZpG // SIG // dc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2 // SIG // TPYrbqgSUei/BQOj0XOmTTd0lBw0gg/wEPK3Rxjtp+iZ // SIG // fD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqEUUbi0b1q // SIG // GFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSL // SIG // W6CmgyFdXzB0kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLU // SIG // HMVr9lxSUV0S2yW6r1AFemzFER1y7435UsSFF5PAPBXb // SIG // GjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQID // SIG // AQABo4IB3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAj // SIG // BgkrBgEEAYI3FQIEFgQUKqdS/mTEmr6CkTxGNSnPEP8v // SIG // BO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1Gely // SIG // MFwGA1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYI // SIG // KwYBBQUHAgEWM2h0dHA6Ly93d3cubWljcm9zb2Z0LmNv // SIG // bS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNV // SIG // HSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4K // SIG // AFMAdQBiAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/ // SIG // BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo0T2U // SIG // kFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8v // SIG // Y3JsLm1pY3Jvc29mdC5jb20vcGtpL2NybC9wcm9kdWN0 // SIG // cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5jcmwwWgYI // SIG // KwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8v // SIG // d3d3Lm1pY3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jv // SIG // b0NlckF1dF8yMDEwLTA2LTIzLmNydDANBgkqhkiG9w0B // SIG // AQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwU // SIG // tj5OR2R4sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTC // SIG // j/ts0aGUGCLu6WZnOlNN3Zi6th542DYunKmCVgADsAW+ // SIG // iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhT // SIG // dSRXud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYS // SIG // EhFdPSfgQJY4rPf5KYnDvBewVIVCs/wMnosZiefwC2qB // SIG // woEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0 // SIG // DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxy // SIG // bxCrdTDFNLB62FD+CljdQDzHVG2dY3RILLFORy3BFARx // SIG // v2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFrDZ+k // SIG // KNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2 // SIG // tVdUCbFpAUR+fKFhbHP+CrvsQWY9af3LwUFJfn6Tvsv4 // SIG // O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7ntdAoGokL // SIG // jzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTm // SIG // dHRbatGePu1+oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/Z // SIG // cGNTTY3ugm2lBRDBcQZqELQdVTNYs6FwZvKhggLUMIIC // SIG // PQIBATCCAQChgdikgdUwgdIxCzAJBgNVBAYTAlVTMRMw // SIG // EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt // SIG // b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRp // SIG // b24xLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9w // SIG // ZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVz // SIG // IFRTUyBFU046MDg0Mi00QkU2LUMyOUExJTAjBgNVBAMT // SIG // HE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2WiIwoB // SIG // ATAHBgUrDgMCGgMVAEKiHyGJYx1GzaGNP8I4V0Z/7EgN // SIG // oIGDMIGApH4wfDELMAkGA1UEBhMCVVMxEzARBgNVBAgT // SIG // Cldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAc // SIG // BgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQG // SIG // A1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIw // SIG // MTAwDQYJKoZIhvcNAQEFBQACBQDpi5cPMCIYDzIwMjQw // SIG // MzAxMDc1MTQzWhgPMjAyNDAzMDIwNzUxNDNaMHQwOgYK // SIG // KwYBBAGEWQoEATEsMCowCgIFAOmLlw8CAQAwBwIBAAIC // SIG // BQMwBwIBAAICEbwwCgIFAOmM6I8CAQAwNgYKKwYBBAGE // SIG // WQoEAjEoMCYwDAYKKwYBBAGEWQoDAqAKMAgCAQACAweh // SIG // IKEKMAgCAQACAwGGoDANBgkqhkiG9w0BAQUFAAOBgQAR // SIG // xrClZLwjZv1nlqVgz6xTyGiMm5jNXL2zI60cL9flLlCg // SIG // PwChlbuNsEgjEdcrH/QOU73GLGBbeXJX8RqmSutN2a2m // SIG // ZefvpbkDUepgXvVSMfUhoPGFEr/ypjsdd+UxU91690e5 // SIG // +GFNrwPx/TG91rPv3o8E2ZVhKGX0AeK0DGi7XDGCBA0w // SIG // ggQJAgEBMIGTMHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQI // SIG // EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4w // SIG // HAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAk // SIG // BgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAy // SIG // MDEwAhMzAAAB2o7VyVoA0RGxAAEAAAHaMA0GCWCGSAFl // SIG // AwQCAQUAoIIBSjAaBgkqhkiG9w0BCQMxDQYLKoZIhvcN // SIG // AQkQAQQwLwYJKoZIhvcNAQkEMSIEIMsvvrdx3RzpQ7wP // SIG // PrfrwiE32xTQLDyArvZC4hpqAsgjMIH6BgsqhkiG9w0B // SIG // CRACLzGB6jCB5zCB5DCBvQQgIqWjaWLA756k3veQ49Qt // SIG // PdNtCOZY4m61v53SAjsYPcYwgZgwgYCkfjB8MQswCQYD // SIG // VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G // SIG // A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 // SIG // IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQg // SIG // VGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAdqO1claANER // SIG // sQABAAAB2jAiBCDfXeOrWD0z5uz31Uv1gi8PFvL69E0n // SIG // icHYd2UgK03z+zANBgkqhkiG9w0BAQsFAASCAgATPaVI // SIG // e9xwo8GRp0b9inmVNc5Fatg97CVPJPv3Yd9j/pr5gbiE // SIG // cQKk5Ed6paj2HwRgYn/OSmUOeNg+Jn76LVB2IFcfxjsu // SIG // Kx4pWMuskZwDA5NhzDG9q+ICKnKH71cn8NK+1o8BGgrn // SIG // lnuhsiF1QLHQ6Ww5DDfEFfGP77gRlANUiS0u16XLKOsK // SIG // tS8XIYqCHaGU33JOmR+OsQS/uJVftC1bNExGDCpmiu7l // SIG // Aoqpb/fm202GEzB6wM5EPcWoQbAJv+3uo6fsnlroSXWd // SIG // VU+wpnIM21OfiLS9ecO3v9V3CMX83irQq4krfjo1TZEh // SIG // j13rAxzL077YdIOfRnQJXDhCptHVxiqkMyE+G/4k40KN // SIG // /ppU7kmJdvxqp3FW8CtIVtwD+lBfQgZjmZ82jvNONXL8 // SIG // qDCZwAQLKghqsmTGZFf9AOmApoAgHFGYbTUHplJTEIdY // SIG // Pg63bYyM6X8GAAWPqWo3Fr3IE9M8AsWlZ5gX0naG1q9n // SIG // 8HJ53RBBJFvA2EsRVw6JDMIhuPmpd44TWmGyLdGxyIzN // SIG // Jx/N/Yi5W/gY57uJEQOlDSJPTu3zkwXgINMkTuorjk7C // SIG // bc9T2UBIVT//G0HBueDzk2JjdrfLGsRJfcXdXd9JTSFk // SIG // JtN2boYMk7rcM2e0nbe1Zqr4PjKIY2xrPilIyR75F5Nj // SIG // XwD2KneHXKiutYgs6A== // SIG // End signature block
combined_dataset/train/non-malicious/1573.ps1
1573.ps1
function Get-MrPipelineInput { [CmdletBinding()] param ( [Parameter(Mandatory)] [string]$Name, [System.Management.Automation.WhereOperatorSelectionMode]$Option = 'Default', [ValidateRange(1,2147483647)] [int]$Records = 2147483647 ) (Get-Command -Name $Name).ParameterSets.Parameters.Where({ $_.ValueFromPipeline -or $_.ValueFromPipelineByPropertyName }, $Option, $Records).ForEach({ [pscustomobject]@{ ParameterName = $_.Name ParameterType = $_.ParameterType ValueFromPipeline = $_.ValueFromPipeline ValueFromPipelineByPropertyName = $_.ValueFromPipelineByPropertyName } }) }
combined_dataset/train/non-malicious/3137.ps1
3137.ps1
[CmdletBinding(DefaultParameterSetName='Decrypt')] param ( [Parameter( Position=0, Mandatory=$true, HelpMessage='String which you want to encrypt or decrypt')] [String]$Text, [Parameter( Position=1, HelpMessage='Specify which rotation you want to use (Default=1..47)')] [ValidateRange(1,47)] [Int32[]]$Rot=1..47, [Parameter( ParameterSetName='Encrypt', Position=2, HelpMessage='Encrypt a string')] [switch]$Encrypt, [Parameter( ParameterSetName='Decrypt', Position=2, HelpMessage='Decrypt a string')] [switch]$Decrypt, [Parameter( Position=3, HelpMessage='Use complete ascii table 0..255 chars (Default=33..126)')] [switch]$UseAllAsciiChars ) Begin{ [System.Collections.ArrayList]$AsciiChars = @() $CharsIndex = 1 $StartAscii = 33 $EndAscii = 126 if($UseAllAsciiChars) { $StartAscii = 0 $EndAscii = 255 Write-Host "Warning: Parameter -UseAllAsciiChars will use all chars from 0 to 255 in the ascii table. This may not work properly, but could be usefull to encrypt or decrypt languages like german with umlauts!" -ForegroundColor Yellow } foreach($i in $StartAscii..$EndAscii) { $Char = [char]$i [pscustomobject]$Result = @{ Index = $CharsIndex Char = $Char } [void]$AsciiChars.Add($Result) $CharsIndex++ } if(($Encrypt -eq $false -and $Decrypt -eq $false) -or ($Decrypt)) { $Mode = "Decrypt" } else { $Mode = "Encrypt" } Write-Verbose -Message "Mode is set to: $Mode" } Process{ foreach($Rot2 in $Rot) { $ResultText = [String]::Empty foreach($i in 0..($Text.Length -1)) { $CurrentChar = $Text.Substring($i, 1) if(($AsciiChars.Char -ccontains $CurrentChar) -and ($CurrentChar -ne " ")) { if($Mode -eq "Encrypt") { [int]$NewIndex = ($AsciiChars | Where-Object {$_.Char -ceq $CurrentChar}).Index + $Rot2 if($NewIndex -gt $AsciiChars.Count) { $NewIndex -= $AsciiChars.Count $ResultText += ($AsciiChars | Where-Object {$_.Index -eq $NewIndex}).Char } else { $ResultText += ($AsciiChars | Where-Object {$_.Index -eq $NewIndex}).Char } } else { [int]$NewIndex = ($AsciiChars | Where-Object {$_.Char -ceq $CurrentChar}).Index - $Rot2 if($NewIndex -lt 1) { $NewIndex += $AsciiChars.Count $ResultText += ($AsciiChars | Where-Object {$_.Index -eq $NewIndex}).Char } else { $ResultText += ($AsciiChars | Where-Object {$_.Index -eq $NewIndex}).Char } } } else { $ResultText += $CurrentChar } } [pscustomobject] @{ Rot = $Rot2 Text = $ResultText } } } End{ }
combined_dataset/train/non-malicious/3605.ps1
3605.ps1
function Get-PSResourceGroupName { return Get-DeviceResourceGroupName } function Get-PSDeviceName { return getAssetName } function Test-GetDeviceNonExistent { $rgname = Get-PSResourceGroupName $dfname = Get-PSDeviceName Assert-ThrowsContains { Get-AzDataBoxEdgeDevice $rgname $dfname } "not found" } function Test-CreateDevice { $rgname = Get-PSResourceGroupName $dfname = Get-PSDeviceName $sku = 'Edge' $location = 'westus2' try { $expected = New-AzDataBoxEdgeDevice $rgname $dfname -Sku $sku -Location $location Assert-AreEqual $expected.Name $dfname } finally { Remove-AzDataBoxEdgeDevice $rgname $dfname } } function Test-RemoveDevice { $rgname = Get-PSResourceGroupName $dfname = Get-PSDeviceName $sku = 'Edge' $location = 'westus2' $expected = New-AzDataBoxEdgeDevice $rgname $dfname -Sku $sku -Location $location Remove-AzDataBoxEdgeDevice $rgname $dfname Assert-ThrowsContains { Get-AzDataBoxEdgeDevice $rgname $dfname } "not found" }
combined_dataset/train/non-malicious/1899.ps1
1899.ps1
Describe "Read-Host Test" -tag "CI" { BeforeAll { $th = New-TestHost $rs = [runspacefactory]::Createrunspace($th) $rs.open() $ps = [powershell]::Create() $ps.Runspace = $rs $ps.Commands.Clear() } AfterEach { $ps.Commands.Clear() } AfterAll { $rs.Close() $rs.Dispose() $ps.Dispose() } It "Read-Host returns expected string" { $result = $ps.AddCommand("Read-Host").Invoke() $result | Should -Be $th.UI.ReadLineData } It "Read-Host sets the prompt correctly" { $result = $ps.AddScript("Read-Host -prompt myprompt").Invoke() $prompt = $th.ui.streams.prompt[0] $prompt | Should -Not -BeNullOrEmpty $prompt.split(":")[-1] | Should -Be myprompt } It "Read-Host returns a secure string when using -AsSecureString parameter" { $result = $ps.AddScript("Read-Host -AsSecureString").Invoke() | select-object -first 1 $result | Should -BeOfType SecureString [pscredential]::New("foo",$result).GetNetworkCredential().Password | Should -BeExactly TEST } It "Read-Host doesn't enter command prompt mode" { $result = "!1" | pwsh -NoProfile -c "Read-host -Prompt 'foo'" if ($IsWindows) { $expected = @('!1','!1') } else { $expected = @('foo: !1','!1') } $result | should -BeExactly $expected } }
combined_dataset/train/non-malicious/sample_17_48.ps1
sample_17_48.ps1
# # Module manifest for module 'Microsoft.SME.ServerManager' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.ServerManager.psm1' # Version number of this module. ModuleVersion = '4.12.2' # Supported PSEditions # CompatiblePSEditions = @() # ID used to uniquely identify this module GUID = '8B31361A-4AB4-46A1-839A-5672BA9BD539' # 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 = @( 'Disconnect-WACSMHybridManagement', 'Get-WACSMAntimalwareSoftwareStatus', 'Get-WACSMAzureProtectionStatus', 'Get-WACSMAzureVMStatus', 'Get-WACSMBmcInfo', 'Get-WACSMCimDiskRegistry', 'Get-WACSMCimDiskSummary', 'Get-WACSMCimMemorySummary', 'Get-WACSMCimNetworkAdapterSummary', 'Get-WACSMCimProcessorSummary', 'Get-WACSMClientConnectionStatus', 'Get-WACSMClusterInformation', 'Get-WACSMComputerIdentification', 'Get-WACSMDiskSummaryDownlevel', 'Get-WACSMEnvironmentVariables', 'Get-WACSMHybridManagementConfiguration', 'Get-WACSMHybridManagementStatus', 'Get-WACSMHyperVEnhancedSessionModeSettings', 'Get-WACSMHyperVGeneralSettings', 'Get-WACSMHyperVHostPhysicalGpuSettings', 'Get-WACSMHyperVLiveMigrationSettings', 'Get-WACSMHyperVMigrationSupport', 'Get-WACSMHyperVNumaSpanningSettings', 'Get-WACSMHyperVRoleInstalled', 'Get-WACSMHyperVStorageMigrationSettings', 'Get-WACSMLicenseStatusChecks', 'Get-WACSMMemorySummaryDownLevel', 'Get-WACSMMmaStatus', 'Get-WACSMNetworkSummaryDownlevel', 'Get-WACSMNumberOfLoggedOnUsers', 'Get-WACSMPowerConfigurationPlan', 'Get-WACSMProcessorSummaryDownlevel', 'Get-WACSMRbacEnabled', 'Get-WACSMRbacSessionConfiguration', 'Get-WACSMRebootPendingStatus', 'Get-WACSMRemoteDesktop', 'Get-WACSMSQLServerEndOfSupportVersion', 'Get-WACSMServerConnectionStatus', 'Install-WACSMMonitoringDependencies', 'New-WACSMEnvironmentVariable', 'Remove-WACSMEnvironmentVariable', 'Restart-WACSMOperatingSystem', 'Set-WACSMComputerIdentification', 'Set-WACSMEnvironmentVariable', 'Set-WACSMHybridManagement', 'Set-WACSMHyperVEnhancedSessionModeSettings', 'Set-WACSMHyperVHostGeneralSettings', 'Set-WACSMHyperVHostLiveMigrationSettings', 'Set-WACSMHyperVHostNumaSpanningSettings', 'Set-WACSMHyperVHostStorageMigrationSettings', 'Set-WACSMPowerConfigurationPlan', 'Set-WACSMRemoteDesktop', 'Start-WACSMDiskPerf', 'Stop-WACSMCimOperatingSystem', 'Stop-WACSMDiskPerf', 'Add-WACSMAdministrators', 'Disconnect-WACSMAzureHybridManagement', 'Get-WACSMAzureHybridManagementConfiguration', 'Get-WACSMAzureHybridManagementOnboardState', 'Get-WACSMCimServiceDetail', 'Get-WACSMCimSingleService', 'Get-WACSMCimWin32LogicalDisk', 'Get-WACSMCimWin32NetworkAdapter', 'Get-WACSMCimWin32PhysicalMemory', 'Get-WACSMCimWin32Processor', 'Get-WACSMClusterInventory', 'Get-WACSMClusterNodes', 'Get-WACSMDecryptedDataFromNode', 'Get-WACSMEncryptionJWKOnNode', 'Get-WACSMServerInventory', 'Resolve-WACSMDNSName', 'Resume-WACSMCimService', 'Set-WACSMAzureHybridManagement', 'Set-WACSMVMPovisioning', 'Start-WACSMCimService', 'Start-WACSMVMProvisioning', 'Suspend-WACSMCimService' ) # Function attributes: {"localScripts":["Disconnect-WACSMHybridManagement","Get-WACSMAntimalwareSoftwareStatus","Get-WACSMAzureProtectionStatus","Get-WACSMAzureVMStatus","Get-WACSMBmcInfo","Get-WACSMCimDiskRegistry","Get-WACSMCimDiskSummary","Get-WACSMCimMemorySummary","Get-WACSMCimNetworkAdapterSummary","Get-WACSMCimProcessorSummary","Get-WACSMClientConnectionStatus","Get-WACSMClusterInformation","Get-WACSMComputerIdentification","Get-WACSMDiskSummaryDownlevel","Get-WACSMEnvironmentVariables","Get-WACSMHybridManagementConfiguration","Get-WACSMHybridManagementStatus","Get-WACSMHyperVEnhancedSessionModeSettings","Get-WACSMHyperVGeneralSettings","Get-WACSMHyperVHostPhysicalGpuSettings","Get-WACSMHyperVLiveMigrationSettings","Get-WACSMHyperVMigrationSupport","Get-WACSMHyperVNumaSpanningSettings","Get-WACSMHyperVRoleInstalled","Get-WACSMHyperVStorageMigrationSettings","Get-WACSMLicenseStatusChecks","Get-WACSMMemorySummaryDownLevel","Get-WACSMMmaStatus","Get-WACSMNetworkSummaryDownlevel","Get-WACSMNumberOfLoggedOnUsers","Get-WACSMPowerConfigurationPlan","Get-WACSMProcessorSummaryDownlevel","Get-WACSMRbacEnabled","Get-WACSMRbacSessionConfiguration","Get-WACSMRebootPendingStatus","Get-WACSMRemoteDesktop","Get-WACSMSQLServerEndOfSupportVersion","Get-WACSMServerConnectionStatus","Install-WACSMMonitoringDependencies","New-WACSMEnvironmentVariable","Remove-WACSMEnvironmentVariable","Restart-WACSMOperatingSystem","Set-WACSMComputerIdentification","Set-WACSMEnvironmentVariable","Set-WACSMHybridManagement","Set-WACSMHyperVEnhancedSessionModeSettings","Set-WACSMHyperVHostGeneralSettings","Set-WACSMHyperVHostLiveMigrationSettings","Set-WACSMHyperVHostNumaSpanningSettings","Set-WACSMHyperVHostStorageMigrationSettings","Set-WACSMPowerConfigurationPlan","Set-WACSMRemoteDesktop","Start-WACSMDiskPerf","Stop-WACSMCimOperatingSystem","Stop-WACSMDiskPerf"],"externalScripts":["Add-WACSMAdministrators","Disconnect-WACSMAzureHybridManagement","Get-WACSMAzureHybridManagementConfiguration","Get-WACSMAzureHybridManagementOnboardState","Get-WACSMCimServiceDetail","Get-WACSMCimSingleService","Get-WACSMCimWin32LogicalDisk","Get-WACSMCimWin32NetworkAdapter","Get-WACSMCimWin32PhysicalMemory","Get-WACSMCimWin32Processor","Get-WACSMClusterInventory","Get-WACSMClusterNodes","Get-WACSMDecryptedDataFromNode","Get-WACSMEncryptionJWKOnNode","Get-WACSMServerInventory","Resolve-WACSMDNSName","Resume-WACSMCimService","Set-WACSMAzureHybridManagement","Set-WACSMVMPovisioning","Start-WACSMCimService","Start-WACSMVMProvisioning","Suspend-WACSMCimService"]} # 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 # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # Bg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BC5NZ+L03Xlfw8qqGeQUS3/kd4q3PcuH # IXWprGHpiK1MTubSvDIl5I4= # SIG # End signature block
combined_dataset/train/non-malicious/4096.ps1
4096.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 "Google Chrome" -Switches "/qb- /norestart"
combined_dataset/train/non-malicious/sample_10_23.ps1
sample_10_23.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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kSag/Sckiv2lurspi+ZhvgqAl1VJn/S/DOZRA/fgnNAMSrcEJVGcl/h4CXDrc # XwcvemzfcOhuQpsAQBxNzF84tMGS7j7yMGY4/bmggoF+Q0on3zVnQfqEHtlrsgwF # IINrtfJJ7dzNr8TcJ+v3mBg= # SIG # End signature block
combined_dataset/train/non-malicious/ConvertTo-Hex_9.ps1
ConvertTo-Hex_9.ps1
# Ported from C# technique found here: http://forums.asp.net/p/1298956/2529558.aspx param ( [string]$SidString ) # Create SID .NET object using SID string provided $sid = New-Object system.Security.Principal.SecurityIdentifier $sidstring # Create a byte array of the proper length $sidBytes = New-Object byte[] $sid.BinaryLength #Convert to bytes $sid.GetBinaryForm( $sidBytes, 0 ) # Iterate through bytes, converting each to the hexidecimal equivalent $hexArr = $sidBytes | ForEach-Object { $_.ToString("X2") } # Join the hex array into a single string for output $hexArr -join ''
combined_dataset/train/non-malicious/212.ps1
212.ps1
function Get-ADFSMORole { [CmdletBinding()] PARAM ( [Alias("RunAs")] [System.Management.Automation.Credential()] [pscredential] $Credential = [System.Management.Automation.PSCredential]::Empty ) TRY { IF (-not (Get-Module -Name ActiveDirectory)) { Import-Module -Name ActiveDirectory -ErrorAction 'Stop' -Verbose:$false } IF ($PSBoundParameters['Credential']) { $ForestRoles = Get-ADForest -Credential $Credential -ErrorAction 'Stop' -ErrorVariable ErrorGetADForest $DomainRoles = Get-ADDomain -Credential $Credential -ErrorAction 'Stop' -ErrorVariable ErrorGetADDomain } ELSE { $ForestRoles = Get-ADForest $DomainRoles = Get-ADDomain } $Properties = @{ SchemaMaster = $ForestRoles.SchemaMaster DomainNamingMaster = $ForestRoles.DomainNamingMaster InfraStructureMaster = $DomainRoles.InfraStructureMaster RIDMaster = $DomainRoles.RIDMaster PDCEmulator = $DomainRoles.PDCEmulator } New-Object -TypeName PSObject -Property $Properties } CATCH { $PSCmdlet.ThrowTerminatingError($_) } }
combined_dataset/train/non-malicious/HttpRest.ps1
HttpRest.ps1
## Http Rest #################################################################################################### ## The first implementation of the HttpRest module, as a bunch of script functions ## Based on the REST api from MindTouch's Dream SDK ## ## INSTALL: ## You need log4net.dll mindtouch.core.dll mindtouch.dream.dll and SgmlReaderDll.dll from the SDK ## Download DREAM from http`://sourceforge.net/project/showfiles.php?group_id=173074 ## Unpack it, and you can find these dlls in the "dist" folder. ## Make sure to put them in the folder with the module. ## ## For documentation of Dream: http`://wiki.developer.mindtouch.com/Dream #################################################################################################### ## Usage: ## function Get-Google { ## Invoke-Http GET http`://www.google.com/search @{q=$args} | ## Receive-Http Xml "//h3[@class='r']/a" | Select href, InnerText ## } ## ######################################################################### ## function Get-WebFile($url,$cred) { ## Invoke-Http GET $url -auth $cred | Receive-Http File ## } ## ######################################################################### ## function Send-Paste { ## PARAM($PastebinURI="http`://posh.jaykul.com/p/",[IO.FileInfo]$file) ## PROCESS { ## if($_){[IO.FileInfo]$file=$_} ## ## if($file.Exists) { ## $ofs="`n" ## $result = Invoke-Http POST $PastebinURI @{ ## format="posh" # PowerShell ## expiry="d" # (d)ay or (m)onth or (f)orever ## poster=$([Security.Principal.WindowsIdentity]::GetCurrent().Name.Split("\\")[-1]) ## code2="$((gc $file) -replace "http`://","http``://")" # To get past the spam filter. ## paste="Send" ## } -Type FORM_URLENCODED -Wait ## $xml = $result.AsDocument().ToXml() ## write-output $xml.SelectSingleNode("//*[@class='highlight']/*").href ## } else { throw "File Not Found" } ## }} ## #################################################################################################### if(!$PSScriptRoot){ Write-Debug $($MyInvocation.MyCommand | out-string) $PSScriptRoot=(Split-Path $MyInvocation.MyCommand.Path -Parent) } # Write-Debug "Invocation: $($MyInvocation.MyCommand.Path)" # Write-Debug "Invocation: $($MyInvocation.MyCommand)" # Write-Debug "Invocation: $($MyInvocation)" Write-Debug "PSScriptRoot: '$PSScriptRoot'" # This Module depends on MindTouch.Dream $null = [Reflection.Assembly]::LoadFrom( "$PSScriptRoot\\mindtouch.dream.dll" ) # MindTouch.Dream requires: mindtouch.dream.dll, mindtouch.core.dll, SgmlReaderDll.dll, and log4net.dll) # This Module also depends on utility functions from System.Web $null = [Reflection.Assembly]::LoadWithPartialName("System.Web") ## Some utility functions are defined at the bottom [uri]$global:url = "" [System.Management.Automation.PSCredential]$global:HttpRestCredential = $null function Get-DreamMessage($Content,$Type) { if(!$Content) { return [MindTouch.Dream.DreamMessage]::Ok() } if( $Content -is [System.Xml.XmlDocument]) { return [MindTouch.Dream.DreamMessage]::Ok( $Content ) } if(Test-Path $Content -EA "SilentlyContinue") { return [MindTouch.Dream.DreamMessage]::FromFile((Convert-Path (Resolve-Path $Content))); } if($Type -is [String]) { $Type = [MindTouch.Dream.MimeType]::$Type } if($Type -is [MindTouch.Dream.DreamMessage]) { return [MindTouch.Dream.DreamMessage]::Ok( $Type, $Content ) } else { return [MindTouch.Dream.DreamMessage]::Ok( $([MindTouch.Dream.MimeType]::TEXT), $Content ) } } function Get-DreamPlug { PARAM ( $Url, [hashtable]$With ) if($Url -is [array]) { if($Url[0] -is [hashtable]) { $plug = [MindTouch.Dream.Plug]::New($global:url) foreach($param in $url.GetEnumerator()) { if($param.Value) { $plug = $plug.At($param.Key,"=$(Encode-Twice $param.Value)") } else { $plug = $plug.At($param.Key) } } } else { [URI]$uri = Join-Url $global:url $url $plug = [MindTouch.Dream.Plug]::New($uri) } } elseif($url -is [string]) { [URI]$uri = $url if(!$uri.IsAbsoluteUri) { $uri = Join-Url $global:url $url } $plug = [MindTouch.Dream.Plug]::New($uri) } else { $plug = [MindTouch.Dream.Plug]::New($global:url) } if($with) { foreach($param in $with.GetEnumerator()) { if($param.Value) { $plug = $plug.With($param.Key,$param.Value) } } } return $plug } #CMDLET Receive-Http { Function Receive-Http { PARAM( # [Parameter(Position=1, Mandatory=$false)] # [ValidateSet("Xml", "File", "Text","Bytes")] # [Alias("As")] $Output = "Xml" , # [Parameter(Position=2, Mandatory=$false)] [string]$Path , # [Parameter(Mandatory=$true, ValueFromPipeline=$true, ParameterSetName="Result")] # [Alias("IO")] # [MindTouch.Dream.Result``1[[MindTouch.Dream.DreamMessage]]] $InputObject #, # [Parameter(Mandatory=$true, ValueFromPipeline=$true, ParameterSetName="Response")] # [MindTouch.Dream.DreamMessage] # $response ) BEGIN { if($InputObject) { Write-Output $inputObject | Receive-Http $Output $Path } # else they'd better pass it in on the pipeline ... } PROCESS { $response = $null if($_ -is [MindTouch.Dream.Result``1[[MindTouch.Dream.DreamMessage]]]) { $response = $_.Wait() } elseif($_ -is [MindTouch.Dream.DreamMessage]) { $response = $_ } elseif($_) { throw "We can only pipeline [MindTouch.Dream.DreamMessage] objects, or [MindTouch.Dream.Result`1[DreamMessage]] objects" } if($response) { Write-Debug $($response | Out-String) if(!$response.IsSuccessful) { Write-Error $($response | Out-String) Write-Verbose $response.AsText() throw "ERROR: '$($response.Status)' Response Status." } else { switch($Output) { "File" { ## Joel's magic filename guesser ... if(!$Path) { [string]$fileName = ([regex]'(?i)filename=(.*)$').Match( $response.Headers["Content-Disposition"] ).Groups[1].Value $Path = $fileName.trim("\\/""'") if(!$Path) { $fileName = $response.ResponseUri.Segments[-1] $Path = $fileName.trim("\\/") if(!([IO.FileInfo]$Path).Extension) { $Path = $Path + "." + $response.ContentType.Split(";")[0].Split("/")[1] } } } $File = Get-FileName $Path [StreamUtil]::CopyToFile( $response.AsStream(), $response.ContentLength, $File ) Get-ChildItem $File } "XDoc" { if($Path) { $response.AsDocument()[$Path] } else { $response.AsDocument()#.ToXml() } } "Xml" { if($Path) { $response.AsDocument().ToXml().SelectNodes($Path) } else { $response.AsDocument().ToXml() } } "Text" { if($Path) { $response.AsDocument()[$Path] | % { $_.AsText } } else { $response.AsText() } } "Bytes" { $response.AsBytes() } } } } } } ## http`://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html ## Nobody actually uses HEAD or OPTIONS, right? ## And nobody's even heard of TRACE or CONNECT ;) # CMDLET Invoke-Http { Function Invoke-Http { PARAM( # [Parameter(Position=0, Mandatory=$false)] # [ValidateSet("Post", "Get", "Put", "Delete", "Head", "Options")] ## There are other verbs, but we need a list to make sure you don't screw up [string]$Verb = "Get" , # [Parameter(Position=1, Mandatory=$false, ValueFromPipeline=$true)] # [string] $Path , # [Parameter(Position=2, Mandatory=$false)] [hashtable]$with , # [Parameter(Position=3, Mandatory=$false)] $Content , $Type # Of Content , $authenticate , [switch]$waitForResponse ) BEGIN { $Verbs = "Post", "Get", "Put", "Delete", "Head", "Options" if($Verbs -notcontains $Verb) { Write-Warning "The specified verb '$Verb' is NOT one of the common verbs: $Verbs" } if($Path) { if($Content) { Write-Output ($Path | Invoke-Http $Verb -With $With -Content $Content -Type $Type -Authenticate $authenticate -waitForResponse:$WaitForResponse) } else { Write-Output ($Path | Invoke-Http $Verb -With $With -Type $Type-Authenticate $authenticate -waitForResponse:$WaitForResponse) } } # else they'd better pass it in on the pipeline ... } PROCESS { if($_) { $Path = $_ $plug = Get-DreamPlug $Path $With Write-Verbose "Content Type: $Type" Write-Verbose "Content: $Content" ## Special Handling for FORM_URLENCODED if($Type -like "Form*" -and !$Content) { $dream = [MindTouch.Dream.DreamMessage]::Ok( $Plug.Uri ) $Plug = [MindTouch.Dream.Plug]::New( $Plug.Uri.SchemeHostPortPath ) Write-Verbose "RECREATED Plug: $($Plug.Uri.SchemeHostPortPath)" } else { $dream = Get-DreamMessage $Content $Type } if(!$plug -or !$dream) { throw "Can't come up with a request!" } Write-Verbose $( $dream | Out-String ) if($authenticate){ Write-Verbose "AUTHENTICATE AS $($authenticate.UserName)" if($authenticate -is [System.Management.Automation.PSCredential]) { Write-Verbose "AUTHENTICATING AS $($authenticate.UserName)" $plug = $plug.WithCredentials($authenticate.UserName, ($authenticate.GetNetworkCredential().Password)) } elseif($authenticate -is [System.Net.NetworkCredential]) { Write-Verbose "AUTHENTICATING AS $($authenticate.UserName)" $plug = $plug.WithCredentials($authenticate.UserName, $authenticate.Password) } else { Get-HttpCredential Write-Verbose "AUTHENTICATING AS $($authenticate.UserName)" $plug = $plug.WithCredentials($global:HttpRestCredential.UserName, $global:HttpRestCredential.Password) } } Write-Verbose $plug.Uri ## DEBUG: Write-Debug "URI: $($Plug.Uri)" Write-Debug "Verb: $($Verb.ToUpper())" Write-Debug $($dream | Out-String) $result = $plug.InvokeAsync( $Verb.ToUpper(), $dream ) Write-Debug $($result | Out-String) # if($DebugPreference -eq "Continue") { # Write-Debug $($result.Wait() | Out-String) # } if($waitForResponse) { $result = $result.Wait() } write-output $result trap [MindTouch.Dream.DreamResponseException] { Write-Error @" TRAPPED DreamResponseException $($_.Exception.Response | Out-String) $($_.Exception.Response.Headers | Out-String) "@ break; } } } } # function Get-Http { return Invoke-Http "GET" @args } # function New-Http { return Invoke-Http "PUT" @args } # function Update-Http { return Invoke-Http "POST" @args } # function Remove-Http { return Invoke-Http "DELETE" @args } # new-alias Set-Http Update-Http # new-alias Put-Http New-Http # new-alias Post-Http Update-Http # new-alias Delete-Http Remove-Http function Set-HttpDefaultUrl { PARAM ([uri]$baseUri=$(Read-Host "Please enter the base Uri for your RESTful web-service")) $global:url = $baseUri } function Set-HttpCredential { param($Credential=$(Get-CredentialBetter -Title "Http Authentication Request - $($global:url.Host)" ` -Message "Your login for $($global:url.Host)" ` -Domain $($global:url.Host)) ) if($Credential -is [System.Management.Automation.PSCredential]) { $global:HttpRestCredential = $Credential } elseif($Credential -is [System.Net.NetworkCredential]) { $global:HttpRestCredential = new-object System.Management.Automation.PSCredential $Credential.UserName, $(ConvertTo-SecureString $credential.Password) } } function Get-HttpCredential([switch]$Secure) { if(!$global:url) { Set-HttpDefaultUrl } if(!$global:HttpRestCredential) { Set-HttpCredential } if(!$Secure) { return $global:HttpRestCredential.GetNetworkCredential(); } else { return $global:HttpRestCredential } } # function Authenticate-Http { # PARAM($URL=@("users","authenticate"), $Credential = $(Get-HttpCredential)) # $plug = [MindTouch.Dream.Plug]::New( $global:url ) # $null = $plug.At("users", "authenticate").WithCredentials( $auth.UserName, $auth.Password ).Get() # } function Encode-Twice { param([string]$text) return [System.Web.HttpUtility]::UrlEncode( [System.Web.HttpUtility]::UrlEncode( $text ) ) } function Join-Url ( [uri]$baseUri=$global:url ) { $ofs="/";$BaseUrl = "" if($BaseUri -and $baseUri.AbsoluteUri) { $BaseUrl = "$($baseUri.AbsoluteUri.Trim('/'))/" } return [URI]"$BaseUrl$([string]::join("/",@($args)).TrimStart('/'))" } function ConvertTo-SecureString { Param([string]$input) $result = new-object System.Security.SecureString foreach($c in $input.ToCharArray()) { $result.AppendChar($c) } $result.MakeReadOnly() return $result } ## Unit-Test Get-FileName ## Should return TRUE ## (Get-FileName C:\\Windows\\System32\\Notepad.exe) -eq "C:\\Windows\\System32\\Notepad.exe" -and ## (Get-FileName C:\\Windows\\Notepad.exe C:\\Windows\\System32\\) -eq "C:\\Windows\\System32\\Notepad.exe" -and ## (Get-FileName WaitFor.exe C:\\Windows\\System32\\WaitForIt.exe) -eq "C:\\Windows\\System32\\WaitForIt.exe" -and ## (Get-FileName -Path C:\\Windows\\System32\\WaitForIt.exe) -eq "C:\\Windows\\System32\\WaitForIt.exe" function Get-FileName { param($fileName=$([IO.Path]::GetRandomFileName()), $path) $fileName = $fileName.trim("\\/""'") ## if the $Path has a file name, and it's folder exists: if($Path -and !(Test-Path $Path -Type Container) -and (Test-Path (Split-Path $path) -Type Container)) { $path ## if the $Path is just a folder (and it exists) } elseif($Path -and (Test-Path $path -Type Container)) { $fileName = Split-Path $fileName -leaf Join-Path $path $fileName ## If there's no valid $Path, and the $FileName has a folder... } elseif((Split-Path $fileName) -and (Test-Path (Split-Path $fileName))) { $fileName } else { Join-Path (Get-Location -PSProvider "FileSystem") (Split-Path $fileName -Leaf) } } function Get-UtcTime { Param($Format="yyyyMMddhhmmss") [DateTime]::Now.ToUniversalTime().ToString($Format) } ## Get-CredentialBetter ## An improvement over the default cmdlet which has no options ... ################################################################################################### ## History ## 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-CredentialBetter{ PARAM([string]$UserName, [string]$Title, [string]$Message, [string]$Domain, [switch]$Console) $ShellIdKey = "HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds" ## Carefully EA=SilentlyContinue because by default it's MISSING, not $False $cp = (Get-ItemProperty $ShellIdKey ConsolePrompting -ea "SilentlyContinue") ## Compare to $True, because by default it's $null ... $cp = $cp.ConsolePrompting -eq $True if($Console -and !$cp) { Set-ItemProperty $ShellIdKey ConsolePrompting $True } elseif(!$Console -and $Console.IsPresent -and $cp) { Set-ItemProperty $ShellIdKey ConsolePrompting $False } ## Now call the Host.UI method ... if they don't have one, we'll die, yay. $Host.UI.PromptForCredential($Title,$Message,$UserName,$Domain,"Generic","Default") ## BoyScouts: Leave everything better than you found it (I'm tempted to leave it = True) Set-ItemProperty $ShellIdKey ConsolePrompting $cp } # Export-ModuleMember Invoke-Http, Receive-Http, Set-HttpCredential, Set-HttpDefaultUrl
combined_dataset/train/non-malicious/sample_49_77.ps1
sample_49_77.ps1
function Get-RoleArnPolicy { <# .SYNOPSIS Returns a customized Arn policy using the Sentinel Workspace Id .PARAMETER WorkspaceId Specifies the Azure Sentinel workspace id #> [OutputType([string])] [CmdletBinding()] param ( [Parameter(position=0)] [ValidateNotNullOrEmpty()] [string] $WorkspaceId ) $arnRolePolicy = "{ 'Version': '2012-10-17', 'Statement': [ { 'Effect': 'Allow', 'Principal': { 'AWS': '$($AwsCloudResource):iam::197857026523:root' }, 'Action': 'sts:AssumeRole', 'Condition': { 'StringEquals': { 'sts:ExternalId': '$WorkspaceId' } } } ] }" return $arnRolePolicy.Replace("'",'\"') } function Get-OIDCRoleArnPolicy { <# .SYNOPSIS Returns a customized Arn policy using the Sentinel Workspace Id .PARAMETER WorkspaceId Specifies the Azure Sentinel workspace id .PARAMETER CustomerAWSAccountId Specifies the customer AWS account id #> [OutputType([string])] [CmdletBinding()] param ( [Parameter(position=0)] [ValidateNotNullOrEmpty()] [string] $WorkspaceId, [Parameter(position=1)] [ValidateNotNullOrEmpty()] [string] $CustomerAWSAccountId ) $arnRolePolicy = "{ 'Version': '2012-10-17', 'Statement': [ { 'Effect': 'Allow', 'Principal': { 'Federated': '$($AwsCloudResource):iam::$($CustomerAWSAccountId):oidc-provider/sts.windows.net/$($SentinelTenantId)/' }, 'Action': 'sts:AssumeRoleWithWebIdentity', 'Condition': { 'StringEquals': { 'sts.windows.net/$($SentinelTenantId)/:aud': '$($SentinelClientId)', 'sts:RoleSessionName': 'MicrosoftSentinel_$WorkspaceId' } } } ] }" return $arnRolePolicy.Replace("'",'\"') } function Get-S3AndRuleSQSPolicies { <# .SYNOPSIS Returns a customized Sqs rule policy using the specified S3 bucket name, the Sqs ARN, and role ARN. .PARAMETER EventNotificationName Specifies the event notification name .PARAMETER EventNotificationPrefix Specifies the event notification prefix .PARAMETER SqsArn Specifies the Sqs ARN #> [OutputType([string])] [CmdletBinding()] param ( [ValidateNotNullOrEmpty()][string] $RoleArn, [ValidateNotNullOrEmpty()][string] $BucketName, [ValidateNotNullOrEmpty()][string] $SqsArn ) $sqsPolicyForS3 = " { 'Version': '2008-10-17', 'Id':'__default_policy_ID', 'Statement': [ { 'Sid': 'allow s3 to send notification messages to SQS queue', 'Effect': 'Allow', 'Principal': { 'Service': 's3.amazonaws.com' }, 'Action': 'SQS:SendMessage', 'Resource': '$SqsArn', 'Condition': { 'ArnLike': { 'aws:SourceArn': '$($AwsCloudResource):s3:*:*:$BucketName' } } }, { 'Sid': 'allow specific role to read/delete/change visibility of SQS messages and get queue url', 'Effect': 'Allow', 'Principal': { 'AWS': '$RoleArn' }, 'Action': [ 'SQS:ChangeMessageVisibility', 'SQS:DeleteMessage', 'SQS:ReceiveMessage', 'SQS:GetQueueUrl' ], 'Resource': '$SqsArn' } ] }" return $sqsPolicyForS3.Replace("'",'"') } function Get-SqsEventNotificationConfig { <# .SYNOPSIS Returns a customized Sqs event notification config policy using the specified event notification name, the Sqs ARN, and notification prefix. .PARAMETER EventNotificationName Specifies the event notification name .PARAMETER EventNotificationPrefix Specifies the event notification prefix .PARAMETER SqsArn Specifies the Sqs ARN #> [OutputType([string])] [CmdletBinding()] param ( [Parameter(position=0)] [ValidateNotNullOrEmpty()] [string] $EventNotificationName, [Parameter(position=1)] [ValidateNotNullOrEmpty()] [string] $EventNotificationPrefix, [Parameter(position=2)] [ValidateNotNullOrEmpty()] [string] $SqsArn, [Parameter()] [bool] $IsCustomLog ) $SqsSuffix = "" if($true -ne $IsCustomLog) { $SqsSuffix = ",{ 'Name': 'suffix', 'Value': '.gz' }" } $sqsEventConfig = " { 'QueueConfigurations': [ { 'Id':'$EventNotificationName', 'QueueArn': '$SqsArn', 'Events': ['s3:ObjectCreated:*'], 'Filter': { 'Key': { 'FilterRules': [ { 'Name': 'prefix', 'Value': '$EventNotificationPrefix' } $SqsSuffix ] } } } ] }" return $sqsEventConfig.Replace("'",'"') } function Get-RoleS3Policy { <# .SYNOPSIS Returns a customized Arn policy using the specified role ARN and bucket name .PARAMETER RoleArn Specifies the Role ARN .PARAMETER BucketName Specifies the S3 Bucket #> [OutputType([string])] [CmdletBinding()] param ( [Parameter(position=0)] [ValidateNotNullOrEmpty()][string] $RoleArn, [Parameter(position=1)] [ValidateNotNullOrEmpty()][string] $BucketName ) $s3PolicyForArn = "{ 'Statement': [{ 'Sid': 'Allow Arn read access S3 bucket', 'Effect': 'Allow', 'Principal': { 'AWS': '$RoleArn' }, 'Action': ['s3:GetObject'], 'Resource': '$($AwsCloudResource):s3:::$BucketName/*' }]}" return $s3PolicyForArn.Replace("'",'"') }
combined_dataset/train/non-malicious/3690.ps1
3690.ps1
function Test-SourceDataSetsCrud { $resourceGroup = getAssetName $AccountName = getAssetName $ShareSubscriptionName = getAssetName $SourceDataSets = Get-AzDataShareSourceDataSet -ResourceGroupName $resourceGroup -AccountName $AccountName -ShareSubscriptionName $ShareSubscriptionName Assert-NotNull $SourceDataSets }
combined_dataset/train/non-malicious/sample_8_8.ps1
sample_8_8.ps1
#************************************************ # DC_RAS-Component.ps1 # Version 1.0 # Collects registry and netsh information. # Version 1.1 # Commented out "ras show activeservers". <- On Win7, this caused a Windows Firewall prompt to allow RAS server advertisements # Commented out "ras show user" <- This command enumerates all User accounts from the Active Directory and their Dial-in Settings, which can take a very long time in a big enterprise environment. # Version 1.2 # Corrected the section that collects RAS Tracing logs. # Date: 2009, 2013, 2014 # Author: Boyd Benson ([email protected]) # Description: Collects information about RAS. # Called from: Main Networking Diag, etc #******************************************************* 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 } Import-LocalizedData -BindingVariable RasTracingStrings Write-DiagProgress -Activity $RasTracingStrings.ID_RasTracingLogs -Status $RasTracingStrings.ID_RasTracingLogsDesc $sectionDescription = "RAS Component" function RunNetSH ([string]$NetSHCommandToExecute="") { Write-DiagProgress -Activity $RasTracingStrings.ID_RasNetsh -Status "netsh $NetSHCommandToExecute" $NetSHCommandToExecuteLength = $NetSHCommandToExecute.Length + 6 "-" * ($NetSHCommandToExecuteLength) + "`r`n" + "netsh $NetSHCommandToExecute" + "`r`n" + "-" * ($NetSHCommandToExecuteLength) | Out-File -FilePath $OutputFile -append $CommandToExecute = "cmd.exe /c netsh.exe " + $NetSHCommandToExecute + " >> $OutputFile " RunCmD -commandToRun $CommandToExecute -CollectFiles $false "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append } #----------Log Files $RasTracing = "$Env:windir\tracing" if (Test-Path -Path $RasTracing) { if (-not (Test-Path($PWD.Path + "\RasTracingDir"))) {[void](New-Item $Pwd.Path -Name RasTracingDir -ItemType directory | Out-Null )} $RasTracingPath = $Pwd.Path + "\RasTracingDir" Copy-Item -Path "$Env:windir\tracing\*.*" -Destination $RasTracingPath $RasTracingFiles = $RasTracingPath + "\*.*" $RasTracingLogs = $ComputerName + "_RasTracingLogs.zip" $zipComp = CompressCollectFiles -NumberofDays 10 -filesToCollect $RasTracingFiles -DestinationFileName $RasTracingLogs -renameOutput $false -fileDescription "RAS Tracing Logs" -sectionDescription $sectionDescription if ($zipComp) { Write-Verbose "_... zipped $RasTracingFiles" Remove-Item -Path $RasTracingFiles -Recurse Remove-Item $Pwd.Path`\RasTracingDir } } #----------Registry $OutputFile= $Computername + "_RAS_reg_.TXT" $CurrentVersionKeys = "HKLM\System\CurrentControlSet\services\RasMan" RegQuery -RegistryKeys $CurrentVersionKeys -Recursive $true -OutputFile $OutputFile -fileDescription "RAS registry output" -SectionDescription $sectionDescription #----------Netsh $OutputFile = $ComputerName + "_RAS_netsh_ras-output.TXT" "====================================================" | Out-File -FilePath $OutputFile -append "RAS Netsh Output" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append "Overview" | Out-File -FilePath $OutputFile -append "----------------------------------------------------" | Out-File -FilePath $OutputFile -append " 1. netsh ras aaaa show accounting" | Out-File -FilePath $OutputFile -append " 2. netsh ras aaaa show acctserver" | Out-File -FilePath $OutputFile -append " 3. netsh ras aaaa show authentication" | Out-File -FilePath $OutputFile -append " 4. netsh ras aaaa show authserver" | Out-File -FilePath $OutputFile -append " 5. netsh ras aaaa show ipsecpolicy" | Out-File -FilePath $OutputFile -append " 6. netsh ras demanddial show interface" | Out-File -FilePath $OutputFile -append " 7. netsh ras demanddial show" | Out-File -FilePath $OutputFile -append " 8. netsh ras diagnostics show tracefacilities" | Out-File -FilePath $OutputFile -append " 9. netsh ras ip show config" | Out-File -FilePath $OutputFile -append " 10. netsh ras ip show preferredadapter" | Out-File -FilePath $OutputFile -append " 11. netsh ras ipv6 show config" | Out-File -FilePath $OutputFile -append " 12. netsh ras show authmode" | Out-File -FilePath $OutputFile -append " 13. netsh ras show authtype" | Out-File -FilePath $OutputFile -append " 14. netsh ras show client" | Out-File -FilePath $OutputFile -append " 15. netsh ras show conf" | Out-File -FilePath $OutputFile -append " 16. netsh ras show ikev2connection" | Out-File -FilePath $OutputFile -append " 17. netsh ras show ikev2saexpiry" | Out-File -FilePath $OutputFile -append " 18. netsh ras show link" | Out-File -FilePath $OutputFile -append " 19. netsh ras show multilink" | Out-File -FilePath $OutputFile -append " 20. netsh ras show portstatus" | Out-File -FilePath $OutputFile -append " 21. netsh ras show registeredserver" | Out-File -FilePath $OutputFile -append " 22. netsh ras show sstp-ssl-cert" | Out-File -FilePath $OutputFile -append " 23. netsh ras show status" | Out-File -FilePath $OutputFile -append " 24. netsh ras show type" | Out-File -FilePath $OutputFile -append " 25. netsh ras show wanports" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append "`n`n`n`n`n" | Out-File -FilePath $OutputFile -append "__ value of Switch skipHang: $Global:skipHang - 'True' will suppress output for: NetSh ras show client `n`n" | Out-File -FilePath $OutputFile -append RunNetSH -NetSHCommandToExecute "ras aaaa show accounting" RunNetSH -NetSHCommandToExecute "ras aaaa show acctserver" RunNetSH -NetSHCommandToExecute "ras aaaa show authentication" RunNetSH -NetSHCommandToExecute "ras aaaa show authserver" RunNetSH -NetSHCommandToExecute "ras aaaa show ipsecpolicy" RunNetSH -NetSHCommandToExecute "ras demanddial show interface" RunNetSH -NetSHCommandToExecute "ras demanddial show" RunNetSH -NetSHCommandToExecute "ras diagnostics show tracefacilities" RunNetSH -NetSHCommandToExecute "ras ip show config" RunNetSH -NetSHCommandToExecute "ras ip show preferredadapter" RunNetSH -NetSHCommandToExecute "ras ipv6 show config" # RunNetSH -NetSHCommandToExecute "ras show activeservers" <- On Win7, this caused a Windows Firewall prompt to allow RAS server advertisements RunNetSH -NetSHCommandToExecute "ras show authmode" RunNetSH -NetSHCommandToExecute "ras show authtype" if ($Global:skipHang -ne $true) { RunNetSH -NetSHCommandToExecute "ras show client" } RunNetSH -NetSHCommandToExecute "ras show conf" RunNetSH -NetSHCommandToExecute "ras show ikev2connection" RunNetSH -NetSHCommandToExecute "ras show ikev2saexpiry" RunNetSH -NetSHCommandToExecute "ras show link" RunNetSH -NetSHCommandToExecute "ras show multilink" RunNetSH -NetSHCommandToExecute "ras show portstatus" RunNetSH -NetSHCommandToExecute "ras show registeredserver" RunNetSH -NetSHCommandToExecute "ras show sstp-ssl-cert" RunNetSH -NetSHCommandToExecute "ras show status" RunNetSH -NetSHCommandToExecute "ras show type" # RunNetSH -NetSHCommandToExecute "ras show user" <- This command enumerates all User accounts from the Active Directory and their Dial-in Settings, which can take a very long time in a big enterprise environment. RunNetSH -NetSHCommandToExecute "ras show wanports" CollectFiles -sectionDescription $sectionDescription -fileDescription "RAS netsh output" -filesToCollect $OutputFile # SIG # Begin signature block # MIIoPAYJKoZIhvcNAQcCoIIoLTCCKCkCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAnCLTO9PxRtuOv # 6lKuSR+C7crEVf58guGBbd5ZLGqGQKCCDYUwggYDMIID66ADAgECAhMzAAAEA73V # lV0POxitAAAAAAQDMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjQwOTEyMjAxMTEzWhcNMjUwOTExMjAxMTEzWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24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VoU # ceb4s49ulWwvNrZWPALUMe2mFrNzjFURproK2rHLcMXQv9nM9Jrx//4S+zjHOu9s # YeehGkHJSzsM/el6ezNrhFegqbZ/xxhccBQ9w1aXNmHeLR8AngthUnEx/0fbxBVz # W03ORUKOQK3S9Qudmb6la7ErpOVj8IkhPIlVwZ54HnhTvy0yDYDAkdKQwYPz0mB5 # heXuSEjKb86dIAqkRdT5jS3jcRWvcttxFj0BEzAlWh9OYL+C121ts2L/ODYW/97h # ny804fnxiKJwY1ouJpzXiYXEQu5uyMX2iyxGlDcnp1jKxOY4EalTQPp48g3P25kD # HlETgcNTwzJx3qr2pHk4j5G1uYjvD0+Ww4vMrfJ/mYpElu828K+JUhNc/BZ74d6m # 4ON49T8GOG5BnYVj8QlfsuFlA4yjKVdvUJaxmmBRGu7eOqkb7lULRHRFaj6hn669 # zo9gKD0DRTW/8bgUGjCRIQKNNj1nsR2NK/oLwlyiO0o= # SIG # End signature block
combined_dataset/train/non-malicious/sample_17_34.ps1
sample_17_34.ps1
#************************************************ # DC_NgenCollect.ps1 # Version 1.0 # Date: 2009-2019 # Author: Walter Eder ([email protected]) # Description: Collects .Net Framework nGen files # 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_NgenCollect.ps1" "==================== Starting NgenCollect.ps1 script ====================" | WriteTo-StdOut #_# Import-LocalizedData -BindingVariable ScriptStrings # Registry keys # Saved Directories "Getting .Net Framework nGen files" | WriteTo-StdOut Write-DiagProgress -Activity $ScriptStrings.ID_NetFrameworknGenfiles_Title -Status $ScriptStrings.ID_NetFrameworknGenfiles_Status $sectionDescription = " .Net Framework nGen files" if(test-path "$env:windir\Microsoft.NET\Framework64\v4.0.30319\ngen.log") { $OutputFile = $ComputerName + "_ngen64.log" copy-item -Path "$env:windir\Microsoft.NET\Framework64\v4.0.30319\ngen.log" -Destination $OutputFile -Force CollectFiles -filesToCollect $OutputFile -fileDescription ".NET Framework v4 ngen.log (64-bit)" -sectionDescription $sectionDescription } if(test-path "$env:windir\Microsoft.NET\Framework\v4.0.30319\ngen.log") { $OutputFile = $ComputerName + "_ngen.log" copy-item -Path "$env:windir\Microsoft.NET\Framework\v4.0.30319\ngen.log" -Destination $OutputFile -Force CollectFiles -filesToCollect $OutputFile -fileDescription ".NET Framework v4 ngen.log" -sectionDescription $sectionDescription } # Directory Listings # Permission Data # Event Logs Write-verbose "$(Get-Date -UFormat "%R:%S") : end of script DC_NgenCollect.ps1" # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBXYM+09Y11DKJ5 # ksXHYk1jfm8qku5xBr9uf97msuFm9aCCDXYwggX0MIID3KADAgECAhMzAAAEBGx0 # Bv9XKydyAAAAAAQEMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjQwOTEyMjAxMTE0WhcNMjUwOTExMjAxMTE0WjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wH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eFIg # 2eJR3T6DtN3bTZb3OIILS7ey7MJtRi38uCGNZOPAKnT1f/epRJXGXmkIzfbOLM8Q # WmYUHkwkyN4JF53caMqMDQx3N1AWK1McIj0Fu2UBK4//3IYZLwImnl9SrcOZERGm # 3orufJT4IjS9TFR0j1gUZaTIioTZTEriF3EWZw9CeQShr8UTJEjI4BDTnVjuujL9 # dZ6wMMkTuTJs4u59Ty41hA2RqR7k+/+X62yHuQOYqTVFrx6U69EvAuR2KZxG4twl # BjimKiMgei7lWaESI5G9fVmK2XthsfBXm4cm/BVIy5Q+R2/3fy/0WnHIdRy2UxFr # 0/MY3W1VagE4q2g8BWrIQB2DO1EtLaKtm2y/DwNhmw5IBaDtIWbyCpTBfSQEze39 # PwOrAiZvzBgbj4SyOKApgS7Mg5xlzoxgNE6lUnf1IXlHXqdXSnUOzwn1SLNxYyqa # OnEMz97PBYak591t/jJ0LNvPtnDGY0CL6gaQ+/VeWe/XfYwDpAdzOr1s8NgPxK9p # DfZuE+ygnGg83Ry+14vJAeA= # SIG # End signature block
combined_dataset/train/non-malicious/ScheduleGPOBackups.ps1
ScheduleGPOBackups.ps1
Import-Module grouppolicy #region ConfigBlock # What domain are we going to backup GPOs for? $domain = "psd267.wednet.edu" # Where are we going to store the backups? $gpoBackupRootDir = "c:\\gpoBackups" # As I plan to do a new backup set each month I'll setup the directory names to reflect # the year and month in a nice sortable way. # Set this up and format to your liking, I prefer $gpoBackupRootDir\\yyyy-MM $backupDir = "$gpoBackupRootDir\\{0:yyyy-MM}" -f (Get-Date) # Perform a full backup how often? Day/Week/Month/Year? #$fullBackupFrequency = "Day" #$fullBackupFrequency = "Week" $fullBackupFrequency = "Month" #$fullBackupFrequency = "Year" # Perform Incremental backups how often? Hour/Day/Week/Month? $IncBackupFreqency = "Hour" # $IncBackupFreqency = "Day" # $IncBackupFreqency = "Week" # $IncBackupFreqency = "Month" # How many full sets to keep? # Alternatively, how far back do we keep our backup sets? $numKeepBackupSets = 12 # On what day do we want to consider the start of Week? #$startOfWeek = "Sunday" $startOfWeek = "Monday" #$startOfWeek = "Tuesday" #$startOfWeek = "Wednesday" #$startOfWeek = "Thursday" #$startOfWeek = "Friday" #$startOfWeek = "Saturday" # On what day do we want to consider the start of Month? $startOfMonth = 1 # On what day do we want to consider the start of Year? $startOfYear = 1 #endregion $currentDateTime = Get-Date $doFull = $false $doInc = $false # Does our backup directory exist? # If not attempt to create it and fail the script with an approprate error if (-not (Test-Path $backupDir)) { try { New-Item -ItemType Directory -Path $backupDir } catch { Throw $("Could not create directory $backupDir") } } # If we're here then our backup directory is in good shape # Check if we need to run a full backup or not # if we do, then run it if ( Test-Path $backupDir\\LastFullTimestamp.xml ) { # Import the timestamp from the last recorded complete full $lastFullTimestamp = Import-Clixml $backupDir\\LastFullTimestamp.xml # check to see if the timestamp is valid, if not then delete it and run a full if ( $lastFullTimestamp -isnot [datetime] ) { $doFull = $true Remove-Item $backupDir\\LastFullTimestamp.xml } else # $lastfulltimestamp is or can be boxed/cast into [datetime] { # determine how long it has been since the last recorded full $fullDelta = $currentDateTime - $lastFullTimestamp switch ($fullBackupFrequency) { Day { if ( $fullDelta.days -gt 0 ) { $doFull = $true } } Week { if ( ($currentDateTime.dayOfWeek -eq [DayOfWeek]$startOfWeek) ` -or ($fullDelta.days -gt 7) ) { $doFull = $true } } Month { if ( ($currentDateTime.day -eq $startOfMonth) ` -or ($fullDelta.days -gt 30) ) { $doFull = $true } } Year { if ( ($currentDateTime.dayofyear -eq $startOfYear) ` -or ($fullDelta.days -gt 365) ) { $doFull = $true } } } } } else # There is no recorded last completed full so we want to run one { $doFull = $true } if ($doFull) { # Run Backup of All GPOs in domain $GPOs = Get-GPO -domain $domain -All foreach ($GPO in $GPOs) { $GPOBackup = Backup-GPO $GPO.DisplayName -Path $backupDir # First build the Report path, then generate a report of the backed up settings. $ReportPath = $backupDir + "\\" + $GPO.ModificationTime.Year + "-" + $GPO.ModificationTime.Month + "-" + $GPO.ModificationTime.Day + "_" + $GPO.Displayname + "_" + $GPOBackup.Id + ".html" Get-GPOReport -Name $GPO.DisplayName -path $ReportPath -ReportType HTML } Export-Clixml -Path $backupDir\\LastFullTimestamp.xml -InputObject ($currentDateTime) } else # If we're not running a full check if we need to run an incremental backup { if ( Test-Path $backupDir\\LastIncTimestamp.xml ) { # Import the timestamp from the last recorded complete Incremental $lastIncTimestamp = Import-Clixml $backupDir\\LastIncTimestamp.xml # check to see if the timestamp is valid, if not then delete it and run an inc if ( $lastIncTimestamp -isnot [datetime] ) { # Import the timestamp from the last recorded complete full # If we're here then the timestamp is valid. It is checked earlier and if it fails # or doesn't exist then we run a full and will never get here. # determine how long it has been since the last recorded full $lastFullTimestamp = Import-Clixml $backupDir\\LastFullTimestamp.xml $IncDelta = $currentDateTime - $lastFullTimestamp $doInc = $true Remove-Item $backupDir\\LastIncTimestamp.xml } else # $lastIncTimestamp is or can be boxed/cast into [datetime] { # determine how long it has been since the last recorded full $IncDelta = $currentDateTime - $lastIncTimestamp } } else # There is no recorded last Incremental { # Import the timestamp from the last recorded complete full # If we're here then the timestamp is valid. It is checked earlier and if it fails # or doesn't exist then we run a full and will never get here. # determine how long it has been since the last recorded full $lastFullTimestamp = Import-Clixml $backupDir\\LastFullTimestamp.xml $IncDelta = $currentDateTime - $lastFullTimestamp } # If we have already determined to run an Inc we want to skip this part if ($doInc = $false) { switch ($IncBackupFreqency) { Hour { if ($IncDelta.hours -gt 0) { $doInc = $true } } Day { if ($IncDelta.days -gt 0) { $doInc = $true } } Week { if ( ($currentDateTime.dayOfWeek -eq [DayOfWeek]$startOfWeek) ` -or ($IncDelta.days -gt 7) ) { $doInc = $true } } Month { if ( ($currentDateTime.day -eq $startOfMonth) ` -or ($IncDelta.days -gt 30) ) { $doInc = $true } } } } # Time to check our Incremental flag and run the backup if we need to if ($doInc) { # Run Incremental Backup $GPOs = Get-GPO -domain $domain -All | Where-Object { $_.modificationTime -gt ($currentDateTime - $incDelta) } foreach ($GPO in $GPOs) { $GPOBackup = Backup-GPO $GPO.DisplayName -Path $backupDir # First build the Report path, then generate a report of the backed up settings. $ReportPath = $backupDir + "\\" + $GPO.ModificationTime.Year + "-" + $GPO.ModificationTime.Month + "-" + $GPO.ModificationTime.Day + "_" + $GPO.Displayname + ".html" Get-GPOReport -Name $GPO.DisplayName -path $ReportPath -ReportType HTML } Export-Clixml -Path $backupDir\\LastIncTimestamp.xml -InputObject ($currentDateTime) } } #TODO: Cleanup old backup sets
combined_dataset/train/non-malicious/sample_33_90.ps1
sample_33_90.ps1
<############################################################## # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # ##############################################################> using Module ..\..\HelperFiles\Result.psm1 Import-Module $PSScriptRoot\..\..\HelperFiles\TestObsHelper.psm1 -Force Import-Module $PSScriptRoot\..\..\HelperFiles\ReportHelper.psm1 -Force Import-Module $PSScriptRoot\WatchdogTestRow.psm1 -Force function Test-Watchdog { Param( [Parameter(Mandatory=$true)] [PSCustomObject] $TestReport, [Parameter(Mandatory=$true)] [string] $DeviceType ) try { $functionName = $($MyInvocation.MyCommand.Name) Trace-Progress "$functionName : Getting status of watchdog" $testRow = Get-WatchDogStatus $TestReport.Rows.Add($testRow) Trace-Progress "$functionName : Getting status of FDA" $testRow = Get-FDAStatus $testReport.Rows.Add($testRow) Trace-Progress "$functionName : Getting status of MonAgentHost" $testRow = Get-MonAgentHostStatus $testReport.Rows.Add($testRow) Trace-Progress "$functionName : Getting status of Observability Agent" $testRow = Get-ObservabilityAgentStatus $testReport.Rows.Add($testRow) return $TestReport } catch { Trace-Progress "$functionName : Failed with $_" -Error return $TestReport } } function Get-WatchDogStatus { $functionName = $($MyInvocation.MyCommand.Name) $testName = "Get status of Watchdog" $testRow = New-WatchdogTestRow -TestName $testName try { $service = Get-Service "WatchdogAgent" if ($service.Status -ieq "Running") { $testRow.Result = [Result]::PASS } else { $testRow.Result = [Result]::FAIL $testRow.ReasonForFailure = "The watchdog agent does not have status 'running'. It has status $($service.Status)" } return $testRow } catch { $failureMessage = "$functionName : failed with $_" Trace-Progress $failureMessage -Error return Update-WatchdogTestRowForError -TestRow $testRow -FailureMessage $failureMessage ` -TestName $testName } } function Get-FDAStatus { $functionName = $($MyInvocation.MyCommand.Name) $testName = "Get status of FDA" $testRow = New-WatchdogTestRow -TestName $testName try { try { $watchdogStatusJSON = Read-WatchdogStatusJSON } catch { Trace-Progress "$functionName Error is $_" -Error } if ($null -eq $watchdogStatusJSON) { $testRow.Result = [Result]::FAIL $testRow.ReasonForFailure = "Can't get data from Wachdogstatus JSON file. Error is $_" return $testRow } $message = $watchdogStatusJSON.Heartbeat.FormattedMessage.Message $testRow.AdditionalInformation = "The watchdog status message is $message" $regex = "^.*FleetDiagnosticsAgent process is ([A-Za-z0-9_ ]+)\..*$" return Get-Status -TestRow $testRow -Message $message -Regex $regex -ProcessName "FleetDiagnosticsAgent" } catch { $failureMessage = "$functionName : failed with $_" Trace-Progress $failureMessage -Error return Update-WatchdogTestRowForError -TestRow $testRow -FailureMessage $failureMessage ` -TestName $testName } } function Get-MonAgentHostStatus { $functionName = $($MyInvocation.MyCommand.Name) $testName = "Get status of MonAgentHost" $testRow = New-WatchdogTestRow -TestName $testName try { try { $watchdogStatusJSON = Read-WatchdogStatusJSON } catch { Trace-Progress "$functionName Error is $_" -Error } if ($null -eq $watchdogStatusJSON) { $testRow.Result = [Result]::FAIL $testRow.ReasonForFailure = "Can't get data from Wachdogstatus JSON file. Error is $_" return $testRow } $watchdogStatusJSON = Read-WatchdogStatusJSON $message = $watchdogStatusJSON.Heartbeat.FormattedMessage.Message $testRow.AdditionalInformation = "The watchdog status message is $message" $regex = "^.*MonAgentHost process is ([A-Za-z0-9_ ]+)\..*$" return Get-Status -TestRow $testRow -Message $message -Regex $regex -ProcessName "MonAgentHost" } catch { $failureMessage = "$functionName : failed with $_" Trace-Progress $failureMessage -Error return Update-WatchdogTestRowForError -TestRow $testRow -FailureMessage $failureMessage ` -TestName $testName } } function Get-ObservabilityAgentStatus { $functionName = $($MyInvocation.MyCommand.Name) $testName = "Get status of ObservabilityAgent" $testRow = New-WatchdogTestRow -TestName $testName try { try { $watchdogStatusJSON = Read-WatchdogStatusJSON } catch { Trace-Progress "$functionName Error is $_" -Error } if ($null -eq $watchdogStatusJSON) { $testRow.Result = [Result]::FAIL $testRow.ReasonForFailure = "Can't get data from Wachdogstatus JSON file. Error is $_" return $testRow } $watchdogStatusJSON = Read-WatchdogStatusJSON $message = $watchdogStatusJSON.Heartbeat.FormattedMessage.Message $testRow.AdditionalInformation = "The watchdog status message is $message" $regex = "^.*AzureStack Observability Agent service is ([A-Za-z0-9_ ]+)\..*$" return Get-Status -TestRow $testRow -Message $message -Regex $regex -ProcessName "ObservabilityAgent" } catch { $failureMessage = "$functionName : failed with $_" Trace-Progress $failureMessage -Error return Update-WatchdogTestRowForError -TestRow $testRow -FailureMessage $failureMessage ` -TestName $testName } } function Get-Status { Param( [Parameter(Mandatory=$true)] [PSCustomObject] $TestRow, [Parameter(Mandatory=$true)] [string] $Message, [Parameter(Mandatory=$true)] [string] $Regex, [Parameter(Mandatory=$true)] [string] $ProcessName ) if ($message -match $regex) { $status = $matches[1] if ($status -ieq "running") { $testRow.Result = [Result]::PASS } else { $testRow.Result = [Result]::FAIL $testRow.ReasonForFailure = "The status of $ProcessName is not running. It is $status" } } else { $testRow.Result = [Result]::FAIL $testRow.ReasonForFailure = "Could not get status of $ProcessName" } return $testRow } function Read-WatchdogStatusJSON { $pathToExtensionHelper = "$env:SystemDrive\Packages\Plugins\Microsoft.AzureStack.Observability.*TelemetryAndDiagnostics\*\scripts" $files = Get-ChildItem -Path $pathToExtensionHelper -recurse -filter "*ExtensionHelper.psm1" $extensionHelperFullName = $files[0].FullName Import-Module $extensionHelperFullName $watchdogStatusFile = Get-WatchdogStatusFile -LogFile "file.log" return Get-Content -path $watchdogStatusFile | ConvertFrom-JSON } Export-ModuleMember -Function Test-Watchdog -Verbose:$false # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZ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AON2bihHGHV4wRtyWBHAddReJABVhPZuLASIuE # OFchy5nkbsCGDISLd7EPpFo= # SIG # End signature block
combined_dataset/train/non-malicious/3844.ps1
3844.ps1
function Test-Media { $rgname = GetResourceGroupName $preferedlocation = "East US" $location = Get-AvailableLocation $preferedlocation Write-Output $location $resourceGroup = CreateResourceGroup $rgname $location $storageAccountName1 = "sto" + $rgname $storageAccount1 = CreateStorageAccount $rgname $storageAccountName1 $location $storageAccountName2 = "sto" + $rgname + "2" $storageAccount2 = CreateStorageAccount $rgname $storageAccountName2 $location $accountName = "med" + $rgname $availability = Get-AzMediaServiceNameAvailability -AccountName $accountName Assert-AreEqual $true $availability.nameAvailable $accountName = "med" + $rgname $tags = @{"tag1" = "value1"; "tag2" = "value2"} $storageAccount1 = GetStorageAccount -ResourceGroupName $rgname -Name $storageAccountName1 $mediaService = New-AzMediaService -ResourceGroupName $rgname -AccountName $accountName -Location $location -StorageAccountId $storageAccount1.Id -Tag $tags Assert-NotNull $mediaService Assert-AreEqual $accountName $mediaService.AccountName Assert-AreEqual $rgname $mediaService.ResourceGroupName Assert-AreEqual $location $mediaService.Location Assert-Tags $tags $mediaService.Tags Assert-AreEqual $storageAccountName1 $mediaService.StorageAccounts[0].AccountName Assert-AreEqual $true $mediaService.StorageAccounts[0].IsPrimary Assert-AreEqual $rgname $mediaService.StorageAccounts[0].ResourceGroupName $availability = Get-AzMediaServiceNameAvailability -AccountName $accountName Assert-AreEqual $false $availability.nameAvailable $mediaServices = Get-AzMediaService -ResourceGroupName $rgname Assert-NotNull $mediaServices Assert-AreEqual 1 $mediaServices.Count Assert-AreEqual $accountName $mediaServices[0].AccountName Assert-AreEqual $rgname $mediaServices[0].ResourceGroupName Assert-AreEqual $location $mediaServices[0].Location Assert-AreEqual $storageAccountName1 $mediaServices[0].StorageAccounts[0].AccountName Assert-AreEqual $true $mediaService.StorageAccounts[0].IsPrimary Assert-AreEqual $rgname $mediaServices[0].StorageAccounts[0].ResourceGroupName $mediaService = Get-AzMediaService -ResourceGroupName $rgname -AccountName $accountName Assert-NotNull $mediaService Assert-AreEqual $accountName $mediaService.AccountName Assert-AreEqual $rgname $mediaService.ResourceGroupName Assert-AreEqual $location $mediaService.Location Assert-AreEqual $storageAccountName1 $mediaService.StorageAccounts[0].AccountName Assert-AreEqual $true $mediaService.StorageAccounts[0].IsPrimary Assert-AreEqual $rgname $mediaService.StorageAccounts[0].ResourceGroupName $tagsUpdated = @{"tag3" = "value3"; "tag4" = "value4"} $storageAccount2 = GetStorageAccount -ResourceGroupName $rgname -Name $storageAccountName2 $primaryStorageAccount = New-AzMediaServiceStorageConfig -storageAccountId $storageAccount1.Id -IsPrimary $secondaryStorageAccount = New-AzMediaServiceStorageConfig -storageAccountId $storageAccount2.Id $storageAccounts = @($primaryStorageAccount, $secondaryStorageAccount) $mediaServiceUpdated = Set-AzMediaService -ResourceGroupName $rgname -AccountName $accountName -Tag $tagsUpdated -StorageAccounts $storageAccounts Assert-NotNull $mediaServiceUpdated Assert-Tags $tagsUpdated $mediaServiceUpdated.Tags Assert-AreEqual $storageAccountName1 $mediaServiceUpdated.StorageAccounts[0].AccountName Assert-AreEqual $true $mediaService.StorageAccounts[0].IsPrimary Assert-AreEqual $storageAccountName2 $mediaServiceUpdated.StorageAccounts[1].AccountName Assert-AreEqual $false $mediaServiceUpdated.StorageAccounts[1].IsPrimary $serviceKeys = Get-AzMediaServiceKeys -ResourceGroupName $rgname -AccountName $accountName Assert-NotNull $serviceKeys Assert-NotNull $serviceKeys.PrimaryAuthEndpoint Assert-NotNull $serviceKeys.PrimaryKey Assert-NotNull $serviceKeys.SecondaryAuthEndpoint Assert-NotNull $serviceKeys.SecondaryKey Assert-NotNull $serviceKeys.Scope $serviceKeysUpdated1 = Set-AzMediaServiceKey -ResourceGroupName $rgname -AccountName $accountName -KeyType Primary Assert-NotNull $serviceKeysUpdated1 Assert-NotNull $serviceKeysUpdated1.Key Assert-AreNotEqual $serviceKeys.PrimaryKey $serviceKeysUpdated1.Key $serviceKeysUpdated2 = Set-AzMediaServiceKey -ResourceGroupName $rgname -AccountName $accountName -KeyType Secondary Assert-NotNull $serviceKeysUpdated2 Assert-NotNull $serviceKeysUpdated2.Key Assert-AreNotEqual $serviceKeys.SecondaryKey $serviceKeysUpdated2.Key Remove-AzMediaService -ResourceGroupName $rgname -AccountName $accountName -Force $mediaServices = Get-AzMediaService -ResourceGroupName $rgname Assert-Null $mediaServices $tags = @{"tag1" = "value1"; "tag2" = "value2"} $mediaService = New-AzMediaService -ResourceGroupName $rgname -AccountName $accountName -Location $location -StorageAccounts $storageAccounts -Tag $tags Assert-NotNull $mediaService Assert-AreEqual $accountName $mediaService.AccountName Assert-AreEqual $rgname $mediaService.ResourceGroupName Assert-AreEqual $location $mediaService.Location Assert-Tags $tags $mediaService.Tags Assert-AreEqual $storageAccountName1 $mediaService.StorageAccounts[0].AccountName Assert-AreEqual $true $mediaService.StorageAccounts[0].IsPrimary Assert-AreEqual $rgname $mediaService.StorageAccounts[0].ResourceGroupName Assert-AreEqual $storageAccountName2 $mediaService.StorageAccounts[1].AccountName Assert-AreEqual $false $mediaService.StorageAccounts[1].IsPrimary Assert-AreEqual $rgname $mediaService.StorageAccounts[1].ResourceGroupName Remove-AzMediaService -ResourceGroupName $rgname -AccountName $accountName -Force RemoveStorageAccount $rgname $storageAccountName1 RemoveStorageAccount $rgname $storageAccountName2 RemoveResourceGroup $rgname } function Test-MediaWithPiping { $rgname = GetResourceGroupName $preferedlocation = "East US" $location = Get-AvailableLocation $preferedlocation $resourceGroup = CreateResourceGroup $rgname $location Assert-NotNull $resourceGroup Assert-AreEqual $rgname $resourceGroup.ResourceGroupName Assert-AreEqual $location $resourceGroup.Location $storageAccountName1 = "sto" + $rgname $storageAccount1 = CreateStorageAccount $rgname $storageAccountName1 $location $accountName = "med" + $rgname $tags = @{"tag1" = "value1"; "tag2" = "value2"} $mediaService = GetStorageAccount -ResourceGroupName $rgname -Name $storageAccountName1 | New-AzMediaService -ResourceGroupName $rgname -AccountName $accountName -Location $location -Tag $tags Assert-NotNull $mediaService Assert-AreEqual $accountName $mediaService.AccountName Assert-AreEqual $rgname $mediaService.ResourceGroupName Assert-AreEqual $location $mediaService.Location Assert-Tags $tags $mediaService.Tags Assert-AreEqual $storageAccountName1 $mediaService.StorageAccounts[0].AccountName Assert-AreEqual $true $mediaService.StorageAccounts[0].IsPrimary Assert-AreEqual $rgname $mediaService.StorageAccounts[0].ResourceGroupName $tagsUpdated = @{"tag3" = "value3"; "tag4" = "value4"} $mediaServiceUpdated = Get-AzMediaService -ResourceGroupName $rgname -AccountName $accountName | Set-AzMediaService -Tag $tagsUpdated Assert-NotNull $mediaServiceUpdated Assert-Tags $tagsUpdated $mediaServiceUpdated.Tags $serviceKeys = Get-AzMediaService -ResourceGroupName $rgname -AccountName $accountName | Get-AzMediaServiceKeys Assert-NotNull $serviceKeys Assert-NotNull $serviceKeys.PrimaryAuthEndpoint Assert-NotNull $serviceKeys.PrimaryKey Assert-NotNull $serviceKeys.SecondaryAuthEndpoint Assert-NotNull $serviceKeys.SecondaryKey Assert-NotNull $serviceKeys.Scope $serviceKeysUpdated2 = Get-AzMediaService -ResourceGroupName $rgname -AccountName $accountName | Set-AzMediaServiceKey -KeyType Secondary Assert-NotNull $serviceKeysUpdated2 Assert-NotNull $serviceKeysUpdated2.Key Assert-AreNotEqual $serviceKeys.SecondaryKey $serviceKeysUpdated2.Key Get-AzMediaService -ResourceGroupName $rgname -AccountName $accountName | Remove-AzMediaService -Force RemoveStorageAccount $rgname $storageAccountName RemoveResourceGroup $rgname }
combined_dataset/train/non-malicious/sample_36_51.ps1
sample_36_51.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-Acl", "Set-Acl", "Get-PfxCertificate", "Get-Credential", "Get-ExecutionPolicy", "Set-ExecutionPolicy", "Get-AuthenticodeSignature", "Set-AuthenticodeSignature", "ConvertFrom-SecureString", "ConvertTo-SecureString", "Get-CmsMessage", "Unprotect-CmsMessage", "Protect-CmsMessage" , "New-FileCatalog" , "Test-FileCatalog" AliasesToExport = @() NestedModules="Microsoft.PowerShell.Security.dll" HelpInfoURI = 'https://aka.ms/powershell72-help' } # SIG # Begin signature block # MIInvgYJKoZIhvcNAQcCoIInrzCCJ6sCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCD++xTkW7oivoiQ # gqU/R85f/MwSI1hVEeaegSriXP6+BqCCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQDOS8s1ra6f0YGtg0OhEaQa/t3Q+q1MEHhWJhqQVuO5amYXQpy8MDPNoJYk+FWA # hePP5LxwcSge5aen+f5Q6WNPd6EDxGzotvVpNi5ve0H97S3F7C/axDfKxyNh21MG # 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JJNhLrMV0sQVBKC # vqzJCxpv5/NxGR7xJy1caTkPjyWdbhGZhUMs9hn/pAcoEQy7Lr/91qvU+v2fxMvt # aHD5EXOjocwO4OPvgIsMD8mpuH2I+iPJI22LspZ7vuiLRoPogrhdQfULB6X7bpvA # 4ae8EX7Ji+V5HWNGOk1rh3m8So5M6rwUUlalmD0iGt0OH2fQqCMklkC0435mTgZ/ # KF8= # SIG # End signature block
combined_dataset/train/non-malicious/3268.ps1
3268.ps1
class ChannelRule { [string]$Channel [string[]]$IncludeCommands [string[]]$ExcludeCommands ChannelRule() { $this.Channel = '*' $this.IncludeCommands = @('*') $this.ExcludeCommands = @() } ChannelRule([string]$Channel, [string[]]$IncludeCommands, [string]$ExcludeCommands) { $this.Channel = $Channel $this.IncludeCommands = $IncludeCommands $this.ExcludeCommands = $ExcludeCommands } [hashtable]ToHash() { return @{ Channel = $this.Channel IncludeCommands = $this.IncludeCommands ExcludeCommands = $this.ExcludeCommands } } static [ChannelRule] Serialize([hashtable]$DeserializedObject) { $cr = [ChannelRule]::new() $cr.Channel = $DeserializedObject.Channel $cr.IncludeCommands = $DeserializedObject.IncludeCommands $cr.ExcludeCommands = $DeserializedObject.ExcludeCommands return $cr } }
combined_dataset/train/non-malicious/653.ps1
653.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 New-TestCredentials { param( [string] $Username, [string] $Password ) $securePassword = ConvertTo-SecureString $Password -AsPlainText -Force return New-Object System.Management.Automation.PSCredential ($Username, $securePassword) } function Verify-CredentialsInServer { param( [Parameter(Mandatory = $True)] [object] $CredentialsInServer, [Parameter(Mandatory = $True)] [string] $Username, [switch] $WindowsCredentials, [switch] $ImpersonateUser ) $CredentialsInServer | Should Not BeNullOrEmpty $CredentialsInServer.Username | Should Be $Username $CredentialsInServer.UseAsWindowsCredentials | Should Be $WindowsCredentials $CredentialsInServer.ImpersonateAuthenticatedUser | Should Be $ImpersonateUser } function Verify-CredentialsByUser { param( [Parameter(Mandatory = $True)] [object] $CredentialsByUser, [string] $PromptMessage, [switch] $WindowsCredentials ) Process { $CredentialsByUser | Should Not BeNullOrEmpty $CredentialsByUser.DisplayText | Should Be $PromptMessage $CredentialsByUser.UseAsWindowsCredentials | Should Be $WindowsCredentials } } Describe "Set-RsRestItemDataSource" { $session = $null $rsFolderPath = "" BeforeAll { $localPath = (Get-Item -Path ".\").FullName + '\Tests\CatalogItems\testResources' } BeforeEach { $session = New-RsRestSession -ReportPortalUri $reportPortalUri $folderName = 'SUT_GetRsRestItemDataSource_' + [guid]::NewGuid() New-RsRestFolder -WebSession $session -RsFolder / -FolderName $folderName $rsFolderPath = '/' + $folderName } AfterEach { Remove-RsRestFolder -WebSession $session -RsFolder $rsFolderPath -Confirm:$false } Context "ReportPortalUri parameter - Paginated Reports" { $datasourcesReport = "" BeforeEach { Write-RsRestCatalogItem -WebSession $session -Path "$localPath\datasources\datasourcesReport.rdl" -RsFolder $rsFolderPath $datasourcesReport = "$rsFolderPath/datasourcesReport" } It "Updates datasource connection string" { $datasources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $datasources[0].ConnectionString = "This is a test connection string" $datasources[0].IsConnectionStringOverridden = $true Set-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $fetchedDataSources[0].ConnectionString | Should Be "This is a test connection string" $fetchedDataSources[0].IsConnectionStringOverridden | Should Be True } It "Updates datasource credential retrieval to integrated" { $datasources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Integrated' $datasources[0].CredentialsInServer = New-RsRestCredentialsInServerObject -Credential (New-TestCredentials -Username 'dummyUser' -Password 'dummyPassword') Set-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Integrated" } It "Updates datasource credential retrieval to store with SQL creds and NO impersonation" { $datasources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Store' $datasources[0].CredentialsInServer = New-RsRestCredentialsInServerObject -Credential (New-TestCredentials -Username 'dummyUser' -Password 'dummyPassword') Set-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Store" Verify-CredentialsInServer -CredentialsInServer $fetchedDataSources[0].CredentialsInServer -Username "dummyUser" } It "Updates datasource credential retrieval to store with Windows creds and NO impersonation" { $datasources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Store' $datasources[0].CredentialsInServer = New-RsRestCredentialsInServerObject -Credential (New-TestCredentials -Username 'dummyUser' -Password 'dummyPassword') -WindowsCredentials Set-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Store" Verify-CredentialsInServer -CredentialsInServer $fetchedDataSources[0].CredentialsInServer -Username "dummyUser" -WindowsCredentials } It "Updates datasource credential retrieval to store with SQL creds and impersonation" { $datasources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Store' $datasources[0].CredentialsInServer = New-RsRestCredentialsInServerObject -Credential (New-TestCredentials -Username 'dummyUser' -Password 'dummyPassword') -ImpersonateUser Set-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Store" Verify-CredentialsInServer -CredentialsInServer $fetchedDataSources[0].CredentialsInServer -Username "dummyUser" -ImpersonateUser } It "Updates datasource credential retrieval to store with Windows creds and impersonation" { $datasources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Store' $datasources[0].CredentialsInServer = New-RsRestCredentialsInServerObject -Credential (New-TestCredentials -Username 'dummyUser' -Password 'dummyPassword') -WindowsCredentials -ImpersonateUser Set-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Store" Verify-CredentialsInServer -CredentialsInServer $fetchedDataSources[0].CredentialsInServer -Username "dummyUser" -WindowsCredentials -ImpersonateUser } It "Updates datasource credential retrieval to prompt with default parameters" { $datasources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Prompt' $datasources[0].CredentialsByUser = New-RsRestCredentialsByUserObject Set-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Prompt" Verify-CredentialsByUser -CredentialsByUser $fetchedDataSources[0].CredentialsByUser } It "Updates datasource credential retrieval to prompt with prompt message" { $datasources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Prompt' $datasources[0].CredentialsByUser = New-RsRestCredentialsByUserObject -PromptMessage "This is a prompt message" Set-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Prompt" Verify-CredentialsByUser -CredentialsByUser $fetchedDataSources[0].CredentialsByUser -PromptMessage "This is a prompt message" } It "Updates datasource credential retrieval to prompt with prompt message and Windows credentials" { $datasources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Prompt' $datasources[0].CredentialsByUser = New-RsRestCredentialsByUserObject -PromptMessage "This is a prompt message" -WindowsCredentials Set-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Prompt" Verify-CredentialsByUser -CredentialsByUser $fetchedDataSources[0].CredentialsByUser -PromptMessage "This is a prompt message" -WindowsCredentials } It "Updates datasource credential retrieval to none" { $datasources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'None' $datasources[0].CredentialsInServer = New-RsRestCredentialsInServerObject -Credential (New-TestCredentials -Username 'dummyUser' -Password 'dummyPassword') Set-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "None" } } Context "ReportPortalUri parameter - Power BI Reports" { $sqlPowerBIReport = "" BeforeEach { Write-RsRestCatalogItem -WebSession $session -Path "$localPath\SqlPowerBIReport.pbix" -RsFolder $rsFolderPath $sqlPowerBIReport = "$rsFolderPath/SqlPowerBIReport" } It "Updates datasource AuthType to Windows" { $datasources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $sqlPowerBIReport $datasources.DataModelDataSource.AuthType = 'Windows' $datasources.DataModelDataSource.Username = 'domain\dummyUser' $datasources.DataModelDataSource.Secret = 'dummyUserPassword' Set-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $sqlPowerBIReport -RsItemType PowerBIReport -Datasources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $sqlPowerBIReport $fetchedDataSources.DataModelDataSource.AuthType | Should Be 'Windows' $fetchedDataSources.DataModelDataSource.Username | Should Be 'domain\dummyUser' } It "Updates datasource AuthType to UsernamePassword" { $datasources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $sqlPowerBIReport $datasources.DataModelDataSource.AuthType = 'UsernamePassword' $datasources.DataModelDataSource.Username = 'sqlSA' $datasources.DataModelDataSource.Secret = 'sqlSAPassword' Set-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $sqlPowerBIReport -RsItemType PowerBIReport -Datasources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -ReportPortalUri $reportPortalUri -RsItem $sqlPowerBIReport $fetchedDataSources.DataModelDataSource.AuthType | Should Be 'UsernamePassword' $fetchedDataSources.DataModelDataSource.Username | Should Be 'sqlSA' } } Context "WebSession parameter - Paginated Reports" { $datasourcesReport = "" $rsSession = $null BeforeEach { Write-RsRestCatalogItem -WebSession $session -Path "$localPath\datasources\datasourcesReport.rdl" -RsFolder $rsFolderPath $datasourcesReport = "$rsFolderPath/datasourcesReport" $rsSession = New-RsRestSession -ReportPortalUri $reportPortalUri } It "Updates datasource connection string" { $datasources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $datasources[0].ConnectionString = "This is a test connection string" $datasources[0].IsConnectionStringOverridden = $true Set-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $fetchedDataSources[0].ConnectionString | Should Be "This is a test connection string" $fetchedDataSources[0].IsConnectionStringOverridden | Should Be True } It "Updates datasource credential retrieval to integrated" { $datasources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Integrated' $datasources[0].CredentialsInServer = New-RsRestCredentialsInServerObject -Credential (New-TestCredentials -Username 'dummyUser' -Password 'dummyPassword') Set-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Integrated" } It "Updates datasource credential retrieval to store with SQL creds and NO impersonation" { $datasources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Store' $datasources[0].CredentialsInServer = New-RsRestCredentialsInServerObject -Credential (New-TestCredentials -Username 'dummyUser' -Password 'dummyPassword') Set-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Store" Verify-CredentialsInServer -CredentialsInServer $fetchedDataSources[0].CredentialsInServer -Username "dummyUser" } It "Updates datasource credential retrieval to store with Windows creds and NO impersonation" { $datasources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Store' $datasources[0].CredentialsInServer = New-RsRestCredentialsInServerObject -Credential (New-TestCredentials -Username 'dummyUser' -Password 'dummyPassword') -WindowsCredentials Set-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Store" Verify-CredentialsInServer -CredentialsInServer $fetchedDataSources[0].CredentialsInServer -Username "dummyUser" -WindowsCredentials } It "Updates datasource credential retrieval to store with SQL creds and impersonation" { $datasources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Store' $datasources[0].CredentialsInServer = New-RsRestCredentialsInServerObject -Credential (New-TestCredentials -Username 'dummyUser' -Password 'dummyPassword') -ImpersonateUser Set-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Store" Verify-CredentialsInServer -CredentialsInServer $fetchedDataSources[0].CredentialsInServer -Username "dummyUser" -ImpersonateUser } It "Updates datasource credential retrieval to store with Windows creds and impersonation" { $datasources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Store' $datasources[0].CredentialsInServer = New-RsRestCredentialsInServerObject -Credential (New-TestCredentials -Username 'dummyUser' -Password 'dummyPassword') -WindowsCredentials -ImpersonateUser Set-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Store" Verify-CredentialsInServer -CredentialsInServer $fetchedDataSources[0].CredentialsInServer -Username "dummyUser" -WindowsCredentials -ImpersonateUser } It "Updates datasource credential retrieval to prompt with default parameters" { $datasources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Prompt' $datasources[0].CredentialsByUser = New-RsRestCredentialsByUserObject Set-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Prompt" Verify-CredentialsByUser -CredentialsByUser $fetchedDataSources[0].CredentialsByUser } It "Updates datasource credential retrieval to prompt with prompt message" { $datasources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Prompt' $datasources[0].CredentialsByUser = New-RsRestCredentialsByUserObject -PromptMessage "This is a prompt message" Set-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Prompt" Verify-CredentialsByUser -CredentialsByUser $fetchedDataSources[0].CredentialsByUser -PromptMessage "This is a prompt message" } It "Updates datasource credential retrieval to prompt with prompt message and Windows credentials" { $datasources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'Prompt' $datasources[0].CredentialsByUser = New-RsRestCredentialsByUserObject -PromptMessage "This is a prompt message" -WindowsCredentials Set-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "Prompt" Verify-CredentialsByUser -CredentialsByUser $fetchedDataSources[0].CredentialsByUser -PromptMessage "This is a prompt message" -WindowsCredentials } It "Updates datasource credential retrieval to none" { $datasources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $datasources[0].CredentialRetrieval = 'None' $datasources[0].CredentialsInServer = New-RsRestCredentialsInServerObject -Credential (New-TestCredentials -Username 'dummyUser' -Password 'dummyPassword') Set-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport -RsItemType Report -DataSources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $datasourcesReport $fetchedDataSources[0].CredentialRetrieval | Should Be "None" } } Context "ReportPortalUri parameter - Power BI Reports" { $sqlPowerBIReport = "" BeforeEach { Write-RsRestCatalogItem -WebSession $session -Path "$localPath\SqlPowerBIReport.pbix" -RsFolder $rsFolderPath $sqlPowerBIReport = "$rsFolderPath/SqlPowerBIReport" } It "Updates datasource AuthType to Windows" { $datasources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $sqlPowerBIReport $datasources.DataModelDataSource.AuthType = 'Windows' $datasources.DataModelDataSource.Username = 'domain\dummyUser' $datasources.DataModelDataSource.Secret = 'dummyUserPassword' Set-RsRestItemDataSource -WebSession $rsSession -RsItem $sqlPowerBIReport -RsItemType PowerBIReport -Datasources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $sqlPowerBIReport $fetchedDataSources.DataModelDataSource.AuthType | Should Be 'Windows' $fetchedDataSources.DataModelDataSource.Username | Should Be 'domain\dummyUser' } It "Updates datasource AuthType to UsernamePassword" { $datasources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $sqlPowerBIReport $datasources.DataModelDataSource.AuthType = 'UsernamePassword' $datasources.DataModelDataSource.Username = 'sqlSA' $datasources.DataModelDataSource.Secret = 'sqlSAPassword' Set-RsRestItemDataSource -WebSession $rsSession -RsItem $sqlPowerBIReport -RsItemType PowerBIReport -Datasources $datasources -Verbose $fetchedDataSources = Get-RsRestItemDataSource -WebSession $rsSession -RsItem $sqlPowerBIReport $fetchedDataSources.DataModelDataSource.AuthType | Should Be 'UsernamePassword' $fetchedDataSources.DataModelDataSource.Username | Should Be 'sqlSA' } } }
combined_dataset/train/non-malicious/281.ps1
281.ps1
$groupID = " FILL ME IN " $datasetID = " FILL ME IN " $clientId = " FILL ME IN " function GetAuthToken { if(-not (Get-Module AzureRm.Profile)) { Import-Module AzureRm.Profile } $redirectUri = "urn:ietf:wg:oauth:2.0:oob" $resourceAppIdURI = "https://analysis.windows.net/powerbi/api" $authority = "https://login.microsoftonline.com/common/oauth2/authorize"; $authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext" -ArgumentList $authority $authResult = $authContext.AcquireToken($resourceAppIdURI, $clientId, $redirectUri, "Auto") return $authResult } $token = GetAuthToken $authHeader = @{ 'Content-Type'='application/json' 'Authorization'=$token.CreateAuthorizationHeader() } $groupsPath = "" if ($groupID -eq "me") { $groupsPath = "myorg" } else { $groupsPath = "myorg/groups/$groupID" } $uri = "https://api.powerbi.com/v1.0/$groupsPath/datasets/$datasetID/refreshes" Invoke-RestMethod -Uri $uri –Headers $authHeader –Method POST –Verbose $uri = "https://api.powerbi.com/v1.0/$groupsPath/datasets/$datasetID/refreshes" Invoke-RestMethod -Uri $uri –Headers $authHeader –Method GET –Verbose
combined_dataset/train/non-malicious/sample_38_31.ps1
sample_38_31.ps1
# # Module manifest for module 'ExtensionService' # # Generated by: Microsoft # # Generated on: 04/09/2020 # @{ # Script module or binary module file associated with this manifest. ModuleToProcess = 'ExtensionService.psm1' # Version number of this module. ModuleVersion = '1.0' # ID used to uniquely identify this module GUID = '9aa62b84-1fba-4dac-b33f-bf65628164b1' # Author of this module Author = 'Microsoft Corporation' # Company or vendor of this module CompanyName = 'Microsoft Corporation' # Copyright statement for this module Copyright = '(c) 2017 Microsoft Corporation. All rights reserved.' # Description of the functionality provided by this module Description = 'This module is used to install/uninstall Guest Configuration Extension Service.' # Minimum version of the Windows PowerShell engine required by this module PowerShellVersion = '2.0' # Functions to export from this module FunctionsToExport = @('Install-ExtensionService', 'Enable-ExtensionService', 'Uninstall-ExtensionService', 'Update-ExtensionService') } # SIG # Begin signature block # MIIoOwYJKoZIhvcN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9FOQrGsxeO11hS/ULWXjErcefznytlOl # ZQVF731LCSCvXryX3CY8Q0GtySCNySlGN7TbRp1bdO89iA1Sk4HW2JSVJTNoR/wY # TEml0phtSIZa66kG0kJeVebBQ4LZnBRx3knqlGuSaA== # SIG # End signature block
combined_dataset/train/non-malicious/1459.ps1
1459.ps1
function Set-CDotNetAppSetting { [CmdletBinding(SupportsShouldProcess=$true, DefaultParameterSetName='All')] param( [Parameter(Mandatory=$true)] [string] $Name, [Parameter(Mandatory=$true)] [string] $Value, [Switch] $Framework, [Switch] $Framework64, [Switch] $Clr2, [Switch] $Clr4 ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState if( -not ($Framework -or $Framework64) ) { Write-Error "You must supply either or both of the Framework and Framework64 switches." return } if( -not ($Clr2 -or $Clr4) ) { Write-Error "You must supply either or both of the Clr2 and Clr4 switches." return } $runtimes = @() if( $Clr2 ) { $runtimes += 'v2.0' } if( $Clr4 ) { $runtimes += 'v4.0' } $runtimes | ForEach-Object { $params = @{ FilePath = (Join-Path $CarbonBinDir 'Set-DotNetAppSetting.ps1' -Resolve); ArgumentList = @( (ConvertTo-CBase64 -Value $Name), (ConvertTo-CBase64 -Value $Value) ); Runtime = $_; ExecutionPolicy = [Microsoft.PowerShell.ExecutionPolicy]::RemoteSigned; } if( $Framework ) { Invoke-CPowerShell @params -x86 } if( $Framework64 ) { Invoke-CPowerShell @params } } }
combined_dataset/train/non-malicious/sample_33_68.ps1
sample_33_68.ps1
## Copyright (c) Microsoft Corporation. All rights reserved. <# .SYNOPSIS This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. .DESCRIPTION This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. These performance recordings contain Microsoft-Antimalware-Engine and NT kernel process events and can be analyzed after collection using the Get-MpPerformanceReport cmdlet. This cmdlet requires elevated administrator privileges. The performance analyzer provides insight into problematic files that could cause performance degradation of Microsoft Defender Antivirus. This tool is provided "AS IS", and is not intended to provide suggestions on exclusions. Exclusions can reduce the level of protection on your endpoints. Exclusions, if any, should be defined with caution. .EXAMPLE New-MpPerformanceRecording -RecordTo:.\Defender-scans.etl #> function New-MpPerformanceRecording { [CmdletBinding(DefaultParameterSetName='Interactive')] param( # Specifies the location where to save the Microsoft Defender Antivirus # performance recording. [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$RecordTo, # Specifies the duration of the performance recording in seconds. [Parameter(Mandatory=$true, ParameterSetName='Timed')] [ValidateRange(0,2147483)] [int]$Seconds, # Specifies the PSSession object in which to create and save the Microsoft # Defender Antivirus performance recording. When you use this parameter, # the RecordTo parameter refers to the local path on the remote machine. [Parameter(Mandatory=$false)] [System.Management.Automation.Runspaces.PSSession[]]$Session, # Optional argument to specifiy a different tool for recording traces. Default is wpr.exe # When $Session parameter is used this path represents a location on the remote machine. [Parameter(Mandatory=$false)] [string]$WPRPath = $null ) [bool]$interactiveMode = ($PSCmdlet.ParameterSetName -eq 'Interactive') [bool]$timedMode = ($PSCmdlet.ParameterSetName -eq 'Timed') # Hosts [string]$powerShellHostConsole = 'ConsoleHost' [string]$powerShellHostISE = 'Windows PowerShell ISE Host' [string]$powerShellHostRemote = 'ServerRemoteHost' if ($interactiveMode -and ($Host.Name -notin @($powerShellHostConsole, $powerShellHostISE, $powerShellHostRemote))) { $ex = New-Object System.Management.Automation.ItemNotFoundException 'Cmdlet supported only on local PowerShell console, Windows PowerShell ISE and remote PowerShell console.' $category = [System.Management.Automation.ErrorCategory]::NotImplemented $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'NotImplemented',$category,$Host.Name $psCmdlet.WriteError($errRecord) return } if ($null -ne $Session) { [int]$RemotedSeconds = if ($timedMode) { $Seconds } else { -1 } Invoke-Command -Session:$session -ArgumentList:@($RecordTo, $RemotedSeconds) -ScriptBlock:{ param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$RecordTo, [Parameter(Mandatory=$true)] [ValidateRange(-1,2147483)] [int]$RemotedSeconds ) if ($RemotedSeconds -eq -1) { New-MpPerformanceRecording -RecordTo:$RecordTo -WPRPath:$WPRPath } else { New-MpPerformanceRecording -RecordTo:$RecordTo -Seconds:$RemotedSeconds -WPRPath:$WPRPath } } return } if (-not (Test-Path -LiteralPath:$RecordTo -IsValid)) { $ex = New-Object System.Management.Automation.ItemNotFoundException "Cannot record Microsoft Defender Antivirus performance recording to path '$RecordTo' because the location does not exist." $category = [System.Management.Automation.ErrorCategory]::InvalidArgument $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'InvalidPath',$category,$RecordTo $psCmdlet.WriteError($errRecord) return } # Resolve any relative paths $RecordTo = $psCmdlet.SessionState.Path.GetUnresolvedProviderPathFromPSPath($RecordTo) # Dependencies: WPR Profile [string]$wprProfile = "$PSScriptRoot\MSFT_MpPerformanceRecording.wprp" if (-not (Test-Path -LiteralPath:$wprProfile -PathType:Leaf)) { $ex = New-Object System.Management.Automation.ItemNotFoundException "Cannot find dependency file '$wprProfile' because it does not exist." $category = [System.Management.Automation.ErrorCategory]::ObjectNotFound $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'PathNotFound',$category,$wprProfile $psCmdlet.WriteError($errRecord) return } # Dependencies: WPR Version try { # If user provides a valid string as $WPRPath we go with that. [string]$wprCommand = $WPRPath if (!$wprCommand) { $wprCommand = "wpr.exe" $wprs = @(Get-Command -All "wpr" 2> $null) if ($wprs -and ($wprs.Length -ne 0)) { $latestVersion = [System.Version]"0.0.0.0" $wprs | ForEach-Object { $currentVersion = $_.Version $currentFullPath = $_.Source $currentVersionString = $currentVersion.ToString() Write-Host "Found $currentVersionString at $currentFullPath" if ($currentVersion -gt $latestVersion) { $latestVersion = $currentVersion $wprCommand = $currentFullPath } } } } } catch { # Fallback to the old ways in case we encounter an error (ex: version string format change). [string]$wprCommand = "wpr.exe" } finally { Write-Host "`nUsing $wprCommand version $((Get-Command $wprCommand).FileVersionInfo.FileVersion)`n" } # # Test dependency presence # if (-not (Get-Command $wprCommand -ErrorAction:SilentlyContinue)) { $ex = New-Object System.Management.Automation.ItemNotFoundException "Cannot find dependency command '$wprCommand' because it does not exist." $category = [System.Management.Automation.ErrorCategory]::ObjectNotFound $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'PathNotFound',$category,$wprCommand $psCmdlet.WriteError($errRecord) return } # Exclude versions that have known bugs or are not supported any more. [int]$wprFileVersion = ((Get-Command $wprCommand).Version.Major) -as [int] if ($wprFileVersion -le 6) { $ex = New-Object System.Management.Automation.PSNotSupportedException "You are using an older and unsupported version of '$wprCommand'. Please download and install Windows ADK:`r`nhttps://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install`r`nand try again." $category = [System.Management.Automation.ErrorCategory]::NotInstalled $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'NotSupported',$category,$wprCommand $psCmdlet.WriteError($errRecord) return } function CancelPerformanceRecording { Write-Host "`n`nCancelling Microsoft Defender Antivirus performance recording... " -NoNewline & $wprCommand -cancel -instancename MSFT_MpPerformanceRecording $wprCommandExitCode = $LASTEXITCODE switch ($wprCommandExitCode) { 0 {} 0xc5583000 { Write-Error "Cannot cancel performance recording because currently Windows Performance Recorder is not recording." return } default { Write-Error ("Cannot cancel performance recording: 0x{0:x08}." -f $wprCommandExitCode) return } } Write-Host "ok.`n`nRecording has been cancelled." } # # Ensure Ctrl-C doesn't abort the app without cleanup # # - local PowerShell consoles: use [Console]::TreatControlCAsInput; cleanup performed and output preserved # - PowerShell ISE: use try { ... } catch { throw } finally; cleanup performed and output preserved # - remote PowerShell: use try { ... } catch { throw } finally; cleanup performed but output truncated [bool]$canTreatControlCAsInput = $interactiveMode -and ($Host.Name -eq $powerShellHostConsole) $savedControlCAsInput = $null $shouldCancelRecordingOnTerminatingError = $false try { if ($canTreatControlCAsInput) { $savedControlCAsInput = [Console]::TreatControlCAsInput [Console]::TreatControlCAsInput = $true } # # Start recording # Write-Host "Starting Microsoft Defender Antivirus performance recording... " -NoNewline $shouldCancelRecordingOnTerminatingError = $true & $wprCommand -start "$wprProfile!Scans.Light" -filemode -instancename MSFT_MpPerformanceRecording $wprCommandExitCode = $LASTEXITCODE switch ($wprCommandExitCode) { 0 {} 0xc5583001 { $shouldCancelRecordingOnTerminatingError = $false Write-Error "Cannot start performance recording because Windows Performance Recorder is already recording." return } default { $shouldCancelRecordingOnTerminatingError = $false Write-Error ("Cannot start performance recording: 0x{0:x08}." -f $wprCommandExitCode) return } } Write-Host "ok.`n`nRecording has started." -NoNewline if ($timedMode) { Write-Host "`n`n Recording for $Seconds seconds... " -NoNewline Start-Sleep -Seconds:$Seconds Write-Host "ok." -NoNewline } elseif ($interactiveMode) { $stopPrompt = "`n`n=> Reproduce the scenario that is impacting the performance on your device.`n`n Press <ENTER> to stop and save recording or <Ctrl-C> to cancel recording" if ($canTreatControlCAsInput) { Write-Host "${stopPrompt}: " do { $key = [Console]::ReadKey($true) if (($key.Modifiers -eq [ConsoleModifiers]::Control) -and (($key.Key -eq [ConsoleKey]::C))) { CancelPerformanceRecording $shouldCancelRecordingOnTerminatingError = $false # # Restore Ctrl-C behavior # [Console]::TreatControlCAsInput = $savedControlCAsInput return } } while (($key.Modifiers -band ([ConsoleModifiers]::Alt -bor [ConsoleModifiers]::Control -bor [ConsoleModifiers]::Shift)) -or ($key.Key -ne [ConsoleKey]::Enter)) } else { Read-Host -Prompt:$stopPrompt } } # # Stop recording # Write-Host "`n`nStopping Microsoft Defender Antivirus performance recording... " & $wprCommand -stop $RecordTo -instancename MSFT_MpPerformanceRecording $wprCommandExitCode = $LASTEXITCODE switch ($wprCommandExitCode) { 0 { $shouldCancelRecordingOnTerminatingError = $false } 0xc5583000 { $shouldCancelRecordingOnTerminatingError = $false Write-Error "Cannot stop performance recording because Windows Performance Recorder is not recording a trace." return } default { Write-Error ("Cannot stop performance recording: 0x{0:x08}." -f $wprCommandExitCode) return } } Write-Host "ok.`n`nRecording has been saved to '$RecordTo'." Write-Host ` ' The performance analyzer provides insight into problematic files that could cause performance degradation of Microsoft Defender Antivirus. This tool is provided "AS IS", and is not intended to provide suggestions on exclusions. Exclusions can reduce the level of protection on your endpoints. Exclusions, if any, should be defined with caution. ' Write-Host ` ' The trace you have just captured may contain personally identifiable information, including but not necessarily limited to paths to files accessed, paths to registry accessed and process names. Exact information depends on the events that were logged. Please be aware of this when sharing this trace with other people. ' } catch { throw } finally { if ($shouldCancelRecordingOnTerminatingError) { CancelPerformanceRecording } if ($null -ne $savedControlCAsInput) { # # Restore Ctrl-C behavior # [Console]::TreatControlCAsInput = $savedControlCAsInput } } } function PadUserDateTime { [OutputType([DateTime])] param( [Parameter(Mandatory = $true, Position = 0)] [DateTime]$UserDateTime ) # Padding user input to include all events up to the start of the next second. if (($UserDateTime.Ticks % 10000000) -eq 0) { return $UserDateTime.AddTicks(9999999) } else { return $UserDateTime } } function ValidateTimeInterval { [OutputType([PSCustomObject])] param( [DateTime]$MinStartTime = [DateTime]::MinValue, [DateTime]$MinEndTime = [DateTime]::MinValue, [DateTime]$MaxStartTime = [DateTime]::MaxValue, [DateTime]$MaxEndTime = [DateTime]::MaxValue ) $ret = [PSCustomObject]@{ arguments = [string[]]@() status = $false } if ($MinStartTime -gt $MaxEndTime) { $ex = New-Object System.Management.Automation.ValidationMetadataException "MinStartTime '$MinStartTime' should have been lower than MaxEndTime '$MaxEndTime'" $category = [System.Management.Automation.ErrorCategory]::InvalidArgument $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'Invalid time interval',$category,"'$MinStartTime' .. '$MaxEndTime'" $psCmdlet.WriteError($errRecord) return $ret } if ($MinStartTime -gt $MaxStartTime) { $ex = New-Object System.Management.Automation.ValidationMetadataException "MinStartTime '$MinStartTime' should have been lower than MaxStartTime '$MaxStartTime'" $category = [System.Management.Automation.ErrorCategory]::InvalidArgument $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'Invalid time interval',$category,"'$MinStartTime' .. '$MaxStartTime'" $psCmdlet.WriteError($errRecord) return $ret } if ($MinEndTime -gt $MaxEndTime) { $ex = New-Object System.Management.Automation.ValidationMetadataException "MinEndTime '$MinEndTime' should have been lower than MaxEndTime '$MaxEndTime'" $category = [System.Management.Automation.ErrorCategory]::InvalidArgument $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'Invalid time interval',$category,"'$MinEndTime' .. '$MaxEndTime'" $psCmdlet.WriteError($errRecord) return $ret } if ($MinStartTime -gt [DateTime]::MinValue) { try { $MinStartFileTime = $MinStartTime.ToFileTime() } catch { $ex = New-Object System.Management.Automation.ValidationMetadataException "MinStartTime '$MinStartTime' is not a valid timestamp." $category = [System.Management.Automation.ErrorCategory]::InvalidArgument $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'Value has to be a local DateTime between "January 1, 1601 12:00:00 AM UTC" and "December 31, 9999 11:59:59 PM UTC"',$category,"'$MinStartTime'" $psCmdlet.WriteError($errRecord) return $ret } $ret.arguments += @('-MinStartTime', $MinStartFileTime) } if ($MaxEndTime -lt [DateTime]::MaxValue) { try { $MaxEndFileTime = $MaxEndTime.ToFileTime() } catch { $ex = New-Object System.Management.Automation.ValidationMetadataException "MaxEndTime '$MaxEndTime' is not a valid timestamp." $category = [System.Management.Automation.ErrorCategory]::InvalidArgument $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'Value has to be a local DateTime between "January 1, 1601 12:00:00 AM UTC" and "December 31, 9999 11:59:59 PM UTC"',$category,"'$MaxEndTime'" $psCmdlet.WriteError($errRecord) return $ret } $ret.arguments += @('-MaxEndTime', $MaxEndFileTime) } if ($MaxStartTime -lt [DateTime]::MaxValue) { try { $MaxStartFileTime = $MaxStartTime.ToFileTime() } catch { $ex = New-Object System.Management.Automation.ValidationMetadataException "MaxStartTime '$MaxStartTime' is not a valid timestamp." $category = [System.Management.Automation.ErrorCategory]::InvalidArgument $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'Value has to be a local DateTime between "January 1, 1601 12:00:00 AM UTC" and "December 31, 9999 11:59:59 PM UTC"',$category,"'$MaxStartTime'" $psCmdlet.WriteError($errRecord) return $ret } $ret.arguments += @('-MaxStartTime', $MaxStartFileTime) } if ($MinEndTime -gt [DateTime]::MinValue) { try { $MinEndFileTime = $MinEndTime.ToFileTime() } catch { $ex = New-Object System.Management.Automation.ValidationMetadataException "MinEndTime '$MinEndTime' is not a valid timestamp." $category = [System.Management.Automation.ErrorCategory]::InvalidArgument $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'Value has to be a local DateTime between "January 1, 1601 12:00:00 AM UTC" and "December 31, 9999 11:59:59 PM UTC"',$category,"'$MinEndTime'" $psCmdlet.WriteError($errRecord) return $ret } $ret.arguments += @('-MinEndTime', $MinEndFileTime) } $ret.status = $true return $ret } function ParseFriendlyDuration { [OutputType([TimeSpan])] param( [Parameter(Mandatory = $true, Position = 0)] [string] $FriendlyDuration ) if ($FriendlyDuration -match '^(\d+)(?:\.(\d+))?(sec|ms|us)$') { [string]$seconds = $Matches[1] [string]$decimals = $Matches[2] [string]$unit = $Matches[3] [uint32]$magnitude = switch ($unit) { 'sec' {7} 'ms' {4} 'us' {1} } if ($decimals.Length -gt $magnitude) { throw [System.ArgumentException]::new("String '$FriendlyDuration' was not recognized as a valid Duration: $($decimals.Length) decimals specified for time unit '$unit'; at most $magnitude expected.") } return [timespan]::FromTicks([int64]::Parse($seconds + $decimals.PadRight($magnitude, '0'))) } [timespan]$result = [timespan]::FromTicks(0) if ([timespan]::TryParse($FriendlyDuration, [ref]$result)) { return $result } throw [System.ArgumentException]::new("String '$FriendlyDuration' was not recognized as a valid Duration; expected a value like '0.1234567sec' or '0.1234ms' or '0.1us' or a valid TimeSpan.") } [scriptblock]$FriendlyTimeSpanToString = { '{0:0.0000}ms' -f ($this.Ticks / 10000.0) } function New-FriendlyTimeSpan { param( [Parameter(Mandatory = $true)] [uint64]$Ticks, [bool]$Raw = $false ) if ($Raw) { return $Ticks } $result = [TimeSpan]::FromTicks($Ticks) $result.PsTypeNames.Insert(0, 'MpPerformanceReport.TimeSpan') $result | Add-Member -Force -MemberType:ScriptMethod -Name:'ToString' -Value:$FriendlyTimeSpanToString $result } function New-FriendlyDateTime { param( [Parameter(Mandatory = $true)] [uint64]$FileTime, [bool]$Raw = $false ) if ($Raw) { return $FileTime } [DateTime]::FromFileTime($FileTime) } function Add-DefenderCollectionType { param( [Parameter(Mandatory = $true)] [ref]$CollectionRef ) if ($CollectionRef.Value.Length -and ($CollectionRef.Value | Get-Member -Name:'Processes','Files','Extensions','Scans','Folder')) { $CollectionRef.Value.PSTypeNames.Insert(0, 'MpPerformanceReport.NestedCollection') } } [scriptblock]$FriendlyScanInfoToString = { [PSCustomObject]@{ ScanType = $this.ScanType StartTime = $this.StartTime EndTime = $this.EndTime Duration = $this.Duration Reason = $this.Reason Path = $this.Path ProcessPath = $this.ProcessPath ProcessId = $this.ProcessId Image = $this.Image } } function Get-ScanComments { param( [PSCustomObject[]]$SecondaryEvents, [bool]$Raw = $false ) $Comments = @() foreach ($item in @($SecondaryEvents | Sort-Object -Property:StartTime)) { if (($item | Get-Member -Name:'Message' -MemberType:NoteProperty).Count -eq 1) { if (($item | Get-Member -Name:'Duration' -MemberType:NoteProperty).Count -eq 1) { $Duration = New-FriendlyTimeSpan -Ticks:$item.Duration -Raw:$Raw $StartTime = New-FriendlyDateTime -FileTime:$item.StartTime -Raw:$Raw $Comments += "Expensive operation `"{0}`" started at {1} lasted {2}" -f ($item.Message, $StartTime, $Duration.ToString()) if (($item | Get-Member -Name:'Debug' -MemberType:NoteProperty).Count -eq 1) { $item.Debug | ForEach-Object { if ($_.EndsWith("is NOT trusted") -or $_.StartsWith("Not trusted, ") -or $_.ToLower().Contains("error") -or $_.Contains("Result of ValidateTrust")) { $Comments += "$_" } } } } else { if ($item.Message.Contains("subtype=Lowfi")) { $Comments += $item.Message.Replace("subtype=Lowfi", "Low-fidelity detection") } else { $Comments += $item.Message } } } elseif (($item | Get-Member -Name:'ScanType' -MemberType:NoteProperty).Count -eq 1) { $Duration = New-FriendlyTimeSpan -Ticks:$item.Duration -Raw:$Raw $OpId = "Internal opertion" if (($item | Get-Member -Name:'Path' -MemberType:NoteProperty).Count -eq 1) { $OpId = $item.Path } elseif (($item | Get-Member -Name:'ProcessPath' -MemberType:NoteProperty).Count -eq 1) { $OpId = $item.ProcessPath } $Comments += "{0} {1} lasted {2}" -f ($item.ScanType, $OpId, $Duration.ToString()) } } $Comments } filter ConvertTo-DefenderScanInfo { param( [bool]$Raw = $false ) $result = [PSCustomObject]@{ ScanType = [string]$_.ScanType StartTime = New-FriendlyDateTime -FileTime:$_.StartTime -Raw:$Raw EndTime = New-FriendlyDateTime -FileTime:$_.EndTime -Raw:$Raw Duration = New-FriendlyTimeSpan -Ticks:$_.Duration -Raw:$Raw Reason = [string]$_.Reason SkipReason = [string]$_.SkipReason } if (($_ | Get-Member -Name:'Path' -MemberType:NoteProperty).Count -eq 1) { $result | Add-Member -NotePropertyName:'Path' -NotePropertyValue:([string]$_.Path) } if (($_ | Get-Member -Name:'ProcessPath' -MemberType:NoteProperty).Count -eq 1) { $result | Add-Member -NotePropertyName:'ProcessPath' -NotePropertyValue:([string]$_.ProcessPath) } if (($_ | Get-Member -Name:'Image' -MemberType:NoteProperty).Count -eq 1) { $result | Add-Member -NotePropertyName:'Image' -NotePropertyValue:([string]$_.Image) } elseif ($_.ProcessPath -and (-not $_.ProcessPath.StartsWith("pid"))) { try { $result | Add-Member -NotePropertyName:'Image' -NotePropertyValue:([string]([System.IO.FileInfo]$_.ProcessPath).Name) } catch { # Silently ignore. } } $ProcessId = if ($_.ProcessId -gt 0) { [int]$_.ProcessId } elseif ($_.ScannedProcessId -gt 0) { [int]$_.ScannedProcessId } else { $null } if ($ProcessId) { $result | Add-Member -NotePropertyName:'ProcessId' -NotePropertyValue:([int]$ProcessId) } if ($result.Image -and $result.ProcessId) { $ProcessName = "{0} ({1})" -f $result.Image, $result.ProcessId $result | Add-Member -NotePropertyName:'ProcessName' -NotePropertyValue:([string]$ProcessName) } if ((($_ | Get-Member -Name:'Extra' -MemberType:NoteProperty).Count -eq 1) -and ($_.Extra.Count -gt 0)) { $Comments = @(Get-ScanComments -SecondaryEvents:$_.Extra -Raw:$Raw) $result | Add-Member -NotePropertyName:'Comments' -NotePropertyValue:$Comments } if (-not $Raw) { $result.PSTypeNames.Insert(0, 'MpPerformanceReport.ScanInfo') } $result | Add-Member -Force -MemberType:ScriptMethod -Name:'ToString' -Value:$FriendlyScanInfoToString $result } filter ConvertTo-DefenderScanOverview { param( [bool]$Raw = $false ) $vals = [ordered]@{} foreach ($entry in $_.PSObject.Properties) { if ($entry.Value) { $Key = $entry.Name.Replace("_", " ") if ($Key.EndsWith("Time")) { $vals[$Key] = New-FriendlyDateTime -FileTime:$entry.Value -Raw:$Raw } elseif ($Key.EndsWith("Duration")) { $vals[$Key] = New-FriendlyTimeSpan -Ticks:$entry.Value -Raw:$Raw } else { $vals[$Key] = $entry.Value } } } # Remove duplicates if (($_ | Get-Member -Name:'PerfHints' -MemberType:NoteProperty).Count -eq 1) { $hints = [ordered]@{} foreach ($hint in $_.PerfHints) { $hints[$hint] = $true } $vals["PerfHints"] = @($hints.Keys) } $result = New-Object PSCustomObject -Property:$vals $result } filter ConvertTo-DefenderScanStats { param( [bool]$Raw = $false ) $result = [PSCustomObject]@{ Count = $_.Count TotalDuration = New-FriendlyTimeSpan -Ticks:$_.TotalDuration -Raw:$Raw MinDuration = New-FriendlyTimeSpan -Ticks:$_.MinDuration -Raw:$Raw AverageDuration = New-FriendlyTimeSpan -Ticks:$_.AverageDuration -Raw:$Raw MaxDuration = New-FriendlyTimeSpan -Ticks:$_.MaxDuration -Raw:$Raw MedianDuration = New-FriendlyTimeSpan -Ticks:$_.MedianDuration -Raw:$Raw } if (-not $Raw) { $result.PSTypeNames.Insert(0, 'MpPerformanceReport.ScanStats') } $result } [scriptblock]$FriendlyScannedFilePathStatsToString = { [PSCustomObject]@{ Count = $this.Count TotalDuration = $this.TotalDuration MinDuration = $this.MinDuration AverageDuration = $this.AverageDuration MaxDuration = $this.MaxDuration MedianDuration = $this.MedianDuration Path = $this.Path } } filter ConvertTo-DefenderScannedFilePathStats { param( [bool]$Raw = $false ) $result = $_ | ConvertTo-DefenderScanStats -Raw:$Raw if (-not $Raw) { $result.PSTypeNames.Insert(0, 'MpPerformanceReport.ScannedFilePathStats') } $result | Add-Member -NotePropertyName:'Path' -NotePropertyValue:($_.Path) $result | Add-Member -Force -MemberType:ScriptMethod -Name:'ToString' -Value:$FriendlyScannedFilePathStatsToString if ($null -ne $_.Scans) { $result | Add-Member -NotePropertyName:'Scans' -NotePropertyValue:@( $_.Scans | ConvertTo-DefenderScanInfo -Raw:$Raw ) if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.Scans) } } if ($null -ne $_.Processes) { $result | Add-Member -NotePropertyName:'Processes' -NotePropertyValue:@( $_.Processes | ConvertTo-DefenderScannedProcessStats -Raw:$Raw ) if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.Processes) } } $result } [scriptblock]$FriendlyScannedPathsStatsToString = { [PSCustomObject]@{ Count = $this.Count TotalDuration = $this.TotalDuration MinDuration = $this.MinDuration AverageDuration = $this.AverageDuration MaxDuration = $this.MaxDuration MedianDuration = $this.MedianDuration Path = $this.Path Folder = $this.Folder } } filter ConvertTo-DefenderScannedPathsStats { param( [bool]$Raw = $false ) $result = $_ | ConvertTo-DefenderScanStats -Raw:$Raw if (-not $Raw) { $result.PSTypeNames.Insert(0, 'MpPerformanceReport.ScannedPathStats') } $result | Add-Member -NotePropertyName:'Path' -NotePropertyValue:($_.Path) if ($null -ne $_.Folder) { $result | Add-Member -NotePropertyName:'Folder' -NotePropertyValue:@( $_.Folder | ConvertTo-DefenderScannedPathsStats -Raw:$Raw ) $result | Add-Member -Force -MemberType:ScriptMethod -Name:'ToString' -Value:$FriendlyScannedPathsStatsToString if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.Folder) } } if ($null -ne $_.Files) { $result | Add-Member -NotePropertyName:'Files' -NotePropertyValue:@( $_.Files | ConvertTo-DefenderScannedFilePathStats -Raw:$Raw ) if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.Files) } } if ($null -ne $_.Scans) { $result | Add-Member -NotePropertyName:'Scans' -NotePropertyValue:@( $_.Scans | ConvertTo-DefenderScanInfo -Raw:$Raw ) if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.Scans) } } if ($null -ne $_.Processes) { $result | Add-Member -NotePropertyName:'Processes' -NotePropertyValue:@( $_.Processes | ConvertTo-DefenderScannedProcessStats -Raw:$Raw ) if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.Processes) } } $result } [scriptblock]$FriendlyScannedFileExtensionStatsToString = { [PSCustomObject]@{ Count = $this.Count TotalDuration = $this.TotalDuration MinDuration = $this.MinDuration AverageDuration = $this.AverageDuration MaxDuration = $this.MaxDuration MedianDuration = $this.MedianDuration Extension = $this.Extension } } filter ConvertTo-DefenderScannedFileExtensionStats { param( [bool]$Raw = $false ) $result = $_ | ConvertTo-DefenderScanStats -Raw:$Raw if (-not $Raw) { $result.PSTypeNames.Insert(0, 'MpPerformanceReport.ScannedFileExtensionStats') } $result | Add-Member -NotePropertyName:'Extension' -NotePropertyValue:($_.Extension) $result | Add-Member -Force -MemberType:ScriptMethod -Name:'ToString' -Value:$FriendlyScannedFileExtensionStatsToString if ($null -ne $_.Scans) { $result | Add-Member -NotePropertyName:'Scans' -NotePropertyValue:@( $_.Scans | ConvertTo-DefenderScanInfo -Raw:$Raw ) if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.Scans) } } if ($null -ne $_.Files) { $result | Add-Member -NotePropertyName:'Files' -NotePropertyValue:@( $_.Files | ConvertTo-DefenderScannedFilePathStats -Raw:$Raw ) if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.Files) } } if ($null -ne $_.Processes) { $result | Add-Member -NotePropertyName:'Processes' -NotePropertyValue:@( $_.Processes | ConvertTo-DefenderScannedProcessStats -Raw:$Raw ) if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.Processes) } } if ($null -ne $_.Folder) { $result | Add-Member -NotePropertyName:'Folder' -NotePropertyValue:@( $_.Folder | ConvertTo-DefenderScannedPathsStats -Raw:$Raw ) if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.Folder) } } $result } [scriptblock]$FriendlyScannedProcessStatsToString = { [PSCustomObject]@{ Count = $this.Count TotalDuration = $this.TotalDuration MinDuration = $this.MinDuration AverageDuration = $this.AverageDuration MaxDuration = $this.MaxDuration MedianDuration = $this.MedianDuration ProcessPath = $this.ProcessPath } } filter ConvertTo-DefenderScannedProcessStats { param( [bool]$Raw ) $result = $_ | ConvertTo-DefenderScanStats -Raw:$Raw if (-not $Raw) { $result.PSTypeNames.Insert(0, 'MpPerformanceReport.ScannedProcessStats') } $result | Add-Member -NotePropertyName:'ProcessPath' -NotePropertyValue:($_.Process) $result | Add-Member -Force -MemberType:ScriptMethod -Name:'ToString' -Value:$FriendlyScannedProcessStatsToString if ($null -ne $_.Scans) { $result | Add-Member -NotePropertyName:'Scans' -NotePropertyValue:@( $_.Scans | ConvertTo-DefenderScanInfo -Raw:$Raw ) if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.Scans) } } if ($null -ne $_.Files) { $result | Add-Member -NotePropertyName:'Files' -NotePropertyValue:@( $_.Files | ConvertTo-DefenderScannedFilePathStats -Raw:$Raw ) if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.Files) } } if ($null -ne $_.Extensions) { $result | Add-Member -NotePropertyName:'Extensions' -NotePropertyValue:@( $_.Extensions | ConvertTo-DefenderScannedFileExtensionStats -Raw:$Raw ) if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.Extensions) } } if ($null -ne $_.Folder) { $result | Add-Member -NotePropertyName:'Folder' -NotePropertyValue:@( $_.Folder | ConvertTo-DefenderScannedPathsStats -Raw:$Raw ) if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.Folder) } } $result } <# .SYNOPSIS This cmdlet reports the file paths, file extensions, and processes that cause the highest impact to Microsoft Defender Antivirus scans. .DESCRIPTION This cmdlet analyzes a previously collected Microsoft Defender Antivirus performance recording and reports the file paths, file extensions and processes that cause the highest impact to Microsoft Defender Antivirus scans. The performance analyzer provides insight into problematic files that could cause performance degradation of Microsoft Defender Antivirus. This tool is provided "AS IS", and is not intended to provide suggestions on exclusions. Exclusions can reduce the level of protection on your endpoints. Exclusions, if any, should be defined with caution. .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopFiles:10 -TopExtensions:10 -TopProcesses:10 -TopScans:10 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopFiles:10 -TopExtensions:10 -TopProcesses:10 -TopScans:10 -Raw | ConvertTo-Json .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopScans:10 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopFiles:10 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopFiles:10 -TopScansPerFile:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopFiles:10 -TopProcessesPerFile:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopFiles:10 -TopProcessesPerFile:3 -TopScansPerProcessPerFile:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopPathsDepth:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopPathsDepth:3 -TopScansPerPath:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopScansPerPath:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopPathsDepth:3 -TopFilesPerPath:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopFilesPerPath:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopPathsDepth:3 -TopFilesPerPath:3 -TopScansPerFilePerPath:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopFilesPerPath:3 -TopScansPerFilePerPath:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopPathsDepth:3 -TopExtensionsPerPath:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopExtensionsPerPath:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopPathsDepth:3 -TopExtensionsPerPath:3 -TopScansPerExtensionPerPath:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopExtensionsPerPath:3 -TopScansPerExtensionPerPath:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopPathsDepth:3 -TopProcessesPerPath:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopProcessesPerPath:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopPathsDepth:3 -TopProcessesPerPath:3 -TopScansPerProcessPerPath:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopPaths:10 -TopProcessesPerPath:3 -TopScansPerProcessPerPath:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopExtensions:10 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopExtensions:10 -TopScansPerExtension:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopExtensions:10 -TopPathsPerExtension:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopExtensions:10 -TopPathsPerExtension:3 -TopPathsDepth:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopExtensions:10 -TopPathsPerExtension:3 -TopPathsDepth:3 -TopScansPerPathPerExtension:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopExtensions:10 -TopPathsPerExtension:3 -TopScansPerPathPerExtension:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopExtensions:10 -TopFilesPerExtension:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopExtensions:10 -TopFilesPerExtension:3 -TopScansPerFilePerExtension:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopExtensions:10 -TopProcessesPerExtension:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopExtensions:10 -TopProcessesPerExtension:3 -TopScansPerProcessPerExtension:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopProcesses:10 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopProcesses:10 -TopScansPerProcess:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopProcesses:10 -TopExtensionsPerProcess:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopProcesses:10 -TopExtensionsPerProcess:3 -TopScansPerExtensionPerProcess:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopProcesses:10 -TopFilesPerProcess:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopProcesses:10 -TopFilesPerProcess:3 -TopScansPerFilePerProcess:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopProcesses:10 -TopPathsPerProcess:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopProcesses:10 -TopPathsPerProcess:3 -TopPathsDepth:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopProcesses:10 -TopPathsPerProcess:3 -TopPathsDepth:3 -TopScansPerPathPerProcess:3 .EXAMPLE Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopProcesses:10 -TopPathsPerProcess:3 -TopScansPerPathPerProcess:3 .EXAMPLE # Find top 10 scans with longest durations that both start and end between MinStartTime and MaxEndTime: Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopScans:10 -MinStartTime:"5/14/2022 7:01:11 AM" -MaxEndTime:"5/14/2022 7:01:41 AM" .EXAMPLE # Find top 10 scans with longest durations between MinEndTime and MaxStartTime, possibly partially overlapping this period Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopScans:10 -MinEndTime:"5/14/2022 7:01:11 AM" -MaxStartTime:"5/14/2022 7:01:41 AM" .EXAMPLE # Find top 10 scans with longest durations between MinStartTime and MaxStartTime, possibly partially overlapping this period Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopScans:10 -MinStartTime:"5/14/2022 7:01:11 AM" -MaxStartTime:"5/14/2022 7:01:41 AM" .EXAMPLE # Find top 10 scans with longest durations that start at MinStartTime or later: Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopScans:10 -MinStartTime:"5/14/2022 7:01:11 AM" .EXAMPLE # Find top 10 scans with longest durations that start before or at MaxStartTime: Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopScans:10 -MaxStartTime:"5/14/2022 7:01:11 AM" .EXAMPLE # Find top 10 scans with longest durations that end at MinEndTime or later: Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopScans:10 -MinEndTime:"5/14/2022 7:01:11 AM" .EXAMPLE # Find top 10 scans with longest durations that end before or at MaxEndTime: Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopScans:10 -MaxEndTime:"5/14/2022 7:01:11 AM" .EXAMPLE # Find top 10 scans with longest durations, impacting the current interval, that did not start or end between MaxStartTime and MinEndTime. Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopScans:10 -MaxStartTime:"5/14/2022 7:01:11 AM" -MinEndTime:"5/14/2022 7:01:41 AM" .EXAMPLE # Find top 10 scans with longest durations, impacting the current interval, that started between MinStartTime and MaxStartTime, and ended later than MinEndTime. Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopScans:10 -MinStartTime:"5/14/2022 7:00:00 AM" -MaxStartTime:"5/14/2022 7:01:11 AM" -MinEndTime:"5/14/2022 7:01:41 AM" .EXAMPLE # Find top 10 scans with longest durations, impacting the current interval, that started before MaxStartTime, and ended between MinEndTime and MaxEndTime. Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopScans:10 -MaxStartTime:"5/14/2022 7:01:11 AM" -MinEndTime:"5/14/2022 7:01:41 AM" -MaxEndTime:"5/14/2022 7:02:00 AM" .EXAMPLE # Find top 10 scans with longest durations, impacting the current interval, that started between MinStartTime and MaxStartTime, and ended between MinEndTime and MaxEndTime. Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopScans:10 -MinStartTime:"5/14/2022 7:00:00 AM" -MaxStartTime:"5/14/2022 7:01:11 AM" -MinEndTime:"5/14/2022 7:01:41 AM" -MaxEndTime:"5/14/2022 7:02:00 AM" .EXAMPLE # Find top 10 scans with longest durations that both start and end between MinStartTime and MaxEndTime, using DateTime as raw numbers in FILETIME format, e.g. from -Raw report format: Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopScans:10 -MinStartTime:([DateTime]::FromFileTime(132969744714304340)) -MaxEndTime:([DateTime]::FromFileTime(132969745000971033)) .EXAMPLE # Find top 10 scans with longest durations between MinEndTime and MaxStartTime, possibly partially overlapping this period, using DateTime as raw numbers in FILETIME format, e.g. from -Raw report format: Get-MpPerformanceReport -Path:.\Defender-scans.etl -TopScans:10 -MinEndTime:([DateTime]::FromFileTime(132969744714304340)) -MaxStartTime:([DateTime]::FromFileTime(132969745000971033)) .EXAMPLE # Display a summary or overview of the scans captured in the trace, in addition to the information displayed regularly through other arguments. Output is influenced by time interval arguments MinStartTime and MaxEndTime. Get-MpPerformanceReport -Path:.\Defender-scans.etl [other arguments] -Overview #> function Get-MpPerformanceReport { [CmdletBinding()] param( # Specifies the location of Microsoft Defender Antivirus performance recording to analyze. [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, HelpMessage="Location of Microsoft Defender Antivirus performance recording.")] [ValidateNotNullOrEmpty()] [string]$Path, # Requests a top files report and specifies how many top files to output, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopFiles = 0, # Specifies how many top scans to output for each top file, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScansPerFile = 0, # Specifies how many top processes to output for each top file, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopProcessesPerFile = 0, # Specifies how many top scans to output for each top process for each top file, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScansPerProcessPerFile = 0, # Requests a top paths report and specifies how many top entries to output, sorted by "Duration". This is called recursively for each directory entry. Scans are grouped hierarchically per folder and sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopPaths = 0, # Specifies the maxmimum depth (path-wise) that will be used to grop scans when $TopPaths is used. [ValidateRange(1,1024)] [int]$TopPathsDepth = 0, # Specifies how many top scans to output for each top path, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScansPerPath = 0, # Specifies how many top files to output for each top path, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopFilesPerPath = 0, # Specifies how many top scans to output for each top file for each top path, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScansPerFilePerPath = 0, # Specifies how many top extensions to output for each top path, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopExtensionsPerPath = 0, # Specifies how many top scans to output for each top extension for each top path, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScansPerExtensionPerPath = 0, # Specifies how many top processes to output for each top path, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopProcessesPerPath = 0, # Specifies how many top scans to output for each top process for each top path, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScansPerProcessPerPath = 0, # Requests a top extensions report and specifies how many top extensions to output, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopExtensions = 0, # Specifies how many top scans to output for each top extension, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScansPerExtension = 0, # Specifies how many top paths to output for each top extension, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopPathsPerExtension = 0, # Specifies how many top scans to output for each top path for each top extension, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScansPerPathPerExtension = 0, # Specifies how many top files to output for each top extension, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopFilesPerExtension = 0, # Specifies how many top scans to output for each top file for each top extension, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScansPerFilePerExtension = 0, # Specifies how many top processes to output for each top extension, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopProcessesPerExtension = 0, # Specifies how many top scans to output for each top process for each top extension, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScansPerProcessPerExtension = 0, # Requests a top processes report and specifies how many top processes to output, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopProcesses = 0, # Specifies how many top scans to output for each top process in the Top Processes report, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScansPerProcess = 0, # Specifies how many top files to output for each top process, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopFilesPerProcess = 0, # Specifies how many top scans to output for each top file for each top process, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScansPerFilePerProcess = 0, # Specifies how many top extensions to output for each top process, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopExtensionsPerProcess = 0, # Specifies how many top scans to output for each top extension for each top process, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScansPerExtensionPerProcess = 0, # Specifies how many top paths to output for each top process, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopPathsPerProcess = 0, # Specifies how many top scans to output for each top path for each top process, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScansPerPathPerProcess = 0, # Requests a top scans report and specifies how many top scans to output, sorted by "Duration". [ValidateRange(0,([int]::MaxValue))] [int]$TopScans = 0, ## TimeSpan format: d | h:m | h:m:s | d.h:m | h:m:.f | h:m:s.f | d.h:m:s | d.h:m:.f | d.h:m:s.f => d | (d.)?h:m(:s(.f)?)? | ((d.)?h:m:.f) # Specifies the minimum duration of any scans or total scan durations of files, extensions and processes included in the report. # Accepts values like '0.1234567sec' or '0.1234ms' or '0.1us' or a valid TimeSpan. [ValidatePattern('^(?:(?:(\d+)(?:\.(\d+))?(sec|ms|us))|(?:\d+)|(?:(\d+\.)?\d+:\d+(?::\d+(?:\.\d+)?)?)|(?:(\d+\.)?\d+:\d+:\.\d+))$')] [string]$MinDuration = '0us', # Specifies the minimum start time of scans included in the report. Accepts a valid DateTime. [DateTime]$MinStartTime = [DateTime]::MinValue, # Specifies the minimum end time of scans included in the report. Accepts a valid DateTime. [DateTime]$MinEndTime = [DateTime]::MinValue, # Specifies the maximum start time of scans included in the report. Accepts a valid DateTime. [DateTime]$MaxStartTime = [DateTime]::MaxValue, # Specifies the maximum end time of scans included in the report. Accepts a valid DateTime. [DateTime]$MaxEndTime = [DateTime]::MaxValue, # Adds an overview or summary of the scans captured in the trace to the regular output. [switch]$Overview, # Specifies that the output should be machine readable and readily convertible to serialization formats like JSON. # - Collections and elements are not be formatted. # - TimeSpan values are represented as number of 100-nanosecond intervals. # - DateTime values are represented as number of 100-nanosecond intervals since January 1, 1601 (UTC). [switch]$Raw ) # # Validate performance recording presence # if (-not (Test-Path -Path:$Path -PathType:Leaf)) { $ex = New-Object System.Management.Automation.ItemNotFoundException "Cannot find path '$Path'." $category = [System.Management.Automation.ErrorCategory]::ObjectNotFound $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'PathNotFound',$category,$Path $psCmdlet.WriteError($errRecord) return } function ParameterValidationError { [CmdletBinding()] param ( [Parameter(Mandatory)] [string] $ParameterName, [Parameter(Mandatory)] [string] $ParentParameterName ) $ex = New-Object System.Management.Automation.ValidationMetadataException "Parameter '$ParameterName' requires parameter '$ParentParameterName'." $category = [System.Management.Automation.ErrorCategory]::MetadataError $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'InvalidParameter',$category,$ParameterName $psCmdlet.WriteError($errRecord) } # # Additional parameter validation # if ($TopFiles -eq 0) { if ($TopScansPerFile -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopScansPerFile' -ParentParameterName:'TopFiles' } if ($TopProcessesPerFile -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopProcessesPerFile' -ParentParameterName:'TopFiles' } } if ($TopProcessesPerFile -eq 0) { if ($TopScansPerProcessPerFile -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopScansPerProcessPerFile' -ParentParameterName:'TopProcessesPerFile' } } if ($TopPathsDepth -gt 0) { if (($TopPaths -eq 0) -and ($TopPathsPerProcess -eq 0) -and ($TopPathsPerExtension -eq 0)) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopPathsDepth' -ParentParameterName:'TopPaths or TopPathsPerProcess or TopPathsPerExtension' } } if ($TopPaths -eq 0) { if ($TopScansPerPath -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopScansPerPath' -ParentParameterName:'TopPaths' } if ($TopFilesPerPath -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopFilesPerPath' -ParentParameterName:'TopPaths' } if ($TopExtensionsPerPath -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopExtensionsPerPath' -ParentParameterName:'TopPaths' } if ($TopProcessesPerPath -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopProcessesPerPath' -ParentParameterName:'TopPaths' } } if ($TopFilesPerPath -eq 0) { if ($TopScansPerFilePerPath -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopScansPerFilePerPath' -ParentParameterName:'TopFilesPerPath' } } if ($TopExtensionsPerPath -eq 0) { if ($TopScansPerExtensionPerPath -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopScansPerExtensionPerPath' -ParentParameterName:'TopExtensionsPerPath' } } if ($TopProcessesPerPath -eq 0) { if ($TopScansPerProcessPerPath -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopScansPerProcessPerPath' -ParentParameterName:'TopProcessesPerPath' } } if ($TopExtensions -eq 0) { if ($TopScansPerExtension -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopScansPerExtension' -ParentParameterName:'TopExtensions' } if ($TopFilesPerExtension -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopFilesPerExtension' -ParentParameterName:'TopExtensions' } if ($TopProcessesPerExtension -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopProcessesPerExtension' -ParentParameterName:'TopExtensions' } if ($TopPathsPerExtension -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopPathsPerExtension' -ParentParameterName:'TopExtensions' } } if ($TopFilesPerExtension -eq 0) { if ($TopScansPerFilePerExtension -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopScansPerFilePerExtension' -ParentParameterName:'TopFilesPerExtension' } } if ($TopProcessesPerExtension -eq 0) { if ($TopScansPerProcessPerExtension -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopScansPerProcessPerExtension' -ParentParameterName:'TopProcessesPerExtension' } } if ($TopPathsPerExtension -eq 0) { if ($TopScansPerPathPerExtension -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopScansPerPathPerExtension' -ParentParameterName:'TopPathsPerExtension' } } if ($TopProcesses -eq 0) { if ($TopScansPerProcess -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopScansPerProcess' -ParentParameterName:'TopProcesses' } if ($TopFilesPerProcess -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopFilesPerProcess' -ParentParameterName:'TopProcesses' } if ($TopExtensionsPerProcess -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopExtensionsPerProcess' -ParentParameterName:'TopProcesses' } if ($TopPathsPerProcess -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopPathsPerProcess' -ParentParameterName:'TopProcesses' } } if ($TopFilesPerProcess -eq 0) { if ($TopScansPerFilePerProcess -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopScansPerFilePerProcess' -ParentParameterName:'TopFilesPerProcess' } } if ($TopExtensionsPerProcess -eq 0) { if ($TopScansPerExtensionPerProcess -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopScansPerExtensionPerProcess' -ParentParameterName:'TopExtensionsPerProcess' } } if ($TopPathsPerProcess -eq 0) { if ($TopScansPerPathPerProcess -gt 0) { ParameterValidationError -ErrorAction:Stop -ParameterName:'TopScansPerPathPerProcess' -ParentParameterName:'TopPathsPerProcess' } } if (($TopFiles -eq 0) -and ($TopExtensions -eq 0) -and ($TopProcesses -eq 0) -and ($TopScans -eq 0) -and ($TopPaths -eq 0) -and (-not $Overview)) { $ex = New-Object System.Management.Automation.ItemNotFoundException "At least one of the parameters 'TopFiles', 'TopPaths', 'TopExtensions', 'TopProcesses', 'TopScans' or 'Overview' must be present." $category = [System.Management.Automation.ErrorCategory]::InvalidArgument $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'InvalidArgument',$category,$wprProfile $psCmdlet.WriteError($errRecord) return } # Dependencies [string]$PlatformPath = (Get-ItemProperty -Path:'HKLM:\Software\Microsoft\Windows Defender' -Name:'InstallLocation' -ErrorAction:Stop).InstallLocation # # Test dependency presence # [string]$mpCmdRunCommand = "${PlatformPath}MpCmdRun.exe" if (-not (Get-Command $mpCmdRunCommand -ErrorAction:SilentlyContinue)) { $ex = New-Object System.Management.Automation.ItemNotFoundException "Cannot find '$mpCmdRunCommand'." $category = [System.Management.Automation.ErrorCategory]::ObjectNotFound $errRecord = New-Object System.Management.Automation.ErrorRecord $ex,'PathNotFound',$category,$mpCmdRunCommand $psCmdlet.WriteError($errRecord) return } # assemble report arguments [string[]]$reportArguments = @( $PSBoundParameters.GetEnumerator() | Where-Object { $_.Key.ToString().StartsWith("Top") -and ($_.Value -gt 0) } | ForEach-Object { "-$($_.Key)"; "$($_.Value)"; } ) [timespan]$MinDurationTimeSpan = ParseFriendlyDuration -FriendlyDuration:$MinDuration if ($MinDurationTimeSpan -gt [TimeSpan]::FromTicks(0)) { $reportArguments += @('-MinDuration', ($MinDurationTimeSpan.Ticks)) } $MaxEndTime = PadUserDateTime -UserDateTime:$MaxEndTime $MaxStartTime = PadUserDateTime -UserDateTime:$MaxStartTime $ret = ValidateTimeInterval -MinStartTime:$MinStartTime -MaxEndTime:$MaxEndTime -MaxStartTime:$MaxStartTime -MinEndTime:$MinEndTime if ($false -eq $ret.status) { return } [string[]]$intervalArguments = $ret.arguments if (($null -ne $intervalArguments) -and ($intervalArguments.Length -gt 0)) { $reportArguments += $intervalArguments } if ($Overview) { $reportArguments += "-Overview" } $report = (& $mpCmdRunCommand -PerformanceReport -RecordingPath $Path @reportArguments) | Where-Object { -not [string]::IsNullOrEmpty($_) } | ConvertFrom-Json $result = [PSCustomObject]@{} if (-not $Raw) { $result.PSTypeNames.Insert(0, 'MpPerformanceReport.Result') } if ($TopFiles -gt 0) { $reportTopFiles = @(if ($null -ne $report.TopFiles) { @($report.TopFiles | ConvertTo-DefenderScannedFilePathStats -Raw:$Raw) } else { @() }) $result | Add-Member -NotePropertyName:'TopFiles' -NotePropertyValue:$reportTopFiles if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.TopFiles) } } if ($TopPaths -gt 0) { $reportTopPaths = @(if ($null -ne $report.TopPaths) { @($report.TopPaths | ConvertTo-DefenderScannedPathsStats -Raw:$Raw) } else { @() }) $result | Add-Member -NotePropertyName:'TopPaths' -NotePropertyValue:$reportTopPaths if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.TopPaths) } } if ($TopExtensions -gt 0) { $reportTopExtensions = @(if ($null -ne $report.TopExtensions) { @($report.TopExtensions | ConvertTo-DefenderScannedFileExtensionStats -Raw:$Raw) } else { @() }) $result | Add-Member -NotePropertyName:'TopExtensions' -NotePropertyValue:$reportTopExtensions if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.TopExtensions) } } if ($TopProcesses -gt 0) { $reportTopProcesses = @(if ($null -ne $report.TopProcesses) { @($report.TopProcesses | ConvertTo-DefenderScannedProcessStats -Raw:$Raw) } else { @() }) $result | Add-Member -NotePropertyName:'TopProcesses' -NotePropertyValue:$reportTopProcesses if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.TopProcesses) } } if ($TopScans -gt 0) { $reportTopScans = @(if ($null -ne $report.TopScans) { @($report.TopScans | ConvertTo-DefenderScanInfo -Raw:$Raw) } else { @() }) $result | Add-Member -NotePropertyName:'TopScans' -NotePropertyValue:$reportTopScans if (-not $Raw) { Add-DefenderCollectionType -CollectionRef:([ref]$result.TopScans) } } if ($Overview) { if ($null -ne $report.Overview) { $reportOverview = $report.Overview | ConvertTo-DefenderScanOverview -Raw:$Raw $result | Add-Member -NotePropertyName:'Overview' -NotePropertyValue:$reportOverview if (-not $Raw) { $result.Overview.PSTypeNames.Insert(0, 'MpPerformanceReport.Overview') } } } $result } $exportModuleMemberParam = @{ Function = @( 'New-MpPerformanceRecording' 'Get-MpPerformanceReport' ) } Export-ModuleMember @exportModuleMemberParam # SIG # Begin signature block # MIImEwYJKoZIhvcNAQcCoIImBDCCJgACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCABOtUhuRLDSJsH # 5LjfiBWymKYbjYNumRKF78V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bm4v3uO/y4nA1CB6eYkUc7osz+I2o1WDR9LjtUZzDngdcpPDP6jzS # igyHLoSEjwhOdFxeJeCsS2IoCFfHGCbb9seUGQDRp6ihHpxRqYuY2sTgWFtuKJPc # pMTyA4GQ8ac7sgxSyABSbYM4t/RO4WdvR4EvvskMFNh8F+mXs4EGjxdJ0UH5c6FU # O5NBOkloDhOklA5LVed61zJR8o9QN4qji1FX5EA8iECmp+yX+PbQGXyiXoUPFddU # v1SaF3cqUg== # SIG # End signature block
combined_dataset/train/non-malicious/3955.ps1
3955.ps1
function Get-TestResourcesDeployment([string]$rgn) { $virtualMachineName = Get-NrpResourceName $storageAccountName = Get-NrpResourceName $routeTableName = Get-NrpResourceName $virtualNetworkName = Get-NrpResourceName $networkInterfaceName = Get-NrpResourceName $networkSecurityGroupName = Get-NrpResourceName $diagnosticsStorageAccountName = Get-NrpResourceName $paramFile = (Resolve-Path ".\TestData\DeploymentParameters.json").Path $paramContent = @" { "rgName": { "value": "$rgn" }, "location": { "value": "$location" }, "virtualMachineName": { "value": "$virtualMachineName" }, "virtualMachineSize": { "value": "Standard_A4" }, "adminUsername": { "value": "netanaytics12" }, "storageAccountName": { "value": "$storageAccountName" }, "routeTableName": { "value": "$routeTableName" }, "virtualNetworkName": { "value": "$virtualNetworkName" }, "networkInterfaceName": { "value": "$networkInterfaceName" }, "networkSecurityGroupName": { "value": "$networkSecurityGroupName" }, "adminPassword": { "value": "netanalytics-32${resourceGroupName}" }, "storageAccountType": { "value": "Standard_LRS" }, "diagnosticsStorageAccountName": { "value": "$diagnosticsStorageAccountName" }, "diagnosticsStorageAccountId": { "value": "Microsoft.Storage/storageAccounts/${diagnosticsStorageAccountName}" }, "diagnosticsStorageAccountType": { "value": "Standard_LRS" }, "addressPrefix": { "value": "10.17.3.0/24" }, "subnetName": { "value": "default" }, "subnetPrefix": { "value": "10.17.3.0/24" }, "publicIpAddressName": { "value": "${virtualMachineName}-ip" }, "publicIpAddressType": { "value": "Dynamic" } } "@; $st = Set-Content -Path $paramFile -Value $paramContent -Force; New-AzResourceGroupDeployment -Name "${rgn}" -ResourceGroupName "$rgn" -TemplateFile "$templateFile" -TemplateParameterFile $paramFile } function Get-NrpResourceName { Get-ResourceName "psnrp"; } function Get-NrpResourceGroupName { Get-ResourceGroupName "psnrp"; } function Wait-Vm($vm) { $minutes = 30; while((Get-AzVM -ResourceGroupName $vm.ResourceGroupName -Name $vm.Name).ProvisioningState -ne "Succeeded") { Start-TestSleep 60; if(--$minutes -eq 0) { break; } } } function Get-CreateTestNetworkWatcher($location, $nwName, $nwRgName) { $nw = $null $canonicalLocation = Normalize-Location $location $nwlist = Get-AzNetworkWatcher foreach ($i in $nwlist) { if($i.Location -eq $canonicalLocation) { $nw = $i break } } if(!$nw) { $nw = New-AzNetworkWatcher -Name $nwName -ResourceGroupName $nwRgName -Location $location } return $nw } function Get-CanaryLocation { Get-ProviderLocation "Microsoft.Network/networkWatchers" "Central US EUAP"; } function Get-PilotLocation { Get-ProviderLocation "Microsoft.Network/networkWatchers" "West Central US"; } function Test-GetTopology { $resourceGroupName = Get-NrpResourceGroupName $nwName = Get-NrpResourceName $nwRgName = Get-NrpResourceGroupName $templateFile = (Resolve-Path ".\TestData\Deployment.json").Path $location = Get-ProviderLocation "Microsoft.Network/networkWatchers" "East US" try { . ".\AzureRM.Resources.ps1" New-AzResourceGroup -Name $resourceGroupName -Location "$location" Get-TestResourcesDeployment -rgn "$resourceGroupName" New-AzResourceGroup -Name $nwRgName -Location "$location" $nw = Get-CreateTestNetworkWatcher -location $location -nwName $nwName -nwRgName $nwRgName $topology = Get-AzNetworkWatcherTopology -NetworkWatcher $nw -TargetResourceGroupName $resourceGroupName $vm = Get-AzVM -ResourceGroupName $resourceGroupName $nic = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName } finally { Clean-ResourceGroup $resourceGroupName Clean-ResourceGroup $nwRgName } } function Test-GetSecurityGroupView { $resourceGroupName = Get-NrpResourceGroupName $nwName = Get-NrpResourceName $location = Get-PilotLocation $resourceTypeParent = "Microsoft.Network/networkWatchers" $nwLocation = Get-ProviderLocation $resourceTypeParent $nwRgName = Get-NrpResourceGroupName $securityRuleName = Get-NrpResourceName $templateFile = (Resolve-Path ".\TestData\Deployment.json").Path try { . ".\AzureRM.Resources.ps1" New-AzResourceGroup -Name $resourceGroupName -Location "$location" Get-TestResourcesDeployment -rgn "$resourceGroupName" New-AzResourceGroup -Name $nwRgName -Location "$location" $nw = Get-CreateTestNetworkWatcher -location $location -nwName $nwName -nwRgName $nwRgName $vm = Get-AzVM -ResourceGroupName $resourceGroupName $nsg = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName $nsg[0] | Add-AzNetworkSecurityRuleConfig -Name scr1 -Description "test" -Protocol Tcp -SourcePortRange * -DestinationPortRange 80 -SourceAddressPrefix * -DestinationAddressPrefix * -Access Deny -Priority 122 -Direction Outbound $nsg[0] | Set-AzNetworkSecurityGroup Wait-Seconds 300 $job = Get-AzNetworkWatcherSecurityGroupView -NetworkWatcher $nw -Target $vm.Id -AsJob $job | Wait-Job $nsgView = $job | Receive-Job Assert-AreEqual $nsgView.NetworkInterfaces[0].EffectiveSecurityRules[4].Access Deny Assert-AreEqual $nsgView.NetworkInterfaces[0].EffectiveSecurityRules[4].DestinationPortRange 80-80 Assert-AreEqual $nsgView.NetworkInterfaces[0].EffectiveSecurityRules[4].Direction Outbound Assert-AreEqual $nsgView.NetworkInterfaces[0].EffectiveSecurityRules[4].Name UserRule_scr1 Assert-AreEqual $nsgView.NetworkInterfaces[0].EffectiveSecurityRules[4].Protocol TCP Assert-AreEqual $nsgView.NetworkInterfaces[0].EffectiveSecurityRules[4].Priority 122 } finally { Clean-ResourceGroup $resourceGroupName Clean-ResourceGroup $nwRgName } } function Test-GetNextHop { $resourceGroupName = Get-NrpResourceGroupName $nwName = Get-NrpResourceName $nwRgName = Get-NrpResourceGroupName $securityRuleName = Get-NrpResourceName $templateFile = (Resolve-Path ".\TestData\Deployment.json").Path $location = Get-ProviderLocation "Microsoft.Network/networkWatchers" "East US" try { . ".\AzureRM.Resources.ps1" New-AzResourceGroup -Name $resourceGroupName -Location "$location" Get-TestResourcesDeployment -rgn "$resourceGroupName" New-AzResourceGroup -Name $nwRgName -Location "$location" $nw = Get-CreateTestNetworkWatcher -location $location -nwName $nwName -nwRgName $nwRgName $vm = Get-AzVM -ResourceGroupName $resourceGroupName $address = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName $job = Get-AzNetworkWatcherNextHop -NetworkWatcher $nw -TargetVirtualMachineId $vm.Id -DestinationIPAddress 10.1.3.6 -SourceIPAddress $address.IpAddress -AsJob $job | Wait-Job $nextHop1 = $job | Receive-Job $nextHop2 = Get-AzNetworkWatcherNextHop -NetworkWatcher $nw -TargetVirtualMachineId $vm.Id -DestinationIPAddress 12.11.12.14 -SourceIPAddress $address.IpAddress Assert-AreEqual $nextHop1.NextHopType None Assert-AreEqual $nextHop1.NextHopIpAddress 10.0.1.2 Assert-AreEqual $nextHop2.NextHopType Internet Assert-AreEqual $nextHop2.RouteTableId "System Route" } finally { Clean-ResourceGroup $resourceGroupName Clean-ResourceGroup $nwRgName } } function Test-VerifyIPFlow { $resourceGroupName = Get-NrpResourceGroupName $nwName = Get-NrpResourceName $nwRgName = Get-NrpResourceGroupName $securityGroupName = Get-NrpResourceName $templateFile = (Resolve-Path ".\TestData\Deployment.json").Path $location = Get-ProviderLocation "Microsoft.Network/networkWatchers" "East US" try { . ".\AzureRM.Resources.ps1" New-AzResourceGroup -Name $resourceGroupName -Location "$location" Get-TestResourcesDeployment -rgn "$resourceGroupName" New-AzResourceGroup -Name $nwRgName -Location "$location" $nw = Get-CreateTestNetworkWatcher -location $location -nwName $nwName -nwRgName $nwRgName $nsg = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName $nsg[0] | Add-AzNetworkSecurityRuleConfig -Name scr1 -Description "test1" -Protocol Tcp -SourcePortRange * -DestinationPortRange 80 -SourceAddressPrefix * -DestinationAddressPrefix * -Access Deny -Priority 122 -Direction Outbound $nsg[0] | Set-AzNetworkSecurityGroup $nsg[0] | Add-AzNetworkSecurityRuleConfig -Name sr2 -Description "test2" -Protocol Tcp -SourcePortRange "23-45" -DestinationPortRange "46-56" -SourceAddressPrefix * -DestinationAddressPrefix * -Access Allow -Priority 123 -Direction Inbound $nsg[0] | Set-AzNetworkSecurityGroup Wait-Seconds 300 $vm = Get-AzVM -ResourceGroupName $resourceGroupName $nic = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName $address = $nic[0].IpConfigurations[0].PrivateIpAddress $job = Test-AzNetworkWatcherIPFlow -NetworkWatcher $nw -TargetVirtualMachineId $vm.Id -Direction Inbound -Protocol Tcp -RemoteIPAddress 121.11.12.14 -LocalIPAddress $address -LocalPort 50 -RemotePort 40 -AsJob $job | Wait-Job $verification1 = $job | Receive-Job $verification2 = Test-AzNetworkWatcherIPFlow -NetworkWatcher $nw -TargetVirtualMachineId $vm.Id -Direction Outbound -Protocol Tcp -RemoteIPAddress 12.11.12.14 -LocalIPAddress $address -LocalPort 80 -RemotePort 80 Assert-AreEqual $verification2.Access Deny Assert-AreEqual $verification2.RuleName securityRules/scr1 } finally { Clean-ResourceGroup $resourceGroupName Clean-ResourceGroup $nwRgName } } function Test-NetworkConfigurationDiagnostic { $resourceGroupName = Get-NrpResourceGroupName $nwName = Get-NrpResourceName $nwRgName = Get-NrpResourceGroupName $securityGroupName = Get-NrpResourceName $templateFile = (Resolve-Path ".\TestData\Deployment.json").Path $location = Get-ProviderLocation "Microsoft.Network/networkWatchers" "East US" try { . ".\AzureRM.Resources.ps1" New-AzResourceGroup -Name $resourceGroupName -Location "$location" Get-TestResourcesDeployment -rgn "$resourceGroupName" New-AzResourceGroup -Name $nwRgName -Location "$location" $nw = Get-CreateTestNetworkWatcher -location $location -nwName $nwName -nwRgName $nwRgName $nsg = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName $vm = Get-AzVM -ResourceGroupName $resourceGroupName $profile = New-AzNetworkWatcherNetworkConfigurationDiagnosticProfile -Direction Inbound -Protocol Tcp -Source 10.1.1.4 -Destination * -DestinationPort 50 $result1 = Invoke-AzNetworkWatcherNetworkConfigurationDiagnostic -NetworkWatcher $nw -TargetResourceId $vm.Id -Profile $profile $result2 = Invoke-AzNetworkWatcherNetworkConfigurationDiagnostic -NetworkWatcher $nw -TargetResourceId $vm.Id -Profile $profile -VerbosityLevel Full Assert-AreEqual $result1.results[0].profile.direction Inbound Assert-AreEqual $result1.results[0].profile.protocol Tcp Assert-AreEqual $result1.results[0].profile.source 10.1.1.4 Assert-AreEqual $result1.results[0].profile.destinationPort 50 Assert-AreEqual $result1.results[0].networkSecurityGroupResult.securityRuleAccessResult Deny } finally { Clean-ResourceGroup $resourceGroupName Clean-ResourceGroup $nwRgName } } function Test-PacketCapture { $resourceGroupName = Get-NrpResourceGroupName $nwName = Get-NrpResourceName $location = Get-PilotLocation $resourceTypeParent = "Microsoft.Network/networkWatchers" $nwLocation = Get-ProviderLocation $resourceTypeParent $nwRgName = Get-NrpResourceGroupName $securityGroupName = Get-NrpResourceName $templateFile = (Resolve-Path ".\TestData\Deployment.json").Path $pcName1 = Get-NrpResourceName $pcName2 = Get-NrpResourceName try { . ".\AzureRM.Resources.ps1" New-AzResourceGroup -Name $resourceGroupName -Location "$location" Get-TestResourcesDeployment -rgn "$resourceGroupName" New-AzResourceGroup -Name $nwRgName -Location "$location" $nw = Get-CreateTestNetworkWatcher -location $location -nwName $nwName -nwRgName $nwRgName $vm = Get-AzVM -ResourceGroupName $resourceGroupName Set-AzVMExtension -ResourceGroupName "$resourceGroupName" -Location "$location" -VMName $vm.Name -Name "MyNetworkWatcherAgent" -Type "NetworkWatcherAgentWindows" -TypeHandlerVersion "1.4" -Publisher "Microsoft.Azure.NetworkWatcher"  $f1 = New-AzPacketCaptureFilterConfig -Protocol Tcp -RemoteIPAddress 127.0.0.1-127.0.0.255 -LocalPort 80 -RemotePort 80-120 $f2 = New-AzPacketCaptureFilterConfig -LocalIPAddress 127.0.0.1;127.0.0.5 $job = New-AzNetworkWatcherPacketCapture -NetworkWatcher $nw -PacketCaptureName $pcName1 -TargetVirtualMachineId $vm.Id -LocalFilePath C:\tmp\Capture.cap -Filter $f1, $f2 -AsJob $job | Wait-Job New-AzNetworkWatcherPacketCapture -NetworkWatcher $nw -PacketCaptureName $pcName2 -TargetVirtualMachineId $vm.Id -LocalFilePath C:\tmp\Capture.cap -TimeLimitInSeconds 1 Start-Sleep -s 2 $job = Get-AzNetworkWatcherPacketCapture -NetworkWatcher $nw -PacketCaptureName $pcName1 -AsJob $job | Wait-Job $pc1 = $job | Receive-Job $pc2 = Get-AzNetworkWatcherPacketCapture -NetworkWatcher $nw -PacketCaptureName $pcName2 $pcList = Get-AzNetworkWatcherPacketCapture -NetworkWatcher $nw -PacketCaptureName "*" Assert-AreEqual $pc1.Name $pcName1 Assert-AreEqual "Succeeded" $pc1.ProvisioningState Assert-AreEqual $pc1.TotalBytesPerSession 1073741824 Assert-AreEqual $pc1.BytesToCapturePerPacket 0 Assert-AreEqual $pc1.TimeLimitInSeconds 18000 Assert-AreEqual $pc1.Filters[0].LocalPort 80 Assert-AreEqual $pc1.Filters[0].Protocol TCP Assert-AreEqual $pc1.Filters[0].RemoteIPAddress 127.0.0.1-127.0.0.255 Assert-AreEqual $pc1.Filters[1].LocalIPAddress 127.0.0.1;127.0.0.5 Assert-AreEqual $pc1.StorageLocation.FilePath C:\tmp\Capture.cap $currentCount = $pcList.Count; $job = Stop-AzNetworkWatcherPacketCapture -NetworkWatcher $nw -PacketCaptureName $pcName1 -AsJob $job | Wait-Job $pc1 = Get-AzNetworkWatcherPacketCapture -NetworkWatcher $nw -PacketCaptureName $pcName1 $job = Remove-AzNetworkWatcherPacketCapture -NetworkWatcher $nw -PacketCaptureName $pcName1 -AsJob $job | Wait-Job $pcList = Get-AzNetworkWatcherPacketCapture -NetworkWatcher $nw Assert-AreEqual $pcList.Count ($currentCount - 1) Remove-AzNetworkWatcherPacketCapture -NetworkWatcher $nw -PacketCaptureName $pcName2 } finally { Clean-ResourceGroup $resourceGroupName Clean-ResourceGroup $nwRgName } } function Test-Troubleshoot { $resourceGroupName = Get-NrpResourceGroupName $nwName = Get-NrpResourceName $location = Get-PilotLocation $resourceTypeParent = "Microsoft.Network/networkWatchers" $nwLocation = Get-ProviderLocation $resourceTypeParent $nwRgName = Get-NrpResourceGroupName $domainNameLabel = Get-NrpResourceName $vnetName = Get-NrpResourceName $publicIpName = Get-NrpResourceName $vnetGatewayConfigName = Get-NrpResourceName $gwName = Get-NrpResourceName try { New-AzResourceGroup -Name $resourceGroupName -Location "$location" $subnet = New-AzVirtualNetworkSubnetConfig -Name "GatewaySubnet" -AddressPrefix 10.0.0.0/24 $vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $resourceGroupName -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet $vnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $resourceGroupName $subnet = Get-AzVirtualNetworkSubnetConfig -Name "GatewaySubnet" -VirtualNetwork $vnet $publicip = New-AzPublicIpAddress -ResourceGroupName $resourceGroupName -name $publicIpName -location $location -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel $vnetIpConfig = New-AzVirtualNetworkGatewayIpConfig -Name $vnetGatewayConfigName -PublicIpAddress $publicip -Subnet $subnet $gw = New-AzVirtualNetworkGateway -ResourceGroupName $resourceGroupName -Name $gwName -location $location -IpConfigurations $vnetIpConfig -GatewayType Vpn -VpnType RouteBased -EnableBgp $false New-AzResourceGroup -Name $nwRgName -Location "$location" $nw = Get-CreateTestNetworkWatcher -location $location -nwName $nwName -nwRgName $nwRgName $stoname = 'sto' + $resourceGroupName $stotype = 'Standard_GRS' $containerName = 'cont' + $resourceGroupName New-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $stoname -Location $location -Type $stotype; $key = Get-AzStorageAccountKey -ResourceGroupName $resourceGroupName -Name $stoname $context = New-AzStorageContext -StorageAccountName $stoname -StorageAccountKey $key[0].Value New-AzStorageContainer -Name $containerName -Context $context $container = Get-AzStorageContainer -Name $containerName -Context $context $sto = Get-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $stoname; Start-AzNetworkWatcherResourceTroubleshooting -NetworkWatcher $nw -TargetResourceId $gw.Id -StorageId $sto.Id -StoragePath $container.CloudBlobContainer.StorageUri.PrimaryUri.AbsoluteUri; $result = Get-AzNetworkWatcherTroubleshootingResult -NetworkWatcher $nw -TargetResourceId $gw.Id Assert-AreEqual $result.code "UnHealthy" Assert-AreEqual $result.results[0].id "NoConnectionsFoundForGateway" } finally { Clean-ResourceGroup $resourceGroupName Clean-ResourceGroup $nwRgName } } function Test-FlowLog { $resourceGroupName = Get-NrpResourceGroupName $nwName = Get-NrpResourceName $nwRgName = Get-NrpResourceGroupName $domainNameLabel = Get-NrpResourceName $nsgName = Get-NrpResourceName $stoname = Get-NrpResourceName $workspaceName = Get-NrpResourceName $location = Get-ProviderLocation "Microsoft.Network/networkWatchers" "West Central US" $workspaceLocation = Get-ProviderLocation ResourceManagement "East US" $flowlogFormatType = "Json" $flowlogFormatVersion = "1" $trafficAnalyticsInterval = 10; try { New-AzResourceGroup -Name $resourceGroupName -Location "$location" $nsg = New-AzNetworkSecurityGroup -name $nsgName -ResourceGroupName $resourceGroupName -Location $location $getNsg = Get-AzNetworkSecurityGroup -name $nsgName -ResourceGroupName $resourceGroupName New-AzResourceGroup -Name $nwRgName -Location "$location" $nw = Get-CreateTestNetworkWatcher -location $location -nwName $nwName -nwRgName $nwRgName $stoname = 'sto' + $stoname $stotype = 'Standard_GRS' New-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $stoname -Location $location -Type $stotype; $sto = Get-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $stoname; $workspaceName = 'tawspace' + $workspaceName $workspaceSku = 'free' New-AzOperationalInsightsWorkspace -ResourceGroupName $resourceGroupName -Name $workspaceName -Location $workspaceLocation -Sku $workspaceSku; $workspace = Get-AzOperationalInsightsWorkspace -Name $workspaceName -ResourceGroupName $resourceGroupName $job = Set-AzNetworkWatcherConfigFlowLog -NetworkWatcher $nw -TargetResourceId $getNsg.Id -EnableFlowLog $true -StorageAccountId $sto.Id -EnableTrafficAnalytics:$true -Workspace $workspace -AsJob -FormatType $flowlogFormatType -FormatVersion $flowlogFormatVersion -TrafficAnalyticsInterval $trafficAnalyticsInterval $job | Wait-Job $config = $job | Receive-Job $job = Get-AzNetworkWatcherFlowLogStatus -NetworkWatcher $nw -TargetResourceId $getNsg.Id -AsJob $job | Wait-Job $status = $job | Receive-Job Assert-AreEqual $config.TargetResourceId $getNsg.Id Assert-AreEqual $config.StorageId $sto.Id Assert-AreEqual $config.Enabled $true Assert-AreEqual $config.RetentionPolicy.Days 0 Assert-AreEqual $config.RetentionPolicy.Enabled $false Assert-AreEqual $config.Format.Type $flowlogFormatType Assert-AreEqual $config.Format.Version $flowlogFormatVersion Assert-AreEqual $config.FlowAnalyticsConfiguration.NetworkWatcherFlowAnalyticsConfiguration.Enabled $true Assert-AreEqual $config.FlowAnalyticsConfiguration.NetworkWatcherFlowAnalyticsConfiguration.WorkspaceResourceId $workspace.ResourceId Assert-AreEqual $config.FlowAnalyticsConfiguration.NetworkWatcherFlowAnalyticsConfiguration.WorkspaceId $workspace.CustomerId.ToString() Assert-AreEqual $config.FlowAnalyticsConfiguration.NetworkWatcherFlowAnalyticsConfiguration.WorkspaceRegion $workspace.Location Assert-AreEqual $config.FlowAnalyticsConfiguration.NetworkWatcherFlowAnalyticsConfiguration.TrafficAnalyticsInterval $trafficAnalyticsInterval Assert-AreEqual $status.TargetResourceId $getNsg.Id Assert-AreEqual $status.StorageId $sto.Id Assert-AreEqual $status.Enabled $true Assert-AreEqual $status.RetentionPolicy.Days 0 Assert-AreEqual $status.RetentionPolicy.Enabled $false Assert-AreEqual $status.Format.Type $flowlogFormatType Assert-AreEqual $status.Format.Version $flowlogFormatVersion Assert-AreEqual $status.FlowAnalyticsConfiguration.NetworkWatcherFlowAnalyticsConfiguration.Enabled $true Assert-AreEqual $status.FlowAnalyticsConfiguration.NetworkWatcherFlowAnalyticsConfiguration.WorkspaceResourceId $workspace.ResourceId Assert-AreEqual $status.FlowAnalyticsConfiguration.NetworkWatcherFlowAnalyticsConfiguration.WorkspaceId $workspace.CustomerId.ToString() Assert-AreEqual $status.FlowAnalyticsConfiguration.NetworkWatcherFlowAnalyticsConfiguration.WorkspaceRegion $workspace.Location Assert-AreEqual $status.FlowAnalyticsConfiguration.NetworkWatcherFlowAnalyticsConfiguration.TrafficAnalyticsInterval $trafficAnalyticsInterval } finally { Clean-ResourceGroup $resourceGroupName Clean-ResourceGroup $nwRgName } } function Test-ConnectivityCheck { . ".\AzureRM.Resources.ps1" $resourceGroupName = Get-NrpResourceGroupName $nwName = Get-NrpResourceName $nwRgName = Get-NrpResourceGroupName $securityGroupName = Get-NrpResourceName $templateFile = (Resolve-Path ".\TestData\Deployment.json").Path $pcName1 = Get-NrpResourceName $pcName2 = Get-NrpResourceName $location = Get-ProviderLocation "Microsoft.Network/networkWatchers" "West Central US" try { . ".\AzureRM.Resources.ps1" New-AzResourceGroup -Name $resourceGroupName -Location "$location" Get-TestResourcesDeployment -rgn "$resourceGroupName" New-AzResourceGroup -Name $nwRgName -Location "$location" $nw = Get-CreateTestNetworkWatcher -location $location -nwName $nwName -nwRgName $nwRgName $vm = Get-AzVM -ResourceGroupName $resourceGroupName Set-AzVMExtension -ResourceGroupName "$resourceGroupName" -Location "$location" -VMName $vm.Name -Name "MyNetworkWatcherAgent" -Type "NetworkWatcherAgentWindows" -TypeHandlerVersion "1.4" -Publisher "Microsoft.Azure.NetworkWatcher" $config = New-AzNetworkWatcherProtocolConfiguration -Protocol "Http" -Method "Get" -Header @{"accept"="application/json"} -ValidStatusCode @(200,202,204) $job = Test-AzNetworkWatcherConnectivity -NetworkWatcher $nw -SourceId $vm.Id -DestinationAddress "bing.com" -DestinationPort 80 -ProtocolConfiguration $config -AsJob $job | Wait-Job $check = $job | Receive-Job Assert-AreEqual $check.ConnectionStatus "Reachable" Assert-AreEqual $check.ProbesFailed 0 Assert-AreEqual $check.Hops.Count 2 Assert-True { $check.Hops[0].Type -eq "19" -or $check.Hops[0].Type -eq "VirtualMachine"} Assert-AreEqual $check.Hops[1].Type "Internet" Assert-AreEqual $check.Hops[0].Address "10.17.3.4" } finally { Assert-ThrowsContains { Test-AzNetworkWatcherConnectivity -NetworkWatcher $nw -SourceId $vm.Id -DestinationId $vm.Id -DestinationPort 80 } "Connectivity check destination resource id must not be the same as source"; Assert-ThrowsContains { Test-AzNetworkWatcherConnectivity -NetworkWatcher $nw -SourceId $vm.Id -DestinationPort 80 } "Connectivity check missing destination resource id or address"; Assert-ThrowsContains { Test-AzNetworkWatcherConnectivity -NetworkWatcher $nw -SourceId $vm.Id -DestinationAddress "bing.com" } "Connectivity check missing destination port"; Clean-ResourceGroup $resourceGroupName Clean-ResourceGroup $nwRgName } } function Test-ReachabilityReport { $rgname = Get-NrpResourceGroupName $nwName = Get-NrpResourceName $resourceTypeParent = "Microsoft.Network/networkWatchers" $location = Get-ProviderLocation $resourceTypeParent "West Central US" try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $location -Tags @{ testtag = "testval" } $nw = Get-CreateTestNetworkWatcher -location $location -nwName $nwName -nwRgName $rgName $job = Get-AzNetworkWatcherReachabilityReport -NetworkWatcher $nw -Location "West US" -Country "United States" -StartTime "2017-10-05" -EndTime "2017-10-10" -AsJob $job | Wait-Job $report1 = $job | Receive-Job $report2 = Get-AzNetworkWatcherReachabilityReport -NetworkWatcher $nw -Location "West US" -Country "United States" -State "washington" -StartTime "2017-10-05" -EndTime "2017-10-10" $report3 = Get-AzNetworkWatcherReachabilityReport -NetworkWatcher $nw -Location "West US" -Country "United States" -State "washington" -City "seattle" -StartTime "2017-10-05" -EndTime "2017-10-10" Assert-AreEqual $report1.AggregationLevel "Country" Assert-AreEqual $report1.ProviderLocation.Country "United States" Assert-AreEqual $report2.AggregationLevel "State" Assert-AreEqual $report2.ProviderLocation.Country "United States" Assert-AreEqual $report2.ProviderLocation.State "washington" Assert-AreEqual $report3.AggregationLevel "City" Assert-AreEqual $report3.ProviderLocation.Country "United States" Assert-AreEqual $report3.ProviderLocation.State "washington" Assert-AreEqual $report3.ProviderLocation.City "seattle" } finally { Clean-ResourceGroup $rgname } } function Test-ProvidersList { $rgname = Get-NrpResourceGroupName $nwName = Get-NrpResourceName $resourceTypeParent = "Microsoft.Network/networkWatchers" $location = Get-ProviderLocation $resourceTypeParent "West Central US" try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $location -Tags @{ testtag = "testval" } $nw = Get-CreateTestNetworkWatcher -location $location -nwName $nwName -nwRgName $rgname $job = Get-AzNetworkWatcherReachabilityProvidersList -NetworkWatcher $nw -Location "West US" -Country "United States" -AsJob $job | Wait-Job $list1 = $job | Receive-Job $list2 = Get-AzNetworkWatcherReachabilityProvidersList -NetworkWatcher $nw -Location "West US" -Country "United States" -State "washington" $list3 = Get-AzNetworkWatcherReachabilityProvidersList -NetworkWatcher $nw -Location "West US" -Country "United States" -State "washington" -City "seattle" Assert-AreEqual $list1.Countries.CountryName "United States" Assert-AreEqual $list2.Countries.CountryName "United States" Assert-AreEqual $list2.Countries.States.StateName "washington" } finally { Clean-ResourceGroup $rgname } } function Test-ConnectionMonitor { $resourceGroupName = Get-NrpResourceGroupName $nwName = Get-NrpResourceName $location = Get-PilotLocation $resourceTypeParent = "Microsoft.Network/networkWatchers" $nwLocation = Get-ProviderLocation $resourceTypeParent $nwRgName = Get-NrpResourceGroupName $securityGroupName = Get-NrpResourceName $templateFile = (Resolve-Path ".\TestData\Deployment.json").Path $cmName1 = Get-NrpResourceName $cmName2 = Get-NrpResourceName $locationMod = ($location -replace " ","").ToLower() try { . ".\AzureRM.Resources.ps1" New-AzResourceGroup -Name $resourceGroupName -Location "$location" Get-TestResourcesDeployment -rgn "$resourceGroupName" New-AzResourceGroup -Name $nwRgName -Location "$location" $nw = Get-CreateTestNetworkWatcher -location $location -nwName $nwName -nwRgName $nwRgName $vm = Get-AzVM -ResourceGroupName $resourceGroupName Set-AzVMExtension -ResourceGroupName "$resourceGroupName" -Location "$location" -VMName $vm.Name -Name "MyNetworkWatcherAgent" -Type "NetworkWatcherAgentWindows" -TypeHandlerVersion "1.4" -Publisher "Microsoft.Azure.NetworkWatcher"  $job1 = New-AzNetworkWatcherConnectionMonitor -NetworkWatcher $nw -Name $cmName1 -SourceResourceId $vm.Id -DestinationAddress bing.com -DestinationPort 80 -AsJob $job1 | Wait-Job $cm1 = $job1 | Receive-Job Assert-AreEqual $cm1.Name $cmName1 Assert-AreEqual $cm1.Source.ResourceId $vm.Id Assert-AreEqual $cm1.Destination.Address bing.com Assert-AreEqual $cm1.Destination.Port 80 $job2 = New-AzNetworkWatcherConnectionMonitor -NetworkWatcher $nw -Name $cmName2 -SourceResourceId $vm.Id -DestinationAddress google.com -DestinationPort 80 -AsJob $job2 | Wait-Job $cm2 = $job2 | Receive-Job Assert-AreEqual $cm2.Name $cmName2 Assert-AreEqual $cm2.Source.ResourceId $vm.Id Assert-AreEqual $cm2.Destination.Address google.com Assert-AreEqual $cm2.Destination.Port 80 Assert-AreEqual $cm2.MonitoringStatus Running Stop-AzNetworkWatcherConnectionMonitor -ResourceGroup $nw.ResourceGroupName -NetworkWatcherName $nw.Name -Name $cmName1 $cm1 = Set-AzNetworkWatcherConnectionMonitor -ResourceGroup $nw.ResourceGroupName -NetworkWatcherName $nw.Name -Name $cmName1 -SourceResourceId $vm.Id -DestinationAddress bing.com -DestinationPort 81 -ConfigureOnly -MonitoringIntervalInSeconds 50 Assert-AreEqual $cm1.Destination.Port 81 Assert-AreEqual $cm1.MonitoringIntervalInSeconds 50 Stop-AzNetworkWatcherConnectionMonitor -ResourceGroup $nw.ResourceGroupName -NetworkWatcherName $nw.Name -Name $cmName1 $cm1 = Set-AzNetworkWatcherConnectionMonitor -Location $locationMod -Name $cmName1 -SourceResourceId $vm.Id -DestinationAddress test.com -DestinationPort 81 -MonitoringIntervalInSeconds 50 Assert-AreEqual $cm1.Destination.Address test.com Stop-AzNetworkWatcherConnectionMonitor -ResourceGroup $nw.ResourceGroupName -NetworkWatcherName $nw.Name -Name $cmName1 $cm1 = Set-AzNetworkWatcherConnectionMonitor -ResourceId $cm1.Id -SourceResourceId $vm.Id -DestinationAddress test.com -DestinationPort 80 -MonitoringIntervalInSeconds 50 Assert-AreEqual $cm1.Destination.Port 80 Stop-AzNetworkWatcherConnectionMonitor -ResourceGroup $nw.ResourceGroupName -NetworkWatcherName $nw.Name -Name $cmName1 $cm1Job = Set-AzNetworkWatcherConnectionMonitor -InputObject $cm1 -SourceResourceId $vm.Id -DestinationAddress test.com -DestinationPort 81 -MonitoringIntervalInSeconds 42 -AsJob $cm1Job | Wait-Job $cm1 = $cm1Job | Receive-Job Assert-AreEqual $cm1.MonitoringIntervalInSeconds 42 Stop-AzNetworkWatcherConnectionMonitor -ResourceGroup $nw.ResourceGroupName -NetworkWatcherName $nw.Name -Name $cmName1 $cm1 = Set-AzNetworkWatcherConnectionMonitor -NetworkWatcher $nw -Name $cmName1 -SourceResourceId $vm.Id -DestinationAddress test.com -DestinationPort 80 -MonitoringIntervalInSeconds 42 Assert-AreEqual $cm1.Destination.Port 80 $stopJob = Stop-AzNetworkWatcherConnectionMonitor -NetworkWatcher $nw -Name $cmName2 -AsJob -PassThru $stopJob | Wait-Job $stopResult = $stopJob | Receive-Job Assert-AreEqual true $stopResult $cm2 = Get-AzNetworkWatcherConnectionMonitor -NetworkWatcher $nw -Name $cmName2 Assert-AreEqual $cm2.MonitoringStatus Stopped $startJob = Start-AzNetworkWatcherConnectionMonitor -NetworkWatcher $nw -Name $cmName2 -AsJob -PassThru $startJob | Wait-Job $startResult = $startJob | Receive-Job Assert-AreEqual true $startResult $cm2 = Get-AzNetworkWatcherConnectionMonitor -NetworkWatcher $nw -Name $cmName2 Assert-AreEqual $cm2.MonitoringStatus Running Stop-AzNetworkWatcherConnectionMonitor -Location $locationMod -Name $cm2.Name $cm2 = Get-AzNetworkWatcherConnectionMonitor -Location $locationMod -Name $cm2.Name Assert-AreEqual $cm2.MonitoringStatus Stopped Start-AzNetworkWatcherConnectionMonitor -Location $locationMod -Name $cm2.Name $cm2 = Get-AzNetworkWatcherConnectionMonitor -Location $locationMod -Name $cm2.Name Assert-AreEqual $cm2.MonitoringStatus Running Stop-AzNetworkWatcherConnectionMonitor -ResourceId $cm2.Id $cm2 = Get-AzNetworkWatcherConnectionMonitor -ResourceId $cm2.Id Assert-AreEqual $cm2.MonitoringStatus Stopped Start-AzNetworkWatcherConnectionMonitor -ResourceId $cm2.Id $cm2 = Get-AzNetworkWatcherConnectionMonitor -ResourceId $cm2.Id Assert-AreEqual $cm2.MonitoringStatus Running Stop-AzNetworkWatcherConnectionMonitor -InputObject $cm2 $cm2 = Get-AzNetworkWatcherConnectionMonitor -NetworkWatcher $nw -Name $cmName2 Assert-AreEqual $cm2.MonitoringStatus Stopped Start-AzNetworkWatcherConnectionMonitor -InputObject $cm2 $cm2 = Get-AzNetworkWatcherConnectionMonitor -NetworkWatcher $nw -Name $cmName2 Assert-AreEqual $cm2.MonitoringStatus Running $cms = Get-AzNetworkWatcherConnectionMonitor -NetworkWatcher $nw -Name "*" Assert-NotNull $cms $report = Get-AzNetworkWatcherConnectionMonitorReport -NetworkWatcher $nw -Name $cmName1 Assert-NotNull $report $report = Get-AzNetworkWatcherConnectionMonitorReport -Location $locationMod -Name $cmName1 Assert-NotNull $report $report = Get-AzNetworkWatcherConnectionMonitorReport -ResourceId $cm1.Id Assert-NotNull $report $reportJob = Get-AzNetworkWatcherConnectionMonitorReport -InputObject $cm1 -AsJob $reportJob | Wait-Job $report = $reportJob | Receive-Job Assert-NotNull $report Remove-AzNetworkWatcherConnectionMonitor -NetworkWatcher $nw -Name $cmName1 Wait-Vm $vm $job1 = New-AzNetworkWatcherConnectionMonitor -Location $locationMod -Name $cmName1 -SourceResourceId $vm.Id -DestinationAddress bing.com -DestinationPort 80 -ConfigureOnly -MonitoringIntervalInSeconds 30 -AsJob $job1 | Wait-Job $cm1 = $job1 | Receive-Job Remove-AzNetworkWatcherConnectionMonitor -Location $locationMod -Name $cmName1 Wait-Vm $vm $job1 = New-AzNetworkWatcherConnectionMonitor -ResourceGroup $nw.ResourceGroupName -NetworkWatcherName $nw.Name -Name $cmName1 -SourceResourceId $vm.Id -DestinationAddress bing.com -DestinationPort 80 -ConfigureOnly -MonitoringIntervalInSeconds 30 -AsJob $job1 | Wait-Job $cm1 = $job1 | Receive-Job Remove-AzNetworkWatcherConnectionMonitor -ResourceId $cm1.Id Wait-Vm $vm $job1 = New-AzNetworkWatcherConnectionMonitor -ResourceGroup $nw.ResourceGroupName -NetworkWatcherName $nw.Name -Name $cmName1 -SourceResourceId $vm.Id -DestinationAddress bing.com -DestinationPort 80 -ConfigureOnly -MonitoringIntervalInSeconds 30 -AsJob $job1 | Wait-Job $cm1 = $job1 | Receive-Job $rmJob = Remove-AzNetworkWatcherConnectionMonitor -InputObject $cm1 -AsJob -PassThru $rmJob | Wait-Job $result = $rmJob | Receive-Job Wait-Vm $vm Assert-ThrowsLike { Set-AzNetworkWatcherConnectionMonitor -NetworkWatcher $nw -Name "fakeName" -SourceResourceId $vm.Id -DestinationAddress test.com -DestinationPort 80 -MonitoringIntervalInSeconds 42 } "*not*found*" Remove-AzNetworkWatcher -ResourceGroupName $nw.ResourceGroupName -Name $nw.Name Assert-ThrowsLike { New-AzNetworkWatcherConnectionMonitor -Location $locationMod -Name $cmName1 -SourceResourceId $vm.Id -DestinationAddress bing.com -DestinationPort 80 } "*There is no*" Assert-ThrowsLike { Remove-AzNetworkWatcherConnectionMonitor -Location $locationMod -Name $cmName1 } "*There is no*" Assert-ThrowsLike { Get-AzNetworkWatcherConnectionMonitor -Location $locationMod -Name $cmName1 } "*There is no*" Assert-ThrowsLike { Set-AzNetworkWatcherConnectionMonitor -Location $locationMod -Name $cmName1 -SourceResourceId $vm.Id -DestinationAddress test.com -DestinationPort 80 -MonitoringIntervalInSeconds 42 } "*There is no*" Assert-ThrowsLike { Get-AzNetworkWatcherConnectionMonitorReport -Location $locationMod -Name $cmName1 } "*There is no*" Assert-ThrowsLike { Stop-AzNetworkWatcherConnectionMonitor -Location $locationMod -Name $cmName1 } "*There is no*" Assert-ThrowsLike { Start-AzNetworkWatcherConnectionMonitor -Location $locationMod -Name $cmName1 } "*There is no*" } finally { Clean-ResourceGroup $resourceGroupName Clean-ResourceGroup $nwRgName } }
combined_dataset/train/non-malicious/Get-TopProcess.ps1
Get-TopProcess.ps1
## poll-process.ps1 ## Continuously display a process list, sorted ## by the desired criteria. ## ## usage: poll-process [sortCriteria] [pollInterval] ## ## sortCriteria must be one of "Id", "ProcessName", "MainWindowTitle", ## "Processor", "Disk", or "WorkingSet" ## pollInterval is specified in milliseconds ## param( [string] $sortCriteria = "Processor", [int] $Count = 5 ) function main { ## Store the performance counters we need ## for the CPU, and Disk I/O numbers $cpuPerfCounters = @{} $ioOtherOpsPerfCounters = @{} $ioOtherBytesPerfCounters = @{} $ioDataOpsPerfCounters = @{} $ioDataBytesPerfCounters = @{} $processes = $null $lastPoll = get-date $lastSnapshotCount = 0 $lastWindowHeight = 0 $processes = get-process | sort Id ## Go through all of the processes we captured foreach($process in $processes) { ## Get the disk activity, based on I/O Perf Counters, ## for the process in question. Then, add it as a note. $cpuPercent = @(for($i=0;$i -lt 10;$i++) { get-cpuPercent $process }) | measure-object -average [int]$Percent = $cpuPercent.Average #$process | add-member NoteProperty Disk $activity -force $process | add-member NoteProperty Processor $Percent -force } $output = $processes | sort -desc $sortCriteria | select -first $Count $output | format-table Id,ProcessName,MainWindowTitle,WorkingSet } ## As a heuristic, gets the total IO and Data operations per second, and ## returns their sum. function get-diskActivity ( $process = $(throw "Please specify a process for which to get disk usage.") ) { $processName = get-processName $process ## We store the performance counter objects in a hashtable. If we don't, ## then they fail to return any information for a few seconds. if(-not $ioOtherOpsPerfCounters[$processName]) { $ioOtherOpsPerfCounters[$processName] = new-object System.Diagnostics.PerformanceCounter("Process","IO Other Operations/sec",$processName) } if(-not $ioOtherBytesPerfCounters[$processName]) { $ioOtherBytesPerfCounters[$processName] = new-object System.Diagnostics.PerformanceCounter("Process","IO Other Bytes/sec",$processName) } if(-not $ioDataOpsPerfCounters[$processName]) { $ioDataOpsPerfCounters[$processName] = new-object System.Diagnostics.PerformanceCounter("Process","IO Data Operations/sec",$processName) } if(-not $ioDataBytesPerfCounters[$processName]) { $ioDataBytesPerfCounters[$processName] = new-object System.Diagnostics.PerformanceCounter("Process","IO Data Bytes/sec",$processName) } ## If a process exits between the time we capture the processes and now, ## then we will be unable to get its NextValue(). This trap simply ## catches the error and continues. trap { continue; } ## Get the performance counter values $ioOther = (100 * $ioOtherOpsPerfCounters[$processName].NextValue()) + ($ioOtherBytesPerfCounters[$processName].NextValue()) $ioData = (100 * $ioDataOpsPerfCounters[$processName].NextValue()) + ($ioDataBytesPerfCounters[$processName].NextValue()) return [int] ($ioOther + $ioData) } ## Get the percentage of time spent by a process. ## Note: this is multiproc "unaware." We need to divide the ## result by the number of processors. function get-cpuPercent ( $process = $(throw "Please specify a process for which to get CPU usage.") ) { $processName = get-processName $process ## We store the performance counter objects in a hashtable. If we don't, ## then they fail to return any information for a few seconds. if(-not $cpuPerfCounters[$processName]) { $cpuPerfCounters[$processName] = new-object System.Diagnostics.PerformanceCounter("Process","% Processor Time",$processName) } ## If a process exits between the time we capture the processes and now, ## then we will be unable to get its NextValue(). This trap simply ## catches the error and continues. trap { continue; } ## Get the performance counter values $cpuTime = ($cpuPerfCounters[$processName].NextValue() / $env:NUMBER_OF_PROCESSORS) return [int] $cpuTime } ## Performance counters are keyed by process name. However, ## processes may share the same name, so duplicates are named ## <process>#1, <process>#2, etc. function get-processName ( $process = $(throw "Please specify a process for which to get the name.") ) { ## If a process exits between the time we capture the processes and now, ## then we will be unable to get its information. This simply ## ignores the error. $errorActionPreference = "SilentlyContinue" $processName = $process.ProcessName $localProcesses = get-process -ProcessName $processName | sort Id if(@($localProcesses).Count -gt 1) { ## Determine where this one sits in the list $processNumber = -1 for($counter = 0; $counter -lt $localProcesses.Count; $counter++) { if($localProcesses[$counter].Id -eq $process.Id) { break } } ## Append its unique identifier, if required $processName += "#$counter" } return $processName } . main
combined_dataset/train/non-malicious/824.ps1
824.ps1
$cred = Get-Credential New-AzVmss ` -ResourceGroupName "myResourceGroup" ` -VMScaleSetName "myScaleSet" ` -Location "EastUS" ` -VirtualNetworkName "myVnet" ` -SubnetName "mySubnet" ` -PublicIpAddressName "myPublicIPAddress" ` -LoadBalancerName "myLoadBalancer" ` -Credential $cred
combined_dataset/train/non-malicious/sample_65_90.ps1
sample_65_90.ps1
@{ GUID="{Fb6cc51d-c096-4b38-b78d-0fed6277096a}" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" RootModule="Microsoft.Management.Infrastructure.CimCmdlets" RequiredAssemblies="Microsoft.Management.Infrastructure.CimCmdlets.dll","Microsoft.Management.Infrastructure.Dll" FunctionsToExport = @() CmdletsToExport= "Get-CimAssociatedInstance", "Get-CimClass", "Get-CimInstance", "Get-CimSession", "Invoke-CimMethod", "New-CimInstance","New-CimSession","New-CimSessionOption","Register-CimIndicationEvent","Remove-CimInstance", "Remove-CimSession","Set-CimInstance", "Export-BinaryMiLog","Import-BinaryMiLog" AliasesToExport = "gcim","scim","ncim", "rcim","icim","gcai","rcie","ncms","rcms","gcms","ncso","gcls" HelpInfoUri="https://aka.ms/powershell73-help" } # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA1HwyDFeHiXK3E # lEPj+wpNXm/MOZNih5kulbh+q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BAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAAB49+9 # m5ocaIMiAAEAAAHjMCIEINsd2aW1Y7wtnrogb26/8zWtZkK5NN+chuZAiFvrXewx # MA0GCSqGSIb3DQEBCwUABIICABiOPORSsGqaRP9MxFDUaWdlQrnX5KL4hILIWSl3 # rVSWQpy7oos+q+sjXYey/snY3f1s+IA5YA7vHaDpzcu3/zQH8+Bmr1eW9F6KR89i # 8QlCbgrefOiDnCjuNJ/rVs8iothbUpJ387UEU0wOO+LVaW/fQnUA+Pqh93+7NFUk # zG04Yv59dSDwJP+FDxQNOK/7P3VVIipP7DlZzC+uVsaSSIKVzQL1trfgU5LiqKDz # 5w+Fih4/aYjLDO7OfmthibffIeoVho7lnPZmG1engrMVScBJBQTrSSVPoKo4+TIp # 7wMteXaXbe3ToIJDZK+r+WeeI1eXIxWk9AMDcTzq/BJoy3FVJwNOsMXN/ngQppgh # 7jG9My4uPaPlgOq5wREElTHNc0p+evjMnl78UxxyXJHnP40Ylbmetp3tS9ZYTQd3 # ZlcpxXYijXXbuxDYsFAdehkmPQMyxXa7yZAt4fB+dUs9+HEeLJEhDqKfaZQEi+HA # +WPT7T49fmyShaeWB0Vs8p0GuxXZ7Km6hy8mAEw+9qrcuIIj3+Ag9L7Qb8h3kree # 90lmputH8vP3PuYliZOd9Y3J4/mQiNcrVLaZo5jnWFcCAyl0ageDH61HG+gFyJL3 # NPXbGYO1qxeTA6ysikQ48RNd3it8jXzjJp2IGqwj6vVMnyLXVcYTuY6XL9WRgRGz # o8VD # SIG # End signature block
combined_dataset/train/non-malicious/3917.ps1
3917.ps1
function Test-ListUsageDetails { $usageDetails = Get-AzConsumptionUsageDetail -Top 10 Assert-NotNull $usageDetails Assert-AreEqual 10 $usageDetails.Count Foreach($usage in $usageDetails) { Assert-NotNull $usage.AccountName Assert-Null $usage.AdditionalProperties Assert-NotNull $usage.BillingPeriodId Assert-NotNull $usage.ConsumedService Assert-NotNull $usage.CostCenter Assert-NotNull $usage.Currency Assert-NotNull $usage.DepartmentName Assert-NotNull $usage.Id Assert-NotNull $usage.InstanceId Assert-NotNull $usage.InstanceLocation Assert-NotNull $usage.InstanceName Assert-NotNull $usage.IsEstimated Assert-Null $usage.MeterDetails Assert-NotNull $usage.MeterId Assert-NotNull $usage.Name Assert-NotNull $usage.PretaxCost Assert-NotNull $usage.Product Assert-NotNull $usage.SubscriptionGuid Assert-NotNull $usage.SubscriptionName Assert-NotNull $usage.Type Assert-NotNull $usage.UsageEnd Assert-NotNull $usage.UsageQuantity Assert-NotNull $usage.UsageStart } } function Test-ListUsageDetailsWithMeterDetailsExpand { $usageDetails = Get-AzConsumptionUsageDetail -Expand MeterDetails -Top 10 Foreach($usage in $usageDetails) { Assert-NotNull $usage.AccountName Assert-Null $usage.AdditionalProperties Assert-NotNull $usage.BillingPeriodId Assert-NotNull $usage.ConsumedService Assert-NotNull $usage.CostCenter Assert-NotNull $usage.Currency Assert-NotNull $usage.DepartmentName Assert-NotNull $usage.Id Assert-NotNull $usage.InstanceId Assert-NotNull $usage.InstanceLocation Assert-NotNull $usage.InstanceName Assert-NotNull $usage.IsEstimated Assert-NotNull $usage.MeterDetails Assert-NotNull $usage.MeterId Assert-NotNull $usage.Name Assert-NotNull $usage.PretaxCost Assert-NotNull $usage.Product Assert-NotNull $usage.SubscriptionGuid Assert-NotNull $usage.SubscriptionName Assert-NotNull $usage.Type Assert-NotNull $usage.UsageEnd Assert-NotNull $usage.UsageQuantity Assert-NotNull $usage.UsageStart } } function Test-ListUsageDetailsWithDateFilter { $usageDetails = Get-AzConsumptionUsageDetail -StartDate 2017-10-02 -EndDate 2017-10-05 -Top 10 Assert-AreEqual 10 $usageDetails.Count Foreach($usage in $usageDetails) { Assert-NotNull $usage.AccountName Assert-Null $usage.AdditionalProperties Assert-NotNull $usage.BillingPeriodId Assert-NotNull $usage.ConsumedService Assert-NotNull $usage.CostCenter Assert-NotNull $usage.Currency Assert-NotNull $usage.DepartmentName Assert-NotNull $usage.Id Assert-NotNull $usage.InstanceId Assert-NotNull $usage.InstanceLocation Assert-NotNull $usage.InstanceName Assert-NotNull $usage.IsEstimated Assert-Null $usage.MeterDetails Assert-NotNull $usage.MeterId Assert-NotNull $usage.Name Assert-NotNull $usage.PretaxCost Assert-NotNull $usage.Product Assert-NotNull $usage.SubscriptionGuid Assert-NotNull $usage.SubscriptionName Assert-NotNull $usage.Type Assert-NotNull $usage.UsageEnd Assert-NotNull $usage.UsageQuantity Assert-NotNull $usage.UsageStart } } function Test-ListBillingPeriodUsageDetails { $usageDetails = Get-AzConsumptionUsageDetail -BillingPeriodName 201710 -Top 10 Assert-AreEqual 10 $usageDetails.Count Foreach($usage in $usageDetails) { Assert-NotNull $usage.AccountName Assert-Null $usage.AdditionalProperties Assert-NotNull $usage.BillingPeriodId Assert-NotNull $usage.ConsumedService Assert-NotNull $usage.CostCenter Assert-NotNull $usage.Currency Assert-NotNull $usage.DepartmentName Assert-NotNull $usage.Id Assert-NotNull $usage.InstanceId Assert-NotNull $usage.InstanceLocation Assert-NotNull $usage.InstanceName Assert-NotNull $usage.IsEstimated Assert-Null $usage.MeterDetails Assert-NotNull $usage.MeterId Assert-NotNull $usage.Name Assert-NotNull $usage.PretaxCost Assert-NotNull $usage.Product Assert-NotNull $usage.SubscriptionGuid Assert-NotNull $usage.SubscriptionName Assert-NotNull $usage.Type Assert-NotNull $usage.UsageEnd Assert-NotNull $usage.UsageQuantity Assert-NotNull $usage.UsageStart } } function Test-ListBillingPeriodUsageDetailsWithFilterOnInstanceName { $usageDetails = Get-AzConsumptionUsageDetail -BillingPeriodName 201710 -InstanceName 1c2052westus -Top 10 Foreach($usage in $usageDetails) { Assert-NotNull $usage.AccountName Assert-Null $usage.AdditionalProperties Assert-NotNull $usage.BillingPeriodId Assert-NotNull $usage.ConsumedService Assert-NotNull $usage.CostCenter Assert-NotNull $usage.Currency Assert-NotNull $usage.DepartmentName Assert-NotNull $usage.Id Assert-NotNull $usage.InstanceId Assert-NotNull $usage.InstanceLocation Assert-NotNull $usage.InstanceName Assert-AreEqual "1c2052westus" $usage.InstanceName Assert-NotNull $usage.IsEstimated Assert-Null $usage.MeterDetails Assert-NotNull $usage.MeterId Assert-NotNull $usage.Name Assert-NotNull $usage.PretaxCost Assert-NotNull $usage.Product Assert-NotNull $usage.SubscriptionGuid Assert-NotNull $usage.SubscriptionName Assert-NotNull $usage.Type Assert-NotNull $usage.UsageEnd Assert-NotNull $usage.UsageQuantity Assert-NotNull $usage.UsageStart } } function Test-ListBillingPeriodUsageDetailsWithDateFilter { $usageDetails = Get-AzConsumptionUsageDetail -BillingPeriodName 201710 -StartDate 2017-10-19 -Top 10 Assert-AreEqual 10 $usageDetails.Count Foreach($usage in $usageDetails) { Assert-NotNull $usage.AccountName Assert-Null $usage.AdditionalProperties Assert-NotNull $usage.BillingPeriodId Assert-NotNull $usage.ConsumedService Assert-NotNull $usage.CostCenter Assert-NotNull $usage.Currency Assert-NotNull $usage.DepartmentName Assert-NotNull $usage.Id Assert-NotNull $usage.InstanceId Assert-NotNull $usage.InstanceLocation Assert-NotNull $usage.InstanceName Assert-NotNull $usage.IsEstimated Assert-Null $usage.MeterDetails Assert-NotNull $usage.MeterId Assert-NotNull $usage.Name Assert-NotNull $usage.PretaxCost Assert-NotNull $usage.Product Assert-NotNull $usage.SubscriptionGuid Assert-NotNull $usage.SubscriptionName Assert-NotNull $usage.Type Assert-NotNull $usage.UsageEnd Assert-NotNull $usage.UsageQuantity Assert-NotNull $usage.UsageStart } }
combined_dataset/train/non-malicious/1196.ps1
1196.ps1
$userDomain = $env:USERDNSDOMAIN $computerDomain = Get-WmiObject 'Win32_ComputerSystem' | Select-Object -ExpandProperty Domain if( (Get-Service -Name MSMQ -ErrorAction SilentlyContinue) -and $userDomain -eq $computerDomain ) { $publicQueueName = $null $privateQueueName = $null function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { $publicQueueName = 'CarbonTestRemoveQueue-Public' + [Guid]::NewGuid().ToString() $privateQueueName = 'CarbonTestRemoveQueue-Private' + [Guid]::NewGuid().ToString() Install-MSMQMessageQueue $publicQueueName Install-MSMQMessageQueue $privateQueueName -Private } function Stop-Test { if( Test-MSMQMessageQueue -Name $publicQueueName ) { [Messaging.MessageQueue]::Delete( (Get-MSMQMessageQueuePath -Name $publicQueueName) ) Wait-ForQueueDeletion $publicQueueName } if( Test-MSMQMessageQueue -Name $privateQueueName -Private ) { [Messaging.MessageQueue]::Delete( (Get-MSMQMessageQueuePath -Name $privateQueueName -Private) ) Wait-ForQueueDeletion $privateQueueName -Private } } function Test-ShouldRemovePublicMessageQueue { Remove-MSMQMessageQueue $publicQueueName Assert-False (Test-MSMQMessageQueue $publicQueueName) } function Test-ShouldRemovePrivateMessageQueue { Remove-MSMQMessageQueue $privateQueueName -Private Assert-False (Test-MSMQMessageQueue $privateQueueName -Private) } function Test-ShouldSupportWhatIf { Remove-MSMQMessageQueue $publicQueueName -WhatIf Assert-True (Test-MSMQMessageQueue $publicQueueName) } function Wait-ForQueueDeletion($Name, [Switch]$Private) { $queueArgs = @{ Name = $Name ; Private = $Private } while( Test-MSMQMessageQueue @queueArgs ) { Start-Sleep -Milliseconds 1000 } } } else { Write-Warning ("Tests for Get-MSMQMessageQueue not run because MSMQ is not installed or the current user's domain ({0}) and the computer's domain ({1}) are different." -f $userDomain,$computerDomain) }
combined_dataset/train/non-malicious/Easy Migration Tool v2.0.ps1
Easy Migration Tool v2.0.ps1
#Generated Form Function function GenerateForm { ######################################################################## # Code Generated By: Richard Yaw # Generated On: 09/12/2010 # # Easy Migration Script for VMware (Version 2.0) # - Added a "Reload Tasks" feature. # - Fixed issue with the Undo feature for SVMotions. ######################################################################## #region Import the Assemblies [reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null [reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null #endregion #region Generated Form Objects $MigrationForm = New-Object System.Windows.Forms.Form $Header = new-object System.Windows.Forms.Label $MigrateButton = New-Object System.Windows.Forms.Button $ClusterListBox = New-Object System.Windows.Forms.ListBox $SourceHostListBox = New-Object System.Windows.Forms.ListBox $SourceDBListBox = New-Object System.Windows.Forms.CheckedListBox $SourceVMListBox = New-Object System.Windows.Forms.CheckedListBox $DestinationListBox = New-Object System.Windows.Forms.ListBox $vCenterLabel = New-Object System.Windows.Forms.Label $VCTextBox = New-Object System.Windows.Forms.TextBox $LoginButton = New-Object System.Windows.Forms.Button $ClearMsgButton = New-Object System.Windows.Forms.Button $UndoButton = New-Object System.Windows.Forms.Button $UndoALLButton = New-Object System.Windows.Forms.Button $ReloadTaskButton = New-Object System.Windows.Forms.Button $SaveTaskButton = New-Object System.Windows.Forms.Button $ClusterLabel = New-Object System.Windows.Forms.Label $HostToHostButton = New-Object System.Windows.Forms.Button $VMToHostButton = New-Object System.Windows.Forms.Button $DBtoDBButton = New-Object System.Windows.Forms.Button $VMtoDBButton = New-Object System.Windows.Forms.Button $SourceButton = New-Object System.Windows.Forms.Button $DestinationButton = New-Object System.Windows.Forms.Button $ResetButton = New-Object System.Windows.Forms.Button $ChangeVCButton = New-Object System.Windows.Forms.Button $CloseButton = New-Object System.Windows.Forms.Button $MessagesLabel = New-Object System.Windows.Forms.Label $MessagesListBox = New-Object System.Windows.Forms.ListBox $TaskLabel = New-Object System.Windows.Forms.Label $TaskListBox = New-Object System.Windows.Forms.ListBox $InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState #endregion Generated Form Objects #---------------------------------------------- #Generated Event Script Blocks #---------------------------------------------- #Provide Custom Code for events specified in PrimalForms. $LoginButton_Click= { #TODO: Place custom script here If ($VCTextBox.Text -eq "") { [reflection.assembly]::loadwithpartialname('system.windows.forms') [system.Windows.Forms.MessageBox]::show('Please Enter a Valid vCenter Server.') } Else { if ((Get-PSSnapin "VMware.VimAutomation.Core" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin "VMware.VimAutomation.Core" } #Connect to vCenter Connect-VIServer $VCTextBox.Text $ClusterListBox.Enabled = $true #Get Cluster Get-Cluster | % { [void]$ClusterListBox.items.add($_.Name) } If ($ClusterListBox.items -ne $null) { $LoginButton.Enabled = $false $VCTextBox.Enabled = $false $HostToHostButton.Enabled = $true $VMToHostButton.Enabled = $true $DBtoDBButton.Enabled = $true $VMtoDBButton.Enabled = $true $ResetButton.Enabled = $true $ChangeVCButton.Enabled = $true $ReloadTaskButton.Enabled = $true #Generate a log file for this session #$logfile = "C:\\TEMP\\EasyMigrate{0:dd-MM-yyyy_HHmmss}" -f (Get-Date) + ".log" #$logheader = "Easy Migration Tool v1.0 - Log generated on " + (Get-Date) #Out-File -InputObject $logheader -FilePath $logfile #Out-File -InputObject "" -Append -FilePath $logfile } $OnLoadForm_StateCorrection= {#Correct the initial state of the form to prevent the .Net maximized form issue $MigrationForm.WindowState = $InitialFormWindowState } } } $HostToHostButton_Click= { #TODO: Place custom script here $ClusterName = $ClusterListBox.SelectedItem If ($ClusterName -eq $null) { [reflection.assembly]::loadwithpartialname('system.windows.forms') [system.Windows.Forms.MessageBox]::show('Please Select a Cluster.') } Else { $SourceHostListBox.Enabled = $true $SourceHostListBox.Items.Clear() #Get Hostnames in a Cluster Get-Cluster -Name $ClusterName | Get-VMHost | % { [void]$SourceHostListBox.items.add($_.Name) } $ClusterListBox.Enabled = $false $HostToHostButton.Enabled = $false $VMToHostButton.Enabled = $false $DBtoDBButton.Enabled = $false $VMtoDBButton.Enabled = $false $SourceButton.Text = 'Source - Select One Host' $DestinationButton.Text = 'Destination Host' $SourceButton.Enabled = $true $HostToHostButton.BackColor = [System.Drawing.Color]::lightblue $OnLoadForm_StateCorrection= {#Correct the initial state of the form to prevent the .Net maximized form issue $MigrationForm.WindowState = $InitialFormWindowState } } } $VMToHostButton_Click= { #TODO: Place custom script here $ClusterName = $ClusterListBox.SelectedItem If ($ClusterName -eq $null) { [reflection.assembly]::loadwithpartialname('system.windows.forms') [system.Windows.Forms.MessageBox]::show('Please Select a Cluster.') } Else { $MigrationForm.Controls.Remove($SourceHostListBox) $MigrationForm.Controls.Add($SourceVMListBox) $SourceVMListBox.Enabled = $true $SourceVMListBox.Items.Clear() #Get VMs in a Cluster Get-Cluster -Name $ClusterName | Get-VM | % { [void]$SourceVMListBox.items.add($_.Name) } $ClusterListBox.Enabled = $false $HostToHostButton.Enabled = $false $VMToHostButton.Enabled = $false $DBtoDBButton.Enabled = $false $VMtoDBButton.Enabled = $false $SourceButton.Text = 'Source - Select VMs' $DestinationButton.Text = 'Destination Host' $SourceButton.Enabled = $true $VMToHostButton.BackColor = [System.Drawing.Color]::lightblue $OnLoadForm_StateCorrection= {#Correct the initial state of the form to prevent the .Net maximized form issue $MigrationForm.WindowState = $InitialFormWindowState } } } $DBtoDBButton_Click= { #TODO: Place custom script here $ClusterName = $ClusterListBox.SelectedItem If ($ClusterName -eq $null) { [reflection.assembly]::loadwithpartialname('system.windows.forms') [system.Windows.Forms.MessageBox]::show('Please Select a Cluster.') } Else { $MigrationForm.Controls.Remove($SourceHostListBox) $MigrationForm.Controls.Add($SourceDBListBox) $SourceDBListBox.Enabled = $true $SourceDBListBox.Items.Clear() #Get Datastores in a Cluster Get-Cluster -Name $ClusterName | Get-VMHost | Get-Datastore | Where-Object {$_.Name -notlike "*SCR01"} | Where-Object {$_.Name -notlike "DAS*"} | % { [void]$SourceDBListBox.items.add($_.Name) } $ClusterListBox.Enabled = $false $HostToHostButton.Enabled = $false $VMToHostButton.Enabled = $false $DBtoDBButton.Enabled = $false $VMtoDBButton.Enabled = $false $SourceButton.Text = 'Source - Select a Datastore' $DestinationButton.Text = 'Destination Datastore' $SourceButton.Enabled = $true $DBtoDBButton.BackColor = [System.Drawing.Color]::lightblue $OnLoadForm_StateCorrection= {#Correct the initial state of the form to prevent the .Net maximized form issue $MigrationForm.WindowState = $InitialFormWindowState } } } $VMToDBButton_Click= { #TODO: Place custom script here $ClusterName = $ClusterListBox.SelectedItem If ($ClusterName -eq $null) { [reflection.assembly]::loadwithpartialname('system.windows.forms') [system.Windows.Forms.MessageBox]::show('Please Select a Cluster.') } Else { $MigrationForm.Controls.Remove($SourceHostListBox) $MigrationForm.Controls.Add($SourceVMListBox) $SourceVMListBox.Enabled = $true $SourceVMListBox.Items.Clear() #Get VMs in a Cluster Get-Cluster -Name $ClusterName | Get-VM | % { [void]$SourceVMListBox.items.add($_.Name) } $ClusterListBox.Enabled = $false $HostToHostButton.Enabled = $false $VMToHostButton.Enabled = $false $DBtoDBButton.Enabled = $false $VMtoDBButton.Enabled = $false $SourceButton.Text = 'Source - Select VMs' $DestinationButton.Text = 'Destination Datastore' $SourceButton.Enabled = $true $VMtoDBButton.BackColor = [System.Drawing.Color]::lightblue $OnLoadForm_StateCorrection= {#Correct the initial state of the form to prevent the .Net maximized form issue $MigrationForm.WindowState = $InitialFormWindowState } } } $SourceButton_OnClick= { #TODO: Place custom script here $ClusterName = $ClusterListBox.SelectedItem If ($SourceButton.Text -eq "Source - Select One Host") { $SourceHostname = $SourceHostListBox.SelectedItem If ($SourceHostname -eq $null) { [reflection.assembly]::loadwithpartialname('system.windows.forms') [system.Windows.Forms.MessageBox]::show('Please Select a Source Host.') } Else { #Get Hostnames in a Cluster Get-Cluster -Name $ClusterName | Get-VMHost | Where-Object {$_.Name -notlike "$SourceHostname"} | % { [void]$DestinationListBox.items.add($_.Name) } $SourceHostListBox.Enabled = $false $SourceButton.Enabled = $false $DestinationListBox.Enabled = $true $DestinationButton.Enabled = $true $OnLoadForm_StateCorrection= {#Correct the initial state of the form to prevent the .Net maximized form issue $MigrationForm.WindowState = $InitialFormWindowState } } } If ($SourceButton.Text -eq "Source - Select VMs") { $SourceVMname = $SourceVMListBox.SelectedItem If ($SourceVMname -eq $null) { [reflection.assembly]::loadwithpartialname('system.windows.forms') [system.Windows.Forms.MessageBox]::show('Please Select One or More VMs.') } Else { if ($DestinationButton.Text -like "Destination Host") { #Get Hostnames in a Cluster Get-Cluster -Name $ClusterName | Get-VMHost | % { [void]$DestinationListBox.items.add($_.Name) } } Else { #Get Datastores in a Cluster Get-Cluster -Name $ClusterName | Get-VMHost | Get-Datastore | Where-Object {$_.Name -notlike "*SCR01"} | Where-Object {$_.Name -notlike "DAS*"} | % { [void]$DestinationListBox.items.add($_.Name) } } $DestinationListBox.Enabled = $true $SourceVMListBox.Enabled = $false $SourceButton.Enabled = $false $DestinationButton.Enabled = $true $OnLoadForm_StateCorrection= {#Correct the initial state of the form to prevent the .Net maximized form issue $MigrationForm.WindowState = $InitialFormWindowState } } } If ($SourceButton.Text -like "Source - Select a Datastore") { $SourceDBname = $SourceDBListBox.SelectedItem If ($SourceDBname -eq $null) { [reflection.assembly]::loadwithpartialname('system.windows.forms') [system.Windows.Forms.MessageBox]::show('Please Select One Datastore.') } Else { #Get Datastores in a Cluster Get-Cluster -Name $ClusterName | Get-VMHost | Get-Datastore | Where-Object {$_.Name -notlike "*SCR01"} | Where-Object {$_.Name -notlike "DAS*"} | Where-Object {$_.Name -notlike "$SourceDBname"} | % { [void]$DestinationListBox.items.add($_.Name) } $SourceDBListBox.Enabled = $false $SourceButton.Enabled = $false $DestinationListBox.Enabled = $true $DestinationButton.Enabled = $true $OnLoadForm_StateCorrection= {#Correct the initial state of the form to prevent the .Net maximized form issue $MigrationForm.WindowState = $InitialFormWindowState } } } } $DestinationButton_OnClick= { #TODO: Place custom script here $DestinationName = $DestinationListBox.SelectedItem If ($DestinationName -eq $null) { [reflection.assembly]::loadwithpartialname('system.windows.forms') [system.Windows.Forms.MessageBox]::show('Please Select a Destination.') } Else { $DestinationListBox.Enabled = $false $DestinationButton.Enabled = $false $MigrateButton.Enabled = $true $OnLoadForm_StateCorrection= {#Correct the initial state of the form to prevent the .Net maximized form issue $MigrationForm.WindowState = $InitialFormWindowState } } } $MigrateButton_OnClick= { #TODO: Place custom script here If ($SourceButton.Text -eq "Source - Select One Host") { $SourceHostname = $SourceHostListBox.SelectedItem $DestinationName = $DestinationListBox.SelectedItem $VMs = Get-VMHost $SourceHostname | Get-VM foreach($VM in $VMs) { Get-VM -Name $VM | Move-VM -Destination (Get-VMHost $DestinationName) $d = Get-Date $TaskLine = "$d - $VM migrated successfully from $SourceHostName to $DestinationName" [void]$TaskListBox.items.add($TaskLine) } $SourceVMListBox.enabled = $true $SourceButton.enabled = $true $MigrateButton.Enabled = $false $DestinationListBox.Items.Clear() $ClearMsgButton.Enabled = $true $UndoButton.Enabled = $true $UndoALLButton.Enabled = $true $SaveTaskButton.Enabled = $true } If ($SourceButton.Text -eq "Source - Select VMs") { $DestinationName = $DestinationListBox.SelectedItem If($DestinationButton.Text -eq "Destination Host") { foreach($VM in $SourceVMListBox.CheckedItems) { $SourceName = Get-VM -Name $VM | Get-VMHost | % {$_.name} If($SourceName -ne $DestinationName) { Get-VM -Name $VM | Move-VM -Destination (Get-VMHost $DestinationName) $d = Get-Date $line = "$d - $VM migrated successfully from $SourceName to $DestinationName" [void]$TaskListBox.items.add($line) } Else { $d = Get-Date $MsgLine = "$d - Cannot migrate $VM because the source host and the destination host are the same." [void]$MessagesListBox.items.add($MsgLine) } } } Else { foreach($VM in $SourceVMListBox.CheckedItems) { $VMsize = ((Get-VM -Name $VM | Get-HardDisk | Measure-Object -property CapacityKB -Sum).Sum)/1024 $DBFreeSpace = Get-Datastore -Name $DestinationName | %{$_.FreeSpaceMB} $DBReserved = Get-Datastore -Name $DestinationName | %{$_.CapacityMB * 0.2} $DBAvailableSpace = $DBFreeSpace - $DBReserved If ($VMsize -gt $DBAvailableSpace) { $VMSizeGB = "{0:N1}GB" -f ($VMsize / 1024) $DBFreeSpaceGB = "{0:N1} GB" -f ($DBFreeSpace / 1024) $DBAvailableSpaceGB = "{0:N1} GB" -f ($DBAvailableSpace / 1024) $d = Get-Date $MsgLine = "$d - Cannot migrate $VM (Size = $VMSizeGB) because there is insufficient disk space on $DestinationName (Available = $DBAvailableSpaceGB)." [void]$MessagesListBox.items.add($MsgLine) } Else { $SourceName = Get-VM -Name $VM | Get-Datastore | % {$_.name} If($SourceName -ne $DestinationName) { Get-VM -Name $VM | Move-VM -Datastore ($DestinationName) $d = Get-Date $TaskLine = "$d - $VM migrated successfully from $SourceName to $DestinationName" [void]$TaskListBox.items.add($TaskLine) } Else { $d = Get-Date $MsgLine = "$d - Cannot migrate $VM because the source datastore and the destination datastore are the same." [void]$MessagesListBox.items.add($MsgLine) } } } } $SourceVMListBox.enabled = $true $SourceButton.enabled = $true $MigrateButton.Enabled = $false $DestinationListBox.Items.Clear() $ClearMsgButton.Enabled = $true $UndoButton.Enabled = $true $UndoALLButton.Enabled = $true $SaveTaskButton.Enabled = $true } If ($SourceButton.Text -eq "Source - Select a Datastore") { $SourceDBname = $SourceDBListBox.SelectedItem $DestinationName = $DestinationListBox.SelectedItem $VMs = Get-Datastore -Name $SourceDBname | Get-VM If($VMs.count -gt 0) { foreach($VM in $VMs) { $VMsize = ((Get-VM -Name $VM | Get-HardDisk | Measure-Object -property CapacityKB -Sum).Sum)/1024 $DBFreeSpace = Get-Datastore -Name $DestinationName | %{$_.FreeSpaceMB} $DBReserved = Get-Datastore -Name $DestinationName | %{$_.CapacityMB * 0.2} $DBAvailableSpace = $DBFreeSpace - $DBReserved If ($VMsize -gt $DBFreeSpace) { $VMSizeGB = "{0:N1}GB" -f ($VMsize / 1024) $DBFreeSpaceGB = "{0:N1} GB" -f ($DBFreeSpace / 1024) $DBAvailableSpaceGB = "{0:N1} GB" -f ($DBAvailableSpace / 1024) $d = Get-Date $MsgLine = "$d - Cannot migrate $VM (Size = $VMSizeGB) because there is insufficient disk space on $DestinationName (Available = $DBAvailableSpaceGB)." [void]$MessagesListBox.items.add($MsgLine) } Else { Get-VM -Name $VM | Move-VM -Datastore ($DestinationName) $d = Get-Date $line = "$d - $VM migrated successfully from $SourceDBName to $DestinationName" [void]$TaskListBox.items.add($line) } } } Else { $d = Get-Date $MsgLine = "$d - No VM is present on the source datastore $SourceDBname." [void]$MessagesListBox.items.add($MsgLine) } $SourceDBListBox.enabled = $true $SourceButton.enabled = $true $DestinationListBox.Items.Clear() $MigrateButton.Enabled = $false $ClearMsgButton.Enabled = $true $UndoButton.Enabled = $true $UndoALLButton.Enabled = $true $SaveTaskButton.Enabled = $true } } $RESETButton_OnClick= { #TODO: Place custom script here $ClusterListBox.Enabled = $true $HostToHostButton.Enabled = $true $VMToHostButton.Enabled = $true $DBtoDBButton.Enabled = $true $VMtoDBButton.Enabled = $true $SourceHostListBox.Items.Clear() $SourceDBListBox.Items.Clear() $SourceVMListBox.Items.Clear() $SourceButton.Enabled = $false $SourceButton.Text = 'Source' $DestinationListBox.Items.Clear() $DestinationButton.Enabled = $false $DestinationButton.Text = 'Destination' $MigrateButton.Enabled = $false $MigrationForm.Controls.Remove($SourceHostListBox) $MigrationForm.Controls.Remove($SourceVMListBox) $MigrationForm.Controls.Remove($SourceDBListBox) $MigrationForm.Controls.Add($SourceHostListBox) $HostToHostButton.BackColor = [System.Drawing.Color]::Transparent $VMToHostButton.BackColor = [System.Drawing.Color]::Transparent $DBtoDBButton.BackColor = [System.Drawing.Color]::Transparent $VMtoDBButton.BackColor = [System.Drawing.Color]::Transparent } $ChangeVCButton_OnClick= { #TODO: Place custom script here $VCTextBox.Text = "" $VCTextBox.Enabled = $true $LoginButton.Enabled = $true $ClusterListBox.Items.Clear() $ClusterListBox.Enabled = $false $HostToHostButton.Enabled = $false $VMToHostButton.Enabled = $false $DBtoDBButton.Enabled = $false $VMtoDBButton.Enabled = $false $SourceHostListBox.Items.Clear() $SourceDBListBox.Items.Clear() $SourceVMListBox.Items.Clear() $SourceButton.Enabled = $false $SourceButton.Text = 'Source' $DestinationListBox.Items.Clear() $DestinationButton.Enabled = $false $DestinationButton.Text = 'Destination' $MigrateButton.Enabled = $false $ResetButton.Enabled = $false $ChangeVCButton.Enabled = $false $MessagesListBox.Items.Clear() $TaskListBox.Items.Clear() $MigrationForm.Controls.Remove($SourceHostListBox) $MigrationForm.Controls.Remove($SourceVMListBox) $MigrationForm.Controls.Remove($SourceDBListBox) $MigrationForm.Controls.Add($SourceHostListBox) $HostToHostButton.BackColor = [System.Drawing.Color]::Transparent $VMToHostButton.BackColor = [System.Drawing.Color]::Transparent $DBtoDBButton.BackColor = [System.Drawing.Color]::Transparent $VMtoDBButton.BackColor = [System.Drawing.Color]::Transparent #Disconnect from vCenter server Disconnect-VIServer -Confirm:$false } $CloseButton_OnClick= { #TODO: Place custom script here If ($VCTextBox.Text -ne "") { #Disconnect from vCenter server Disconnect-VIServer -Confirm:$false } #Close Form $MigrationForm.close() } $ClearMsgButton_Click= { #TODO: Place custom script here If($MessagesListBox.items.count -eq 0) { [reflection.assembly]::loadwithpartialname('system.windows.forms') [system.Windows.Forms.MessageBox]::show('No messages to clear.') } Else { $MessagesListBox.items.clear() } } $UndoButton_Click= { #TODO: Place custom script here If ($TaskListBox.Items.Count -eq 0) { [reflection.assembly]::loadwithpartialname('system.windows.forms') [system.Windows.Forms.MessageBox]::show('The task list is empty.') } Else { If ($TaskListBox.SelectedItems.Count -eq 0) { [reflection.assembly]::loadwithpartialname('system.windows.forms') [system.Windows.Forms.MessageBox]::show('Please select one or more tasks.') } Else { foreach($Task in $TaskListBox.SelectedItems) { $Task = $Task.split(" ") $VM = $Task[3] $DestinationName = $Task[7] $a = $DestinationName.indexof("SAN") If ($a -lt 0) #If Destination is NOT a datastore { #Perform VMotion $SourceName = Get-VM -name $VM | Get-VMHost | %{$_.name} If($SourceName -ne $DestinationName) { Get-VM -Name $VM | Move-VM -Destination (Get-VMHost $DestinationName) } Else { $d = Get-Date $MsgLine = "$d - Cannot migrate $VM because the source host and the destination host are the same." [void]$MessagesListBox.items.add($MsgLine) } } Else { #Perform SVMotion $VMsize = ((Get-VM -Name $VM | Get-HardDisk | Measure-Object -property CapacityKB -Sum).Sum)/1024 $DBFreeSpace = Get-Datastore -Name $DestinationName | %{$_.FreeSpaceMB} $DBReserved = Get-Datastore -Name $DestinationName | %{$_.CapacityMB * 0.2} $DBAvailableSpace = $DBFreeSpace - $DBReserved If ($VMsize -gt $DBAvailableSpace) { $VMSizeGB = "{0:N1}GB" -f ($VMsize / 1024) $DBFreeSpaceGB = "{0:N1} GB" -f ($DBFreeSpace / 1024) $DBAvailableSpaceGB = "{0:N1} GB" -f ($DBAvailableSpace / 1024) $d = Get-Date $MsgLine = "$d - Cannot migrate $VM (Size = $VMSizeGB) because there is insufficient disk space on $DestinationName (Available = $DBAvailableSpaceGB)." [void]$MessagesListBox.items.add($MsgLine) } Else { $SourceName = Get-VM -Name $VM | Get-Datastore | % {$_.name} If($SourceName -ne $DestinationName) { Get-VM -Name $VM | Move-VM -Datastore ($DestinationName) } Else { $d = Get-Date $MsgLine = "$d - Cannot migrate $VM because the source datastore and the destination datastore are the same." [void]$MessagesListBox.items.add($MsgLine) } } } } While($TaskListBox.SelectedItems.Count -gt 0) { $TaskListBox.Items.Remove($TaskListBox.SelectedItems[0]) } } } } $UndoALLButton_Click= { #TODO: Place custom script here If ($TaskListBox.Items.Count -eq 0) { [reflection.assembly]::loadwithpartialname('system.windows.forms') [system.Windows.Forms.MessageBox]::show('The task list is empty.') } Else { foreach($Task in $TaskListBox.Items) { $Task = $Task.split(" ") $VM = $Task[3] $DestinationName = $Task[7] $a = $DestinationName.indexof("SAN") If ($a -lt 0) #If Destination is NOT a datastore { #Perform VMotion $SourceName = Get-VM -name $VM | Get-VMHost | %{$_.name} If($SourceName -ne $DestinationName) { Get-VM -Name $VM | Move-VM -Destination (Get-VMHost $DestinationName) } Else { $d = Get-Date $MsgLine = "$d - Cannot migrate $VM because the source host and the destination host are the same." [void]$MessagesListBox.items.add($MsgLine) } } Else { #Perform SVMotion $VMsize = ((Get-VM -Name $VM | Get-HardDisk | Measure-Object -property CapacityKB -Sum).Sum)/1024 $DBFreeSpace = Get-Datastore -Name $DestinationName | %{$_.FreeSpaceMB} $DBReserved = Get-Datastore -Name $DestinationName | %{$_.CapacityMB * 0.2} $DBAvailableSpace = $DBFreeSpace - $DBReserved If ($VMsize -gt $DBAvailableSpace) { $VMSizeGB = "{0:N1}GB" -f ($VMsize / 1024) $DBFreeSpaceGB = "{0:N1} GB" -f ($DBFreeSpace / 1024) $DBAvailableSpaceGB = "{0:N1} GB" -f ($DBAvailableSpace / 1024) $d = Get-Date $MsgLine = "$d - Cannot migrate $VM (Size = $VMSizeGB) because there is insufficient disk space on $DestinationName (Available = $DBAvailableSpaceGB)." [void]$MessagesListBox.items.add($MsgLine) } Else { $SourceName = Get-VM -Name $VM | Get-Datastore | % {$_.name} If($SourceName -ne $DestinationName) { Get-VM -Name $VM | Move-VM -Datastore ($DestinationName) } Else { $d = Get-Date $MsgLine = "$d - Cannot migrate $VM because the source datastore and the destination datastore are the same." [void]$MessagesListBox.items.add($MsgLine) } } } } $TaskListBox.Items.Clear() } } $SaveTaskButton_Click= { #TODO: Place custom script here If ($TaskListBox.items.count -eq 0) { [reflection.assembly]::loadwithpartialname('system.windows.forms') [system.Windows.Forms.MessageBox]::show('Nothing to save to log file.') } Else { $SaveFileD = new-object System.Windows.Forms.SaveFileDialog $SaveFileD.Filter = "Log Files (*.log)|*.log"; $SaveFileD.Title = "Save to a log file"; $SaveFileD.FilterIndex = 2; $SaveFileD.RestoreDirectory = $true; if ($SaveFileD.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) { $FileName = $SaveFileD.FileName $Tasks = $TaskListBox.items $logheader = "Easy Migration Tool v1.0 - Log generated on " + (Get-Date) #Save a log file for this session to a location selected by the user Out-File -InputObject $logheader -FilePath $Filename Out-File -InputObject "" -Append -FilePath $FileName Out-File -InputObject $Tasks -Append -FilePath $FileName } } } $ReloadTaskButton_Click= { #TODO: Place custom script here $OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog #$OpenFileDialog.initialDirectory = $initialDirectory $OpenFileDialog.filter = "Log Files (*.log)|*.log" if ($OpenFileDialog.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) { $FileName = $OpenFileDialog.FileName $LinesCount = (Get-Content $FileName).Count $LogLines = Get-Content $FileName | Select -Last ($LinesCount - 2) $TaskListBox.Items.Clear() foreach ($LogLine in $LogLines) { [void]$TaskListBox.items.add($LogLine) } $ClearMsgButton.Enabled = $true $UndoButton.Enabled = $true $UndoALLButton.Enabled = $true $SaveTaskButton.Enabled = $true } } #---------------------------------------------- #region Generated Form Code # Start Main Form $MigrationForm.Text = 'Easy Migration Tool v1.0' $MigrationForm.Font = new-object System.Drawing.Font("Tahoma",8,[System.Drawing.FontStyle]::Bold) $MigrationForm.Name = 'EasyMigrationForm' $MigrationForm.StartPosition = "CenterScreen" $MigrationForm.FormBorderStyle = "FixedDialog" $MigrationForm.MaximizeBox = $false $MigrationForm.MinimizeBox = $false $MigrationForm.DataBindings.DefaultDataSourceUpdateMode = 0 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 1030 $System_Drawing_Size.Height = 500 $MigrationForm.ClientSize = $System_Drawing_Size # End Main Form #Start Easy_Migration Header $Header.Font = new-object System.Drawing.Font("Tahoma",10,[System.Drawing.FontStyle]::Bold) $Header.TextAlign = [System.Drawing.ContentAlignment]::MiddleLeft $Header.Text = 'Easy Migration Tool v1.0' $Header.Location = new-object System.Drawing.Point(150,15) $Header.Size = new-object System.Drawing.Size(230, 20) $MigrationForm.Controls.Add($Header) #End Easy_Migration Header # Start vCenter Server Label $vCenterLabel.TabIndex = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 95 $System_Drawing_Size.Height = 20 $vCenterLabel.Size = $System_Drawing_Size $vCenterLabel.Font = new-object System.Drawing.Font("Tahoma",8,[System.Drawing.FontStyle]::Bold) $vCenterLabel.Text = 'vCenter Server:' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 15 $System_Drawing_Point.Y = 50 $vCenterLabel.Location = $System_Drawing_Point $vCenterLabel.DataBindings.DefaultDataSourceUpdateMode = 0 $vCenterLabel.Name = 'vCenterLabel' $MigrationForm.Controls.Add($vCenterLabel) # End vCenter Server Label # Start vCenter Textbox $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 120 $System_Drawing_Size.Height = 20 $VCTextBox.Size = $System_Drawing_Size $VCTextBox.Font = new-object System.Drawing.Font("Tahoma",8) $VCTextBox.DataBindings.DefaultDataSourceUpdateMode = 0 $VCTextBox.Name = 'VCTextBox' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 110 $System_Drawing_Point.Y = 50 $VCTextBox.Location = $System_Drawing_Point $VCTextBox.TabIndex = 1 $MigrationForm.Controls.Add($VCTextBox) # End vCenter Textbox # Start Login Button $LoginButton.TabIndex = 0 $LoginButton.Name = 'LoginButton' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 95 $System_Drawing_Size.Height = 25 $LoginButton.Size = $System_Drawing_Size $LoginButton.Font = new-object System.Drawing.Font("Tahoma",8) $LoginButton.UseVisualStyleBackColor = $True $LoginButton.Text = 'Login' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 250 $System_Drawing_Point.Y = 48 $LoginButton.Location = $System_Drawing_Point $LoginButton.DataBindings.DefaultDataSourceUpdateMode = 0 $LoginButton.add_Click($LoginButton_Click) $MigrationForm.Controls.Add($LoginButton) # End Login Button # Start Change VC Button $ChangeVCButton.TabIndex = 19 $ChangeVCButton.Name = 'ChangeVCButton' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 95 $System_Drawing_Size.Height = 25 $ChangeVCButton.Size = $System_Drawing_Size $ChangeVCButton.Font = new-object System.Drawing.Font("Tahoma",8) $ChangeVCButton.UseVisualStyleBackColor = $True $ChangeVCButton.Text = 'Change vCenter' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 355 $System_Drawing_Point.Y = 48 $ChangeVCButton.Location = $System_Drawing_Point $ChangeVCButton.DataBindings.DefaultDataSourceUpdateMode = 0 $ChangeVCButton.add_Click($ChangeVCButton_OnClick) $ChangeVCButton.Enabled = $false $MigrationForm.Controls.Add($ChangeVCButton) # End Change VC Button # Start Cluster Listbox $ClusterLabel.TabIndex = 5 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 85 $System_Drawing_Size.Height = 20 $ClusterLabel.Size = $System_Drawing_Size $ClusterLabel.Font = new-object System.Drawing.Font("Tahoma",8,[System.Drawing.FontStyle]::Bold) $ClusterLabel.Text = 'Select Cluster:' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 20 $System_Drawing_Point.Y = 90 $ClusterLabel.Location = $System_Drawing_Point $ClusterLabel.DataBindings.DefaultDataSourceUpdateMode = 0 $ClusterLabel.Name = 'ClusterLabel' $MigrationForm.Controls.Add($ClusterLabel) $ClusterListBox.FormattingEnabled = $True $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 120 $System_Drawing_Size.Height = 100 $ClusterListBox.Size = $System_Drawing_Size $ClusterListBox.Font = new-object System.Drawing.Font("Tahoma",8) $ClusterListBox.DataBindings.DefaultDataSourceUpdateMode = 0 $ClusterListBox.Name = 'ClusterListBox' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 110 $System_Drawing_Point.Y = 90 $ClusterListBox.Location = $System_Drawing_Point $ClusterListBox.MultiColumn = $false $ClusterListBox.TabIndex = 5 $ClusterListBox.Sorted = $True $MigrationForm.Controls.Add($ClusterListBox) # End Cluster Listbox # Start Host to Host Button $HostToHostButton.TabIndex = 3 $HostToHostButton.Name = 'HostToHostButton' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 130 $System_Drawing_Size.Height = 20 $HostToHostButton.Size = $System_Drawing_Size $HostToHostButton.Font = new-object System.Drawing.Font("Tahoma",8) $HostToHostButton.UseVisualStyleBackColor = $True $HostToHostButton.Text = 'Host to Host' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 250 $System_Drawing_Point.Y = 90 $HostToHostButton.Location = $System_Drawing_Point $HostToHostButton.DataBindings.DefaultDataSourceUpdateMode = 0 $HostToHostButton.add_Click($HostToHostButton_Click) $HostToHostButton.Enabled = $false $MigrationForm.Controls.Add($HostToHostButton) # End Host to Host Button # Start VM to Host Button $VMToHostButton.TabIndex = 3 $VMToHostButton.Name = 'VMToHostButton' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 130 $System_Drawing_Size.Height = 20 $VMToHostButton.Size = $System_Drawing_Size $VMToHostButton.Font = new-object System.Drawing.Font("Tahoma",8) $VMToHostButton.UseVisualStyleBackColor = $True $VMToHostButton.Text = 'VM to Host' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 250 $System_Drawing_Point.Y = 115 $VMToHostButton.Location = $System_Drawing_Point $VMToHostButton.DataBindings.DefaultDataSourceUpdateMode = 0 $VMToHostButton.add_Click($VMToHostButton_Click) $VMToHostButton.Enabled = $false $MigrationForm.Controls.Add($VMToHostButton) # End VM to Host Button # Start Datastore to Datastore Button $DBtoDBButton.TabIndex = 3 $DBtoDBButton.Name = 'DBtoDBButton' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 130 $System_Drawing_Size.Height = 20 $DBtoDBButton.Size = $System_Drawing_Size $DBtoDBButton.Font = new-object System.Drawing.Font("Tahoma",8) $DBtoDBButton.UseVisualStyleBackColor = $True $DBtoDBButton.Text = 'Datastore to Datastore' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 250 $System_Drawing_Point.Y = 140 $DBtoDBButton.Location = $System_Drawing_Point $DBtoDBButton.DataBindings.DefaultDataSourceUpdateMode = 0 $DBtoDBButton.add_Click($DBtoDBButton_Click) $DBtoDBButton.Enabled = $false $MigrationForm.Controls.Add($DBtoDBButton) # End Datastore to Datastore Button # Start VM to Datastore Button $VMtoDBButton.TabIndex = 3 $VMtoDBButton.Name = 'VMtoDBButton' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 130 $System_Drawing_Size.Height = 20 $VMtoDBButton.Size = $System_Drawing_Size $VMtoDBButton.Font = new-object System.Drawing.Font("Tahoma",8) $VMtoDBButton.UseVisualStyleBackColor = $True $VMtoDBButton.Text = 'VM to Datastore' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 250 $System_Drawing_Point.Y = 165 $VMtoDBButton.Location = $System_Drawing_Point $VMtoDBButton.DataBindings.DefaultDataSourceUpdateMode = 0 $VMtoDBButton.add_Click($VMtoDBButton_Click) $VMtoDBButton.Enabled = $false $MigrationForm.Controls.Add($VMtoDBButton) # End VM to Datastore Button # Start Source Host List Box $SourceHostListBox.FormattingEnabled = $True $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 200 $System_Drawing_Size.Height = 200 $SourceHostListBox.Size = $System_Drawing_Size $SourceHostListBox.Font = new-object System.Drawing.Font("Tahoma",8) $SourceHostListBox.DataBindings.DefaultDataSourceUpdateMode = 0 $SourceHostListBox.Name = 'SourceHostListBox' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 30 $System_Drawing_Point.Y = 210 $SourceHostListBox.Location = $System_Drawing_Point $SourceHostListBox.MultiColumn = $false $SourceHostListBox.TabIndex = 5 $SourceHostListBox.Sorted = $True $MigrationForm.Controls.Add($SourceHostListBox) # End Source Host List Box # Start Source Datastore List Box $SourceDBListBox.FormattingEnabled = $True $SourceDBListBox.CheckOnClick = $True $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 200 $System_Drawing_Size.Height = 200 $SourceDBListBox.Size = $System_Drawing_Size $SourceDBListBox.Font = new-object System.Drawing.Font("Tahoma",8) $SourceDBListBox.DataBindings.DefaultDataSourceUpdateMode = 0 $SourceDBListBox.Name = 'SourceDBListBox' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 30 $System_Drawing_Point.Y = 210 $SourceDBListBox.Location = $System_Drawing_Point $SourceDBListBox.MultiColumn = $false $SourceDBListBox.HorizontalScrollBar = $true $SourceDBListBox.TabIndex = 5 $SourceDBListBox.Sorted = $True # End Source Datastore List Box # Start Source VM List Box $SourceVMListBox.FormattingEnabled = $True $SourceVMListBox.CheckOnClick = $True $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 200 $System_Drawing_Size.Height = 200 $SourceVMListBox.Size = $System_Drawing_Size $SourceVMListBox.Font = new-object System.Drawing.Font("Tahoma",8) $SourceVMListBox.DataBindings.DefaultDataSourceUpdateMode = 0 $SourceVMListBox.Name = 'SourceVMListBox' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 30 $System_Drawing_Point.Y = 210 $SourceVMListBox.Location = $System_Drawing_Point $SourceVMListBox.MultiColumn = $false $SourceVMListBox.TabIndex = 5 $SourceVMListBox.Sorted = $True # End Source VM List Box # Start Source Button $SourceButton.TabIndex = 7 $SourceButton.Name = 'Source Button' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 200 $System_Drawing_Size.Height = 20 $SourceButton.Size = $System_Drawing_Size $SourceButton.Font = new-object System.Drawing.Font("Tahoma",8) $SourceButton.UseVisualStyleBackColor = $True $SourceButton.Text = 'Source' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 30 $System_Drawing_Point.Y = 415 $SourceButton.Location = $System_Drawing_Point $SourceButton.DataBindings.DefaultDataSourceUpdateMode = 0 $SourceButton.add_Click($SourceButton_OnClick) $SourceButton.Enabled = $false $MigrationForm.Controls.Add($SourceButton) # End Source Button # Start Destination List Box $DestinationListBox.FormattingEnabled = $True $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 200 $System_Drawing_Size.Height = 200 $DestinationListBox.Size = $System_Drawing_Size $DestinationListBox.Font = new-object System.Drawing.Font("Tahoma",8) $DestinationListBox.DataBindings.DefaultDataSourceUpdateMode = 0 $DestinationListBox.Name = 'DestinationListBox' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 250 $System_Drawing_Point.Y = 210 $DestinationListBox.Location = $System_Drawing_Point $DestinationListBox.HorizontalScrollBar = $true $DestinationListBox.MultiColumn = $false $DestinationListBox.TabIndex = 5 $DestinationListBox.Sorted = $True $MigrationForm.Controls.Add($DestinationListBox) # End Destination List Box # Start Destination Button $DestinationButton.TabIndex = 7 $DestinationButton.Name = 'Destination Button' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 200 $System_Drawing_Size.Height = 20 $DestinationButton.Size = $System_Drawing_Size $DestinationButton.Font = new-object System.Drawing.Font("Tahoma",8) $DestinationButton.UseVisualStyleBackColor = $True $DestinationButton.Text = 'Destination' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 250 $System_Drawing_Point.Y = 415 $DestinationButton.Location = $System_Drawing_Point $DestinationButton.DataBindings.DefaultDataSourceUpdateMode = 0 $DestinationButton.add_Click($DestinationButton_OnClick) $DestinationButton.Enabled = $false $MigrationForm.Controls.Add($DestinationButton) # End Destination Button # Start Migrate Button $MigrateButton.TabIndex = 7 $MigrateButton.Name = 'MigrateButton' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 130 $System_Drawing_Size.Height = 25 $MigrateButton.Size = $System_Drawing_Size $MigrateButton.Font = new-object System.Drawing.Font("Tahoma",8) $MigrateButton.UseVisualStyleBackColor = $True $MigrateButton.Text = 'Migrate' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 30 $System_Drawing_Point.Y = 450 $MigrateButton.Location = $System_Drawing_Point $MigrateButton.DataBindings.DefaultDataSourceUpdateMode = 0 $MigrateButton.add_Click($MigrateButton_OnClick) $MigrateButton.Enabled = $false $MigrationForm.Controls.Add($MigrateButton) # End Migrate Button # Start RESET Button $ResetButton.TabIndex = 19 $ResetButton.Name = 'ResetButton' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 140 $System_Drawing_Size.Height = 25 $ResetButton.Size = $System_Drawing_Size $ResetButton.Font = new-object System.Drawing.Font("Tahoma",8) $ResetButton.UseVisualStyleBackColor = $True $ResetButton.Text = 'Reset' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 170 $System_Drawing_Point.Y = 450 $ResetButton.Location = $System_Drawing_Point $ResetButton.DataBindings.DefaultDataSourceUpdateMode = 0 $ResetButton.add_Click($ResetButton_OnClick) $ResetButton.Enabled = $false $MigrationForm.Controls.Add($ResetButton) # End RESET Button # Start CLOSE Button $CloseButton.TabIndex = 19 $CloseButton.Name = 'CloseButton' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 130 $System_Drawing_Size.Height = 25 $CloseButton.Size = $System_Drawing_Size $CloseButton.Font = new-object System.Drawing.Font("Tahoma",8) $CloseButton.UseVisualStyleBackColor = $True $CloseButton.Text = 'Close' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 320 $System_Drawing_Point.Y = 450 $CloseButton.Location = $System_Drawing_Point $CloseButton.DataBindings.DefaultDataSourceUpdateMode = 0 $CloseButton.add_Click($CloseButton_OnClick) $MigrationForm.Controls.Add($CloseButton) # End CLOSE Button # Start Messages ListBox $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 80 $System_Drawing_Size.Height = 20 $MessagesLabel.Size = $System_Drawing_Size $MessagesLabel.Font = new-object System.Drawing.Font("Tahoma",8,[System.Drawing.FontStyle]::Bold) $MessagesLabel.Text = 'Messages' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 480 $System_Drawing_Point.Y = 50 $MessagesLabel.Location = $System_Drawing_Point $MessagesLabel.DataBindings.DefaultDataSourceUpdateMode = 0 $MessagesLabel.Name = 'MessagesLabel' $MigrationForm.Controls.Add($MessagesLabel) $MessagesListBox.FormattingEnabled = $True $MessagesListBox.SelectionMode = "None" $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 525 $System_Drawing_Size.Height = 140 $MessagesListBox.Size = $System_Drawing_Size $MessagesListBox.Font = new-object System.Drawing.Font("Tahoma",8) $MessagesListBox.DataBindings.DefaultDataSourceUpdateMode = 0 $MessagesListBox.Name = 'MessagesListBox' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 480 $System_Drawing_Point.Y = 70 $MessagesListBox.Location = $System_Drawing_Point $MessagesListBox.MultiColumn = $false $MessagesListBox.HorizontalScrollbar = $true $MigrationForm.Controls.Add($MessagesListBox) # End Messages ListBox # Start Task ListBox $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 80 $System_Drawing_Size.Height = 20 $TaskLabel.Size = $System_Drawing_Size $TaskLabel.Font = new-object System.Drawing.Font("Tahoma",8,[System.Drawing.FontStyle]::Bold) $TaskLabel.Text = 'Recent Tasks' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 480 $System_Drawing_Point.Y = 215 $TaskLabel.Location = $System_Drawing_Point $TaskLabel.DataBindings.DefaultDataSourceUpdateMode = 0 $TaskLabel.Name = 'TaskLabel' $MigrationForm.Controls.Add($TaskLabel) $TaskListBox.FormattingEnabled = $True $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 525 $System_Drawing_Size.Height = 200 $TaskListBox.Size = $System_Drawing_Size $TaskListBox.Font = new-object System.Drawing.Font("Tahoma",8) $TaskListBox.DataBindings.DefaultDataSourceUpdateMode = 0 $TaskListBox.Name = 'TaskListBox' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 480 $System_Drawing_Point.Y = 235 $TaskListBox.Location = $System_Drawing_Point $TaskListBox.MultiColumn = $false $TaskListBox.HorizontalScrollbar = $true $TaskListBox.SelectionMode = "MultiExtended" $MigrationForm.Controls.Add($TaskListBox) # End Task ListBox # Start Clear Messages Button $ClearMsgButton.TabIndex = 0 $ClearMsgButton.Name = 'ClearMsgButton' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 93 $System_Drawing_Size.Height = 25 $ClearMsgButton.Size = $System_Drawing_Size $ClearMsgButton.Font = new-object System.Drawing.Font("Tahoma",8) $ClearMsgButton.UseVisualStyleBackColor = $True $ClearMsgButton.Enabled = $false $ClearMsgButton.Text = 'Clear Messages' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 480 $System_Drawing_Point.Y = 450 $ClearMsgButton.Location = $System_Drawing_Point $ClearMsgButton.DataBindings.DefaultDataSourceUpdateMode = 0 $ClearMsgButton.add_Click($ClearMsgButton_Click) $MigrationForm.Controls.Add($ClearMsgButton) # End Clear Messages Button # Start Undo Button $UndoButton.TabIndex = 0 $UndoButton.Name = 'UndoButton' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 93 $System_Drawing_Size.Height = 25 $UndoButton.Size = $System_Drawing_Size $UndoButton.Font = new-object System.Drawing.Font("Tahoma",8) $UndoButton.UseVisualStyleBackColor = $True $UndoButton.Enabled = $false $UndoButton.Text = 'Undo' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 588 $System_Drawing_Point.Y = 450 $UndoButton.Location = $System_Drawing_Point $UndoButton.DataBindings.DefaultDataSourceUpdateMode = 0 $UndoButton.add_Click($UndoButton_Click) $MigrationForm.Controls.Add($UndoButton) # End Undo Button # Start UndoALL Button $UndoALLButton.TabIndex = 0 $UndoALLButton.Name = 'UndoALLButton' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 93 $System_Drawing_Size.Height = 25 $UndoALLButton.Size = $System_Drawing_Size $UndoALLButton.Font = new-object System.Drawing.Font("Tahoma",8) $UndoALLButton.UseVisualStyleBackColor = $True $UndoALLButton.Enabled = $false $UndoALLButton.Text = 'Undo ALL' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 696 $System_Drawing_Point.Y = 450 $UndoALLButton.Location = $System_Drawing_Point $UndoALLButton.DataBindings.DefaultDataSourceUpdateMode = 0 $UndoALLButton.add_Click($UndoALLButton_Click) $MigrationForm.Controls.Add($UndoALLButton) # End UndoALL Button # Start Save Task Button $SaveTaskButton.TabIndex = 0 $SaveTaskButton.Name = 'SaveTaskButton' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 93 $System_Drawing_Size.Height = 25 $SaveTaskButton.Size = $System_Drawing_Size $SaveTaskButton.Font = new-object System.Drawing.Font("Tahoma",8) $SaveTaskButton.UseVisualStyleBackColor = $True $SaveTaskButton.Enabled = $false $SaveTaskButton.Text = 'Save Tasks' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 804 $System_Drawing_Point.Y = 450 $SaveTaskButton.Location = $System_Drawing_Point $SaveTaskButton.DataBindings.DefaultDataSourceUpdateMode = 0 $SaveTaskButton.add_Click($SaveTaskButton_Click) $MigrationForm.Controls.Add($SaveTaskButton) # End Save Task Button # Start Load Task Button $ReloadTaskButton.TabIndex = 0 $ReloadTaskButton.Name = 'ReloadTaskButton' $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 93 $System_Drawing_Size.Height = 25 $ReloadTaskButton.Size = $System_Drawing_Size $ReloadTaskButton.Font = new-object System.Drawing.Font("Tahoma",8) $ReloadTaskButton.UseVisualStyleBackColor = $True $ReloadTaskButton.Enabled = $false $ReloadTaskButton.Text = 'Reload Tasks' $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 912 $System_Drawing_Point.Y = 450 $ReloadTaskButton.Location = $System_Drawing_Point $ReloadTaskButton.DataBindings.DefaultDataSourceUpdateMode = 0 $ReloadTaskButton.add_Click($ReloadTaskButton_Click) $MigrationForm.Controls.Add($ReloadTaskButton) # End Load Task Button #endregion Generated Form Code #Save the initial state of the form $InitialFormWindowState = $MigrationForm.WindowState #Init the OnLoad event to correct the initial state of the form $MigrationForm.add_Load($OnLoadForm_StateCorrection) #Show the Form $MigrationForm.ShowDialog()| Out-Null } #End Function #Call the Function GenerateForm
combined_dataset/train/non-malicious/3385.ps1
3385.ps1
function Assert-Throws { param([ScriptBlock] $script, [string] $message) try { &$script } catch { if ($message -ne "") { $actualMessage = $_.Exception.Message Write-Output ("Caught exception: '$actualMessage'") if ($actualMessage -eq $message) { return $true; } else { throw "Expected exception not received: '$message' the actual message is '$actualMessage'"; } } else { return $true; } } throw "No exception occurred"; } function Assert-ThrowsContains { param([ScriptBlock] $script, [string] $compare) try { &$script } catch { if ($message -ne "") { $actualMessage = $_.Exception.Message Write-Output ("Caught exception: '$actualMessage'") if ($actualMessage.Contains($compare)) { return $true; } else { throw "Expected exception does not contain expected text '$compare', the actual message is '$actualMessage'"; } } else { return $true; } } throw "No exception occurred"; } function Assert-Env { param([string[]] $vars) $tmp = Get-Item env: $env = @{} $tmp | % { $env.Add($_.Key, $_.Value)} $vars | % { Assert-True {$env.ContainsKey($_)} "Environment Variable $_ Is Required. Please set the value before running the test"} } function Assert-True { param([ScriptBlock] $script, [string] $message) if (!$message) { $message = "Assertion failed: " + $script } $result = &$script if (-not $result) { Write-Debug "Failure: $message" throw $message } return $true } function Assert-False { param([ScriptBlock] $script, [string] $message) if (!$message) { $message = "Assertion failed: " + $script } $result = &$script if ($result) { throw $message } return $true } function Assert-False { param([ScriptBlock] $script, [string] $message) if (!$message) { $message = "Assertion failed: " + $script } $result = &$script if ($result) { throw $message } return $true } function Assert-NotNull { param([object] $actual, [string] $message) if (!$message) { $message = "Assertion failed because the object is null: " + $actual } if ($actual -eq $null) { throw $message } return $true } function Assert-Exists { param([string] $path, [string] $message) return Assert-True {Test-Path $path} $message } function Assert-AreEqual { param([object] $expected, [object] $actual, [string] $message) if (!$message) { $message = "Assertion failed because expected '$expected' does not match actual '$actual'" } if ($expected -ne $actual) { throw $message } return $true } function Assert-AreEqualArray { param([object] $expected, [object] $actual, [string] $message) if (!$message) { $message = "Assertion failed because expected '$expected' does not match actual '$actual'" } $diff = Compare-Object $expected $actual -PassThru if ($diff -ne $null) { throw $message } return $true } function Assert-AreEqualObjectProperties { param([object] $expected, [object] $actual, [string] $message) $properties = $expected | Get-Member -MemberType "Property" | Select -ExpandProperty Name $diff = Compare-Object $expected $actual -Property $properties if ($diff -ne $null) { if (!$message) { $message = "Assert failed because the objects don't match. Expected: " + $diff[0] + " Actual: " + $diff[1] } throw $message } return $true } function Assert-Null { param([object] $actual, [string] $message) if (!$message) { $message = "Assertion failed because the object is not null: " + $actual } if ($actual -ne $null) { throw $message } return $true } function Assert-AreNotEqual { param([object] $expected, [object] $actual, [string] $message) if (!$message) { $message = "Assertion failed because expected '$expected' does match actual '$actual'" } if ($expected -eq $actual) { throw $message } return $true }
combined_dataset/train/non-malicious/sample_49_66.ps1
sample_49_66.ps1
parameters: artifactsPublishingAdditionalParameters: '' PromoteToChannelIds: '' BARBuildId: '' symbolPublishingAdditionalParameters: '' buildQuality: 'daily' useServicingBuildPools: false stages: - stage: publish displayName: Publishing jobs: - job: publish_assets displayName: Publish Assets and Symbols timeoutInMinutes: 120 variables: - group: DotNet-Symbol-Server-Pats - group: DotNetBuilds storage account tokens - group: AzureDevOps-Artifact-Feeds-Pats - group: DotNet-MSRC-Storage - group: Publish-Build-Assets # Default Maestro++ API Endpoint and API Version - name: MaestroApiEndPoint value: "https://maestro.dot.net" - name: MaestroApiAccessToken value: $(MaestroAccessToken) - name: MaestroApiVersion value: "2020-02-20" pool: # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: name: VSEngSS-MicroBuild2022-1ES demands: Cmd # If it's not devdiv, it's dnceng: # Publishing cannot use /eng/common/templates/variables/pool-providers.yml since it always runs from 'main', # including in the servicing build case. Instead the 'useServicingBuildPools' parameter dictates this. # If useServicingBuildPools = false, it's a main branch. ${{ if and(ne(variables['System.TeamProject'], 'DevDiv'), eq(parameters['useServicingBuildPools'], false)) }}: name: NetCore1ESPool-Internal demands: ImageOverride -equals windows.vs2019.amd64 # If useServicingBuildPools = true, it's a release branch: ${{ if and(ne(variables['System.TeamProject'], 'DevDiv'), eq(parameters['useServicingBuildPools'], true)) }}: name: NetCore1ESPool-Svc-Internal demands: ImageOverride -equals windows.vs2019.amd64 steps: - task: PowerShell@2 displayName: Validate and Locate Build inputs: targetType: inline pwsh: true script: | # Keeping this script inline so that we don't need to checkout the whole repo to use just one file try { $buildApiEndpoint = "$(MaestroApiEndPoint)/api/builds/${Env:BARBuildId}?api-version=$(MaestroApiVersion)" $apiHeaders = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' $apiHeaders.Add('Accept', 'application/json') $apiHeaders.Add('Authorization',"Bearer ${Env:MAESTRO_API_TOKEN}") $buildInfo = try { Invoke-WebRequest -Method Get -Uri $buildApiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } if (!$buildInfo) { Write-Host "Build with BAR ID ${Env:BARBuildId} was not found in BAR!" exit 1 } $channels = ${Env:PromoteToChannelIds} -split "-" $channelNames = @() foreach ($channelId in $channels) { $channelApiEndpoint = "$(MaestroApiEndPoint)/api/channels/${channelId}?api-version=$(MaestroApiVersion)" $channelInfo = try { Invoke-WebRequest -Method Get -Uri $channelApiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } if (!$channelInfo) { Write-Host "Channel with ID ${channelId} was not found in BAR. Aborting." exit 1 } $channelNames += "'$($channelInfo.name)'" } $azureDevOpsBuildNumber = $buildInfo.azureDevOpsBuildNumber $azureDevOpsRepository = "Unknown" $lastIndexOfSlash = $buildInfo.azureDevOpsRepository.LastIndexOf('/') if ($lastIndexOfSlash -ne -1) { $azureDevOpsRepository = $buildInfo.azureDevOpsRepository.Substring($lastIndexOfSlash + 1) # Invalid chars in Azdo build number: '"', '/', ':', '<', '>', '\', '|', '?', '@', and '*' $azureDevOpsRepository = $azureDevOpsRepository -replace '["/:<>\\|?@*"]', '_' } $channelNames = $channelNames -join ", " $buildNumberName = "Promoting $azureDevOpsRepository build $azureDevOpsBuildNumber (${Env:BARBuildId}) to channel(s) $channelNames #" # Maximum buildnumber length is 255 chars if ($buildNumberName.Length -GT 255) { $buildNumberName = $buildNumberName.Substring(0, 255) } # Set tags on publishing for visibility Write-Host "##vso[build.updatebuildnumber]$buildNumberName" Write-Host "##vso[build.addbuildtag]Channel(s) - $channelNames" Write-Host "##vso[build.addbuildtag]BAR ID - ${Env:BARBuildId}" # Set variables used in publishing. Write-Host "##vso[task.setvariable variable=AzDOProject]$($buildInfo.azureDevOpsProject)" Write-Host "##vso[task.setvariable variable=AzDOPipelineId]$($buildInfo.azureDevOpsBuildDefinitionId)" Write-Host "##vso[task.setvariable variable=AzDOBuildId]$($buildInfo.azureDevOpsBuildId)" Write-Host "##vso[task.setvariable variable=AzDOAccount]$($buildInfo.azureDevOpsAccount)" Write-Host "##vso[task.setvariable variable=AzDOBranch]$($buildInfo.azureDevOpsBranch)" } catch { Write-Host $_ Write-Host $_.Exception Write-Host $_.ScriptStackTrace exit 1 } env: MAESTRO_API_TOKEN: $(MaestroApiAccessToken) BARBuildId: ${{ parameters.BARBuildId }} PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - task: DownloadBuildArtifacts@0 displayName: Download Build Assets continueOnError: true enabled: true inputs: buildType: specific buildVersionToDownload: specific project: $(AzDOProject) pipeline: $(AzDOPipelineId) buildId: $(AzDOBuildId) downloadType: 'specific' itemPattern: | AssetManifests/** BlobArtifacts/MergedManifest.xml PdbArtifacts/** ReleaseConfigs/SymbolPublishingExclusionsFile.txt downloadPath: '$(Build.ArtifactStagingDirectory)' - task: NuGetToolInstaller@1 displayName: 'Install NuGet.exe' # This is necessary whenever we want to publish/restore to an AzDO private feed - task: NuGetAuthenticate@1 displayName: 'Authenticate to AzDO Feeds' - task: PowerShell@2 displayName: Enable cross-org publishing inputs: filePath: $(Build.SourcesDirectory)/eng/common/enable-cross-org-publishing.ps1 arguments: -token $(dn-bot-all-orgs-artifact-feeds-rw) - task: PowerShell@2 displayName: Publish packages, blobs and symbols inputs: filePath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet /p:PublishingInfraVersion=3 /p:BARBuildId=${{ parameters.BARBuildId }} /p:TargetChannels='${{ parameters.PromoteToChannelIds }}' /p:IsInternalBuild=${{ contains(variables['AzDOBranch'], 'internal/') }} /p:NugetPath=$(NuGetExeToolPath) /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' /p:PublishInstallersAndChecksums=true /p:AzureDevOpsFeedsKey='$(dn-bot-all-orgs-artifact-feeds-rw)' /p:AkaMSClientId=$(akams-client-id) /p:AkaMSClientSecret=$(akams-client-secret) ${{ parameters.artifactsPublishingAdditionalParameters }} /p:PDBArtifactsBasePath='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' /p:SymbolPublishingExclusionsFile='$(Build.ArtifactStagingDirectory)/ReleaseConfigs/SymbolPublishingExclusionsFile.txt' ${{ parameters.symbolPublishingAdditionalParameters}} /p:MsdlToken=$(microsoft-symbol-server-pat) /p:SymWebToken=$(symweb-symbol-server-pat) /p:BuildQuality='${{ parameters.buildQuality }}' /p:AzdoApiToken='$(dn-bot-all-orgs-build-rw-code-rw)' /p:ArtifactsBasePath='$(Build.ArtifactStagingDirectory)/' /p:BuildId='$(AzDOBuildId)' /p:AzureDevOpsOrg='$(AzDOAccount)' /p:AzureProject='$(AzDOProject)' /p:UseStreamingPublishing='true' /p:StreamingPublishingMaxClients=16 /p:NonStreamingPublishingMaxClients=12 /p:DotNetBuildsPublicUriBase64='$(dotnetbuilds-public-container-uri-base64)' /p:DotNetBuildsPublicChecksumsUriBase64='$(dotnetbuilds-public-container-checksum-uri-base64)' /p:DotNetBuildsInternalUriBase64='$(dotnetbuilds-internal-container-uri-base64)' /p:DotNetBuildsInternalChecksumsUriBase64='$(dotnetbuilds-internal-container-checksum-uri-base64)' /p:DotNetCliMsrcDotNetUriBase64='$(dotnetclimsrc-dotnet-container-uri-base64)' /p:DotNetCliChecksumsMsrcDotNetUriBase64='$(dotnetclichecksumsmsrc-dotnet-container-uri-base64)' - template: /eng/common/templates/steps/publish-logs.yml parameters: StageLabel: '${{ parameters.stageName }}' JobLabel: 'AssetsPublishing'
combined_dataset/train/non-malicious/1567.ps1
1567.ps1
function Get-MrParameterAlias { [CmdletBinding()] param ( [Parameter(Mandatory)] [string]$Name ) (Get-Command -Name $Name).Parameters.Values | Where-Object Aliases | Select-Object -Property Name, Aliases }
combined_dataset/train/non-malicious/2281.ps1
2281.ps1
param( [parameter(Mandatory=$true)] [string]$RBOptionFirst, [parameter(Mandatory=$true)] [string]$RBOptionSecond, [parameter(Mandatory=$true)] [string]$DomainName, [parameter(Mandatory=$true)] [string]$DomainSuffix, [parameter(Mandatory=$true)] [string[]]$LocationList ) function Load-Form { $Form.Controls.AddRange(@($RBOption1, $RBOption2, $ComboBox, $Button, $GBSystem, $GBLocation)) $ComboBox.Items.AddRange($LocationList) $Form.Add_Shown({$Form.Activate()}) [void]$Form.ShowDialog() } function Set-OULocation { param( [parameter(Mandatory=$true)] $Location ) if ($RBOption1.Checked -eq $true) { $OULocation = "LDAP://OU=$($RBOptionFirst),OU=$($Location),DC=$($DomainName),DC=$($DomainSuffix)" } if ($RBOption2.Checked -eq $true) { $OULocation = "LDAP://OU=$($RBOptionSecond),OU=$($Location),DC=$($DomainName),DC=$($DomainSuffix)" } $TSEnvironment = New-Object -COMObject Microsoft.SMS.TSEnvironment $TSEnvironment.Value("OSDDomainOUName") = "$($OULocation)" $Form.Close() } [void][System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") [void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") $Form = New-Object System.Windows.Forms.Form $Form.Size = New-Object System.Drawing.Size(260,220) $Form.MinimumSize = New-Object System.Drawing.Size(260,220) $Form.MaximumSize = New-Object System.Drawing.Size(260,220) $Form.SizeGripStyle = "Hide" $Form.StartPosition = "CenterScreen" $Form.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($PSHome + "\powershell.exe") $Form.Text = "Choose a location" $Form.ControlBox = $false $Form.TopMost = $true $GBSystem = New-Object System.Windows.Forms.GroupBox $GBSystem.Location = New-Object System.Drawing.Size(10,10) $GBSystem.Size = New-Object System.Drawing.Size(220,60) $GBSystem.Text = "Select system" $GBLocation = New-Object System.Windows.Forms.GroupBox $GBLocation.Location = New-Object System.Drawing.Size(10,80) $GBLocation.Size = New-Object System.Drawing.Size(220,60) $GBLocation.Text = "Select location" $RBOption1 = New-Object System.Windows.Forms.RadioButton $RBOption1.Location = New-Object System.Drawing.Size(20,33) $RBOption1.Size = New-Object System.Drawing.Size(100,20) $RBOption1.Text = "$($RBOptionFirst)" $RBOption1.Add_MouseClick({$ComboBox.Enabled = $true}) $RBOption2 = New-Object System.Windows.Forms.RadioButton $RBOption2.Location = New-Object System.Drawing.Size(120,33) $RBOption2.Size = New-Object System.Drawing.Size(100,20) $RBOption2.Text = "$($RBOptionSecond)" $RBOption2.Add_MouseClick({$ComboBox.Enabled = $true}) $ComboBox = New-Object System.Windows.Forms.ComboBox $ComboBox.Location = New-Object System.Drawing.Size(20,105) $ComboBox.Size = New-Object System.Drawing.Size(200,30) $ComboBox.DropDownStyle = "DropDownList" $ComboBox.Add_SelectedValueChanged({$Button.Enabled = $true}) $ComboBox.Enabled = $false $Button = New-Object System.Windows.Forms.Button $Button.Location = New-Object System.Drawing.Size(140,145) $Button.Size = New-Object System.Drawing.Size(80,25) $Button.Text = "OK" $Button.Enabled = $false $Button.Add_Click({Set-OULocation -Location $ComboBox.SelectedItem.ToString()}) Load-Form
combined_dataset/train/non-malicious/sample_3_2.ps1
sample_3_2.ps1
#************************************************ # DC_DhcpServer-Component.ps1 # Version x # Date: 2009-2014 # Author: Boyd Benson ([email protected]) # Description: Collects information about DHCP Server. # Called from: Networking Diags #******************************************************* 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 } Import-LocalizedData -BindingVariable ScriptVariable Write-DiagProgress -Activity $ScriptVariable.ID_CTSDHCPServer -Status $ScriptVariable.ID_CTSDHCPServerDescription function RunNetSH ([string]$NetSHCommandToExecute="") { Write-DiagProgress -Activity $ScriptVariable.ID_CTSDHCPServer -Status "netsh $NetSHCommandToExecute" $NetSHCommandToExecuteLength = $NetSHCommandToExecute.Length + 6 "-" * ($NetSHCommandToExecuteLength) + "`r`n" + "netsh $NetSHCommandToExecute" + "`r`n" + "-" * ($NetSHCommandToExecuteLength) | Out-File -FilePath $OutputFile -append $CommandToExecute = "cmd.exe /c netsh.exe " + $NetSHCommandToExecute + " >> $OutputFile " RunCmD -commandToRun $CommandToExecute -CollectFiles $false } function RunPS ([string]$RunPScmd="", [switch]$ft) { $RunPScmdLength = $RunPScmd.Length "-" * ($RunPScmdLength) | Out-File -FilePath $OutputFile -append "$RunPScmd" | Out-File -FilePath $OutputFile -append "-" * ($RunPScmdLength) | Out-File -FilePath $OutputFile -append if ($ft) { # This format-table expression is useful to make sure that wide ft output works correctly Invoke-Expression $RunPScmd |format-table -autosize -outvariable $FormatTableTempVar | Out-File -FilePath $outputFile -Width 500 -append } else { Invoke-Expression $RunPScmd | Out-File -FilePath $OutputFile -append } "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append } $sectionDescription = "DHCP Server" # detect OS version and SKU $wmiOSVersion = Get-CimInstance -Namespace "root\cimv2" -Class Win32_OperatingSystem [int]$bn = [int]$wmiOSVersion.BuildNumber #----------W8/WS2012 powershell cmdlets $outputFile= $Computername + "_DhcpServer_info_pscmdlets.TXT" "====================================================" | Out-File -FilePath $OutputFile -append "DHCP Server Powershell Cmdlets" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append "Overview" | Out-File -FilePath $OutputFile -append "----------------------------------------------------" | Out-File -FilePath $OutputFile -append "DHCP Server Settings" | Out-File -FilePath $OutputFile -append " 1. Get-DhcpServerAuditLog" | Out-File -FilePath $OutputFile -append " 2. Get-DhcpServerDatabase" | Out-File -FilePath $OutputFile -append " 3. Get-DhcpServerDnsCredential" | Out-File -FilePath $OutputFile -append " 4. Get-DhcpServerInDC" | Out-File -FilePath $OutputFile -append " 5. Get-DhcpServerSetting" | Out-File -FilePath $OutputFile -append "----------------------------------------------------" | Out-File -FilePath $OutputFile -append "DHCP Server v4" | Out-File -FilePath $OutputFile -append " 1. Get-DhcpServerv4Binding" | Out-File -FilePath $OutputFile -append " 2. Get-DhcpServerv4Class" | Out-File -FilePath $OutputFile -append " 3. Get-DhcpServerv4DnsSetting" | Out-File -FilePath $OutputFile -append " 4. Get-DhcpServerv4ExclusionRange" | Out-File -FilePath $OutputFile -append " 5. Get-DhcpServerv4Failover" | Out-File -FilePath $OutputFile -append " 6. Get-DhcpServerv4Filter" | Out-File -FilePath $OutputFile -append " 7. Get-DhcpServerv4FilterList" | Out-File -FilePath $OutputFile -append " 8. Get-DhcpServerv4MulticastExclusionRange" | Out-File -FilePath $OutputFile -append " 9. Get-DhcpServerv4MulticastScope" | Out-File -FilePath $OutputFile -append " 10. Get-DhcpServerv4MulticastScopeStatististics" | Out-File -FilePath $OutputFile -append " 11. Get-DhcpServerv4OptionDefinition" | Out-File -FilePath $OutputFile -append " 12. Get-DhcpServerv4OptionValue" | Out-File -FilePath $OutputFile -append " 13. Get-DhcpServerv4Policy" | Out-File -FilePath $OutputFile -append " 14. Get-DhcpServerv4Scope" | Out-File -FilePath $OutputFile -append " 15. Get-DhcpServerv4ScopeStatistics" | Out-File -FilePath $OutputFile -append " 16. Get-DhcpServerv4Statistics" | Out-File -FilePath $OutputFile -append " 17. Get-DhcpServerv4Superscope" | Out-File -FilePath $OutputFile -append " 18. Get-DhcpServerv4SuperscopeStatistics" | Out-File -FilePath $OutputFile -append "----------------------------------------------------" | Out-File -FilePath $OutputFile -append "DHCP Server v6" | Out-File -FilePath $OutputFile -append " 1. Get-DhcpServerv6Binding" | Out-File -FilePath $OutputFile -append " 2. Get-DhcpServerv6Class" | Out-File -FilePath $OutputFile -append " 3. Get-DhcpServerv6DnsSetting" | Out-File -FilePath $OutputFile -append " 4. Get-DhcpServerv6ExclusionRange" | Out-File -FilePath $OutputFile -append " 5. Get-DhcpServerv6OptionDefinition" | Out-File -FilePath $OutputFile -append " 6. Get-DhcpServerv6OptionValue" | Out-File -FilePath $OutputFile -append " 7. Get-DhcpServerv6Scope" | Out-File -FilePath $OutputFile -append " 8. Get-DhcpServerv6ScopeStatistics" | Out-File -FilePath $OutputFile -append " 9. Get-DhcpServerv6StatelessStatistics" | Out-File -FilePath $OutputFile -append " 10. Get-DhcpServerv6StatelessStore" | Out-File -FilePath $OutputFile -append " 11.Get-DhcpServerv6Statistics" | Out-File -FilePath $OutputFile -append "----------------------------------------------------" | Out-File -FilePath $OutputFile -append "DHCP Server Version" | Out-File -FilePath $OutputFile -append " 1. Get-DhcpServerVersion" | Out-File -FilePath $OutputFile -append "----------------------------------------------------" | Out-File -FilePath $OutputFile -append "DHCP Server Failover Statistics" | Out-File -FilePath $OutputFile -append " 1. DHCP Server Failover Statistics Per Scope" | Out-File -FilePath $OutputFile -append " (using Get-DhcpServer4Failover and Get-DhcpServerv4ScopeStatistics)" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append $dhcpServerCheck = Test-path "HKLM:\SYSTEM\CurrentControlSet\Services\DHCPserver" if ($dhcpServerCheck) { if ((Get-Service "DHCPserver").Status -eq 'Running') { if ($bn -ge 9200) { # The powershell cmdlets that have been removed by comment because they require input "====================================================" | Out-File -FilePath $OutputFile -append "DHCP Server Settings" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append RunPS "Get-DhcpServerAuditLog" # W8/WS2012, W8.1/WS2012R2 #fl RunPS "Get-DhcpServerDatabase" # W8/WS2012, W8.1/WS2012R2 #fl RunPS "Get-DhcpServerDnsCredential" -ft # W8/WS2012, W8.1/WS2012R2 #ft RunPS "Get-DhcpServerInDC" -ft # W8/WS2012, W8.1/WS2012R2 #ft RunPS "Get-DhcpServerSetting" # W8/WS2012, W8.1/WS2012R2 #fl "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append "DHCP Server v4" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append RunPS "Get-DhcpServerv4Binding" -ft # W8/WS2012, W8.1/WS2012R2 #ft RunPS "Get-DhcpServerv4Class" -ft # W8/WS2012, W8.1/WS2012R2 #ft RunPS "Get-DhcpServerv4DnsSetting" # W8/WS2012, W8.1/WS2012R2 #fl RunPS "Get-DhcpServerv4ExclusionRange" -ft # W8/WS2012, W8.1/WS2012R2 #ft RunPS "Get-DhcpServerv4Failover" # W8/WS2012, W8.1/WS2012R2 #unknown RunPS "Get-DhcpServerv4Filter" # W8/WS2012, W8.1/WS2012R2 #unknown RunPS "Get-DhcpServerv4FilterList" -ft # W8/WS2012, W8.1/WS2012R2 #ft #RunPS "Get-DhcpServerv4FreeIPAddress" # W8/WS2012, W8.1/WS2012R2 #RunPS "Get-DhcpServerv4Lease" # W8/WS2012, W8.1/WS2012R2 RunPS "Get-DhcpServerv4MulticastExclusionRange" # W8/WS2012, W8.1/WS2012R2 #unknown #RunPS "Get-DhcpServerv4MulticastLease" # W8/WS2012, W8.1/WS2012R2 RunPS "Get-DhcpServerv4MulticastScope" # W8/WS2012, W8.1/WS2012R2 #unknown RunPS "Get-DhcpServerv4MulticastScopeStatistics" # W8/WS2012, W8.1/WS2012R2 #unknown RunPS "Get-DhcpServerv4OptionDefinition" -ft # W8/WS2012, W8.1/WS2012R2 #ft RunPS "Get-DhcpServerv4OptionValue" # W8/WS2012, W8.1/WS2012R2 #unknown RunPS "Get-DhcpServerv4Policy" # W8/WS2012, W8.1/WS2012R2 #unknown #RunPS "Get-DhcpServerv4PolicyIPRange" # W8/WS2012, W8.1/WS2012R2 #RunPS "Get-DhcpServerv4Reservation" # W8/WS2012, W8.1/WS2012R2 RunPS "Get-DhcpServerv4Scope" -ft # W8/WS2012, W8.1/WS2012R2 #ft RunPS "Get-DhcpServerv4ScopeStatistics" -ft # W8/WS2012, W8.1/WS2012R2 #ft RunPS "Get-DhcpServerv4Statistics" # W8/WS2012, W8.1/WS2012R2 #fl RunPS "Get-DhcpServerv4Superscope" # W8/WS2012, W8.1/WS2012R2 #fl RunPS "Get-DhcpServerv4SuperscopeStatistics" # W8/WS2012, W8.1/WS2012R2 #unknown "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append "DHCP Server v6" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append RunPS "Get-DhcpServerv6Binding" # W8/WS2012, W8.1/WS2012R2 #unknown RunPS "Get-DhcpServerv6Class" -ft # W8/WS2012, W8.1/WS2012R2 #ft RunPS "Get-DhcpServerv6DnsSetting" # W8/WS2012, W8.1/WS2012R2 #fl RunPS "Get-DhcpServerv6ExclusionRange" # W8/WS2012, W8.1/WS2012R2 #unknown #RunPS "Get-DhcpServerv6FreeIPAddress" # W8/WS2012, W8.1/WS2012R2 #RunPS "Get-DhcpServerv6Lease" # W8/WS2012, W8.1/WS2012R2 RunPS "Get-DhcpServerv6OptionDefinition" -ft # W8/WS2012, W8.1/WS2012R2 #ft RunPS "Get-DhcpServerv6OptionValue" # W8/WS2012, W8.1/WS2012R2 #unknown #RunPS "Get-DhcpServerv6Reservation" # W8/WS2012, W8.1/WS2012R2 RunPS "Get-DhcpServerv6Scope" # W8/WS2012, W8.1/WS2012R2 #unknown RunPS "Get-DhcpServerv6ScopeStatistics" # W8/WS2012, W8.1/WS2012R2 #unknown RunPS "Get-DhcpServerv6StatelessStatistics" # W8/WS2012, W8.1/WS2012R2 #unknown RunPS "Get-DhcpServerv6StatelessStore" -ft # W8/WS2012, W8.1/WS2012R2 #ft RunPS "Get-DhcpServerv6Statistics" # W8/WS2012, W8.1/WS2012R2 #fl "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append "DHCP Server Version" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append RunPS "Get-DhcpServerVersion" # W8/WS2012, W8.1/WS2012R2 #fl "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append "DHCP Server Failover Statistics" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append "----------------------------------------------------" | Out-File -FilePath $OutputFile -append "DHCP Server Failover Statistics Per Scope" | Out-File -FilePath $OutputFile -append " (using Get-DhcpServer4Failover and Get-DhcpServerv4ScopeStatistics)" | Out-File -FilePath $OutputFile -append "----------------------------------------------------" | Out-File -FilePath $OutputFile -append $dhcpSrvFailoverScopes = Get-DhcpServerv4Failover foreach ($scope in $dhcpSrvFailoverScopes) { $scopeId = $scope.ScopeId Get-DhcpServerv4ScopeStatistics -ScopeId $scopeId | Format-List | Out-File -FilePath $OutputFile -append } "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append } else { "This server is not running WS2012 or WS2012 R2. Not running ps cmdlets." | Out-File -FilePath $OutputFile -append } } else { "The `"DHCP Server`" service is not Running. Not running pscmdlets." | Out-File -FilePath $OutputFile -append } } else { "The `"DHCP Server`" service does not exist. Not running ps cmdlets." | Out-File -FilePath $OutputFile -append } "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append CollectFiles -filesToCollect $OutputFile -fileDescription "DHCP Server Information (Powershell)" -SectionDescription $sectionDescription $OutputFile = $ComputerName + "_DhcpServer_netsh_info.TXT" "====================================================" | Out-File -FilePath $OutputFile -append "DHCP Server Netsh Output" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append "Overview" | Out-File -FilePath $OutputFile -append "----------------------------------------" | Out-File -FilePath $OutputFile -append " 1. netsh dhcp show server" | Out-File -FilePath $OutputFile -append " 2. netsh dhcp server show all" | Out-File -FilePath $OutputFile -append " 3. netsh dhcp server show version" | Out-File -FilePath $OutputFile -append " 4. netsh dhcp server show auditlog" | Out-File -FilePath $OutputFile -append " 5. netsh dhcp server show dbproperties" | Out-File -FilePath $OutputFile -append " 6. netsh dhcp server show bindings" | Out-File -FilePath $OutputFile -append " 7. netsh dhcp server show detectconflictretry" | Out-File -FilePath $OutputFile -append " 8. netsh dhcp server show server" | Out-File -FilePath $OutputFile -append " 9. netsh dhcp server show serverstatus" | Out-File -FilePath $OutputFile -append " 10. netsh dhcp server show scope" | Out-File -FilePath $OutputFile -append " 11. netsh dhcp server show superscope" | Out-File -FilePath $OutputFile -append " 12. netsh dhcp server show class" | Out-File -FilePath $OutputFile -append " 13. netsh dhcp server show dnsconfig" | Out-File -FilePath $OutputFile -append " 14. netsh dhcp server show dnscredentials" | Out-File -FilePath $OutputFile -append " 15. netsh dhcp server show mibinfo" | Out-File -FilePath $OutputFile -append " 16. netsh dhcp server show mscope" | Out-File -FilePath $OutputFile -append " 17. netsh dhcp server show optionvalue" | Out-File -FilePath $OutputFile -append " 18. netsh dhcp server show scope" | Out-File -FilePath $OutputFile -append " 19. netsh dhcp server show superscope" | Out-File -FilePath $OutputFile -append " 20. netsh dhcp server show userclass" | Out-File -FilePath $OutputFile -append " 21. netsh dhcp server show vendorclass" | Out-File -FilePath $OutputFile -append " 22. netsh dhcp server show optiondef" | Out-File -FilePath $OutputFile -append "====================================================" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append $dhcpServerCheck = Test-path "HKLM:\SYSTEM\CurrentControlSet\Services\DHCPserver" if ($dhcpServerCheck) { if ((Get-Service "DHCPserver").Status -eq 'Running') { #----------Netsh for DHCP Server RunNetSH -NetSHCommandToExecute "dhcp show server" RunNetSH -NetSHCommandToExecute "dhcp server show all" RunNetSH -NetSHCommandToExecute "dhcp server show version" RunNetSH -NetSHCommandToExecute "dhcp server show auditlog" RunNetSH -NetSHCommandToExecute "dhcp server show dbproperties" RunNetSH -NetSHCommandToExecute "dhcp server show bindings" RunNetSH -NetSHCommandToExecute "dhcp server show detectconflictretry" RunNetSH -NetSHCommandToExecute "dhcp server show server" RunNetSH -NetSHCommandToExecute "dhcp server show serverstatus" RunNetSH -NetSHCommandToExecute "dhcp server show scope" RunNetSH -NetSHCommandToExecute "dhcp server show superscope" RunNetSH -NetSHCommandToExecute "dhcp server show class" RunNetSH -NetSHCommandToExecute "dhcp server show dnsconfig" RunNetSH -NetSHCommandToExecute "dhcp server show dnscredentials" RunNetSH -NetSHCommandToExecute "dhcp server show mibinfo" RunNetSH -NetSHCommandToExecute "dhcp server show mscope" RunNetSH -NetSHCommandToExecute "dhcp server show optionvalue" RunNetSH -NetSHCommandToExecute "dhcp server show scope" RunNetSH -NetSHCommandToExecute "dhcp server show superscope" RunNetSH -NetSHCommandToExecute "dhcp server show userclass" RunNetSH -NetSHCommandToExecute "dhcp server show vendorclass" RunNetSH -NetSHCommandToExecute "dhcp server show optiondef" #-----DHCP Server Dump $filesToCollect = $ComputerName + "_DhcpServer_netsh_dump.TXT" $commandToRun = "netsh dhcp server dump > " + $filesToCollect RunCMD -CommandToRun $commandToRun -filesToCollect $filesToCollect -fileDescription "DHCP Server Netsh Dump" -sectionDescription $sectionDescription } else { "The DHCP Server service is not Running. Not running netsh commands." | Out-File -FilePath $OutputFile -append "The DHCP Server service is not Running. Not running netsh commands." | Out-File -FilePath $filesToCollect -append } } else { "The `"DHCP Server`" service does not exist. Not running netsh commands." | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append "`n" | Out-File -FilePath $OutputFile -append } CollectFiles -sectionDescription $sectionDescription -fileDescription "DHCP Server Netsh Output" -filesToCollect $filesToCollect CollectFiles -sectionDescription $sectionDescription -fileDescription "DHCP Server Netsh Dump" -filesToCollect $OutputFile #----------DHCP Server registry output $SvcKey = "HKLM:\SYSTEM\CurrentControlSet\services\DHCPServer" if (Test-Path $SvcKey) { #----------Registry $OutputFile= $Computername + "_DhcpServer_reg_.TXT" $CurrentVersionKeys = "HKLM\SYSTEM\CurrentControlSet\Services\DHCPServer" $sectionDescription = "DHCP Server" RegQuery -RegistryKeys $CurrentVersionKeys -Recursive $true -OutputFile $OutputFile -fileDescription "DhcpServer Registry Keys" -SectionDescription $sectionDescription } #----------DHCP Server BPA # This runs in the TS_Main.ps1 script. #----------CDHCP Server event logs for WS2008+ if ($OSVersion.Build -gt 6000) { $sectionDescription = "DHCP Server EventLog" #----------Dhcp-Server EventLog / Operational $EventLogNames = "Microsoft-Windows-Dhcp-Server/Operational" $Prefix = "" $Suffix = "_evt_" .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription $sectionDescription -Prefix $Prefix -Suffix $Suffix #----------Dhcp-Server EventLog /Admin #_# $EventLogNames = "Microsoft-Windows-Dhcp-Server/Admin" $EventLogNames = "DhcpAdminEvents", "Microsoft-Windows-Dhcp-Server/FilterNotifications" $Prefix = "" $Suffix = "_evt_" .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription $sectionDescription -Prefix $Prefix -Suffix $Suffix } # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBwmwBFy9WBHf7k # gVllJLw9zTZqhHuEAJmZcN2mx3FOU6CCDXYwggX0MIID3KADAgECAhMzAAAEBGx0 # Bv9XKydyAAAAAAQEMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjQwOTEyMjAxMTE0WhcNMjUwOTExMjAxMTE0WjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQC0KDfaY50MDqsEGdlIzDHBd6CqIMRQWW9Af1LHDDTuFjfDsvna0nEuDSYJmNyz # NB10jpbg0lhvkT1AzfX2TLITSXwS8D+mBzGCWMM/wTpciWBV/pbjSazbzoKvRrNo # DV/u9omOM2Eawyo5JJJdNkM2d8qzkQ0bRuRd4HarmGunSouyb9NY7egWN5E5lUc3 # a2AROzAdHdYpObpCOdeAY2P5XqtJkk79aROpzw16wCjdSn8qMzCBzR7rvH2WVkvF # HLIxZQET1yhPb6lRmpgBQNnzidHV2Ocxjc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ggeXDRRH5xuHZj7iB2o/qyGbSV # 90eZGlv2DxP8I2vbExqe7FLloSop58pqEDEEXJSu69S15OV+hO9FaUzNbDlnjE5U # 4QNMIyk+9DXuNcWWWwfs9V9lnoYAhmfY8DSS9XLNtDSnivzkW/31IVawjQnLvDMR # 8tUBQudXCuNsbBOOigCteGd/wGiCMTlIIzlm4mVSy0EdQThLD688hKY8 # SIG # End signature block
combined_dataset/train/non-malicious/sample_61_43.ps1
sample_61_43.ps1
function Get-ValueFromLaunchJson { param ( [Parameter(Mandatory=$false)] [string]$LaunchJsonPath, [Parameter(Mandatory=$false)] $ConfigName, [Parameter(Mandatory=$true)] $KeyName, [Parameter(Mandatory=$false)] $LaunchConfig ) if (![String]::IsNullOrEmpty($LaunchConfig)) { return ($LaunchConfig | ConvertFrom-Json).$KeyName } if ([String]::IsNullOrEmpty($LaunchJsonPath)) { $LaunchJsonPath = Get-LaunchJsonPath } if ([String]::IsNullOrEmpty($ConfigName)) { $ConfigName = (Get-ValueFromALTestRunnerConfig -KeyName 'launchConfigName') } $LaunchJson = Get-LaunchJson -Path $LaunchJsonPath ($LaunchJson.configurations | Where-Object name -eq $ConfigName).$KeyName } function Get-LaunchJson { param ( [Parameter(Mandatory=$true)] [string]$Path ) $LaunchJson = Get-Content $Path $LaunchJson = $LaunchJson | Where-Object {$_.ToString().Trim().StartsWith('//') -eq $false} $LaunchJson = $LaunchJson -join [Environment]::NewLine while (($LaunchJson.IndexOf('/*') -gt 0) -and ($LaunchJson.IndexOf('*/') -gt 0)) { $Start = $LaunchJson.IndexOf('/*') $End = $LaunchJson.IndexOf('*/') $LaunchJson = $LaunchJson.Remove($Start, $End - $Start + 2) } ConvertFrom-Json $LaunchJson } Export-ModuleMember -Function Get-ValueFromLaunchJson Export-ModuleMember -Function Get-LaunchJson
combined_dataset/train/non-malicious/Invoke-MoveRequest.ps1
Invoke-MoveRequest.ps1
########################################################################### # # NAME: Invoke-MoveRequest.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: [email protected] # # COMMENT: Script to use when migrating mailboxes to Microsoft Exchange Server 2010 Cross-Forest. Prepares user objects already # moved to the target forest using Active Directory Migration Tool or other tools, and then invokes the mailbox move request. # For more information, see the following blog-post: http://blog.powershell.no/2010/04/23/exchange-server-2010-cross-forest-migration # # 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 23.04.2010 - Initial release # ########################################################################### #Adding Quest AD PowerShell Commands Snapin and Microsoft Exchange Server 2010 PowerShell Snapin Add-PSSnapin Quest.ActiveRoles.ADManagement Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 #Custom variables, edit this section $TargetDatabase = "Mailbox Database A" $TargetDeliveryDomain = "domain.com" $TargetForest="DomainA.local" $SourceForest="domainB.local" $SourceForestGlobalCatalog = "dc-01.domainB.local" $SourceForestCredential = Get-Credential -Credential "Domain\\SourceForestAdministrator" #Connect to source forest to collect users to migrate Connect-QADService -Service $SourceForest | Out-Null $SourceForestUsersToMigrate = Get-QADUser -SearchRoot "DomainA.local/Department A/Users" foreach ($user in $SourceForestUsersToMigrate) { Write-Host "Processing user $user" -ForegroundColor Yellow #Connect to source forest to collect source object attributes Connect-QADService -Service $SourceForest | Out-Null $TargetObject=$user.samaccountname $SourceObject=Get-QADUser $samaccountname -IncludeAllProperties $mail=$SourceObject.Mail $mailNickname=$SourceObject.mailNickname [byte[]]$msExchMailboxGUID=(Get-QADuser $samaccountname -IncludedProperties msExchMailboxGUID -DontConvertValuesToFriendlyRepresentation).msExchMailboxGUID $msExchRecipientDisplayType="-2147483642" $msExchRecipientTypeDetails="128" $msExchUserCulture=$SourceObject.msExchUserCulture $msExchVersion="44220983382016" $proxyAddresses=$SourceObject.proxyAddresses $targetAddress=$SourceObject.Mail $userAccountControl=514 #Connect to target forest to set target object attributes Connect-QADService -Service $TargetForest | Out-Null Set-QADUser -Identity $TargetObject -ObjectAttributes @{mail=$mail;mailNickname=$mailNickname;msExchMailboxGUID=$msExchMailboxGUID;msExchRecipientDisplayType=$msExchRecipientDisplayType;msExchRecipientTypeDetails=$msExchRecipientTypeDetails;msExchUserCulture=$msExchUserCulture;msExchVersion=$msExchVersion;proxyAddresses=$proxyAddresses;targetAddress=$targetAddress;userAccountControl=$userAccountControl;msExchUserCulture=$msExchUserCulture} | Out-Null #Update Exchange-attributes (LegacyExchangeDN etc.) Get-MailUser $TargetObject | Update-Recipient #Invoking a new move-request New-MoveRequest -Identity $TargetObject -RemoteLegacy -TargetDatabase $TargetDatabase -RemoteGlobalCatalog $SourceForestGlobalCatalog -RemoteCredential $SourceForestCredential -TargetDeliveryDomain $TargetDeliveryDomain #Enable target object and unset "User must change password at next logon" Enable-QADUser -Identity $TargetObject | Out-Null Set-QADUser -Identity $TargetObject -UserMustChangePassword $false | Out-Null }
combined_dataset/train/non-malicious/Google Chromium Download_2.ps1
Google Chromium Download_2.ps1
<# .Synopsis Download Google Chromium if there is a later build. .Description Download Google Chromium if there is a later build. http://poshcode.org/2422 #> Set-StrictMode -Version Latest Import-Module bitstransfer # comment out when not debugging $VerbosePreference = "Continue" #$VerbosePreference = "SilentlyContinue" $versionFile = "$Env:temp\\latestChromiumVersion.txt" $installedChromiumVersion = 0 trap [Exception] { write-host write-error $("TRAPPED: " + $_.Exception.GetType().FullName); write-error $("TRAPPED: " + $_.Exception.Message); [string]($installedChromiumVersion) > $versionFile exit; } if (Test-Path $versionFile) { $installedChromiumVersion = [int32] (cat $versionFile) } #$latestChromiumBuildURL ="http://build.chromium.org/f/chromium/snapshots/chromium-rel-xp" #$latestChromiumBuildURL ="http://build.chromium.org/f/chromium/snapshots/Win" $latestChromiumBuildURL ="http://commondatastorage.googleapis.com/chromium-browser-snapshots/Win" Start-BitsTransfer "$latestChromiumBuildURL/LAST_CHANGE" $versionFile $latestChromiumVersion = [int32] (cat $versionFile) if ($installedChromiumVersion -eq $latestChromiumVersion) { Write-Verbose "Exiting... Version $installedChromiumVersion is the latest. (from $latestChromiumBuildURL/LAST_CHANGE)" return } $installerAppName = "mini_installer" $installer = "$Env:temp\\$installerAppName.exe" Write-Verbose "Initiating download of new version $latestChromiumVersion" Start-BitsTransfer "$latestChromiumBuildURL/$latestChromiumVersion/mini_installer.exe" $installer Write-Verbose "Installing new version of Chromium" Invoke-Item $installer $installerRunning = 1 while (!($installerRunning -eq $null)) { sleep 5 $installerRunning = ( Get-Process | ? {$_.ProcessName -match "$installerAppName"} ) } Write-Verbose "New Chromium Installed! Please restart the Chromium browser"
combined_dataset/train/non-malicious/Remove diacritics.ps1
Remove diacritics.ps1
### Grťgory Schiro, 2009 ### <summary> ### Removes diacritics from string. ### </summary> ### <param name="String">String containing diacritics</param> function Remove-Diacritics([string]$String) { $objD = $String.Normalize([Text.NormalizationForm]::FormD) $sb = New-Object Text.StringBuilder for ($i = 0; $i -lt $objD.Length; $i++) { $c = [Globalization.CharUnicodeInfo]::GetUnicodeCategory($objD[$i]) if($c -ne [Globalization.UnicodeCategory]::NonSpacingMark) { [void]$sb.Append($objD[$i]) } } return("$sb".Normalize([Text.NormalizationForm]::FormC)) }
combined_dataset/train/non-malicious/1532.ps1
1532.ps1
Set-StrictMode -Version latest $ErrorActionPreference = 'Stop' $root = (Resolve-Path $PSScriptRoot\..\..).Path $outFolder = "$root\out" $moduleFolder = "$outFolder\platyPS" Import-Module $moduleFolder -Force $MyIsLinux = Get-Variable -Name IsLinux -ValueOnly -ErrorAction SilentlyContinue $MyIsMacOS = Get-Variable -Name IsMacOS -ValueOnly -ErrorAction SilentlyContinue $global:IsUnix = $MyIsLinux -or $MyIsMacOS Import-LocalizedData -BindingVariable LocalizedData -BaseDirectory $moduleFolder -FileName platyPS.Resources.psd1 Describe 'New-MarkdownHelp' { function normalizeEnds([string]$text) { $text -replace "`r`n?|`n", "`r`n" } Context 'errors' { It 'throw when cannot find module' { { New-MarkdownHelp -Module __NON_EXISTING_MODULE -OutputFolder TestDrive:\ } | Should Throw ($LocalizedData.ModuleNotFound -f '__NON_EXISTING_MODULE') } It 'throw when cannot find module' { { New-MarkdownHelp -command __NON_EXISTING_COMMAND -OutputFolder TestDrive:\ } | Should Throw ($LocalizedData.CommandNotFound -f '__NON_EXISTING_COMMAND') } } Context 'metadata' { It 'generates passed metadata' { $file = New-MarkdownHelp -metadata @{ FOO = 'BAR' } -command New-MarkdownHelp -OutputFolder TestDrive:\ $h = Get-MarkdownMetadata $file $h['FOO'] | Should Be 'BAR' } It 'respects -NoMetadata' { $file = New-MarkdownHelp -command New-MarkdownHelp -OutputFolder TestDrive:\ -NoMetadata -Force Get-MarkdownMetadata $file.FullName | Should Be $null } It 'errors on -NoMetadata and -Metadata' { { New-MarkdownHelp -command New-MarkdownHelp -OutputFolder TestDrive:\ -NoMetadata -Force -Metadata @{} } | Should Throw $LocalizedData.NoMetadataAndMetadata } } Context 'encoding' { $file = New-MarkdownHelp -command New-MarkdownHelp -OutputFolder TestDrive:\ -Force -Encoding ([System.Text.Encoding]::UTF32) $content = $file | Get-Content -Encoding UTF32 -Raw Get-MarkdownMetadata -Markdown $content | Should Not Be $null } Context 'from platyPS module' { It 'creates few help files for platyPS' { $files = New-MarkdownHelp -Module PlatyPS -OutputFolder TestDrive:\platyPS -Force ($files | Measure-Object).Count | Should BeGreaterThan 4 } } Context 'from module' { try { New-Module -Name PlatyPSTestModule -ScriptBlock { function Get-AAAA { } function Get-AdvancedFn { [CmdletBinding()] param ( ) } function Get-SimpleFn { param ( ) } function Set-BBBB { } if (-not $global:IsUnix) { Invoke-Expression "Workflow FromCommandWorkflow {}" Export-ModuleMember -Function 'FromCommandWorkflow' } Set-Alias aaaaalias Get-AAAA Set-Alias bbbbalias Get-BBBB New-Alias -Name 'Fork-AAAA' -Value 'Get-AAAA' Export-ModuleMember -Alias Fork-AAAA Export-ModuleMember -Alias aaaaalias Export-ModuleMember -Alias bbbbalias Export-ModuleMember -Function 'Get-AAAA','Get-AdvancedFn','Get-SimpleFn' } | Import-Module -Force $files = New-MarkdownHelp -Module PlatyPSTestModule -OutputFolder TestDrive:\PlatyPSTestModule -Force } finally { Remove-Module PlatyPSTestModule -ErrorAction SilentlyContinue } It 'generates markdown files only for exported functions' -Skip:$IsUnix { ($files | Measure-Object).Count | Should Be 4 $files.Name | Should -BeIn 'Get-AAAA.md','Get-AdvancedFn.md','Get-SimpleFn.md','FromCommandWorkflow.md' } It 'generates markdown that includes CommonParameters in advanced functions' { ($files | Where-Object -FilterScript { $_.Name -eq 'Get-AdvancedFn.md' }).FullName | Should -FileContentMatch ' } It 'generates markdown that excludes CommonParameters from simple functions' { ($files | Where-Object -FilterScript { $_.Name -eq 'Get-SimpleFn.md' }).FullName | Should -FileContentMatch -Not ' } It 'generates markdown for workflows with CommonParameters' -Skip:$IsUnix { ($files | Where-Object -FilterScript { $_.Name -eq 'FromCommandWorkflow.md' }).FullName | Should -FileContentMatch ' } } Context 'from command' { It 'creates 2 markdown files from command names' { $files = New-MarkdownHelp -Command @('New-MarkdownHelp', 'Get-MarkdownMetadata') -OutputFolder TestDrive:\commands -Force ($files | Measure-Object).Count | Should Be 2 } } Context 'from external script' { It 'fully qualified path' { $SeedData = @" Write-Host 'Hello World!' "@ Set-Content -Value $SeedData -Path TestDrive:\Invoke-HelloWorld.ps1 -NoNewline $files = New-MarkdownHelp -Command "TestDrive:\Invoke-HelloWorld.ps1" -OutputFolder TestDrive:\output -Force ($files | Measure-Object).Count | Should Be 1 } It 'relative path' { $SeedData = @" Write-Host 'Hello World!' "@ Set-Content -Value $SeedData -Path TestDrive:\Invoke-HelloWorld.ps1 -NoNewline $Location = Get-Location Set-Location TestDrive:\ $files = New-MarkdownHelp -Command "TestDrive:\Invoke-HelloWorld.ps1" -OutputFolder TestDrive:\output -Force Set-Location $Location ($files | Measure-Object).Count | Should Be 1 } } Context 'AlphabeticParamsOrder' { function global:Get-Alpha { param( [Switch] [Parameter(Position = 1)] $WhatIf, [string] [Parameter(Position = 2)] $CCC, [Parameter(Position = 0)] [uint64] $First, [string] $AAA, [Parameter(Position = 3)] [uint64] $Skip, [string] $BBB, [Parameter(Position = 4)] [switch] $IncludeTotalCount, [Switch] $Confirm ) } It 'uses alphabetic order when specified' { $expectedOrder = normalizeEnds @' '@ $files = New-MarkdownHelp -Command Get-Alpha -OutputFolder TestDrive:\alpha -Force -AlphabeticParamsOrder ($files | Measure-Object).Count | Should Be 1 normalizeEnds (Get-Content $files | Where-Object {$_.StartsWith(' } } Context 'Online version link' { function global:Test-PlatyPSFunction { } @('https://github.com/PowerShell/platyPS', 'http://www.fabrikam.com/extension.html', $null) | ForEach-Object { $uri = $_ It "generates passed online url '$uri'" { $a = @{ command = 'Test-PlatyPSFunction' OutputFolder = 'TestDrive:\' Force = $true OnlineVersionUrl = $uri } $file = New-MarkdownHelp @a $maml = $file | New-ExternalHelp -OutputPath "TestDrive:\" -Force $help = Get-HelpPreview -Path $maml $link = $help.relatedLinks.navigationLink if ($uri) { if ($uri -eq 'http://www.fabrikam.com/extension.html') { ($link | Measure-Object).Count | Should Be 1 $link[0].linkText | Should Be $uri $link[0].uri | Should Be 'http://www.fabrikam.com/extension.html' } else { ($link | Measure-Object).Count | Should Be 2 $link[0].linkText | Should Be 'Online Version:' $link[0].uri | Should Be $uri } } } } } Context 'Generates well-known stub descriptions for parameters' { function global:Test-PlatyPSFunction { param( [string]$Foo, [switch]$Confirm, [switch]$WhatIf, [switch]$IncludeTotalCount, [uint64]$Skip, [uint64]$First ) } $file = New-MarkdownHelp -Command Test-PlatyPSFunction -OutputFolder TestDrive:\ -Force -AlphabeticParamsOrder $maml = $file | New-ExternalHelp -OutputPath "TestDrive:\" -Force $help = Get-HelpPreview -Path $maml It 'generates well-known stub descriptions for -WhatIf' { $param = $help.parameters.parameter | Where-Object { $_.Name -eq 'WhatIf' } $param.description.text | Should Be $LocalizedData.WhatIf } It 'generates well-known stub descriptions for -Confirm' { $param = $help.parameters.parameter | Where-Object { $_.Name -eq 'Confirm' } $param.description.text | Should Be $LocalizedData.Confirm } It 'generates well-known stub descriptions for -IncludeTotalCount' { $param = $help.parameters.parameter | Where-Object { $_.Name -eq 'IncludeTotalCount' } $param.description.text | Should Be $LocalizedData.IncludeTotalCount } It 'generates well-known stub descriptions for -Skip' { $param = $help.parameters.parameter | Where-Object { $_.Name -eq 'Skip' } $param.description.text | Should Be $LocalizedData.Skip } It 'generates well-known stub descriptions for -First' { $param = $help.parameters.parameter | Where-Object { $_.Name -eq 'First' } $param.description.text | Should Be $LocalizedData.First } It 'generates well-known stub descriptions for -Foo' { $param = $help.parameters.parameter | Where-Object { $_.Name -eq 'Foo' } $param.description.text | Should Be ($LocalizedData.ParameterDescription -f 'Foo') } } Context 'Generated markdown features: comment-based help' { function global:Test-PlatyPSFunction { param( [Switch]$Common, [Parameter(ParameterSetName="First", HelpMessage = 'First parameter help description')] [string]$First, [Parameter(ParameterSetName="Second")] [string]$Second ) } $file = New-MarkdownHelp -Command Test-PlatyPSFunction -OutputFolder TestDrive:\testAll1 -Force $content = Get-Content $file It 'generates markdown with correct parameter set names' { ($content | Where-Object {$_ -eq 'Parameter Sets: (All)'} | Measure-Object).Count | Should Be 1 ($content | Where-Object {$_ -eq 'Parameter Sets: First'} | Measure-Object).Count | Should Be 1 ($content | Where-Object {$_ -eq 'Parameter Sets: Second'} | Measure-Object).Count | Should Be 1 } It 'generates markdown with correct synopsis' { ($content | Where-Object {$_ -eq 'Adds a file name extension to a supplied name.'} | Measure-Object).Count | Should Be 2 } It 'generates markdown with correct help description specified by HelpMessage attribute' { ($content | Where-Object {$_ -eq 'First parameter help description'} | Measure-Object).Count | Should Be 1 } It 'generates markdown with correct help description specified by comment-based help' { ($content | Where-Object {$_ -eq 'Second parameter help description'} | Measure-Object).Count | Should Be 1 } It 'generates markdown with placeholder for parameter with no description' { ($content | Where-Object {$_ -eq ($LocalizedData.ParameterDescription -f 'Common')} | Measure-Object).Count | Should Be 1 } } Context 'Generated markdown features: no comment-based help' { function global:Test-PlatyPSFunction { param( [Switch]$Common, [Parameter(ParameterSetName="First", HelpMessage = 'First parameter help description')] [string]$First, [Parameter(ParameterSetName="Second")] [string]$Second ) } $file = New-MarkdownHelp -Command Test-PlatyPSFunction -OutputFolder TestDrive:\testAll2 -Force $content = Get-Content $file It 'generates markdown with correct synopsis placeholder' { ($content | Where-Object {$_ -eq $LocalizedData.Synopsis} | Measure-Object).Count | Should Be 1 } It 'generates markdown with correct help description specified by HelpMessage attribute' { ($content | Where-Object {$_ -eq 'First parameter help description'} | Measure-Object).Count | Should Be 1 } It 'generates markdown with placeholder for parameter with no description' { ($content | Where-Object {$_ -eq ($LocalizedData.ParameterDescription -f 'Common')} | Measure-Object).Count | Should Be 1 } } Context 'Dynamic parameters' { function global:Test-DynamicParameterSet { [CmdletBinding()] [OutputType()] Param ( [Parameter( ParameterSetName = 'Static' )] [Switch] $StaticParameter ) DynamicParam { $dynamicParamAttributes = New-Object -TypeName System.Management.Automation.ParameterAttribute -Property @{ ParameterSetName = 'Dynamic' } $dynamicParamCollection = New-Object -TypeName System.Collections.ObjectModel.Collection[System.Attribute] $dynamicParamCollection.Add($dynamicParamAttributes) $dynamicParam = New-Object -TypeName System.Management.Automation.RuntimeDefinedParameter -ArgumentList ('DynamicParameter', [Switch], $dynamicParamCollection) $dictionary = New-Object -TypeName System.Management.Automation.RuntimeDefinedParameterDictionary $dictionary.Add('DynamicParameter', $dynamicParam) return $dictionary } Process { Write-Output -InputObject $PSCmdlet.ParameterSetName } } It "generates DynamicParameter" { $a = @{ command = 'Test-DynamicParameterSet' OutputFolder = 'TestDrive:\' } $file = New-MarkdownHelp @a $maml = $file | New-ExternalHelp -OutputPath "TestDrive:\" $help = Get-HelpPreview -Path $maml $help.Syntax.syntaxItem.Count | Should Be 2 $dynamicParam = $help.parameters.parameter | Where-Object {$_.name -eq 'DynamicParameter'} ($dynamicParam | Measure-Object).Count | Should Be 1 } } Context 'Module Landing Page'{ $OutputFolder = "TestDrive:\LandingPageMD\" $OutputFolderReadme = 'TestDrive:\LandingPageMD-ReadMe\Readme.md' New-Item -ItemType Directory $OutputFolder It "generates a landing page from Module"{ New-MarkdownHelp -Module PlatyPS -OutputFolder $OutputFolder -WithModulePage -Force $LandingPage = Get-ChildItem (Join-Path $OutputFolder PlatyPS.md) $LandingPage | Should Not Be $null } It "generates a landing page from MAML"{ New-MarkdownHelp -MamlFile (Get-ChildItem "$outFolder\platyPS\en-US\platy*xml") ` -OutputFolder $OutputFolder ` -WithModulePage ` -ModuleName "PlatyPS" ` -Force $LandingPage = Get-ChildItem (Join-Path $OutputFolder PlatyPS.md) $LandingPage | Should Not Be $null } it 'generate a landing page from Module with parameter ModulePagePath' { New-MarkdownHelp -Module PlatyPS -OutputFolder $OutputFolder -WithModulePage -ModulePagePath $OutputFolderReadme -Force $LandingPage = Test-Path -Path $OutputFolderReadme $LandingPage | Should Not Be $null } } Context 'Full Type Name' { function global:Get-Alpha { param( [Switch] [Parameter(Position=1)] $WhatIf, [string] [Parameter(Position=2)] $CCC, [System.Nullable`1[System.Int32]] [Parameter(Position=3)] $ddd ) } It 'use full type name when specified' { $expectedParameters = normalizeEnds @' Type: System.String Type: System.Nullable`1[System.Int32] Type: System.Management.Automation.SwitchParameter '@ $expectedSyntax = normalizeEnds @' Get-Alpha [-WhatIf] [[-CCC] <String>] [[-ddd] <Int32>] [<CommonParameters>] '@ $files = New-MarkdownHelp -Command Get-Alpha -OutputFolder TestDrive:\alpha -Force -AlphabeticParamsOrder -UseFullTypeName ($files | Measure-Object).Count | Should Be 1 normalizeEnds(Get-Content $files | Where-Object {$_.StartsWith('Type: ')} | Out-String) | Should Be $expectedParameters normalizeEnds(Get-Content $files | Where-Object {$_.StartsWith('Get-Alpha')} | Out-String) | Should Be $expectedSyntax } It 'not use full type name when specified' { $expectedParameters = normalizeEnds @' Type: String Type: Int32 Type: SwitchParameter '@ $expectedSyntax = normalizeEnds @' Get-Alpha [-WhatIf] [[-CCC] <String>] [[-ddd] <Int32>] [<CommonParameters>] '@ $files = New-MarkdownHelp -Command Get-Alpha -OutputFolder TestDrive:\alpha -Force -AlphabeticParamsOrder ($files | Measure-Object).Count | Should Be 1 normalizeEnds(Get-Content $files | Where-Object {$_.StartsWith('Type: ')} | Out-String) | Should Be $expectedParameters normalizeEnds(Get-Content $files | Where-Object {$_.StartsWith('Get-Alpha')} | Out-String) | Should Be $expectedSyntax } } Context 'DontShow parameter' { BeforeAll { function global:Test-DontShowParameter { [CmdletBinding()] [OutputType()] Param ( [Parameter()] [Switch] $ShowAll, [Parameter(DontShow)] [Switch] $DontShowAll, [Parameter(ParameterSetName = 'Set1', DontShow)] [Parameter(ParameterSetName = 'Set2')] [Switch] $DontShowSet1, [Parameter(ParameterSetName = 'Set1', DontShow)] [Parameter(ParameterSetName = 'Set2', DontShow)] [Switch] $DontShowSetAll ) Process { Write-Output -InputObject $PSCmdlet.ParameterSetName } } $a = @{ command = 'Test-DontShowParameter' OutputFolder = 'TestDrive:\' } $fileWithoutDontShowSwitch = New-MarkdownHelp @a -Force $file = New-MarkdownHelp @a -ExcludeDontShow -Force $maml = $file | New-ExternalHelp -OutputPath "TestDrive:\" $help = Get-HelpPreview -Path $maml $mamlModelObject = & (Get-Module platyPS) { GetMamlObject -Cmdlet "Test-DontShowParameter" } $updatedFile = Update-MarkdownHelp -Path $fileWithoutDontShowSwitch -ExcludeDontShow $null = New-Item -ItemType Directory "$TestDrive\UpdateMarkdown" $updatedMaml = $file | New-ExternalHelp -OutputPath "TestDrive:\UpdateMarkdown" $updatedHelp = Get-HelpPreview -Path $updatedMaml $updateMamlModelObject = & (Get-Module platyPS) { GetMamlObject -Cmdlet "Test-DontShowParameter" } } Context "New-MarkdownHelp with -ExcludeDontShow" { It "includes ShowAll" { $showAll = $help.parameters.parameter | Where-Object {$_.name -eq 'ShowAll'} ($showAll | Measure-Object).Count | Should Be 1 } It "excludes DontShowAll" { $dontShowAll = $help.parameters.parameter | Where-Object {$_.name -eq 'DontShowAll'} ($dontShowAll | Measure-Object).Count | Should Be 0 } It 'includes DontShowSet1 excludes Set1' -Skip { $dontShowSet1 = $help.parameters.parameter | Where-Object {$_.name -eq 'DontShowSet1'} ($dontShowSet1 | Measure-Object).Count | Should Be 1 $set1 = $mamlModelObject.Syntax | Where-Object {$_.ParameterSetName -eq 'Set1'} ($set1 | Measure-Object).Count | Should Be 0 } It 'excludes DontShowSetAll includes Set2' { $dontShowAll = $help.parameters.parameter | Where-Object {$_.name -eq 'DontShowSetAll'} ($dontShowAll | Measure-Object).Count | Should Be 0 $set2 = $mamlModelObject.Syntax | Where-Object {$_.ParameterSetName -eq 'Set2'} ($set2 | Measure-Object).Count | Should Be 1 } } Context "Update-MarkdownHelp with -ExcludeDontShow" { It "includes ShowAll" { $showAll = $updatedHelp.parameters.parameter | Where-Object {$_.name -eq 'ShowAll'} ($showAll | Measure-Object).Count | Should Be 1 } It "excludes DontShowAll" { $dontShowAll = $updatedHelp.parameters.parameter | Where-Object {$_.name -eq 'DontShowAll'} ($dontShowAll | Measure-Object).Count | Should Be 0 } It 'includes DontShowSet1 excludes Set1' -Skip { $dontShowSet1 = $updatedHelp.parameters.parameter | Where-Object {$_.name -eq 'DontShowSet1'} ($dontShowSet1 | Measure-Object).Count | Should Be 1 $set1 = $mamlModelObject.Syntax | Where-Object {$_.ParameterSetName -eq 'Set1'} ($set1 | Measure-Object).Count | Should Be 0 } It 'excludes DontShowSetAll includes Set2' { $dontShowAll = $updatedHelp.parameters.parameter | Where-Object {$_.name -eq 'DontShowSetAll'} ($dontShowAll | Measure-Object).Count | Should Be 0 $set2 = $mamlModelObject.Syntax | Where-Object {$_.ParameterSetName -eq 'Set2'} ($set2 | Measure-Object).Count | Should Be 1 } } Context 'SupportsWildCards attribute tests' { BeforeAll { function global:Test-WildCardsAttribute { param ( [Parameter()] [SupportsWildcards()] [string] $Name, [Parameter()] [string] $NameNoWildCard ) } $file = New-MarkdownHelp -Command 'Test-WildCardsAttribute' -OutputFolder "$TestDrive\NewMarkDownHelp" $maml = $file | New-ExternalHelp -OutputPath "$TestDrive\NewMarkDownHelp" $help = Get-HelpPreview -Path $maml } It 'sets accepts wildcards property on parameters as expected' { $help.parameters.parameter | Where-Object { $_.Name -eq 'Name' } | ForEach-Object { $_.globbing -eq 'true'} $help.parameters.parameter | Where-Object { $_.Name -eq 'NameNoWildCard' } | ForEach-Object { $_.globbing -eq 'false'} } } } } Describe 'New-ExternalHelp' { BeforeAll { function global:Test-OrderFunction { param ([Parameter(Position=3)]$Third, [Parameter(Position=1)]$First, [Parameter()]$Named) $First $Third $Named } $file = New-MarkdownHelp -Command 'Test-OrderFunction' -OutputFolder $TestDrive -Force $maml = $file | New-ExternalHelp -OutputPath "$TestDrive\TestOrderFunction.xml" -Force } It "generates right order for syntax" { $help = Get-HelpPreview -Path $maml ($help.Syntax.syntaxItem | Measure-Object).Count | Should Be 1 $names = $help.Syntax.syntaxItem.parameter.Name ($names | Measure-Object).Count | Should Be 3 $names[0] | Should Be 'First' $names[1] | Should Be 'Third' $names[2] | Should Be 'Named' } It "checks that xmlns 'http://msh' is present" { $xml = [xml] (Get-Content (Join-Path $TestDrive 'TestOrderFunction.xml')) $xml.helpItems.namespaceuri | Should Be 'http://msh' } } Describe 'New-ExternalHelp -ErrorLogFile' { BeforeAll { function global:Test-OrderFunction { param ([Parameter(Position = 3)]$Third, [Parameter(Position = 1)]$First, [Parameter()]$Named) $First $Third $Named } try { $file = New-MarkdownHelp -Command 'Test-OrderFunction' -OutputFolder $TestDrive -Force -NoMetadata $maml = $file | New-ExternalHelp -OutputPath "$TestDrive\TestOrderFunction.xml" -ErrorLogFile "$TestDrive\warningsAndErrors.json" -Force } catch { } } It "generates error log file" { Test-Path "$TestDrive\warningsAndErrors.json" | Should Be $true } } Describe 'New-ExternalHelp -ApplicableTag for cmdlet level' { BeforeAll { function global:Test-Applicable12 {} function global:Test-ApplicableNone {} function global:Test-Applicable32 {} function global:Test-Applicable4 {} } It 'ignores cmdlet when applicable tag doesn''t match' { $files = @() $files += New-MarkdownHelp -Metadata @{ applicable = 'tag 1, tag 2'} -Command Test-Applicable12 -OutputFolder $TestDrive -Force -WarningAction SilentlyContinue $files += New-MarkdownHelp -Metadata @{ applicable = 'tag 3, tag 2'} -Command Test-Applicable32 -OutputFolder $TestDrive -Force -WarningAction SilentlyContinue $files += New-MarkdownHelp -Command Test-ApplicableNone -OutputFolder $TestDrive -Force -WarningAction SilentlyContinue $files += New-MarkdownHelp -Metadata @{ applicable = 'tag 4'} -Command Test-Applicable4 -OutputFolder $TestDrive -Force -WarningAction SilentlyContinue $maml = $files | New-ExternalHelp -ApplicableTag @('tag 1', 'tag 4') -OutputPath "$TestDrive\TestApplicable.xml" -Force $help = Get-HelpPreview -Path $maml ($help | Measure-Object).Count | Should Be 3 $names = $help.Name $names[0] | Should Be 'Test-Applicable12' $names[1] | Should Be 'Test-ApplicableNone' $names[2] | Should Be 'Test-Applicable4' } } Describe 'New-ExternalHelp -ApplicableTag for parameters level' { It 'ignores parameters when applicable tag doesn''t match' { $md = @' --- schema: 2.0.0 --- ```yaml Type: String Applicable: tag 1, tag 2 ``` ```yaml Type: String Applicable: tag 3 ``` ```yaml Type: String ``` ```yaml Type: String Applicable: tag 4 ``` '@ $path = "$outFolder\Get-Foo.md" Set-Content -Path $path -Value $md $maml = $path | New-ExternalHelp -ApplicableTag @('tag 1', 'tag 4') -OutputPath "$TestDrive\TestApplicable.xml" -Force $help = Get-HelpPreview -Path $maml $names = $help.Parameters.parameter.Name ($names | Measure-Object).Count | Should Be 3 $names[0] | Should Be 'P1' $names[1] | Should Be 'P3' $names[2] | Should Be 'P4' } } if (-not $global:IsUnix) { Describe 'Get-Help & Get-Command on Add-Computer to build MAML Model Object' { Context 'Add-Computer' { It 'Checks that Help Exists on Computer Running Tests' { $Command = Get-Command Add-Computer $HelpFileName = Split-Path $Command.HelpFile -Leaf $foundHelp = @() $paths = $env:PsModulePath.Split(';') foreach($path in $paths) { $path = Split-Path $path -Parent $foundHelp += Get-ChildItem -ErrorAction SilentlyContinue -Path $path -Recurse | Where-Object { $_.Name -like "*$HelpFileName"} | Select-Object Name } $foundHelp.Count | Should BeGreaterThan 0 } $mamlModelObject = & (Get-Module platyPS) { GetMamlObject -Cmdlet "Add-Computer" } It 'Validates attributes by checking several sections of the single attributes for Add-Computer' { $mamlModelObject.Name | Should be "Add-Computer" $mamlModelObject.Synopsis.Text | Should be "Add the local computer to a domain or workgroup." $mamlModelObject.Description.Text.Substring(0,135) | Should be "The Add-Computer cmdlet adds the local computer or remote computers to a domain or workgroup, or moves them from one domain to another." $mamlModelObject.Notes.Text.Substring(0,31) | Should be "In Windows PowerShell 2.0, the " } It 'Validates the examples by checking Add-Computer Example 1' { $mamlModelObject.Examples[0].Title | Should be "Example 1: Add a local computer to a domain then restart the computer" $mamlModelObject.Examples[0].Code[0].Text | Should be "PS C:\>Add-Computer -DomainName `"Domain01`" -Restart" $mamlModelObject.Examples[0].Remarks.Substring(0,120) | Should be "This command adds the local computer to the Domain01 domain and then restarts the computer to make the change effective." } It 'Validates Parameters by checking Add-Computer Computer Name and Local Credential in Domain ParameterSet'{ $Parameter = $mamlModelObject.Syntax[0].Parameters | Where-Object { $_.Name -eq "ComputerName" } $Parameter.Name | Should be "ComputerName" $Parameter.Type | Should be "string[]" $Parameter.Required | Should be $false } It 'Validates there is only 1 default parameterset and that it is the domain parameterset for Add-Computer'{ $DefaultParameterSet = $mamlModelObject.Syntax | Where-Object {$_.IsDefault} $count = 0 foreach($set in $DefaultParameterSet) { $count = $count +1 } $count | Should be 1 $DefaultParameterSetName = $mamlModelObject.Syntax | Where-Object {$_.IsDefault} | Select-Object ParameterSetName $DefaultParameterSetName.ParameterSetName | Should be "Domain" } } Context 'Add-Member' { $mamlModelObject = & (Get-Module platyPS) { GetMamlObject -Cmdlet "Add-Member" } It 'Fetch MemberSet set name' { $MemberSet = $mamlModelObject.Syntax | Where-Object {$_.ParameterSetName -eq 'MemberSet'} ($MemberSet | Measure-Object).Count | Should Be 1 } It 'populates ParameterValueGroup for MemberType' { $Parameters = $mamlModelObject.Syntax.Parameters | Where-Object { $_.Name -eq "MemberType" } ($Parameters | Measure-Object).Count | Should Be 1 $Parameters | ForEach-Object { $_.Name | Should be "MemberType" $_.ParameterValueGroup.Count | Should be 16 } } } } Describe 'New-ExternalHelpCab' { $OutputPath = "$TestDrive\CabTesting" New-Item -ItemType Directory -Path (Join-Path $OutputPath "\Source\Xml\") -ErrorAction SilentlyContinue | Out-Null New-Item -ItemType Directory -Path (Join-Path $OutputPath "\Source\ModuleMd\") -ErrorAction SilentlyContinue | Out-Null New-Item -ItemType Directory -Path (Join-Path $OutputPath "\OutXml") -ErrorAction SilentlyContinue | Out-Null New-Item -ItemType Directory -Path (Join-Path $OutputPath "\OutXml2") -ErrorAction SilentlyContinue | Out-Null New-Item -ItemType File -Path (Join-Path $OutputPath "\Source\Xml\") -Name "HelpXml.xml" -force | Out-Null New-Item -ItemType File -Path (Join-Path $OutputPath "\Source\Xml\") -Name "Module.resources.psd1" | Out-Null New-Item -ItemType File -Path (Join-Path $OutputPath "\Source\ModuleMd\") -Name "Module.md" -ErrorAction SilentlyContinue | Out-Null New-Item -ItemType File -Path $OutputPath -Name "PlatyPs_00000000-0000-0000-0000-000000000000_helpinfo.xml" -ErrorAction SilentlyContinue | Out-Null Set-Content -Path (Join-Path $OutputPath "\Source\Xml\HelpXml.xml") -Value "<node><test>Adding test content to ensure cab builds correctly.</test></node>" | Out-Null Set-Content -Path (Join-Path $OutputPath "\Source\ModuleMd\Module.md") -Value "---`r`nModule Name: PlatyPs`r`nModule Guid: 00000000-0000-0000-0000-000000000000`r`nDownload Help Link: Somesite.com`r`nHelp Version: 5.0.0.1`r`nLocale: en-US`r`n---" | Out-Null Context 'MakeCab.exe' { It 'Validates that MakeCab.exe & Expand.exe exists'{ (Get-Command MakeCab) -ne $null | Should Be $True (Get-Command Expand) -ne $null | Should Be $True } } Context 'New-ExternalHelpCab function, External Help & HelpInfo' { $CmdletContentFolder = (Join-Path $OutputPath "\Source\Xml\") $ModuleMdPageFullPath = (Join-Path $OutputPath "\Source\ModuleMd\Module.md") It 'validates the output of Cab creation' { New-ExternalHelpCab -CabFilesFolder $CmdletContentFolder -OutputFolder $OutputPath -LandingPagePath $ModuleMdPageFullPath -WarningAction SilentlyContinue $cab = (Get-ChildItem (Join-Path $OutputPath "PlatyPs_00000000-0000-0000-0000-000000000000_en-US_HelpContent.cab")).FullName $cabExtract = (Join-Path (Split-Path $cab -Parent) "OutXml") $cabExtract = Join-Path $cabExtract "HelpXml.xml" expand $cab /f:* $cabExtract (Get-ChildItem -Filter "*.cab" -Path "$OutputPath").Name | Should BeExactly "PlatyPs_00000000-0000-0000-0000-000000000000_en-US_HelpContent.cab" (Get-ChildItem -Filter "*.xml" -Path "$OutputPath").Name | Should Be "PlatyPs_00000000-0000-0000-0000-000000000000_helpinfo.xml" (Get-ChildItem -Filter "*.xml" -Path "$OutputPath\OutXml").Name | Should Be "HelpXml.xml" (Get-ChildItem -Filter "*.zip" -Path "$OutputPath").Name | Should BeExactly "PlatyPs_00000000-0000-0000-0000-000000000000_en-US_HelpContent.zip" Get-ChildItem -Filter "*.psd1" -Path "$OutputPath\OutXml" | Should BeNullOrEmpty } It 'Creates a help info file'{ [xml] $PlatyPSHelpInfo = Get-Content (Join-Path $OutputPath "PlatyPs_00000000-0000-0000-0000-000000000000_helpinfo.xml") $PlatyPSHelpInfo | Should Not Be $null $PlatyPSHelpInfo.HelpInfo.SupportedUICultures.UICulture.UICultureName | Should Be "en-US" $PlatyPSHelpInfo.HelpInfo.SupportedUICultures.UICulture.UICultureVersion | Should Be "5.0.0.1" } It 'validates the version is incremented when the switch is used' { New-ExternalHelpCab -CabFilesFolder $CmdletContentFolder -OutputFolder $OutputPath -LandingPagePath $ModuleMdPageFullPath -IncrementHelpVersion -WarningAction SilentlyContinue [xml] $PlatyPSHelpInfo = Get-Content (Join-Path $OutputPath "PlatyPs_00000000-0000-0000-0000-000000000000_helpinfo.xml") $PlatyPSHelpInfo | Should Not Be $null $PlatyPSHelpInfo.HelpInfo.SupportedUICultures.UICulture.UICultureName | Should Be "en-US" $PlatyPSHelpInfo.HelpInfo.SupportedUICultures.UICulture.UICultureVersion | Should Be "5.0.0.2" } It 'Adds another help locale'{ Set-Content -Path (Join-Path $OutputPath "\Source\ModuleMd\Module.md") -Value "---`r`nModule Name: PlatyPs`r`nModule Guid: 00000000-0000-0000-0000-000000000000`r`nDownload Help Link: Somesite.com`r`nHelp Version: 5.0.0.1`r`nLocale: en-US`r`nAdditional Locale: fr-FR,ja-JP`r`nfr-FR Version: 1.2.3.4`r`nja-JP Version: 2.3.4.5`r`n---" | Out-Null New-ExternalHelpCab -CabFilesFolder $CmdletContentFolder -OutputFolder $OutputPath -LandingPagePath $ModuleMdPageFullPath -WarningAction SilentlyContinue [xml] $PlatyPSHelpInfo = Get-Content (Join-Path $OutputPath "PlatyPs_00000000-0000-0000-0000-000000000000_helpinfo.xml") $Count = 0 $PlatyPSHelpInfo.HelpInfo.SupportedUICultures.UICulture | ForEach-Object {$Count++} $Count | Should Be 3 } } } } Describe 'Update-MarkdownHelp -LogPath' { It 'checks the log exists' { $drop = "TestDrive:\MD\SingleCommand" Remove-Item -rec $drop -ErrorAction SilentlyContinue New-MarkdownHelp -Command Add-History -OutputFolder $drop | Out-Null Update-MarkdownHelp -Path $drop -LogPath "$drop\platyPsLog.txt" (Get-Childitem $drop\platyPsLog.txt).Name | Should Be 'platyPsLog.txt' } } Describe 'Get-MarkdownMetadata' { Context 'Simple markdown file' { Set-Content -Path TestDrive:\foo.md -Value @' --- a : 1 b: 2 foo: bar --- this text would be ignored '@ It 'can parse out yaml snippet' { $d = Get-MarkdownMetadata TestDrive:\foo.md $d.Count | Should Be 3 $d['a'] = '1' $d['b'] = '2' $d['foo'] = 'bar' } } } Describe 'Update-MarkdownHelp with New-MarkdownHelp inlined functionality' { $OutputFolder = 'TestDrive:\update-new' $originalFiles = New-MarkdownHelp -Module platyPS -OutputFolder $OutputFolder -WithModulePage It 'creates markdown in the first place' { $originalFiles | Should Not Be $null $originalFiles | Select-Object -First 2 | Remove-Item } It 'updates markdown and creates removed files again' { $updatedFiles = Update-MarkdownHelpModule -Path $OutputFolder ($updatedFiles | Measure-Object).Count | Should Be (($originalFiles | Measure-Object).Count - 1) } $OutputFolderDiff = 'TestDrive:\update-new\Test-RefreshModuleFunctionality.md' it 'remove platyPS.md and make sure its gone' { $File = $originalFiles | Where { $_ -like '*platyPS.md' } Remove-Item -Path $File -Confirm:$false $FileList = Get-ChildItem -Path $OutputFolder | % { Write-Output $_.FullName } ($FileList | Measure-Object).Count | Should Be (($originalFiles | Measure-Object).Count - 1) } it 'update MarkdownHelpFile with -RefreshModulePage' { $UpdatedFiles = Update-MarkdownHelpModule -Path $OutputFolder -RefreshModulePage ($UpdatedFiles | Measure-Object).Count | Should Be (($originalFiles | Measure-Object).Count) $UpdatedFiles | Where { $_ -like '*platyPS.md' } | Should -BeLike '*platyPS.md' } it 'update MarkdownHelpFile with -RefreshModulePage with parameter ModulePagePath' { $UpdatedFiles = Update-MarkdownHelpModule -Path $OutputFolder -RefreshModulePage -ModulePagePath $OutputFolderDiff ($UpdatedFiles | Measure-Object).Count | Should Be (($originalFiles | Measure-Object).Count) $UpdatedFiles | Where { $_ -like '*platyPS.md' } | Should -Be $Null $UpdatedFiles | Where { $_ -like '*Test-RefreshModuleFunctionality.md' } | Should -Not -Be $Null } } Describe 'Update-MarkdownHelp reflection scenario' { function normalizeEnds([string]$text) { $text -replace "`r`n?|`n", "`r`n" } $OutputFolder = 'TestDrive:\CoolStuff' function global:Get-MyCoolStuff { param( [string]$Foo ) } $v1md = New-MarkdownHelp -command Get-MyCoolStuff -OutputFolder $OutputFolder It 'produces original stub' { $v1md.Name | Should Be 'Get-MyCoolStuff.md' } It 'produce a dummy example' { $v1md.FullName | Should FileContentMatch ' } $v1markdown = $v1md | Get-Content -Raw $newFooDescription = normalizeEnds @' ThisIsFooDescription It has mutlilines. And [hyper](http://link.com). - And a list. Yeap. - Good stuff? '@ It 'can update stub' { $v15markdown = $v1markdown -replace ($LocalizedData.ParameterDescription -f 'Foo'), $newFooDescription $v15markdown | Should BeLike "*ThisIsFooDescription*" Set-Content -Encoding UTF8 -Path $v1md -Value $v15markdown } function global:Get-MyCoolStuff { param( [string]$Foo, [string]$Bar ) } $v2md = Update-MarkdownHelp $v1md -Verbose -AlphabeticParamsOrder It 'upgrades stub' { $v2md.Name | Should Be 'Get-MyCoolStuff.md' } $v2maml = New-ExternalHelp -Path $v2md.FullName -OutputPath "$OutputFolder\v2" $v2markdown = $v2md | Get-Content -raw $help = Get-HelpPreview -Path $v2maml It 'has both parameters' { $names = $help.Parameters.parameter.Name ($names | Measure-Object).Count | Should Be 2 $names[0] | Should Be 'Bar' $names[1] | Should Be 'Foo' } It 'preserves hyperlinks' { $v2markdown.Contains($newFooDescription) | Should Be $true } It 'has updated description for Foo' { $fooParam = $help.Parameters.parameter | Where-Object {$_.Name -eq 'Foo'} normalizeEnds($fooParam.Description.Text | Out-String) | Should Be (normalizeEnds @' ThisIsFooDescription It has mutlilines. And hyper (http://link.com). - And a list. Yeap. - Good stuff? '@) } It 'has a placeholder for example' { ($Help.examples.example | Measure-Object).Count | Should Be 1 $e = $Help.examples.example $e.Title | Should Match '-+ Example 1 -+' $e.Code | Should Match 'PS C:\>*' } It 'Confirms that Update-MarkdownHelp correctly populates the Default Parameterset' -Skip:$global:IsUnix { $outputOriginal = "TestDrive:\MarkDownOriginal" $outputUpdated = "TestDrive:\MarkDownUpdated" New-Item -ItemType Directory -Path $outputOriginal New-Item -ItemType Directory -Path $outputUpdated New-MarkdownHelp -Command "Add-Computer" -OutputFolder $outputOriginal -Force Copy-Item -Path (Join-Path $outputOriginal Add-Computer.md) -Destination (Join-Path $outputUpdated Add-Computer.md) Update-MarkdownHelp -Path $outputFolder (Get-Content (Join-Path $outputOriginal Add-Computer.md)) | Should Be (Get-Content (Join-Path $outputUpdated Add-Computer.md)) } It 'parameter type should not be fullname' { $expectedParameters = normalizeEnds @' Type: String Type: String '@ $expectedSyntax = normalizeEnds @' Get-MyCoolStuff [[-Foo] <String>] [[-Bar] <String>] [<CommonParameters>] '@ normalizeEnds($v2md | Get-Content | Where-Object {$_.StartsWith('Type: ')} | Out-String) | Should Be $expectedParameters normalizeEnds($v2md | Get-Content | Where-Object {$_.StartsWith('Get-MyCoolStuff')} | Out-String) | Should Be $expectedSyntax } $v3md = Update-MarkdownHelp $v2md -Verbose -AlphabeticParamsOrder -UseFullTypeName $v3markdown = $v3md | Get-Content It 'parameter type should be fullname' { $expectedParameters = normalizeEnds @' Type: System.String Type: System.String '@ $expectedSyntax = normalizeEnds @' Get-MyCoolStuff [[-Foo] <String>] [[-Bar] <String>] [<CommonParameters>] '@ normalizeEnds($v3markdown | Where-Object {$_.StartsWith('Type: ')} | Out-String) | Should Be $expectedParameters normalizeEnds($v3markdown | Where-Object {$_.StartsWith('Get-MyCoolStuff')} | Out-String) | Should Be $expectedSyntax } It 'all the other part should be the same except line with parameters' { $expectedContent = $v2md | Get-Content | Select-String -pattern "Type: |Get-MyCoolStuff" -notmatch | Out-String $v3markdown | Select-String -pattern "Type: |Get-MyCoolStuff" -notmatch | Out-String | Should Be $expectedContent } } Describe 'Update Markdown Help' { $output = "TestDrive:\" $ValidHelpFileName = "Microsoft.PowerShell.Archive-help.xml" $md = @' --- external help file: ABadFileName-Help.xml online version: http://go.microsoft.com/fwlink/?LinkId=821655 schema: 2.0.0 --- Extracts files from a specified archive (zipped) file. ``` Expand-Archive [-Path] <String> [[-DestinationPath] <String>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>] ``` ``` Expand-Archive -LiteralPath <String> [[-DestinationPath] <String>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>] ``` The Expand-Archive cmdlet extracts files from a specified zipped archive file to a specified destination folder. An archive file allows multiple files to be packaged, and optionally compressed, into a single zipped file for easier distribution and storage. ``` PS C:\>Expand-Archive -LiteralPath C:\Archives\Draft.Zip -DestinationPath C:\Reference ``` This command extracts the contents of an existing archive file, Draft.zip, into the folder specified by the DestinationPath parameter, C:\Reference. ``` PS C:\>Expand-Archive -Path Draft.Zip -DestinationPath C:\Reference ``` This command extracts the contents of an existing archive file in the current folder, Draft.zip, into the folder specified by the DestinationPath parameter, C:\Reference. Specifies the path to the folder in which you want the command to save extracted files. Enter the path to a folder, but do not specify a file name or file name extension. This parameter is required. ```yaml Type: String Parameter Sets: (All) Aliases: Required: False Position: 2 Default value: Accept pipeline input: False Accept wildcard characters: False ``` Forces the command to run without asking for user confirmation. ```yaml Type: SwitchParameter Parameter Sets: (All) Aliases: Required: False Position: Named Default value: Accept pipeline input: False Accept wildcard characters: False ``` Specifies the path to an archive file. Unlike the Path parameter, the value of LiteralPath is used exactly as it is typed. Wildcard characters are not supported. If the path includes escape characters, enclose each escape character in single quotation marks, to instruct Windows PowerShell not to interpret any characters as escape sequences. ```yaml Type: String Parameter Sets: LiteralPath Aliases: PSPath Required: True Position: Named Default value: Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` Specifies the path to the archive file. ```yaml Type: String Parameter Sets: Path Aliases: Required: True Position: 1 Default value: Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False ``` Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet. ```yaml Type: SwitchParameter Parameter Sets: (All) Aliases: cf Required: False Position: Named Default value: False Accept pipeline input: False Accept wildcard characters: False ``` Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: SwitchParameter Parameter Sets: (All) Aliases: wi Required: False Position: Named Default value: False Accept pipeline input: False Accept wildcard characters: False ``` This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). You can pipe a string that contains a path to an existing archive file. [Compress-Archive]() '@ Set-Content -Path "$outFolder\Expand-Archive.md" -Value $md Update-MarkdownHelp -Path "$outFolder\Expand-Archive.md" $updatedMd = Get-Content "$outFolder\Expand-Archive.md" It 'Verifies that a bad metadata value for the help file is fixed on update' { $MetaData = Get-MarkdownMetadata -Markdown ($updatedMd | Out-String) $MetaData["external help file"] | Should Be $ValidHelpFileName } @(' It "use a single spacing for $_ sections" { $lineStart = $_ for ($i=2; $i -lt $updatedMd.Count; $i++) { if ($updatedMd[$i].StartsWith($lineStart)) { $updatedMd[$i - 1] | Should Be '' $updatedMd[$i - 2] | Should Not Be '' } } } } } Describe 'Create About Topic Markdown and Txt' { $output = "TestDrive:\" $aboutTopicName = "PlatyPS" $templateLocation = (Split-Path ((Get-Module $aboutTopicName).Path) -Parent) + "\templates\aboutTemplate.md" $AboutTopicsOutputFolder = Join-Path $output "About" New-Item -Path $AboutTopicsOutputFolder -ItemType Directory It 'Checks the about topic is created with proper file name, and the content is correctly written' { $aboutContent = Get-Content $templateLocation $aboutContent = $aboutContent.Replace("{{FileNameForHelpSystem}}",("about_" + $aboutTopicName)) $aboutContent = $aboutContent.Replace("{{TOPIC NAME}}",$aboutTopicName) New-MarkdownAboutHelp -OutputFolder $output -AboutName $aboutTopicName Test-Path (Join-Path $output ("about_$($aboutTopicName).md")) | Should Be $true Get-Content (Join-Path $output ("about_$($aboutTopicName).md")) | Should Be $aboutContent } It 'Checks the about topic is created with proper file name, and the content is correctly written - avoiding doubled about' { $aboutTopicName = "PlatyPS_about_doubled" $aboutContent = Get-Content $templateLocation $aboutContent = $aboutContent.Replace("{{FileNameForHelpSystem}}",("about_" + $aboutTopicName)) $aboutContent = $aboutContent.Replace("{{TOPIC NAME}}",$aboutTopicName) New-MarkdownAboutHelp -OutputFolder $output -AboutName $("about_" + $aboutTopicName) Test-Path (Join-Path $output ("about_$($aboutTopicName).md")) | Should Be $true Get-Content (Join-Path $output ("about_$($aboutTopicName).md")) | Should Be $aboutContent } It 'Can generate external help for a directly-specified "about" markdown file' { New-MarkdownAboutHelp -OutputFolder $output -AboutName 'JustOne' $aboutMdPath = Join-Path $output "about_JustOne.md" New-ExternalHelp -Path $aboutMdPath -OutputPath $AboutTopicsOutputFolder $aboutExternalHelpPath = Join-Path $AboutTopicsOutputFolder 'about_JustOne.help.txt' Test-Path $aboutExternalHelpPath | Should Be $true } It 'Can generate external help for a directly-specified "about" markdown file - avoiding doubled about_' { New-MarkdownAboutHelp -OutputFolder $output -AboutName 'about_JustSecond' $aboutMdPath = Join-Path $output "about_JustSecond.md" New-ExternalHelp -Path $aboutMdPath -OutputPath $AboutTopicsOutputFolder $aboutExternalHelpPath = Join-Path $AboutTopicsOutputFolder 'about_JustSecond.help.txt' Test-Path $aboutExternalHelpPath | Should Be $true } It 'Takes constructed markdown about topics and converts them to text with proper character width'{ New-MarkdownAboutHelp -OutputFolder $AboutTopicsOutputFolder -AboutName "AboutTopic" New-ExternalHelp -Path $AboutTopicsOutputFolder -OutputPath $AboutTopicsOutputFolder $lineWidthCheck = $true; $AboutTxtFilePath = Join-Path $AboutTopicsOutputFolder "about_AboutTopic.help.txt" $AboutContent = Get-Content $AboutTxtFilePath $AboutContent | ForEach-Object { if($_.Length -gt 80) { $lineWidthCheck = $false } } (Get-ChildItem $AboutTxtFilePath | Measure-Object).Count | Should Be 1 $lineWidthCheck | Should Be $true } It 'Adds a yaml block to the AboutTopic and verifies build as expected'{ $content = Get-Content (Join-Path $output ("about_$($aboutTopicName).md")) $content = ("---Yaml: Stuff---" + $content) Set-Content -Value $content -Path (Join-Path $output ("about_$($aboutTopicName).md")) -Force Test-Path (Join-Path $output ("about_$($aboutTopicName).md")) | Should Be $true Get-Content (Join-Path $output ("about_$($aboutTopicName).md")) | Should Be $content } } Describe 'Merge-MarkdownHelp' { Context 'single file, ignore examples' { function global:Test-PlatyPSMergeFunction { param( [string]$First ) } $file1 = New-MarkdownHelp -Command Test-PlatyPSMergeFunction -OutputFolder TestDrive:\mergeFile1 -Force $maml1 = $file1 | New-ExternalHelp -OutputPath TestDrive:\1.xml -Force $help1 = Get-HelpPreview -Path $maml1 $help1.examples = @() function global:Test-PlatyPSMergeFunction { param( [string]$Second ) } $file2 = New-MarkdownHelp -Command Test-PlatyPSMergeFunction -OutputFolder TestDrive:\mergeFile2 -Force $maml2 = $file2 | New-ExternalHelp -OutputPath TestDrive:\2.xml -Force $help2 = Get-HelpPreview -Path $maml2 $help2.examples = @() It 'generates merged markdown with applicable tags' { $fileNew = Merge-MarkdownHelp -Path @($file1, $file2) -OutputPath TestDrive:\mergeFileOut -Force $mamlNew1 = $fileNew | New-ExternalHelp -OutputPath TestDrive:\1new.xml -Force -ApplicableTag('mergeFile1') $helpNew1 = Get-HelpPreview -Path $mamlNew1 $helpNew1.examples = @() $mamlNew2 = $fileNew | New-ExternalHelp -OutputPath TestDrive:\2new.xml -Force -ApplicableTag('mergeFile2') $helpNew2 = Get-HelpPreview -Path $mamlNew2 $helpNew2.examples = @() ($helpNew1 | Out-String) | Should Be ($help1 | Out-String) ($helpNew2 | Out-String) | Should Be ($help2 | Out-String) } } Context 'two file' { function global:Test-PlatyPSMergeFunction1() {} function global:Test-PlatyPSMergeFunction2() {} $files = @() $files += New-MarkdownHelp -Command Test-PlatyPSMergeFunction1 -OutputFolder TestDrive:\mergePath1 -Force $files += New-MarkdownHelp -Command Test-PlatyPSMergeFunction1, Test-PlatyPSMergeFunction2 -OutputFolder TestDrive:\mergePath2 -Force It 'generates merged markdown with applicable tags' { $fileNew = Merge-MarkdownHelp -Path $files -OutputPath TestDrive:\mergePathOut -Force $mamlNew1 = $fileNew | New-ExternalHelp -OutputPath TestDrive:\1new.xml -Force -ApplicableTag('mergePath1') $helpNew1 = Get-HelpPreview -Path $mamlNew1 $mamlNew2 = $fileNew | New-ExternalHelp -OutputPath TestDrive:\2new.xml -Force -ApplicableTag('mergePath2') $helpNew2 = Get-HelpPreview -Path $mamlNew2 $names1 = $helpNew1.Name $names2 = $helpNew2.Name ($names1 | measure).Count | Should Be 1 $names1 | Should Be 'Test-PlatyPSMergeFunction1' ($names2 | measure).Count | Should Be 2 $names2[0] | Should Be 'Test-PlatyPSMergeFunction1' $names2[1] | Should Be 'Test-PlatyPSMergeFunction2' } } } Describe 'New-YamlHelp' { New-YamlHelp "$root\docs\New-YamlHelp.md" -OutputFolder "$outFolder\yaml" -Force $yamlContent = Get-Content "$outFolder\yaml\New-YamlHelp.yml" -Raw $deserializer = (New-Object -TypeName 'YamlDotNet.Serialization.DeserializerBuilder').WithNamingConvention((New-Object -TypeName 'YamlDotNet.Serialization.NamingConventions.CamelCaseNamingConvention')).Build() $yamlModel = $deserializer.Deserialize($yamlContent, [type]"Markdown.MAML.Model.YAML.YamlCommand") It 'serializes key properties correctly' { $yamlModel.Name | Should Be 'New-YamlHelp' $yamlModel.Module.Name | Should Be 'platyPS' $yamlModel.RequiredParameters.Count | Should Be 2 $yamlModel.RequiredParameters[0].Name | Should Be 'Path' $yamlModel.RequiredParameters[1].Name | Should Be 'OutputFolder' $yamlModel.OptionalParameters.Count | Should Be 2 $yamlModel.OptionalParameters[0].Name | Should Be 'Encoding' $yamlModel.OptionalParameters[1].Name | Should Be 'Force' } It 'throws for OutputFolder that is a file'{ { New-YamlHelp "$root\docs\New-YamlHelp.md" -OutputFolder "$outFolder\yaml\New-YamlHelp.yml" } | Should Throw } }
combined_dataset/train/non-malicious/Get-CryptoBytes_2.ps1
Get-CryptoBytes_2.ps1
function Get-CryptoBytes { #.Synopsis # Generate Cryptographically Random Bytes #.Description # Uses RNGCryptoServiceProvider to generate arrays of random bytes #.Parameter Count # How many bytes to generate #.Parameter AsString # Output hex-formatted strings instead of byte arrays param( [Parameter(ValueFromPipeline=$true)] @@# - array indicator not required [int]$count = 64 , [switch]$AsString ) begin { $RNGCrypto = New-Object System.Security.Cryptography.RNGCryptoServiceProvider $OFS = "" } process { foreach($length in $count) { $bytes = New-Object Byte[] $length $RNGCrypto.GetBytes($bytes) if($AsString){ Write-Output ("{0:X2}" -f $bytes) } else { Write-Output $bytes } } } end { $RNGCrypto = $null } }
combined_dataset/train/non-malicious/3352.ps1
3352.ps1
param ( [string] $configuration = 'Debug', [string] $pathDelimiter = ':' ) $tempModulePath = $env:PSModulePath $outputDir = "$PSScriptRoot/../artifacts/$configuration" Write-Warning "Running Test-ModuleManfiest on .psd1 files in $outputDir" $env:PSModulePath += "$pathDelimiter$outputDir/" Write-Warning "PSModulePath: $env:PSModulePath" $success = $true foreach($psd1FilePath in Get-ChildItem -Path $outputDir -Recurse -Filter *.psd1) { $manifestError = $null Test-ModuleManifest -Path $psd1FilePath.FullName -ErrorVariable manifestError if($manifestError){ Write-Warning "$($psd1FilePath.Name) failed to load." $success = $false } } $env:PSModulePath = $tempModulePath if(-not $success) { Write-Warning 'Failure: One or more module manifests failed to load.' exit 1 }
combined_dataset/train/non-malicious/sample_53_33.ps1
sample_53_33.ps1
# # Module manifest for module 'OCI.PSModules.Optimizer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Optimizer.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '18a4b1e7-fbad-4df9-a45b-6484df378fbb' # 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 Optimizer 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.1.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Optimizer.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-OCIOptimizerCategoriesList', 'Get-OCIOptimizerCategory', 'Get-OCIOptimizerEnrollmentStatus', 'Get-OCIOptimizerEnrollmentStatusesList', 'Get-OCIOptimizerHistoriesList', 'Get-OCIOptimizerProfile', 'Get-OCIOptimizerProfileLevelsList', 'Get-OCIOptimizerProfilesList', 'Get-OCIOptimizerRecommendation', 'Get-OCIOptimizerRecommendationsList', 'Get-OCIOptimizerRecommendationStrategiesList', 'Get-OCIOptimizerResourceAction', 'Get-OCIOptimizerResourceActionQueryableFieldsList', 'Get-OCIOptimizerResourceActionsList', 'Get-OCIOptimizerWorkRequest', 'Get-OCIOptimizerWorkRequestErrorsList', 'Get-OCIOptimizerWorkRequestLogsList', 'Get-OCIOptimizerWorkRequestsList', 'Invoke-OCIOptimizerBulkApplyRecommendations', 'Invoke-OCIOptimizerFilterResourceActions', 'New-OCIOptimizerProfile', 'Remove-OCIOptimizerProfile', 'Update-OCIOptimizerEnrollmentStatus', 'Update-OCIOptimizerProfile', 'Update-OCIOptimizerRecommendation', 'Update-OCIOptimizerResourceAction' # 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','Optimizer' # 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_51_48.ps1
sample_51_48.ps1
. "$PSScriptRoot/api.ps1" . "$PSScriptRoot/../php/api.ps1" $scheduledTasksFile = Get-Full-Path("Custom/scheduled-tasks/scheduled-tasks.json") $scheduledTasks = (Get-Content $scheduledTasksFile -Encoding UTF8 | Out-String | ConvertFrom-Json) while ($true) { Write-Host "Select your schedule :" $indexScheduling = 0 $groups = @{} foreach ($scheduling in $scheduledTasks.groups) { $description = $scheduling.description if ($description) { $description = "($description)" } Write-Host " - $indexScheduling) scheduling_$indexScheduling $description" $groups["$indexScheduling"] = $scheduling $indexScheduling = $indexScheduling + 1 } Write-Host " - $indexScheduling) Quit" $selection = Read-Host "Please make a selection" if ($selection -eq $indexScheduling) { return } $selectedScheduling = $groups["$selection"] Write-Host "Select your task :" $indexTask = 0 $tasks = @{} foreach ($task in $selectedScheduling.tasks) { $description = $task.description if ($description) { $description = "($description)" } $title = $task.phpFile if (-not $title) { $title = $task.commandFile } if (-not $title) { $title = $task.consoleCommand } if (-not $title) { $title = $task.sqlFile } Write-Host " - $indexTask) $title $description" $tasks[$indexTask] = $task $indexTask = $indexTask + 1 } Write-Host " - $indexTask) Quit" $selectionTask = Read-Host "Please make a selection" if ($selectionTask -eq $indexTask) { return } $schedulingFile = "$PSScriptRoot/../../../../Custom/scheduled-tasks/scheduling_$selection.ps1" . $schedulingFile -task $selectionTask }
combined_dataset/train/non-malicious/3879.ps1
3879.ps1
function Test-StorageInsightCreateUpdateDelete { $wsname = Get-ResourceName $siname = Get-ResourceName $saname = Get-ResourceName $rgname = Get-ResourceGroupName $said = Get-StorageResourceId $rgname $saname $wslocation = Get-ProviderLocation New-AzResourceGroup -Name $rgname -Location $wslocation -Force $workspace = New-AzOperationalInsightsWorkspace -ResourceGroupName $rgname -Name $wsname -Location $wslocation -Sku "STANDARD" -Force $storageinsight = New-AzOperationalInsightsStorageInsight -ResourceGroupName $rgname -WorkspaceName $wsname -Name $siname -Tables @("WADWindowsEventLogsTable", "LinuxSyslogVer2v0") -Containers @("wad-iis-logfiles") -StorageAccountResourceId $said -StorageAccountKey "fakekey" Assert-AreEqual $siname $storageInsight.Name Assert-NotNull $storageInsight.ResourceId Assert-AreEqual $rgname $storageInsight.ResourceGroupName Assert-AreEqual $wsname $storageInsight.WorkspaceName Assert-AreEqual $said $storageInsight.StorageAccountResourceId Assert-AreEqual "OK" $storageInsight.State Assert-AreEqualArray @("WADWindowsEventLogsTable", "LinuxSyslogVer2v0") $storageInsight.Tables Assert-AreEqualArray @("wad-iis-logfiles") $storageInsight.Containers $storageInsight = Get-AzOperationalInsightsStorageInsight -ResourceGroupName $rgname -WorkspaceName $wsname -Name $siname Assert-AreEqual $siname $storageInsight.Name Assert-NotNull $storageInsight.ResourceId Assert-AreEqual $rgname $storageInsight.ResourceGroupName Assert-AreEqual $wsname $storageInsight.WorkspaceName Assert-AreEqual $said $storageInsight.StorageAccountResourceId Assert-AreEqual "OK" $storageInsight.State Assert-AreEqualArray @("WADWindowsEventLogsTable", "LinuxSyslogVer2v0") $storageInsight.Tables Assert-AreEqualArray @("wad-iis-logfiles") $storageInsight.Containers $sinametwo = Get-ResourceName $storageinsight = New-AzOperationalInsightsStorageInsight -ResourceGroupName $rgname -WorkspaceName $wsname -Name $sinametwo -Tables @("WADWindowsEventLogsTable", "LinuxSyslogVer2v0") -StorageAccountResourceId $said -StorageAccountKey "fakekey" $storageinsights = Get-AzOperationalInsightsStorageInsight -ResourceGroupName $rgname -WorkspaceName $wsname Assert-AreEqual 2 $storageinsights.Count Assert-AreEqual 1 ($storageinsights | Where {$_.Name -eq $siname}).Count Assert-AreEqual 1 ($storageinsights | Where {$_.Name -eq $sinametwo}).Count $storageinsights = Get-AzOperationalInsightsStorageInsight -Workspace $workspace Assert-AreEqual 2 $storageinsights.Count Assert-AreEqual 1 ($storageinsights | Where {$_.Name -eq $siname}).Count Assert-AreEqual 1 ($storageinsights | Where {$_.Name -eq $sinametwo}).Count Remove-AzOperationalInsightsStorageInsight -ResourceGroupName $rgname -WorkspaceName $wsname -Name $sinametwo -Force Assert-ThrowsContains { Get-AzOperationalInsightsStorageInsight -Workspace $workspace -Name $sinametwo } "NotFound" $storageinsights = Get-AzOperationalInsightsStorageInsight -Workspace $workspace Assert-AreEqual 1 $storageinsights.Count Assert-AreEqual 1 ($storageinsights | Where {$_.Name -eq $siname}).Count Assert-AreEqual 0 ($storageinsights | Where {$_.Name -eq $sinametwo}).Count $storageinsight = Set-AzOperationalInsightsStorageInsight -ResourceGroupName $rgname -WorkspaceName $wsname -Name $siname -Tables @("WADWindowsEventLogsTable") -Containers @() -StorageAccountKey "anotherfakekey" Assert-AreEqualArray @("WADWindowsEventLogsTable") $storageInsight.Tables Assert-AreEqualArray @() $storageInsight.Containers $storageinsight = $storageinsight | Set-AzOperationalInsightsStorageInsight -Tables @() -Containers @("wad-iis-logfiles") -StorageAccountKey "anotherfakekey" Assert-AreEqualArray @() $storageInsight.Tables Assert-AreEqualArray @("wad-iis-logfiles") $storageInsight.Containers $storageinsight = New-AzOperationalInsightsStorageInsight -Workspace $workspace -Name $siname -Tables @("WADWindowsEventLogsTable") -Containers @("wad-iis-logfiles") -StorageAccountKey "anotherfakekey" -StorageAccountResourceId $said -Force Assert-AreEqualArray @("WADWindowsEventLogsTable") $storageInsight.Tables Assert-AreEqualArray @("wad-iis-logfiles") $storageInsight.Containers Remove-AzOperationalInsightsStorageInsight -Workspace $workspace -Name $siname -Force Assert-ThrowsContains { Get-AzOperationalInsightsStorageInsight -Workspace $workspace -Name $siname } "NotFound" $storageinsights = Get-AzOperationalInsightsStorageInsight -Workspace $workspace Assert-AreEqual 0 $storageinsights.Count } function Test-StorageInsightCreateFailsNoWs { $wsname = Get-ResourceName $siname = Get-ResourceName $saname = Get-ResourceName $rgname = Get-ResourceGroupName $said = Get-StorageResourceId $rgname $saname $wslocation = Get-ProviderLocation New-AzResourceGroup -Name $rgname -Location $wslocation -Force Assert-ThrowsContains { New-AzOperationalInsightsStorageInsight -ResourceGroupName $rgname -WorkspaceName $wsname -Name $siname -Tables @("WADWindowsEventLogsTable", "LinuxSyslogVer2v0") -StorageAccountResourceId $said -StorageAccountKey "fakekey" } "NotFound" }
combined_dataset/train/non-malicious/Get-NaNfsExport_1.ps1
Get-NaNfsExport_1.ps1
# Glenn Sizemore ~ www . Get-Admin . Com # Example Powershell function to get the NFS Exports from a NetApp Filer # First you'll need to download the OnTap SDK 3.5 : http://communities.netapp.com/docs/DOC-1365 # within the download your interested in .\\manage-ontap-sdk-3.5\\lib\\DotNet\\ManageOntap.dll # Next load the library... # $Path = 'C:\\Users\\glnsize\\Downloads\\manage-ontap-sdk-3.5\\lib\\DotNet\\ManageOntap.dll' # [Reflection.Assembly]::LoadFile($Path) # # Almost there next step create a NaServer connection object # Here we are connecting to the NetApp Filer TOASTER1, and setting the api to V1.8 # $NaServer = New-Object NetApp.Manage.NaServer("TOASTER1",1,8) # Call the setAdminUser Method and supply some credentials # $NaServer.SetAdminUser('root', 'password') # # Now we're ready to go simply call the function passing your NAServer object as a parameter. # Get-NaNfsExport -Server $NaServer # # Get-NaNfsExport -Server $NaServer -Path /vol/vol0 Function Get-NaNfsExport { Param( [NetApp.Manage.NaServer] $Server, [String] $Path ) Begin { $out = @() } Process { trap [NetApp.Manage.NaAuthException] { # Example trap to catch bad credentials Write-Error "Bad login/password". break } #generate a new naelement request $NaOut = New-Object NetApp.Manage.NaElement("nfs-exportfs-list-rules") # $NaServer.InvokeElem($NaOut) -> retrieve the results of the $NaOut request # ..($NaOut).GetChildByName("rules") -> select the rules element from results # ..GetChildByName("rules").getchildren() -> get any child elements under rules. $NaResults = $Server.InvokeElem($NaOut).GetChildByName("rules").getchildren() #ForEach NFS Rule returned, serialize the output into a PSObject. foreach ($NaElement in $NaResults) { $NaNFS = "" | Select-Object Path, ActualPath, ReadOnly, ReadWrite, Root, Security $NaNFS.Path = $NaElement.GetChildContent("pathname") # This is where the OnTap SDK can get a little nuts... # if you perfer XML then simply try $NaElement.ToPrettyString('') switch ($NaElement) { # if Read-Only is present {$_.GetChildByName("read-only")} { # Get all child elements $ReadOnly = ($_.GetChildByName("read-only")).getchildren() #Foreach elm in read-only foreach ($read in $ReadOnly) { # [bool] if exists "all-hosts" If ($read.GetChildContent("all-hosts")) { $roList = 'All-Hosts' } # Else get the name of the export! Elseif ($read.GetChildContent("name")) { $roList += $read.GetChildContent("name") } } # add our new list to the output $NaNFS.ReadOnly = $roList } # if Read-write is present {$_.GetChildByName("read-write")} { $ReadWrite = ($_.GetChildByName("read-write")).getchildren() foreach ($write in $ReadWrite) { If ($write.GetChildContent("all-hosts")) { $rwList = 'All-Hosts' } Elseif ($r.GetChildContent("name")) { $rwList += $write.GetChildContent("name") } } $NaNFS.ReadWrite = $rwList } # if root is present {$_.GetChildByName("root")} { $Root = ($_.GetChildByName("root")).getchildren() foreach ($r in $Root) { If ($r.GetChildContent("all-hosts")) { $rrList = 'All-Hosts' } Elseif ($r.GetChildContent("name")) { $rrList += $r.GetChildContent("name") } } $NaNFS.Root = $rrList } {$_.GetChildByName("sec-flavor")} { $Security = ($_.GetChildByName("sec-flavor")).getchildren() foreach ($s in $Security) { if ($r.GetChildContent("flavor")) { $SecList += $r.GetChildContent("flavor") } } $NaNFS.Security = $SecList } {$_.GetChildByName("actual-pathname")} { $NaNFS.ActualPath = $_.GetChildByName("actual-pathname") } # needed for mixed vol reporting... {!$_.GetChildByName("actual-pathname")} { $NaNFS.ActualPath = $_.GetChildContent("pathname") } } $out += $NaNFS } } End { If ($Path) { return $out | ?{$_.Path -match $Patch} } else { return $out } } }
combined_dataset/train/non-malicious/930.ps1
930.ps1
$omsId = "<Replace with your OMS ID>" $omsKey = "<Replace with your OMS key>" $resourceGroup = "myResourceGroup" $location = "westeurope" $vmName = "myVM" $cred = Get-Credential -Message "Enter a username and password for the virtual machine." New-AzResourceGroup -Name $resourceGroup -Location $location New-AzVM ` -ResourceGroupName $resourceGroup ` -Name $vmName ` -Location $location ` -ImageName "Win2016Datacenter" ` -VirtualNetworkName "myVnet" ` -SubnetName "mySubnet" ` -SecurityGroupName "myNetworkSecurityGroup" ` -PublicIpAddressName "myPublicIp" ` -Credential $cred ` -OpenPorts 3389 $PublicSettings = New-Object psobject | Add-Member -PassThru NoteProperty workspaceId $omsId | ConvertTo-Json $protectedSettings = New-Object psobject | Add-Member -PassThru NoteProperty workspaceKey $omsKey | ConvertTo-Json Set-AzVMExtension -ExtensionName "OMS" -ResourceGroupName $resourceGroup -VMName $vmName ` -Publisher "Microsoft.EnterpriseCloud.Monitoring" -ExtensionType "MicrosoftMonitoringAgent" ` -TypeHandlerVersion 1.0 -SettingString $PublicSettings -ProtectedSettingString $protectedSettings ` -Location $location
combined_dataset/train/non-malicious/3937.ps1
3937.ps1
function Test-NetworkInterfaceExpandResource { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $nicName = Get-ResourceName $domainNameLabel = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/networkInterfaces" $location = Get-ProviderLocation $resourceTypeParent try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" } $subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24 $vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet $publicip = New-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel $job = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -Subnet $vnet.Subnets[0] -PublicIpAddress $publicip -AsJob $job | Wait-Job $actualNic = $job | Receive-Job $expectedNic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $expectedNic.Name $actualNic.Name Assert-AreEqual $expectedNic.Location $actualNic.Location Assert-NotNull $expectedNic.ResourceGuid Assert-AreEqual "Succeeded" $expectedNic.ProvisioningState Assert-AreEqual $expectedNic.IpConfigurations[0].Name $actualNic.IpConfigurations[0].Name Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $actualNic.IpConfigurations[0].PublicIpAddress.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $actualNic.IpConfigurations[0].Subnet.Id Assert-NotNull $expectedNic.IpConfigurations[0].PrivateIpAddress Assert-AreEqual "Dynamic" $expectedNic.IpConfigurations[0].PrivateIpAllocationMethod Assert-Null $expectedNic.IpConfigurations[0].PublicIpAddress.Name Assert-Null $expectedNic.IpConfigurations[0].Subnet.Name $publicip = Get-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $publicip.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $publicip.IpConfiguration.Id $vnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $vnet.Subnets[0].Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $vnet.Subnets[0].IpConfigurations[0].Id $nic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -ExpandResource "IpConfigurations/Subnet" Assert-Null $nic.IpConfigurations[0].PublicIpAddress.Name Assert-NotNull $nic.IpConfigurations[0].Subnet.Name $nic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -ExpandResource "IpConfigurations/PublicIPAddress" Assert-NotNull $nic.IpConfigurations[0].PublicIpAddress.Name Assert-Null $nic.IpConfigurations[0].Subnet.Name $nic = Get-AzNetworkInterface -ResourceId $expectedNic.Id -ExpandResource "IpConfigurations/Subnet" Assert-Null $nic.IpConfigurations[0].PublicIpAddress.Name Assert-NotNull $nic.IpConfigurations[0].Subnet.Name $nic = Get-AzNetworkInterface -ResourceId $expectedNic.Id -ExpandResource "IpConfigurations/PublicIPAddress" Assert-NotNull $nic.IpConfigurations[0].PublicIpAddress.Name Assert-Null $nic.IpConfigurations[0].Subnet.Name $delete = Remove-AzNetworkInterface -ResourceGroupName $rgname -name $nicName -PassThru -Force Assert-AreEqual true $delete $list = Get-AzNetworkInterface -ResourceGroupName $rgname Assert-AreEqual 0 @($list).Count } finally { Clean-ResourceGroup $rgname } } function Test-NetworkInterfaceCRUD { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $nicName = Get-ResourceName $domainNameLabel = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/networkInterfaces" $location = Get-ProviderLocation $resourceTypeParent try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" } $subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24 $vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet $publicip = New-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel $actualNic = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -Subnet $vnet.Subnets[0] -PublicIpAddress $publicip $expectedNic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $expectedNic.Name $actualNic.Name Assert-AreEqual $expectedNic.Location $actualNic.Location Assert-NotNull $expectedNic.ResourceGuid Assert-AreEqual "Succeeded" $expectedNic.ProvisioningState Assert-AreEqual $expectedNic.IpConfigurations[0].Name $actualNic.IpConfigurations[0].Name Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $actualNic.IpConfigurations[0].PublicIpAddress.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $actualNic.IpConfigurations[0].Subnet.Id Assert-NotNull $expectedNic.IpConfigurations[0].PrivateIpAddress Assert-AreEqual "Dynamic" $expectedNic.IpConfigurations[0].PrivateIpAllocationMethod $expectedNic = Get-AzNetworkInterface -ResourceId $actualNic.Id Assert-AreEqual $expectedNic.ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $expectedNic.Name $actualNic.Name Assert-AreEqual $expectedNic.Location $actualNic.Location Assert-NotNull $expectedNic.ResourceGuid Assert-AreEqual "Succeeded" $expectedNic.ProvisioningState Assert-AreEqual $expectedNic.IpConfigurations[0].Name $actualNic.IpConfigurations[0].Name Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $actualNic.IpConfigurations[0].PublicIpAddress.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $actualNic.IpConfigurations[0].Subnet.Id Assert-NotNull $expectedNic.IpConfigurations[0].PrivateIpAddress Assert-AreEqual "Dynamic" $expectedNic.IpConfigurations[0].PrivateIpAllocationMethod $publicip = Get-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $publicip.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $publicip.IpConfiguration.Id $vnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $vnet.Subnets[0].Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $vnet.Subnets[0].IpConfigurations[0].Id $list = Get-AzNetworkInterface -ResourceGroupName $rgname Assert-AreEqual 1 @($list).Count Assert-AreEqual $list[0].ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $list[0].Name $actualNic.Name Assert-AreEqual $list[0].Location $actualNic.Location Assert-AreEqual "Succeeded" $list[0].ProvisioningState Assert-AreEqual $actualNic.Etag $list[0].Etag $job = Remove-AzNetworkInterface -ResourceGroupName $rgname -name $nicName -PassThru -Force -AsJob $job | Wait-Job $delete = $job | Receive-Job Assert-AreEqual true $delete $list = Get-AzNetworkInterface -ResourceGroupName $rgname Assert-AreEqual 0 @($list).Count } finally { Clean-ResourceGroup $rgname } } function Test-NetworkInterfaceCRUDUsingId { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $nicName = Get-ResourceName $domainNameLabel = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/networkInterfaces" $location = Get-ProviderLocation $resourceTypeParent try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" } $subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24 $vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet $publicip = New-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel $actualNic = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $publicip.Id $expectedNic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $expectedNic.Name $actualNic.Name Assert-AreEqual $expectedNic.Location $actualNic.Location Assert-AreEqual "Succeeded" $expectedNic.ProvisioningState Assert-AreEqual $expectedNic.IpConfigurations[0].Name $actualNic.IpConfigurations[0].Name Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $actualNic.IpConfigurations[0].PublicIpAddress.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $actualNic.IpConfigurations[0].Subnet.Id Assert-NotNull $expectedNic.IpConfigurations[0].PrivateIpAddress Assert-AreEqual "Dynamic" $expectedNic.IpConfigurations[0].PrivateIpAllocationMethod $publicip = Get-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $publicip.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $publicip.IpConfiguration.Id $vnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $vnet.Subnets[0].Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $vnet.Subnets[0].IpConfigurations[0].Id $list = Get-AzNetworkInterface -ResourceGroupName $rgname Assert-AreEqual 1 @($list).Count Assert-AreEqual $list[0].ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $list[0].Name $actualNic.Name Assert-AreEqual $list[0].Location $actualNic.Location Assert-AreEqual "Succeeded" $list[0].ProvisioningState Assert-AreEqual $actualNic.Etag $list[0].Etag $delete = Remove-AzNetworkInterface -ResourceGroupName $rgname -name $nicName -PassThru -Force Assert-AreEqual true $delete $list = Get-AzNetworkInterface -ResourceGroupName $rgname Assert-AreEqual 0 @($list).Count } finally { Clean-ResourceGroup $rgname } } function Test-NetworkInterfaceCRUDStaticAllocation { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $nicName = Get-ResourceName $domainNameLabel = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/networkInterfaces" $location = Get-ProviderLocation $resourceTypeParent try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" } $subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24 $vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet $publicip = New-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Dynamic $actualNic = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -PrivateIpAddress "10.0.1.5" -Subnet $vnet.Subnets[0] -PublicIpAddress $publicip $expectedNic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $expectedNic.Name $actualNic.Name Assert-AreEqual $expectedNic.Location $actualNic.Location Assert-AreEqual "Succeeded" $expectedNic.ProvisioningState Assert-AreEqual $expectedNic.IpConfigurations[0].Name $actualNic.IpConfigurations[0].Name Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $actualNic.IpConfigurations[0].PublicIpAddress.Id Assert-AreEqual "Static" $actualNic.IpConfigurations[0].PrivateIpAllocationMethod Assert-AreEqual "10.0.1.5" $actualNic.IpConfigurations[0].PrivateIpAddress Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $actualNic.IpConfigurations[0].Subnet.Id $publicip = Get-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $publicip.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $publicip.IpConfiguration.Id $vnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $vnet.Subnets[0].Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $vnet.Subnets[0].IpConfigurations[0].Id } finally { Clean-ResourceGroup $rgname } } function Test-NetworkInterfaceNoPublicIpAddress { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $nicName = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/networkInterfaces" $location = Get-ProviderLocation $resourceTypeParent try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" } $subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24 $vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet $actualNic = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -Subnet $vnet.Subnets[0] $expectedNic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $expectedNic.Name $actualNic.Name Assert-AreEqual $expectedNic.Location $actualNic.Location Assert-AreEqual "Succeeded" $expectedNic.ProvisioningState Assert-AreEqual $expectedNic.IpConfigurations[0].Name $actualNic.IpConfigurations[0].Name Assert-Null $expectedNic.IpConfigurations[0].PublicIpAddress.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $actualNic.IpConfigurations[0].Subnet.Id $vnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $vnet.Subnets[0].Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $vnet.Subnets[0].IpConfigurations[0].Id $list = Get-AzNetworkInterface -ResourceGroupName $rgname Assert-AreEqual 1 @($list).Count Assert-AreEqual $list[0].ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $list[0].Name $actualNic.Name Assert-AreEqual $list[0].Location $actualNic.Location Assert-AreEqual "Succeeded" $list[0].ProvisioningState Assert-AreEqual $actualNic.Etag $list[0].Etag $delete = Remove-AzNetworkInterface -ResourceGroupName $rgname -name $nicName -PassThru -Force Assert-AreEqual true $delete $list = Get-AzNetworkInterface -ResourceGroupName $rgname Assert-AreEqual 0 @($list).Count } finally { Clean-ResourceGroup $rgname } } function Test-NetworkInterfaceSet { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $publicIpName2 = Get-ResourceName $nicName = Get-ResourceName $domainNameLabel = Get-ResourceName $domainNameLabel2 = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/networkInterfaces" $location = Get-ProviderLocation $resourceTypeParent try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" } $subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24 $vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet $publicip = New-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel $actualNic = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -SubnetId $vnet.Subnets[0].Id -PublicIpAddressId $publicip.Id $expectedNic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $expectedNic.Name $actualNic.Name Assert-AreEqual $expectedNic.Location $actualNic.Location Assert-AreEqual "Succeeded" $expectedNic.ProvisioningState Assert-AreEqual $expectedNic.IpConfigurations[0].Name $actualNic.IpConfigurations[0].Name Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $actualNic.IpConfigurations[0].PublicIpAddress.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $actualNic.IpConfigurations[0].Subnet.Id $publicip = Get-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $publicip.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $publicip.IpConfiguration.Id $vnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $vnet.Subnets[0].Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $vnet.Subnets[0].IpConfigurations[0].Id $publicip2 = New-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName2 -location $location -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel2 $nic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname $nic.IpConfigurations[0].PublicIpAddress = $publicip2 $job = $nic | Set-AzNetworkInterface -AsJob $job | Wait-Job $nic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname $publicip2 = Get-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName2 Assert-AreEqual $nic.IpConfigurations[0].PublicIpAddress.Id $publicip2.Id Assert-AreEqual $nic.IpConfigurations[0].Id $publicip2.IpConfiguration.Id $publicip = Get-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName Assert-Null $publicip.IpConfiguration $vnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname Assert-AreEqual $nic.IpConfigurations[0].Subnet.Id $vnet.Subnets[0].Id Assert-AreEqual $nic.IpConfigurations[0].Id $vnet.Subnets[0].IpConfigurations[0].Id } finally { Clean-ResourceGroup $rgname } } function Test-NetworkInterfaceIDns { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $nicName = Get-ResourceName $domainNameLabel = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/networkInterfaces" $location = Get-ProviderLocation $resourceTypeParent try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" } $subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24 $vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet $actualNic = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -Subnet $vnet.Subnets[0] -InternalDnsNameLabel "idnstest" $expectedNic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $expectedNic.Name $actualNic.Name Assert-AreEqual $expectedNic.Location $actualNic.Location Assert-AreEqual "Succeeded" $expectedNic.ProvisioningState Assert-AreEqual $expectedNic.IpConfigurations[0].Name $actualNic.IpConfigurations[0].Name Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $actualNic.IpConfigurations[0].PublicIpAddress.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $actualNic.IpConfigurations[0].Subnet.Id Assert-NotNull $expectedNic.IpConfigurations[0].PrivateIpAddress Assert-AreEqual "Dynamic" $expectedNic.IpConfigurations[0].PrivateIpAllocationMethod Assert-AreEqual "idnstest" $expectedNic.DnsSettings.InternalDnsNameLabel Assert-NotNull $expectedNic.DnsSettings.InternalFqdn $delete = Remove-AzNetworkInterface -ResourceGroupName $rgname -name $nicName -PassThru -Force Assert-AreEqual true $delete $list = Get-AzNetworkInterface -ResourceGroupName $rgname Assert-AreEqual 0 @($list).Count } finally { Clean-ResourceGroup $rgname } } function Test-NetworkInterfaceEnableIPForwarding { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $nicName = Get-ResourceName $domainNameLabel = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/networkInterfaces" $location = Get-ProviderLocation $resourceTypeParent try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" } $subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24 $vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet $actualNic = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -Subnet $vnet.Subnets[0] -EnableIPForwarding $expectedNic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $expectedNic.Name $actualNic.Name Assert-AreEqual $expectedNic.Location $actualNic.Location Assert-AreEqual "Succeeded" $expectedNic.ProvisioningState Assert-AreEqual $expectedNic.IpConfigurations[0].Name $actualNic.IpConfigurations[0].Name Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $actualNic.IpConfigurations[0].PublicIpAddress.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $actualNic.IpConfigurations[0].Subnet.Id Assert-NotNull $expectedNic.IpConfigurations[0].PrivateIpAddress Assert-AreEqual true $expectedNic.EnableIPForwarding $nic = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -Subnet $vnet.Subnets[0] -Force Assert-AreEqual $expectedNic.Name $nic.Name Assert-AreEqual false $nic.EnableIPForwarding $nic.EnableIPForwarding = $true $nic = $nic | Set-AzNetworkInterface Assert-AreEqual $expectedNic.Name $nic.Name Assert-AreEqual true $nic.EnableIPForwarding $delete = Remove-AzNetworkInterface -ResourceGroupName $rgname -name $nicName -PassThru -Force Assert-AreEqual true $delete $list = Get-AzNetworkInterface -ResourceGroupName $rgname Assert-AreEqual 0 @($list).Count } finally { Clean-ResourceGroup $rgname } } function Test-NetworkInterfaceIpv6 { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $subnet2Name = Get-ResourceName $publicIpName = Get-ResourceName $nicName = Get-ResourceName $ipconfigName = Get-ResourceName $domainNameLabel = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/networkInterfaces" $location = Get-ProviderLocation $resourceTypeParent try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" } $subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24 $subnet2 = New-AzVirtualNetworkSubnetConfig -Name $subnet2Name -AddressPrefix 10.0.2.0/24 $vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet,$subnet2 $publicip = New-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel $actualNic = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -Subnet $vnet.Subnets[0] -PublicIpAddress $publicip $expectedNic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname $publicip = Get-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $publicip.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $publicip.IpConfiguration.Id $vnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $vnet.Subnets[0].Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $vnet.Subnets[0].IpConfigurations[0].Id $list = Get-AzNetworkInterface -ResourceGroupName $rgname Assert-AreEqual 1 @($list).Count Assert-AreEqual $list[0].ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $list[0].Name $actualNic.Name Assert-AreEqual $list[0].Location $actualNic.Location Assert-AreEqual "Succeeded" $list[0].ProvisioningState Assert-AreEqual $actualNic.Etag $list[0].Etag $nic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname | Add-AzNetworkInterfaceIpConfig -Name $ipconfigName -PrivateIpAddressVersion ipv6 | Set-AzNetworkInterface Assert-AreEqual 2 @($nic.IpConfigurations).Count Assert-AreEqual $expectedNic.IpConfigurations[0].Name $nic.IpConfigurations[0].Name Assert-AreEqual $publicip.Id $nic.IpConfigurations[0].PublicIpAddress.Id Assert-AreEqual $vnet.Subnets[0].Id $nic.IpConfigurations[0].Subnet.Id Assert-NotNull $nic.IpConfigurations[0].PrivateIpAddress Assert-AreEqual "Dynamic" $nic.IpConfigurations[0].PrivateIpAllocationMethod Assert-AreEqual $nic.IpConfigurations[0].PrivateIpAddressVersion IPv4 Assert-AreEqual $ipconfigName $nic.IpConfigurations[1].Name Assert-Null $nic.IpConfigurations[1].PublicIpAddress Assert-Null $nic.IpConfigurations[1].Subnet Assert-AreEqual $nic.IpConfigurations[1].PrivateIpAddressVersion IPv6 $nic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname | Set-AzNetworkInterfaceIpConfig -Name $nic.IpConfigurations[0].Name -Subnet $vnet.Subnets[1] -PrivateIpAddress "10.0.2.10" | Set-AzNetworkInterface Assert-AreEqual 2 @($nic.IpConfigurations).Count Assert-AreEqual $expectedNic.IpConfigurations[0].Name $nic.IpConfigurations[0].Name Assert-Null $nic.IpConfigurations[0].PublicIpAddress Assert-AreEqual $vnet.Subnets[1].Id $nic.IpConfigurations[0].Subnet.Id Assert-NotNull $nic.IpConfigurations[0].PrivateIpAddress Assert-AreEqual "Static" $nic.IpConfigurations[0].PrivateIpAllocationMethod Assert-AreEqual $nic.IpConfigurations[0].PrivateIpAddressVersion IPv4 Assert-AreEqual $ipconfigName $nic.IpConfigurations[1].Name Assert-Null $nic.IpConfigurations[1].PublicIpAddress Assert-Null $nic.IpConfigurations[1].Subnet Assert-AreEqual $nic.IpConfigurations[1].PrivateIpAddressVersion IPv6 $ipconfigv6 = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname | Get-AzNetworkInterfaceIpConfig -Name $ipconfigName Assert-AreEqual $ipconfigName $ipconfigv6.Name Assert-Null $ipconfigv6.PublicIpAddress Assert-Null $ipconfigv6.Subnet Assert-AreEqual $ipconfigv6.PrivateIpAddressVersion IPv6 $ipconfigList = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname | Get-AzNetworkInterfaceIpConfig Assert-AreEqual 2 @($ipconfigList).Count Assert-AreEqual $expectedNic.IpConfigurations[0].Name $ipconfigList[0].Name Assert-Null $ipconfigList[0].PublicIpAddress.Id Assert-NotNull $ipconfigList[0].PrivateIpAddress Assert-AreEqual "Static" $nic.IpConfigurations[0].PrivateIpAllocationMethod Assert-AreEqual $ipconfigList[0].PrivateIpAddressVersion IPv4 Assert-AreEqual $ipconfigName $ipconfigList[1].Name Assert-Null $ipconfigList[1].PublicIpAddress Assert-Null $ipconfigList[1].Subnet Assert-AreEqual $ipconfigList[1].PrivateIpAddressVersion IPv6 $nic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname | Remove-AzNetworkInterfaceIpConfig -Name $ipconfigName | Set-AzNetworkInterface Assert-AreEqual 1 @($nic.IpConfigurations).Count Assert-AreEqual $expectedNic.IpConfigurations[0].Name $nic.IpConfigurations[0].Name Assert-Null $nic.IpConfigurations[0].PublicIpAddress Assert-AreEqual $vnet.Subnets[1].Id $nic.IpConfigurations[0].Subnet.Id Assert-NotNull $nic.IpConfigurations[0].PrivateIpAddress Assert-AreEqual "Static" $nic.IpConfigurations[0].PrivateIpAllocationMethod Assert-AreEqual $nic.IpConfigurations[0].PrivateIpAddressVersion IPv4 $delete = Remove-AzNetworkInterface -ResourceGroupName $rgname -name $nicName -PassThru -Force Assert-AreEqual true $delete $list = Get-AzNetworkInterface -ResourceGroupName $rgname Assert-AreEqual 0 @($list).Count } finally { Clean-ResourceGroup $rgname } } function Test-NetworkInterfaceWithIpConfiguration { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $nicName = Get-ResourceName $ipconfig1Name = Get-ResourceName $ipconfig2Name = Get-ResourceName $domainNameLabel = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/networkInterfaces" $location = Get-ProviderLocation $resourceTypeParent try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" } $subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24 $vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet $publicip = New-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel $ipconfig1 = New-AzNetworkInterfaceIpConfig -Name $ipconfig1Name -Subnet $vnet.Subnets[0] -PublicIpAddress $publicip $ipconfig2 = New-AzNetworkInterfaceIpConfig -Name $ipconfig2Name -PrivateIpAddressVersion IPv6 $nic = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -IpConfiguration $ipconfig1,$ipconfig2 -Tag @{ testtag = "testval" } Assert-AreEqual $rgname $nic.ResourceGroupName Assert-AreEqual $nicName $nic.Name Assert-NotNull $nic.ResourceGuid Assert-AreEqual "Succeeded" $nic.ProvisioningState Assert-AreEqual $nic.IpConfigurations[0].Name $nic.IpConfigurations[0].Name Assert-AreEqual $nic.IpConfigurations[0].PublicIpAddress.Id $nic.IpConfigurations[0].PublicIpAddress.Id Assert-AreEqual $nic.IpConfigurations[0].Subnet.Id $nic.IpConfigurations[0].Subnet.Id Assert-NotNull $nic.IpConfigurations[0].PrivateIpAddress Assert-AreEqual "Dynamic" $nic.IpConfigurations[0].PrivateIpAllocationMethod $publicip = Get-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName Assert-AreEqual $nic.IpConfigurations[0].PublicIpAddress.Id $publicip.Id Assert-AreEqual $nic.IpConfigurations[0].Id $publicip.IpConfiguration.Id $vnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname Assert-AreEqual $nic.IpConfigurations[0].Subnet.Id $vnet.Subnets[0].Id Assert-AreEqual $nic.IpConfigurations[0].Id $vnet.Subnets[0].IpConfigurations[0].Id Assert-AreEqual 2 @($nic.IpConfigurations).Count Assert-AreEqual $ipconfig1Name $nic.IpConfigurations[0].Name Assert-AreEqual $publicip.Id $nic.IpConfigurations[0].PublicIpAddress.Id Assert-AreEqual $vnet.Subnets[0].Id $nic.IpConfigurations[0].Subnet.Id Assert-NotNull $nic.IpConfigurations[0].PrivateIpAddress Assert-AreEqual "Dynamic" $nic.IpConfigurations[0].PrivateIpAllocationMethod Assert-AreEqual $nic.IpConfigurations[0].PrivateIpAddressVersion IPv4 Assert-AreEqual $ipconfig2Name $nic.IpConfigurations[1].Name Assert-Null $nic.IpConfigurations[1].PublicIpAddress Assert-Null $nic.IpConfigurations[1].Subnet Assert-AreEqual $nic.IpConfigurations[1].PrivateIpAddressVersion IPv6 $delete = Remove-AzNetworkInterface -ResourceGroupName $rgname -name $nicName -PassThru -Force Assert-AreEqual true $delete $list = Get-AzNetworkInterface -ResourceGroupName $rgname Assert-AreEqual 0 @($list).Count } finally { Clean-ResourceGroup $rgname } } function Test-NetworkInterfaceWithAcceleratedNetworking { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $nicName = Get-ResourceName $domainNameLabel = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement "West Central US" $resourceTypeParent = "Microsoft.Network/networkInterfaces" $location = Get-ProviderLocation $resourceTypeParent "West Central US" try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" } $subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24 $vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet $publicip = New-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel $actualNic = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -Subnet $vnet.Subnets[0] -PublicIpAddress $publicip -EnableAcceleratedNetworking $expectedNic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $expectedNic.Name $actualNic.Name Assert-AreEqual $expectedNic.Location $actualNic.Location Assert-NotNull $expectedNic.ResourceGuid Assert-AreEqual "Succeeded" $expectedNic.ProvisioningState Assert-AreEqual $expectedNic.IpConfigurations[0].Name $actualNic.IpConfigurations[0].Name Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $actualNic.IpConfigurations[0].PublicIpAddress.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $actualNic.IpConfigurations[0].Subnet.Id Assert-NotNull $expectedNic.IpConfigurations[0].PrivateIpAddress Assert-AreEqual $expectedNic.EnableAcceleratedNetworking $true Assert-AreEqual "Dynamic" $expectedNic.IpConfigurations[0].PrivateIpAllocationMethod $publicip = Get-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName Assert-AreEqual $expectedNic.IpConfigurations[0].PublicIpAddress.Id $publicip.Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $publicip.IpConfiguration.Id $vnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname Assert-AreEqual $expectedNic.IpConfigurations[0].Subnet.Id $vnet.Subnets[0].Id Assert-AreEqual $expectedNic.IpConfigurations[0].Id $vnet.Subnets[0].IpConfigurations[0].Id $list = Get-AzNetworkInterface -ResourceGroupName $rgname Assert-AreEqual 1 @($list).Count Assert-AreEqual $list[0].ResourceGroupName $actualNic.ResourceGroupName Assert-AreEqual $list[0].Name $actualNic.Name Assert-AreEqual $list[0].Location $actualNic.Location Assert-AreEqual "Succeeded" $list[0].ProvisioningState Assert-AreEqual $actualNic.Etag $list[0].Etag $list = Get-AzNetworkInterface -ResourceGroupName "*" -Name "*" Assert-True { $list.Count -ge 0 } $list = Get-AzNetworkInterface -Name "*" Assert-True { $list.Count -ge 0 } $list = Get-AzNetworkInterface -ResourceGroupName "*" Assert-True { $list.Count -ge 0 } $delete = Remove-AzNetworkInterface -ResourceGroupName $rgname -name $nicName -PassThru -Force Assert-AreEqual true $delete $list = Get-AzNetworkInterface -ResourceGroupName $rgname Assert-AreEqual 0 @($list).Count } finally { Clean-ResourceGroup $rgname } } function Test-NetworkInterfaceTapConfigurationCRUD { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $nicName = Get-ResourceName $domainNameLabel = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/networkInterfaces" $location = Get-ProviderLocation $resourceTypeParent $rname = Get-ResourceName $vtapName = Get-ResourceName $vtapName2 = Get-ResourceName $sourceIpConfigName = Get-ResourceName $sourceNicName = Get-ResourceName try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" } $subnet = New-AzVirtualNetworkSubnetConfig -Name $subnetName -AddressPrefix 10.0.1.0/24 $vnet = New-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgname -Location $location -AddressPrefix 10.0.0.0/16 -Subnet $subnet $publicip = New-AzPublicIpAddress -ResourceGroupName $rgname -name $publicIpName -location $location -AllocationMethod Dynamic -DomainNameLabel $domainNameLabel $job = New-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname -Location $location -Subnet $vnet.Subnets[0] -PublicIpAddress $publicip -AsJob $job | Wait-Job $expectedNic = Get-AzNetworkInterface -Name $nicName -ResourceGroupName $rgname $DestinationEndpoint = $expectedNic.IpConfigurations[0] $actualVtap = New-AzVirtualNetworkTap -ResourceGroupName $rgname -Name $vtapName -Location $location -DestinationNetworkInterfaceIPConfiguration $DestinationEndpoint -Force $vVirtualNetworkTap = Get-AzVirtualNetworkTap -ResourceGroupName $rgname -Name $vtapName; $sourceIpConfig = New-AzNetworkInterfaceIpConfig -Name $sourceIpConfigName -Subnet $vnet.Subnets[0] $sourceNic = New-AzNetworkInterface -Name $sourceNicName -ResourceGroupName $rgname -Location $location -IpConfiguration $sourceIpConfig -Tag @{ testtag = "testval" } Add-AzNetworkInterfaceTapConfig -NetworkInterface $sourceNic -VirtualNetworkTap $vVirtualNetworkTap -Name $rname $tapConfig = Get-AzNetworkInterfaceTapConfig -ResourceGroupName $rgname -NetworkInterfaceName $sourceNicName -Name $rname Assert-NotNull $tapConfig Assert-AreEqual $tapConfig.ResourceGroupName $rgname Assert-AreEqual $tapConfig.NetworkInterfaceName $sourceNicName Assert-AreEqual $tapConfig.Name $rname $tapConfigs = Get-AzNetworkInterfaceTapConfig -ResourceGroupName $rgname -NetworkInterfaceName $sourceNicName Assert-NotNull $tapConfigs $tapConfigs = Get-AzNetworkInterfaceTapConfig -ResourceGroupName $rgname -NetworkInterfaceName $sourceNicName -Name "*" Assert-NotNull $tapConfigs $tapConfig = Get-AzNetworkInterfaceTapConfig -ResourceId $tapConfig.Id Assert-NotNull $tapConfig Assert-AreEqual $tapConfig.ResourceGroupName $rgname Assert-AreEqual $tapConfig.NetworkInterfaceName $sourceNicName Assert-AreEqual $tapConfig.Name $rname $sourceNic = Get-AzNetworkInterface -Name $sourceNicName -ResourceGroupName $rgname Assert-NotNull $sourceNic.TapConfigurations Assert-NotNull $sourceNic.TapConfigurations[0] Assert-AreEqual $sourceNic.TapConfigurations[0].Id $tapConfig.Id $vVirtualNetworkTap = Get-AzVirtualNetworkTap -ResourceGroupName $rgname -Name $vtapName; Assert-NotNull $vVirtualNetworkTap.NetworkInterfaceTapConfigurations Assert-NotNull $vVirtualNetworkTap.NetworkInterfaceTapConfigurations[0] Assert-AreEqual $vVirtualNetworkTap.NetworkInterfaceTapConfigurations[0].Id $tapConfig.Id $job = Set-AzNetworkInterfaceTapConfig -NetworkInterfaceTapConfig $tapConfig -AsJob -Force $job | Wait-Job $tapConfig = $job | Receive-Job Assert-NotNull $tapConfig Assert-AreEqual $tapConfig.ResourceGroupName $rgname Assert-AreEqual $tapConfig.NetworkInterfaceName $sourceNicName Assert-AreEqual $tapConfig.Name $rname $removeNetworkInterfaceTapConfiguration = Remove-AzNetworkInterfaceTapConfig -ResourceGroupName $rgname -NetworkInterfaceName $sourceNicName -Name $rname -PassThru -Force; Assert-AreEqual $true $removeNetworkInterfaceTapConfiguration; $sourceNic = Get-AzNetworkInterface -Name $sourceNicName -ResourceGroupName $rgname Assert-NotNull $sourceNic.TapConfigurations Assert-Null $sourceNic.TapConfigurations[0] $vVirtualNetworkTap = Get-AzVirtualNetworkTap -ResourceGroupName $rgname -Name $vtapName; Assert-NotNull $vVirtualNetworkTap.NetworkInterfaceTapConfigurations Assert-Null $vVirtualNetworkTap.NetworkInterfaceTapConfigurations[0] Assert-ThrowsContains { Get-AzNetworkInterfaceTapConfig -ResourceGroupName $rgname -NetworkInterfaceName $sourceNicName -Name $rname } "not found"; } finally { Clean-ResourceGroup $rgname; } } function Get-NameById($Id, $ResourceType) { $name = $Id.Substring($Id.IndexOf($ResourceType + '/') + $ResourceType.Length + 1); if ($name.IndexOf('/') -ne -1) { $name = $name.Substring(0, $name.IndexOf('/')); } return $name; } function Test-NetworkInterfaceVmss { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Compute/virtualMachineScaleSets" $location = Get-ProviderLocation $resourceTypeParent $lbName = Get-ResourceName try { $resourceGroup = New-AzureRmResourceGroup -Name $rgname -Location $rglocation -Tags @{ testtag = "testval" } $secpasswd = ConvertTo-SecureString "Pa$$word2018" -AsPlainText -Force $mycreds = New-Object System.Management.Automation.PSCredential ("username", $secpasswd) $vmssName = "vmssip" $templateFile = (Resolve-Path ".\ScenarioTests\Data\VmssDeploymentTemplate.json").Path New-AzureRmResourceGroupDeployment -Name $rgname -ResourceGroupName $rgname -TemplateFile $templateFile; $listAllResults = Get-AzureRmNetworkInterface -ResourceGroupName $rgname -VirtualMachineScaleSetName $vmssName; Assert-NotNull $listAllResults; $listFirstResultId = $listAllResults[0].Id; $vmIndex = Get-NameById $listFirstResultId "virtualMachines"; $nicName = Get-NameById $listFirstResultId "networkInterfaces"; $listResults = Get-AzureRmNetworkInterface -ResourceGroupName $rgname -VirtualMachineScaleSetName $vmssName -VirtualmachineIndex $vmIndex; Assert-NotNull $listResults; Assert-AreEqualObjectProperties $listAllResults[0] $listResults[0] "List and list all results should contain equal items"; $vmssNic = Get-AzureRmNetworkInterface -VirtualMachineScaleSetName $vmssName -ResourceGroupName $rgname -VirtualMachineIndex $vmIndex -Name $nicName; Assert-NotNull $vmssNic; Assert-AreEqualObjectProperties $vmssNic $listResults[0] "List and get results should contain equal items"; } finally { Clean-ResourceGroup $rgname; } }
combined_dataset/train/non-malicious/1654.ps1
1654.ps1
function Get-SNMPPrinterInfo { param ( [string[]]$printers ) begin { $snmp = New-Object -ComObject olePrn.OleSNMP $ping = New-Object System.Net.NetworkInformation.Ping } process { foreach ($printer in $printers) { try { $result = $ping.Send($printer) } catch { $result = $null } if ($result.Status -eq 'Success') { $printerip = $result.Address.ToString() $snmp.open($printerip, 'public', 2, 3000) try { $model = $snmp.Get('.1.3.6.1.2.1.25.3.2.1.3.1') } catch { $model = $null } if ($model) { try { $sysdescr0 = $snmp.Get('.1.3.6.1.2.1.1.1.0') } catch { $sysdescr0 = $null } try { if ($snmp.Get('.1.3.6.1.2.1.43.11.1.1.6.1.2') -match 'Toner|Cartridge') { $color = 'Yes' } else { $color = 'No' } } catch { $color = 'No' } try { $trays = $($snmp.GetTree('.1.3.6.1.2.1.43.8.2.1.13') | ? {$_ -notlike 'print*'}) -join ';' } catch { $trays = $null } try { $comment = $snmp.Get('.1.3.6.1.2.1.1.6.0') } catch { $comment = $null } $features = $null $name = $null switch -Regex ($model) { '^sharp' { try { $features = $($snmp.GetTree('.1.3.6.1.4.1.2385.1.1.3.2.1.3') | ? {$_ -notlike '.*'}) -join ';' } catch { $features = $null } try { $name = $snmp.Get('.1.3.6.1.4.1.1536.1.3.5.4.2.0').toupper() } catch { $name = $null } } '^canon' { try { $name = $snmp.Gettree('.1.3.6.1.4.1.1602.1.3.3.1.1.2.1.1.10.134') | ? {$_ -notlike '.*'} | select -f 1 | % {$_.toupper()} } catch { $name = $null } } '^zebra' { try { $name = $snmp.Get('.1.3.6.1.4.1.10642.1.4.0').toupper() } catch { $name = $null } } '^lexmark' { try { $name = $snmp.Get('.1.3.6.1.4.1.641.1.5.7.6.0').toupper() } catch { $name = $null } } '^ricoh' { try { $name = $snmp.Get('.1.3.6.1.4.1.367.3.2.1.7.3.5.1.1.2.1.1').toupper() } catch { $name = $null } } '^hp' { try { $name = $snmp.Get('.1.3.6.1.4.1.11.2.4.3.5.46.0').toupper() } catch { $name = $null } } default { $features = $null $name = $null } } try { $addr = ($snmp.Gettree('.1.3.6.1.2.1.4.20.1.1') | ? {$_ -match '(?:[^\.]{1,3}\.){3}[^\.]{1,3}$' -and $_ -notmatch '127\.0\.0\.1'} | % {$ip = $_.split('.'); "$($ip[-4]).$($ip[-3]).$($ip[-2]).$($ip[-1])"}) -join ';' } catch { $addr = $null } [pscustomobject]@{ Machine = $printer IP = $printerip Name = $name Model = $model Comment = $comment Color = $color Trays = $trays Features = $features SystemDescription = $sysdescr0 Addresses = $addr } } } else { Write-Warning "Machine '$printer' may be offline." } } } }
combined_dataset/train/non-malicious/sample_20_57.ps1
sample_20_57.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\[email protected]\node_modules\mockjs\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\[email protected]\node_modules\mockjs\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\[email protected]\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\node_modules" if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux builds of Node # are installed in the same directory $exe=".exe" $pathsep=";" } else { $new_node_path="/mnt/c/Users/abder/component-maker/web/node_modules/.pnpm/[email protected]/node_modules/mockjs/bin/node_modules:/mnt/c/Users/abder/component-maker/web/node_modules/.pnpm/[email protected]/node_modules/mockjs/node_modules:/mnt/c/Users/abder/component-maker/web/node_modules/.pnpm/[email protected]/node_modules:/mnt/c/Users/abder/component-maker/web/node_modules/.pnpm/node_modules" } if ([string]::IsNullOrEmpty($env_node_path)) { $env:NODE_PATH=$new_node_path } else { $env:NODE_PATH="$new_node_path$pathsep$env_node_path" } $ret=0 if (Test-Path "$basedir/node$exe") { # Support pipeline input if ($MyInvocation.ExpectingInput) { $input | & "$basedir/node$exe" "$basedir/../mockjs/bin/random" $args } else { & "$basedir/node$exe" "$basedir/../mockjs/bin/random" $args } $ret=$LASTEXITCODE } else { # Support pipeline input if ($MyInvocation.ExpectingInput) { $input | & "node$exe" "$basedir/../mockjs/bin/random" $args } else { & "node$exe" "$basedir/../mockjs/bin/random" $args } $ret=$LASTEXITCODE } $env:NODE_PATH=$env_node_path exit $ret
combined_dataset/train/non-malicious/sample_67_92.ps1
sample_67_92.ps1
########################################################################## # DELL PROPRIETARY INFORMATION # # This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this # software to you under the terms of a license agreement,nondisclosure agreement or both. # You may not copy, disclose, or use this software except in accordance with those terms. # # Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved. # # DELL INC. MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, # EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. # DELL SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, # MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. # # # ########################################################################## <# This is a Resource designer script which generates a mof schema for DCPP_POSTBehavior resource in DellBIOSProvider module. #> $category = New-xDscResourceProperty -name Category -Type String -Attribute Key $enablelegacyoptionroms = New-xDscResourceProperty -name EnableLegacyOptionROMs -Type String -Attribute Write -ValidateSet @("Enabled", "Disabled") $Password = New-xDscResourceProperty -Name Password -Type string -Attribute Write -Description "Password" $SecurePassword = New-xDscResourceProperty -Name SecurePassword -Type string -Attribute Write -Description "SecurePassword" $PathToKey = New-xDscResourceProperty -Name PathToKey -Type string -Attribute Write $properties = @($category,$enablelegacyoptionroms,$Password,$SecurePassword,$PathToKey) New-xDscResource -ModuleName DellBIOSProviderX86 -Name DCPP_AdvancedBootOptions -Property $properties -Path 'C:\Program Files\WindowsPowerShell\Modules' -FriendlyName "AdvancedBootOptions" -Force -Verbose # SIG # Begin signature block # MIIutQYJKoZIhvcNAQcCoIIupjCCLqICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB6PyG8gf3arUv3 # guc2yHYdv9yCLOfqoF0g3r8iv43LpKCCEugwggXfMIIEx6ADAgECAhBOQOQ3VO3m # jAAAAABR05R/MA0GCSqGSIb3DQ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/pG1WylJvN29RBpu27yOOEQ17QbvAjCB0AYLKoZIhvcN # AQkQAi8xgcAwgb0wgbowgbcwCwYJYIZIAWUDBAIDBEA5EUIuFwI+qpkkmXQODsjo # 0nLTVfxc9mz5EVavl1U05ICv07x8TFtX79H/vNt1FGXg1AVahU6bETnZ9+xV1f4k # MGYwUqRQME4xCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMScw # JQYDVQQDEx5FbnRydXN0IFRpbWUgU3RhbXBpbmcgQ0EgLSBUUzICEFtwJsyW9nga # u4X2EfVtu24wCwYJKoZIhvcNAQENBIICAF6h2NBqmM4vLdVQSRF0H0lbJ7sOKmSl # 3lussBBEYD5DRPdoBhaikYQQqdsclxk0qCt5LvsOzdwmgJHm1S/lCl25qiMAJnTn # Nu4Qyni4qiO+GHwXupZaetGpRaIcXyj63fom3k//nOP+AfOXOxe64Vf/FNx9KXKp # pRv7RFMae2mKi1nfFHC0bpuDDvpBOaAuka9xKCe0P4H20jnVpWBKD2oYtFbjpKMC # YAsamxtXunC+2/VUrtRdAoRRkAOsYrAwc1Qj3bagIzxHernb0jQpcoQ3afDIFlN0 # vfu5l1A63/3x5jSrL88eMX21/nwgGIX4Luspc1897o6zYXxHTqAgrA56IGrmwKXk # gVSpzLZ2ryBPSc6mJmauN++V9SpOoyZWc1Jd4FJNQA7ZQV2FfDPah+ZsuiLP9Ac0 # gsUwgp+092DRR2UClPgY2e+2NU0W427aLDPm17I63GZeG3UM1HUedFSpSi9XsN87 # GLLa5+IvMZnNLqIdn6QkthsfBfOcrVit8d7JSFqDCt9OCOKv59gQULm2ZimW3yB5 # LVl/L0YaEtStyqNj+2VPLimsu7XrRCQpMoq/ppR4EgDrMW2sq7SDoRx/YCaqymNN # AmRtkN4vvYgH8Rx4u3qbgUQBlJlAoII8StXtFAX3ywU2mUrGwrMCxU124nEumwSr # aJg1xd6n1LSE # SIG # End signature block
combined_dataset/train/non-malicious/3938.ps1
3938.ps1
function Check-CmdletReturnType { param($cmdletName, $cmdletReturn) $cmdletData = Get-Command $cmdletName; Assert-NotNull $cmdletData; [array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") }; [array]$cmdletReturnTypes = $cmdletReturnTypes | Foreach-Object { return ($_ -replace "System.","") }; $realReturnType = $cmdletReturn.GetType().Name -replace "Microsoft.Azure.Commands.Network.Models.",""; return $cmdletReturnTypes -contains $realReturnType; } function Test-LoadBalancerCRUDMinimalParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers"; $PublicIPAddressName = "PublicIPAddressName"; $PublicIPAddressAllocationMethod = "Static"; $FrontendIPConfigurationName = "FrontendIPConfigurationName"; $BackendAddressPoolName = "BackendAddressPoolName"; $ProbeName = "ProbeName"; $ProbePort = 2424; $ProbeIntervalInSeconds = 6; $ProbeProbeCount = 4; $InboundNatPoolName = "InboundNatPoolName"; $InboundNatPoolProtocol = "Udp"; $InboundNatPoolFrontendPortRangeStart = 555; $InboundNatPoolFrontendPortRangeEnd = 999; $InboundNatPoolBackendPort = 987; try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $PublicIPAddress = New-AzPublicIPAddress -ResourceGroupName $rgname -Location $location -Name $PublicIPAddressName -AllocationMethod $PublicIPAddressAllocationMethod; $FrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationName -PublicIpAddress $PublicIPAddress; $BackendAddressPool = New-AzLoadBalancerBackendAddressPoolConfig -Name $BackendAddressPoolName; $Probe = New-AzLoadBalancerProbeConfig -Name $ProbeName -Port $ProbePort -IntervalInSeconds $ProbeIntervalInSeconds -ProbeCount $ProbeProbeCount; $InboundNatPool = New-AzLoadBalancerInboundNatPoolConfig -Name $InboundNatPoolName -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $InboundNatPoolProtocol -FrontendPortRangeStart $InboundNatPoolFrontendPortRangeStart -FrontendPortRangeEnd $InboundNatPoolFrontendPortRangeEnd -BackendPort $InboundNatPoolBackendPort; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -Location $location -FrontendIpConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Probe $Probe -InboundNatPool $InboundNatPool; Assert-NotNull $vLoadBalancer; Assert-True { Check-CmdletReturnType "New-AzLoadBalancer" $vLoadBalancer }; Assert-NotNull $vLoadBalancer.FrontendIpConfigurations; Assert-True { $vLoadBalancer.FrontendIpConfigurations.Length -gt 0 }; Assert-NotNull $vLoadBalancer.BackendAddressPools; Assert-True { $vLoadBalancer.BackendAddressPools.Length -gt 0 }; Assert-NotNull $vLoadBalancer.Probes; Assert-True { $vLoadBalancer.Probes.Length -gt 0 }; Assert-NotNull $vLoadBalancer.InboundNatPools; Assert-True { $vLoadBalancer.InboundNatPools.Length -gt 0 }; Assert-AreEqual $rname $vLoadBalancer.Name; $vLoadBalancer = Get-AzLoadBalancer -ResourceGroupName $rgname -Name $rname; Assert-NotNull $vLoadBalancer; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancer" $vLoadBalancer }; Assert-AreEqual $rname $vLoadBalancer.Name; $listLoadBalancer = Get-AzLoadBalancer -ResourceGroupName $rgname; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $listLoadBalancer = Get-AzLoadBalancer; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $listLoadBalancer = Get-AzLoadBalancer -ResourceGroupName "*"; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $listLoadBalancer = Get-AzLoadBalancer -Name "*"; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $listLoadBalancer = Get-AzLoadBalancer -ResourceGroupName "*" -Name "*"; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $job = Remove-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -PassThru -Force -AsJob; $job | Wait-Job; $removeLoadBalancer = $job | Receive-Job; Assert-AreEqual $true $removeLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancer -ResourceGroupName $rgname -Name $rname } "not found"; } finally { Clean-ResourceGroup $rgname; } } function Test-LoadBalancerCRUDAllParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers"; $Tag = @{tag1='test'}; $Sku = "Basic"; $TagSet = @{tag2='testSet'}; $PublicIPAddressName = "PublicIPAddressName"; $PublicIPAddressAllocationMethod = "Static"; $FrontendIPConfigurationName = "FrontendIPConfigurationName"; $BackendAddressPoolName = "BackendAddressPoolName"; $ProbeName = "ProbeName"; $ProbePort = 2424; $ProbeIntervalInSeconds = 6; $ProbeProbeCount = 4; $InboundNatPoolName = "InboundNatPoolName"; $InboundNatPoolProtocol = "Udp"; $InboundNatPoolFrontendPortRangeStart = 555; $InboundNatPoolFrontendPortRangeEnd = 999; $InboundNatPoolBackendPort = 987; try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $PublicIPAddress = New-AzPublicIPAddress -ResourceGroupName $rgname -Location $location -Name $PublicIPAddressName -AllocationMethod $PublicIPAddressAllocationMethod; $FrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationName -PublicIpAddress $PublicIPAddress; $BackendAddressPool = New-AzLoadBalancerBackendAddressPoolConfig -Name $BackendAddressPoolName; $Probe = New-AzLoadBalancerProbeConfig -Name $ProbeName -Port $ProbePort -IntervalInSeconds $ProbeIntervalInSeconds -ProbeCount $ProbeProbeCount; $InboundNatPool = New-AzLoadBalancerInboundNatPoolConfig -Name $InboundNatPoolName -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $InboundNatPoolProtocol -FrontendPortRangeStart $InboundNatPoolFrontendPortRangeStart -FrontendPortRangeEnd $InboundNatPoolFrontendPortRangeEnd -BackendPort $InboundNatPoolBackendPort; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -Location $location -FrontendIpConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Probe $Probe -InboundNatPool $InboundNatPool -Tag $Tag -Sku $Sku; Assert-NotNull $vLoadBalancer; Assert-True { Check-CmdletReturnType "New-AzLoadBalancer" $vLoadBalancer }; Assert-NotNull $vLoadBalancer.FrontendIpConfigurations; Assert-True { $vLoadBalancer.FrontendIpConfigurations.Length -gt 0 }; Assert-NotNull $vLoadBalancer.BackendAddressPools; Assert-True { $vLoadBalancer.BackendAddressPools.Length -gt 0 }; Assert-NotNull $vLoadBalancer.Probes; Assert-True { $vLoadBalancer.Probes.Length -gt 0 }; Assert-NotNull $vLoadBalancer.InboundNatPools; Assert-True { $vLoadBalancer.InboundNatPools.Length -gt 0 }; Assert-AreEqual $rname $vLoadBalancer.Name; Assert-AreEqualObjectProperties $Tag $vLoadBalancer.Tag; Assert-AreEqual $Sku $vLoadBalancer.Sku.Name; $vLoadBalancer = Get-AzLoadBalancer -ResourceGroupName $rgname -Name $rname; Assert-NotNull $vLoadBalancer; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancer" $vLoadBalancer }; Assert-AreEqual $rname $vLoadBalancer.Name; Assert-AreEqualObjectProperties $Tag $vLoadBalancer.Tag; Assert-AreEqual $Sku $vLoadBalancer.Sku.Name; $listLoadBalancer = Get-AzLoadBalancer -ResourceGroupName $rgname; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $listLoadBalancer = Get-AzLoadBalancer; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $listLoadBalancer = Get-AzLoadBalancer -ResourceGroupName "*"; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $listLoadBalancer = Get-AzLoadBalancer -Name "*"; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $listLoadBalancer = Get-AzLoadBalancer -ResourceGroupName "*" -Name "*"; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $vLoadBalancer.Tag = $TagSet; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-True { Check-CmdletReturnType "Set-AzLoadBalancer" $vLoadBalancer }; Assert-AreEqual $rname $vLoadBalancer.Name; Assert-AreEqualObjectProperties $TagSet $vLoadBalancer.Tag; $vLoadBalancer = Get-AzLoadBalancer -ResourceGroupName $rgname -Name $rname; Assert-NotNull $vLoadBalancer; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancer" $vLoadBalancer }; Assert-AreEqual $rname $vLoadBalancer.Name; Assert-AreEqualObjectProperties $TagSet $vLoadBalancer.Tag; $listLoadBalancer = Get-AzLoadBalancer -ResourceGroupName $rgname; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $listLoadBalancer = Get-AzLoadBalancer; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $listLoadBalancer = Get-AzLoadBalancer -ResourceGroupName "*"; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $listLoadBalancer = Get-AzLoadBalancer -Name "*"; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $listLoadBalancer = Get-AzLoadBalancer -ResourceGroupName "*" -Name "*"; Assert-NotNull ($listLoadBalancer | Where-Object { $_.ResourceGroupName -eq $rgname -and $_.Name -eq $rname }); $job = Remove-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -PassThru -Force -AsJob; $job | Wait-Job; $removeLoadBalancer = $job | Receive-Job; Assert-AreEqual $true $removeLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancer -ResourceGroupName $rgname -Name $rname } "not found"; Assert-ThrowsContains { Set-AzLoadBalancer -LoadBalancer $vLoadBalancer } "not found"; } finally { Clean-ResourceGroup $rgname; } } function Test-FrontendIPConfigurationCRUDMinimalParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $rnameAdd = "${rname}Add"; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers" "East US 2"; $SubnetName = "SubnetName"; $SubnetAddressPrefix = "10.0.1.0/24"; $VirtualNetworkName = "VirtualNetworkName"; $VirtualNetworkAddressPrefix = @("10.0.0.0/8"); try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $Subnet = New-AzVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $SubnetAddressPrefix; $VirtualNetwork = New-AzVirtualNetwork -ResourceGroupName $rgname -Location $location -Name $VirtualNetworkName -Subnet $Subnet -AddressPrefix $VirtualNetworkAddressPrefix; if(-not $Subnet.Id) { $Subnet = Get-AzVirtualNetworkSubnetConfig -Name $SubnetName -VirtualNetwork $VirtualNetwork; } $vFrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $rname -Subnet $Subnet; Assert-NotNull $vFrontendIPConfiguration; Assert-True { Check-CmdletReturnType "New-AzLoadBalancerFrontendIpConfig" $vFrontendIPConfiguration }; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -FrontendIPConfiguration $vFrontendIPConfiguration -Location $location; Assert-NotNull $vLoadBalancer; Assert-AreEqual $rname $vFrontendIPConfiguration.Name; $vFrontendIPConfiguration = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vFrontendIPConfiguration; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerFrontendIpConfig" $vFrontendIPConfiguration }; Assert-AreEqual $rname $vFrontendIPConfiguration.Name; $listFrontendIPConfiguration = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listFrontendIPConfiguration | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Set-AzLoadBalancerFrontendIpConfig -Name $rname -LoadBalancer $vLoadBalancer -Subnet $Subnet; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vFrontendIPConfiguration = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vFrontendIPConfiguration; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerFrontendIpConfig" $vFrontendIPConfiguration }; Assert-AreEqual $rname $vFrontendIPConfiguration.Name; $listFrontendIPConfiguration = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listFrontendIPConfiguration | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Add-AzLoadBalancerFrontendIpConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -Subnet $Subnet; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vFrontendIPConfiguration = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; Assert-NotNull $vFrontendIPConfiguration; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerFrontendIpConfig" $vFrontendIPConfiguration }; Assert-AreEqual $rnameAdd $vFrontendIPConfiguration.Name; $listFrontendIPConfiguration = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listFrontendIPConfiguration | Where-Object { $_.Name -eq $rnameAdd }); Assert-ThrowsContains { Add-AzLoadBalancerFrontendIpConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -Subnet $Subnet } "already exists"; $vLoadBalancer = Remove-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd } "Sequence contains no matching element"; Assert-ThrowsContains { Set-AzLoadBalancerFrontendIpConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -Subnet $Subnet } "does not exist"; } finally { Clean-ResourceGroup $rgname; } } function Test-FrontendIPConfigurationCRUDAllParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $rnameAdd = "${rname}Add"; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers" "East US 2"; $PrivateIpAddress = "10.0.1.13"; $PrivateIpAddressSet = "10.0.1.16"; $SubnetName = "SubnetName"; $SubnetAddressPrefix = "10.0.1.0/24"; $VirtualNetworkName = "VirtualNetworkName"; $VirtualNetworkAddressPrefix = @("10.0.0.0/8"); try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $Subnet = New-AzVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $SubnetAddressPrefix; $VirtualNetwork = New-AzVirtualNetwork -ResourceGroupName $rgname -Location $location -Name $VirtualNetworkName -Subnet $Subnet -AddressPrefix $VirtualNetworkAddressPrefix; if(-not $Subnet.Id) { $Subnet = Get-AzVirtualNetworkSubnetConfig -Name $SubnetName -VirtualNetwork $VirtualNetwork; } $vFrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $rname -Subnet $Subnet -PrivateIpAddress $PrivateIpAddress; Assert-NotNull $vFrontendIPConfiguration; Assert-True { Check-CmdletReturnType "New-AzLoadBalancerFrontendIpConfig" $vFrontendIPConfiguration }; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -FrontendIPConfiguration $vFrontendIPConfiguration -Location $location; Assert-NotNull $vLoadBalancer; Assert-AreEqual $rname $vFrontendIPConfiguration.Name; Assert-AreEqual $PrivateIpAddress $vFrontendIPConfiguration.PrivateIpAddress; $vFrontendIPConfiguration = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vFrontendIPConfiguration; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerFrontendIpConfig" $vFrontendIPConfiguration }; Assert-AreEqual $rname $vFrontendIPConfiguration.Name; Assert-AreEqual $PrivateIpAddress $vFrontendIPConfiguration.PrivateIpAddress; $listFrontendIPConfiguration = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listFrontendIPConfiguration | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Set-AzLoadBalancerFrontendIpConfig -Name $rname -LoadBalancer $vLoadBalancer -Subnet $Subnet -PrivateIpAddress $PrivateIpAddressSet; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vFrontendIPConfiguration = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vFrontendIPConfiguration; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerFrontendIpConfig" $vFrontendIPConfiguration }; Assert-AreEqual $rname $vFrontendIPConfiguration.Name; Assert-AreEqual $PrivateIpAddressSet $vFrontendIPConfiguration.PrivateIpAddress; $listFrontendIPConfiguration = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listFrontendIPConfiguration | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Add-AzLoadBalancerFrontendIpConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -Subnet $Subnet; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vFrontendIPConfiguration = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; Assert-NotNull $vFrontendIPConfiguration; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerFrontendIpConfig" $vFrontendIPConfiguration }; Assert-AreEqual $rnameAdd $vFrontendIPConfiguration.Name; $listFrontendIPConfiguration = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listFrontendIPConfiguration | Where-Object { $_.Name -eq $rnameAdd }); Assert-ThrowsContains { Add-AzLoadBalancerFrontendIpConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -Subnet $Subnet } "already exists"; $vLoadBalancer = Remove-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd } "Sequence contains no matching element"; Assert-ThrowsContains { Set-AzLoadBalancerFrontendIpConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -Subnet $Subnet -PrivateIpAddress $PrivateIpAddressSet } "does not exist"; } finally { Clean-ResourceGroup $rgname; } } function Test-BackendAddressPoolCRUDMinimalParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $rnameAdd = "${rname}Add"; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers"; $PublicIPAddressName = "PublicIPAddressName"; $PublicIPAddressAllocationMethod = "Static"; $FrontendIPConfigurationName = "FrontendIPConfigurationName"; try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $PublicIPAddress = New-AzPublicIPAddress -ResourceGroupName $rgname -Location $location -Name $PublicIPAddressName -AllocationMethod $PublicIPAddressAllocationMethod; $FrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationName -PublicIpAddress $PublicIPAddress; $vBackendAddressPool = New-AzLoadBalancerBackendAddressPoolConfig -Name $rname; Assert-NotNull $vBackendAddressPool; Assert-True { Check-CmdletReturnType "New-AzLoadBalancerBackendAddressPoolConfig" $vBackendAddressPool }; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -BackendAddressPool $vBackendAddressPool -FrontendIPConfiguration $FrontendIPConfiguration -Location $location; Assert-NotNull $vLoadBalancer; Assert-AreEqual $rname $vBackendAddressPool.Name; $vBackendAddressPool = Get-AzLoadBalancerBackendAddressPoolConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vBackendAddressPool; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerBackendAddressPoolConfig" $vBackendAddressPool }; Assert-AreEqual $rname $vBackendAddressPool.Name; $listBackendAddressPool = Get-AzLoadBalancerBackendAddressPoolConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listBackendAddressPool | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Add-AzLoadBalancerBackendAddressPoolConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vBackendAddressPool = Get-AzLoadBalancerBackendAddressPoolConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; Assert-NotNull $vBackendAddressPool; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerBackendAddressPoolConfig" $vBackendAddressPool }; Assert-AreEqual $rnameAdd $vBackendAddressPool.Name; $listBackendAddressPool = Get-AzLoadBalancerBackendAddressPoolConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listBackendAddressPool | Where-Object { $_.Name -eq $rnameAdd }); Assert-ThrowsContains { Add-AzLoadBalancerBackendAddressPoolConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer } "already exists"; $vLoadBalancer = Remove-AzLoadBalancerBackendAddressPoolConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; $vLoadBalancer = Remove-AzLoadBalancerBackendAddressPoolConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Remove-AzLoadBalancerBackendAddressPoolConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancerBackendAddressPoolConfig -LoadBalancer $vLoadBalancer -Name $rname } "Sequence contains no matching element"; } finally { Clean-ResourceGroup $rgname; } } function Test-LoadBalancingRuleCRUDMinimalParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $rnameAdd = "${rname}Add"; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers"; $Protocol = "Udp"; $FrontendPort = 1024; $BackendPort = 4096; $ProtocolSet = "Tcp"; $FrontendPortSet = 1026; $BackendPortSet = 4095; $ProtocolAdd = "Tcp"; $FrontendPortAdd = 1025; $BackendPortAdd = 4094; $SubnetName = "SubnetName"; $SubnetAddressPrefix = "10.0.1.0/24"; $VirtualNetworkName = "VirtualNetworkName"; $VirtualNetworkAddressPrefix = @("10.0.0.0/8"); $FrontendIPConfigurationName = "FrontendIPConfigurationName"; $BackendAddressPoolName = "BackendAddressPoolName"; $ProbeName = "ProbeName"; $ProbePort = 2424; $ProbeIntervalInSeconds = 6; $ProbeProbeCount = 4; try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $Subnet = New-AzVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $SubnetAddressPrefix; $VirtualNetwork = New-AzVirtualNetwork -ResourceGroupName $rgname -Location $location -Name $VirtualNetworkName -Subnet $Subnet -AddressPrefix $VirtualNetworkAddressPrefix; if(-not $Subnet.Id) { $Subnet = Get-AzVirtualNetworkSubnetConfig -Name $SubnetName -VirtualNetwork $VirtualNetwork; } $FrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationName -Subnet $Subnet; $BackendAddressPool = New-AzLoadBalancerBackendAddressPoolConfig -Name $BackendAddressPoolName; $Probe = New-AzLoadBalancerProbeConfig -Name $ProbeName -Port $ProbePort -IntervalInSeconds $ProbeIntervalInSeconds -ProbeCount $ProbeProbeCount; $vLoadBalancingRule = New-AzLoadBalancerRuleConfig -Name $rname -FrontendIpConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Probe $Probe -Protocol $Protocol -FrontendPort $FrontendPort -BackendPort $BackendPort; Assert-NotNull $vLoadBalancingRule; Assert-True { Check-CmdletReturnType "New-AzLoadBalancerRuleConfig" $vLoadBalancingRule }; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -LoadBalancingRule $vLoadBalancingRule -FrontendIPConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Probe $Probe -Location $location; Assert-NotNull $vLoadBalancer; Assert-NotNull $vLoadBalancer.FrontendIpConfigurations; Assert-True { $vLoadBalancer.FrontendIpConfigurations.Length -gt 0 }; Assert-NotNull $vLoadBalancer.BackendAddressPools; Assert-True { $vLoadBalancer.BackendAddressPools.Length -gt 0 }; Assert-NotNull $vLoadBalancer.Probes; Assert-True { $vLoadBalancer.Probes.Length -gt 0 }; Assert-AreEqual $rname $vLoadBalancingRule.Name; Assert-AreEqual $Protocol $vLoadBalancingRule.Protocol; Assert-AreEqual $FrontendPort $vLoadBalancingRule.FrontendPort; Assert-AreEqual $BackendPort $vLoadBalancingRule.BackendPort; $vLoadBalancingRule = Get-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vLoadBalancingRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerRuleConfig" $vLoadBalancingRule }; Assert-AreEqual $rname $vLoadBalancingRule.Name; Assert-AreEqual $Protocol $vLoadBalancingRule.Protocol; Assert-AreEqual $FrontendPort $vLoadBalancingRule.FrontendPort; Assert-AreEqual $BackendPort $vLoadBalancingRule.BackendPort; $listLoadBalancingRule = Get-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listLoadBalancingRule | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Set-AzLoadBalancerRuleConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Probe $Probe -Protocol $ProtocolSet -FrontendPort $FrontendPortSet -BackendPort $BackendPortSet; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vLoadBalancingRule = Get-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vLoadBalancingRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerRuleConfig" $vLoadBalancingRule }; Assert-AreEqual $rname $vLoadBalancingRule.Name; Assert-AreEqual $ProtocolSet $vLoadBalancingRule.Protocol; Assert-AreEqual $FrontendPortSet $vLoadBalancingRule.FrontendPort; Assert-AreEqual $BackendPortSet $vLoadBalancingRule.BackendPort; $listLoadBalancingRule = Get-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listLoadBalancingRule | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Add-AzLoadBalancerRuleConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Probe $Probe -Protocol $ProtocolAdd -FrontendPort $FrontendPortAdd -BackendPort $BackendPortAdd; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vLoadBalancingRule = Get-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; Assert-NotNull $vLoadBalancingRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerRuleConfig" $vLoadBalancingRule }; Assert-AreEqual $rnameAdd $vLoadBalancingRule.Name; Assert-AreEqual $ProtocolAdd $vLoadBalancingRule.Protocol; Assert-AreEqual $FrontendPortAdd $vLoadBalancingRule.FrontendPort; Assert-AreEqual $BackendPortAdd $vLoadBalancingRule.BackendPort; $listLoadBalancingRule = Get-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listLoadBalancingRule | Where-Object { $_.Name -eq $rnameAdd }); Assert-ThrowsContains { Add-AzLoadBalancerRuleConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Probe $Probe -Protocol $ProtocolAdd -FrontendPort $FrontendPortAdd -BackendPort $BackendPortAdd } "already exists"; $vLoadBalancer = Remove-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; $vLoadBalancer = Remove-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Remove-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer -Name $rname } "Sequence contains no matching element"; Assert-ThrowsContains { Set-AzLoadBalancerRuleConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Probe $Probe -Protocol $ProtocolSet -FrontendPort $FrontendPortSet -BackendPort $BackendPortSet } "does not exist"; } finally { Clean-ResourceGroup $rgname; } } function Test-LoadBalancingRuleCRUDAllParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $rnameAdd = "${rname}Add"; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers"; $Protocol = "Udp"; $LoadDistribution = "Default"; $FrontendPort = 1024; $BackendPort = 4096; $IdleTimeoutInMinutes = 5; $EnableFloatingIP = $true; $EnableTcpReset = $false; $ProtocolSet = "Tcp"; $LoadDistributionSet = "SourceIP"; $FrontendPortSet = 1026; $BackendPortSet = 4095; $IdleTimeoutInMinutesSet = 29; $EnableFloatingIPSet = $false; $EnableTcpResetSet = $false; $ProtocolAdd = "Tcp"; $LoadDistributionAdd = "SourceIPProtocol"; $FrontendPortAdd = 1025; $BackendPortAdd = 4094; $IdleTimeoutInMinutesAdd = 7; $EnableFloatingIPAdd = $false; $EnableTcpResetAdd = $false; $SubnetName = "SubnetName"; $SubnetAddressPrefix = "10.0.1.0/24"; $VirtualNetworkName = "VirtualNetworkName"; $VirtualNetworkAddressPrefix = @("10.0.0.0/8"); $FrontendIPConfigurationName = "FrontendIPConfigurationName"; $BackendAddressPoolName = "BackendAddressPoolName"; $ProbeName = "ProbeName"; $ProbePort = 2424; $ProbeIntervalInSeconds = 6; $ProbeProbeCount = 4; try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $Subnet = New-AzVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $SubnetAddressPrefix; $VirtualNetwork = New-AzVirtualNetwork -ResourceGroupName $rgname -Location $location -Name $VirtualNetworkName -Subnet $Subnet -AddressPrefix $VirtualNetworkAddressPrefix; if(-not $Subnet.Id) { $Subnet = Get-AzVirtualNetworkSubnetConfig -Name $SubnetName -VirtualNetwork $VirtualNetwork; } $FrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationName -Subnet $Subnet; $BackendAddressPool = New-AzLoadBalancerBackendAddressPoolConfig -Name $BackendAddressPoolName; $Probe = New-AzLoadBalancerProbeConfig -Name $ProbeName -Port $ProbePort -IntervalInSeconds $ProbeIntervalInSeconds -ProbeCount $ProbeProbeCount; $vLoadBalancingRule = New-AzLoadBalancerRuleConfig -Name $rname -FrontendIpConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Probe $Probe -Protocol $Protocol -LoadDistribution $LoadDistribution -FrontendPort $FrontendPort -BackendPort $BackendPort -IdleTimeoutInMinutes $IdleTimeoutInMinutes -EnableFloatingIP; Assert-NotNull $vLoadBalancingRule; Assert-True { Check-CmdletReturnType "New-AzLoadBalancerRuleConfig" $vLoadBalancingRule }; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -LoadBalancingRule $vLoadBalancingRule -FrontendIPConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Probe $Probe -Location $location; Assert-NotNull $vLoadBalancer; Assert-NotNull $vLoadBalancer.FrontendIpConfigurations; Assert-True { $vLoadBalancer.FrontendIpConfigurations.Length -gt 0 }; Assert-NotNull $vLoadBalancer.BackendAddressPools; Assert-True { $vLoadBalancer.BackendAddressPools.Length -gt 0 }; Assert-NotNull $vLoadBalancer.Probes; Assert-True { $vLoadBalancer.Probes.Length -gt 0 }; Assert-AreEqual $rname $vLoadBalancingRule.Name; Assert-AreEqual $Protocol $vLoadBalancingRule.Protocol; Assert-AreEqual $LoadDistribution $vLoadBalancingRule.LoadDistribution; Assert-AreEqual $FrontendPort $vLoadBalancingRule.FrontendPort; Assert-AreEqual $BackendPort $vLoadBalancingRule.BackendPort; Assert-AreEqual $IdleTimeoutInMinutes $vLoadBalancingRule.IdleTimeoutInMinutes; Assert-AreEqual $EnableFloatingIP $vLoadBalancingRule.EnableFloatingIP; Assert-AreEqual $EnableTcpReset $vLoadBalancingRule.EnableTcpReset; $vLoadBalancingRule = Get-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vLoadBalancingRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerRuleConfig" $vLoadBalancingRule }; Assert-AreEqual $rname $vLoadBalancingRule.Name; Assert-AreEqual $Protocol $vLoadBalancingRule.Protocol; Assert-AreEqual $LoadDistribution $vLoadBalancingRule.LoadDistribution; Assert-AreEqual $FrontendPort $vLoadBalancingRule.FrontendPort; Assert-AreEqual $BackendPort $vLoadBalancingRule.BackendPort; Assert-AreEqual $IdleTimeoutInMinutes $vLoadBalancingRule.IdleTimeoutInMinutes; Assert-AreEqual $EnableFloatingIP $vLoadBalancingRule.EnableFloatingIP; Assert-AreEqual $EnableTcpReset $vLoadBalancingRule.EnableTcpReset; $listLoadBalancingRule = Get-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listLoadBalancingRule | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Set-AzLoadBalancerRuleConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Probe $Probe -Protocol $ProtocolSet -LoadDistribution $LoadDistributionSet -FrontendPort $FrontendPortSet -BackendPort $BackendPortSet -IdleTimeoutInMinutes $IdleTimeoutInMinutesSet; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vLoadBalancingRule = Get-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vLoadBalancingRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerRuleConfig" $vLoadBalancingRule }; Assert-AreEqual $rname $vLoadBalancingRule.Name; Assert-AreEqual $ProtocolSet $vLoadBalancingRule.Protocol; Assert-AreEqual $LoadDistributionSet $vLoadBalancingRule.LoadDistribution; Assert-AreEqual $FrontendPortSet $vLoadBalancingRule.FrontendPort; Assert-AreEqual $BackendPortSet $vLoadBalancingRule.BackendPort; Assert-AreEqual $IdleTimeoutInMinutesSet $vLoadBalancingRule.IdleTimeoutInMinutes; Assert-AreEqual $EnableFloatingIPSet $vLoadBalancingRule.EnableFloatingIP; Assert-AreEqual $EnableTcpResetSet $vLoadBalancingRule.EnableTcpReset; $listLoadBalancingRule = Get-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listLoadBalancingRule | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Add-AzLoadBalancerRuleConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Probe $Probe -Protocol $ProtocolAdd -LoadDistribution $LoadDistributionAdd -FrontendPort $FrontendPortAdd -BackendPort $BackendPortAdd -IdleTimeoutInMinutes $IdleTimeoutInMinutesAdd; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vLoadBalancingRule = Get-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; Assert-NotNull $vLoadBalancingRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerRuleConfig" $vLoadBalancingRule }; Assert-AreEqual $rnameAdd $vLoadBalancingRule.Name; Assert-AreEqual $ProtocolAdd $vLoadBalancingRule.Protocol; Assert-AreEqual $LoadDistributionAdd $vLoadBalancingRule.LoadDistribution; Assert-AreEqual $FrontendPortAdd $vLoadBalancingRule.FrontendPort; Assert-AreEqual $BackendPortAdd $vLoadBalancingRule.BackendPort; Assert-AreEqual $IdleTimeoutInMinutesAdd $vLoadBalancingRule.IdleTimeoutInMinutes; Assert-AreEqual $EnableFloatingIPAdd $vLoadBalancingRule.EnableFloatingIP; Assert-AreEqual $EnableTcpResetAdd $vLoadBalancingRule.EnableTcpReset; $listLoadBalancingRule = Get-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listLoadBalancingRule | Where-Object { $_.Name -eq $rnameAdd }); Assert-ThrowsContains { Add-AzLoadBalancerRuleConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Probe $Probe -Protocol $ProtocolAdd -LoadDistribution $LoadDistributionAdd -FrontendPort $FrontendPortAdd -BackendPort $BackendPortAdd -IdleTimeoutInMinutes $IdleTimeoutInMinutesAdd } "already exists"; $vLoadBalancer = Remove-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; $vLoadBalancer = Remove-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Remove-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancerRuleConfig -LoadBalancer $vLoadBalancer -Name $rname } "Sequence contains no matching element"; Assert-ThrowsContains { Set-AzLoadBalancerRuleConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Probe $Probe -Protocol $ProtocolSet -LoadDistribution $LoadDistributionSet -FrontendPort $FrontendPortSet -BackendPort $BackendPortSet -IdleTimeoutInMinutes $IdleTimeoutInMinutesSet } "does not exist"; } finally { Clean-ResourceGroup $rgname; } } function Test-ProbeCRUDMinimalParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $rnameAdd = "${rname}Add"; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers"; $Port = 2424; $IntervalInSeconds = 6; $ProbeCount = 4; $PortSet = 4244; $IntervalInSecondsSet = 14; $ProbeCountSet = 7; $PortAdd = 443; $IntervalInSecondsAdd = 11; $ProbeCountAdd = 5; $PublicIPAddressName = "PublicIPAddressName"; $PublicIPAddressAllocationMethod = "Static"; $FrontendIPConfigurationName = "FrontendIPConfigurationName"; try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $PublicIPAddress = New-AzPublicIPAddress -ResourceGroupName $rgname -Location $location -Name $PublicIPAddressName -AllocationMethod $PublicIPAddressAllocationMethod; $FrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationName -PublicIpAddress $PublicIPAddress; $vProbe = New-AzLoadBalancerProbeConfig -Name $rname -Port $Port -IntervalInSeconds $IntervalInSeconds -ProbeCount $ProbeCount; Assert-NotNull $vProbe; Assert-True { Check-CmdletReturnType "New-AzLoadBalancerProbeConfig" $vProbe }; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -Probe $vProbe -FrontendIPConfiguration $FrontendIPConfiguration -Location $location; Assert-NotNull $vLoadBalancer; Assert-AreEqual $rname $vProbe.Name; Assert-AreEqual $Port $vProbe.Port; Assert-AreEqual $IntervalInSeconds $vProbe.IntervalInSeconds; Assert-AreEqual $ProbeCount $vProbe.NumberOfProbes; $vProbe = Get-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vProbe; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerProbeConfig" $vProbe }; Assert-AreEqual $rname $vProbe.Name; Assert-AreEqual $Port $vProbe.Port; Assert-AreEqual $IntervalInSeconds $vProbe.IntervalInSeconds; Assert-AreEqual $ProbeCount $vProbe.NumberOfProbes; $listProbe = Get-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listProbe | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Set-AzLoadBalancerProbeConfig -Name $rname -LoadBalancer $vLoadBalancer -Port $PortSet -IntervalInSeconds $IntervalInSecondsSet -ProbeCount $ProbeCountSet; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vProbe = Get-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vProbe; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerProbeConfig" $vProbe }; Assert-AreEqual $rname $vProbe.Name; Assert-AreEqual $PortSet $vProbe.Port; Assert-AreEqual $IntervalInSecondsSet $vProbe.IntervalInSeconds; Assert-AreEqual $ProbeCountSet $vProbe.NumberOfProbes; $listProbe = Get-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listProbe | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Add-AzLoadBalancerProbeConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -Port $PortAdd -IntervalInSeconds $IntervalInSecondsAdd -ProbeCount $ProbeCountAdd; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vProbe = Get-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; Assert-NotNull $vProbe; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerProbeConfig" $vProbe }; Assert-AreEqual $rnameAdd $vProbe.Name; Assert-AreEqual $PortAdd $vProbe.Port; Assert-AreEqual $IntervalInSecondsAdd $vProbe.IntervalInSeconds; Assert-AreEqual $ProbeCountAdd $vProbe.NumberOfProbes; $listProbe = Get-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listProbe | Where-Object { $_.Name -eq $rnameAdd }); Assert-ThrowsContains { Add-AzLoadBalancerProbeConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -Port $PortAdd -IntervalInSeconds $IntervalInSecondsAdd -ProbeCount $ProbeCountAdd } "already exists"; $vLoadBalancer = Remove-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; $vLoadBalancer = Remove-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Remove-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer -Name $rname } "Sequence contains no matching element"; Assert-ThrowsContains { Set-AzLoadBalancerProbeConfig -Name $rname -LoadBalancer $vLoadBalancer -Port $PortSet -IntervalInSeconds $IntervalInSecondsSet -ProbeCount $ProbeCountSet } "does not exist"; } finally { Clean-ResourceGroup $rgname; } } function Test-ProbeCRUDAllParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $rnameAdd = "${rname}Add"; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers"; $Protocol = "Http"; $Port = 2424; $IntervalInSeconds = 6; $ProbeCount = 4; $RequestPath = "/create"; $ProtocolSet = "Tcp"; $PortSet = 4244; $IntervalInSecondsSet = 14; $ProbeCountSet = 7; $PortAdd = 443; $IntervalInSecondsAdd = 11; $ProbeCountAdd = 5; $PublicIPAddressName = "PublicIPAddressName"; $PublicIPAddressAllocationMethod = "Static"; $FrontendIPConfigurationName = "FrontendIPConfigurationName"; try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $PublicIPAddress = New-AzPublicIPAddress -ResourceGroupName $rgname -Location $location -Name $PublicIPAddressName -AllocationMethod $PublicIPAddressAllocationMethod; $FrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationName -PublicIpAddress $PublicIPAddress; $vProbe = New-AzLoadBalancerProbeConfig -Name $rname -Protocol $Protocol -Port $Port -IntervalInSeconds $IntervalInSeconds -ProbeCount $ProbeCount -RequestPath $RequestPath; Assert-NotNull $vProbe; Assert-True { Check-CmdletReturnType "New-AzLoadBalancerProbeConfig" $vProbe }; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -Probe $vProbe -FrontendIPConfiguration $FrontendIPConfiguration -Location $location; Assert-NotNull $vLoadBalancer; Assert-AreEqual $rname $vProbe.Name; Assert-AreEqual $Protocol $vProbe.Protocol; Assert-AreEqual $Port $vProbe.Port; Assert-AreEqual $IntervalInSeconds $vProbe.IntervalInSeconds; Assert-AreEqual $ProbeCount $vProbe.NumberOfProbes; Assert-AreEqual $RequestPath $vProbe.RequestPath; $vProbe = Get-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vProbe; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerProbeConfig" $vProbe }; Assert-AreEqual $rname $vProbe.Name; Assert-AreEqual $Protocol $vProbe.Protocol; Assert-AreEqual $Port $vProbe.Port; Assert-AreEqual $IntervalInSeconds $vProbe.IntervalInSeconds; Assert-AreEqual $ProbeCount $vProbe.NumberOfProbes; Assert-AreEqual $RequestPath $vProbe.RequestPath; $listProbe = Get-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listProbe | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Set-AzLoadBalancerProbeConfig -Name $rname -LoadBalancer $vLoadBalancer -Protocol $ProtocolSet -Port $PortSet -IntervalInSeconds $IntervalInSecondsSet -ProbeCount $ProbeCountSet; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vProbe = Get-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vProbe; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerProbeConfig" $vProbe }; Assert-AreEqual $rname $vProbe.Name; Assert-AreEqual $ProtocolSet $vProbe.Protocol; Assert-AreEqual $PortSet $vProbe.Port; Assert-AreEqual $IntervalInSecondsSet $vProbe.IntervalInSeconds; Assert-AreEqual $ProbeCountSet $vProbe.NumberOfProbes; $listProbe = Get-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listProbe | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Add-AzLoadBalancerProbeConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -Port $PortAdd -IntervalInSeconds $IntervalInSecondsAdd -ProbeCount $ProbeCountAdd; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vProbe = Get-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; Assert-NotNull $vProbe; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerProbeConfig" $vProbe }; Assert-AreEqual $rnameAdd $vProbe.Name; Assert-AreEqual $PortAdd $vProbe.Port; Assert-AreEqual $IntervalInSecondsAdd $vProbe.IntervalInSeconds; Assert-AreEqual $ProbeCountAdd $vProbe.NumberOfProbes; $listProbe = Get-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listProbe | Where-Object { $_.Name -eq $rnameAdd }); Assert-ThrowsContains { Add-AzLoadBalancerProbeConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -Port $PortAdd -IntervalInSeconds $IntervalInSecondsAdd -ProbeCount $ProbeCountAdd } "already exists"; $vLoadBalancer = Remove-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; $vLoadBalancer = Remove-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Remove-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancerProbeConfig -LoadBalancer $vLoadBalancer -Name $rname } "Sequence contains no matching element"; Assert-ThrowsContains { Set-AzLoadBalancerProbeConfig -Name $rname -LoadBalancer $vLoadBalancer -Protocol $ProtocolSet -Port $PortSet -IntervalInSeconds $IntervalInSecondsSet -ProbeCount $ProbeCountSet } "does not exist"; } finally { Clean-ResourceGroup $rgname; } } function Test-InboundNatRuleCRUDMinimalParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $rnameAdd = "${rname}Add"; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers"; $FrontendPort = 123; $BackendPort = 456; $FrontendPortSet = 128; $BackendPortSet = 500; $FrontendPortAdd = 80; $BackendPortAdd = 512; $SubnetName = "SubnetName"; $SubnetAddressPrefix = "10.0.1.0/24"; $VirtualNetworkName = "VirtualNetworkName"; $VirtualNetworkAddressPrefix = @("10.0.0.0/8"); $FrontendIPConfigurationName = "FrontendIPConfigurationName"; try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $Subnet = New-AzVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $SubnetAddressPrefix; $VirtualNetwork = New-AzVirtualNetwork -ResourceGroupName $rgname -Location $location -Name $VirtualNetworkName -Subnet $Subnet -AddressPrefix $VirtualNetworkAddressPrefix; if(-not $Subnet.Id) { $Subnet = Get-AzVirtualNetworkSubnetConfig -Name $SubnetName -VirtualNetwork $VirtualNetwork; } $FrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationName -Subnet $Subnet; $vInboundNatRule = New-AzLoadBalancerInboundNatRuleConfig -Name $rname -FrontendIpConfiguration $FrontendIPConfiguration -FrontendPort $FrontendPort -BackendPort $BackendPort; Assert-NotNull $vInboundNatRule; Assert-True { Check-CmdletReturnType "New-AzLoadBalancerInboundNatRuleConfig" $vInboundNatRule }; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -InboundNatRule $vInboundNatRule -FrontendIPConfiguration $FrontendIPConfiguration -Location $location; Assert-NotNull $vLoadBalancer; Assert-NotNull $vLoadBalancer.FrontendIpConfigurations; Assert-True { $vLoadBalancer.FrontendIpConfigurations.Length -gt 0 }; Assert-AreEqual $rname $vInboundNatRule.Name; Assert-AreEqual $FrontendPort $vInboundNatRule.FrontendPort; Assert-AreEqual $BackendPort $vInboundNatRule.BackendPort; $vInboundNatRule = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vInboundNatRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerInboundNatRuleConfig" $vInboundNatRule }; Assert-AreEqual $rname $vInboundNatRule.Name; Assert-AreEqual $FrontendPort $vInboundNatRule.FrontendPort; Assert-AreEqual $BackendPort $vInboundNatRule.BackendPort; $listInboundNatRule = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listInboundNatRule | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Set-AzLoadBalancerInboundNatRuleConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -FrontendPort $FrontendPortSet -BackendPort $BackendPortSet; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vInboundNatRule = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vInboundNatRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerInboundNatRuleConfig" $vInboundNatRule }; Assert-AreEqual $rname $vInboundNatRule.Name; Assert-AreEqual $FrontendPortSet $vInboundNatRule.FrontendPort; Assert-AreEqual $BackendPortSet $vInboundNatRule.BackendPort; $listInboundNatRule = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listInboundNatRule | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Add-AzLoadBalancerInboundNatRuleConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -FrontendPort $FrontendPortAdd -BackendPort $BackendPortAdd; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vInboundNatRule = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; Assert-NotNull $vInboundNatRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerInboundNatRuleConfig" $vInboundNatRule }; Assert-AreEqual $rnameAdd $vInboundNatRule.Name; Assert-AreEqual $FrontendPortAdd $vInboundNatRule.FrontendPort; Assert-AreEqual $BackendPortAdd $vInboundNatRule.BackendPort; $listInboundNatRule = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listInboundNatRule | Where-Object { $_.Name -eq $rnameAdd }); Assert-ThrowsContains { Add-AzLoadBalancerInboundNatRuleConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -FrontendPort $FrontendPortAdd -BackendPort $BackendPortAdd } "already exists"; $vLoadBalancer = Remove-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; $vLoadBalancer = Remove-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Remove-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer -Name $rname } "Sequence contains no matching element"; Assert-ThrowsContains { Set-AzLoadBalancerInboundNatRuleConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -FrontendPort $FrontendPortSet -BackendPort $BackendPortSet } "does not exist"; } finally { Clean-ResourceGroup $rgname; } } function Test-InboundNatRuleCRUDAllParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $rnameAdd = "${rname}Add"; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers"; $Protocol = "Udp"; $FrontendPort = 123; $BackendPort = 456; $IdleTimeoutInMinutes = 7; $EnableFloatingIP = $true; $EnableTcpReset = $false; $ProtocolSet = "Tcp"; $FrontendPortSet = 128; $BackendPortSet = 500; $IdleTimeoutInMinutesSet = 15; $EnableFloatingIPSet = $false; $EnableTcpResetSet = $false; $ProtocolAdd = "Tcp"; $FrontendPortAdd = 80; $BackendPortAdd = 512; $IdleTimeoutInMinutesAdd = 17; $EnableFloatingIPAdd = $false; $EnableTcpResetAdd = $false; $SubnetName = "SubnetName"; $SubnetAddressPrefix = "10.0.1.0/24"; $VirtualNetworkName = "VirtualNetworkName"; $VirtualNetworkAddressPrefix = @("10.0.0.0/8"); $FrontendIPConfigurationName = "FrontendIPConfigurationName"; try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $Subnet = New-AzVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $SubnetAddressPrefix; $VirtualNetwork = New-AzVirtualNetwork -ResourceGroupName $rgname -Location $location -Name $VirtualNetworkName -Subnet $Subnet -AddressPrefix $VirtualNetworkAddressPrefix; if(-not $Subnet.Id) { $Subnet = Get-AzVirtualNetworkSubnetConfig -Name $SubnetName -VirtualNetwork $VirtualNetwork; } $FrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationName -Subnet $Subnet; $vInboundNatRule = New-AzLoadBalancerInboundNatRuleConfig -Name $rname -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $Protocol -FrontendPort $FrontendPort -BackendPort $BackendPort -IdleTimeoutInMinutes $IdleTimeoutInMinutes -EnableFloatingIP; Assert-NotNull $vInboundNatRule; Assert-True { Check-CmdletReturnType "New-AzLoadBalancerInboundNatRuleConfig" $vInboundNatRule }; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -InboundNatRule $vInboundNatRule -FrontendIPConfiguration $FrontendIPConfiguration -Location $location; Assert-NotNull $vLoadBalancer; Assert-NotNull $vLoadBalancer.FrontendIpConfigurations; Assert-True { $vLoadBalancer.FrontendIpConfigurations.Length -gt 0 }; Assert-AreEqual $rname $vInboundNatRule.Name; Assert-AreEqual $Protocol $vInboundNatRule.Protocol; Assert-AreEqual $FrontendPort $vInboundNatRule.FrontendPort; Assert-AreEqual $BackendPort $vInboundNatRule.BackendPort; Assert-AreEqual $IdleTimeoutInMinutes $vInboundNatRule.IdleTimeoutInMinutes; Assert-AreEqual $EnableFloatingIP $vInboundNatRule.EnableFloatingIP; Assert-AreEqual $EnableTcpReset $vInboundNatRule.EnableTcpReset; $vInboundNatRule = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vInboundNatRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerInboundNatRuleConfig" $vInboundNatRule }; Assert-AreEqual $rname $vInboundNatRule.Name; Assert-AreEqual $Protocol $vInboundNatRule.Protocol; Assert-AreEqual $FrontendPort $vInboundNatRule.FrontendPort; Assert-AreEqual $BackendPort $vInboundNatRule.BackendPort; Assert-AreEqual $IdleTimeoutInMinutes $vInboundNatRule.IdleTimeoutInMinutes; Assert-AreEqual $EnableFloatingIP $vInboundNatRule.EnableFloatingIP; Assert-AreEqual $EnableTcpReset $vInboundNatRule.EnableTcpReset; $listInboundNatRule = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listInboundNatRule | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Set-AzLoadBalancerInboundNatRuleConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $ProtocolSet -FrontendPort $FrontendPortSet -BackendPort $BackendPortSet -IdleTimeoutInMinutes $IdleTimeoutInMinutesSet; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vInboundNatRule = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vInboundNatRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerInboundNatRuleConfig" $vInboundNatRule }; Assert-AreEqual $rname $vInboundNatRule.Name; Assert-AreEqual $ProtocolSet $vInboundNatRule.Protocol; Assert-AreEqual $FrontendPortSet $vInboundNatRule.FrontendPort; Assert-AreEqual $BackendPortSet $vInboundNatRule.BackendPort; Assert-AreEqual $IdleTimeoutInMinutesSet $vInboundNatRule.IdleTimeoutInMinutes; Assert-AreEqual $EnableFloatingIPSet $vInboundNatRule.EnableFloatingIP; Assert-AreEqual $EnableTcpResetSet $vInboundNatRule.EnableTcpReset; $listInboundNatRule = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listInboundNatRule | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Add-AzLoadBalancerInboundNatRuleConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $ProtocolAdd -FrontendPort $FrontendPortAdd -BackendPort $BackendPortAdd -IdleTimeoutInMinutes $IdleTimeoutInMinutesAdd; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vInboundNatRule = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; Assert-NotNull $vInboundNatRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerInboundNatRuleConfig" $vInboundNatRule }; Assert-AreEqual $rnameAdd $vInboundNatRule.Name; Assert-AreEqual $ProtocolAdd $vInboundNatRule.Protocol; Assert-AreEqual $FrontendPortAdd $vInboundNatRule.FrontendPort; Assert-AreEqual $BackendPortAdd $vInboundNatRule.BackendPort; Assert-AreEqual $IdleTimeoutInMinutesAdd $vInboundNatRule.IdleTimeoutInMinutes; Assert-AreEqual $EnableFloatingIPAdd $vInboundNatRule.EnableFloatingIP; Assert-AreEqual $EnableTcpResetAdd $vInboundNatRule.EnableTcpReset; $listInboundNatRule = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listInboundNatRule | Where-Object { $_.Name -eq $rnameAdd }); Assert-ThrowsContains { Add-AzLoadBalancerInboundNatRuleConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $ProtocolAdd -FrontendPort $FrontendPortAdd -BackendPort $BackendPortAdd -IdleTimeoutInMinutes $IdleTimeoutInMinutesAdd } "already exists"; $vLoadBalancer = Remove-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; $vLoadBalancer = Remove-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Remove-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $vLoadBalancer -Name $rname } "Sequence contains no matching element"; Assert-ThrowsContains { Set-AzLoadBalancerInboundNatRuleConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $ProtocolSet -FrontendPort $FrontendPortSet -BackendPort $BackendPortSet -IdleTimeoutInMinutes $IdleTimeoutInMinutesSet } "does not exist"; } finally { Clean-ResourceGroup $rgname; } } function Test-InboundNatPoolCRUDMinimalParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $rnameAdd = "${rname}Add"; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers"; $Protocol = "Udp"; $FrontendPortRangeStart = 555; $FrontendPortRangeEnd = 999; $BackendPort = 987; $ProtocolSet = "Tcp"; $FrontendPortRangeStartSet = 777; $FrontendPortRangeEndSet = 888; $BackendPortSet = 789; $ProtocolAdd = "Tcp"; $FrontendPortRangeStartAdd = 444; $FrontendPortRangeEndAdd = 445; $BackendPortAdd = 8080; $PublicIPAddressName = "PublicIPAddressName"; $PublicIPAddressAllocationMethod = "Static"; $FrontendIPConfigurationName = "FrontendIPConfigurationName"; try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $PublicIPAddress = New-AzPublicIPAddress -ResourceGroupName $rgname -Location $location -Name $PublicIPAddressName -AllocationMethod $PublicIPAddressAllocationMethod; $FrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationName -PublicIpAddress $PublicIPAddress; $vInboundNatPool = New-AzLoadBalancerInboundNatPoolConfig -Name $rname -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $Protocol -FrontendPortRangeStart $FrontendPortRangeStart -FrontendPortRangeEnd $FrontendPortRangeEnd -BackendPort $BackendPort; Assert-NotNull $vInboundNatPool; Assert-True { Check-CmdletReturnType "New-AzLoadBalancerInboundNatPoolConfig" $vInboundNatPool }; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -InboundNatPool $vInboundNatPool -FrontendIPConfiguration $FrontendIPConfiguration -Location $location; Assert-NotNull $vLoadBalancer; Assert-NotNull $vLoadBalancer.FrontendIpConfigurations; Assert-True { $vLoadBalancer.FrontendIpConfigurations.Length -gt 0 }; Assert-AreEqual $rname $vInboundNatPool.Name; Assert-AreEqual $Protocol $vInboundNatPool.Protocol; Assert-AreEqual $FrontendPortRangeStart $vInboundNatPool.FrontendPortRangeStart; Assert-AreEqual $FrontendPortRangeEnd $vInboundNatPool.FrontendPortRangeEnd; Assert-AreEqual $BackendPort $vInboundNatPool.BackendPort; $vInboundNatPool = Get-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vInboundNatPool; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerInboundNatPoolConfig" $vInboundNatPool }; Assert-AreEqual $rname $vInboundNatPool.Name; Assert-AreEqual $Protocol $vInboundNatPool.Protocol; Assert-AreEqual $FrontendPortRangeStart $vInboundNatPool.FrontendPortRangeStart; Assert-AreEqual $FrontendPortRangeEnd $vInboundNatPool.FrontendPortRangeEnd; Assert-AreEqual $BackendPort $vInboundNatPool.BackendPort; $listInboundNatPool = Get-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listInboundNatPool | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Set-AzLoadBalancerInboundNatPoolConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $ProtocolSet -FrontendPortRangeStart $FrontendPortRangeStartSet -FrontendPortRangeEnd $FrontendPortRangeEndSet -BackendPort $BackendPortSet; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vInboundNatPool = Get-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vInboundNatPool; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerInboundNatPoolConfig" $vInboundNatPool }; Assert-AreEqual $rname $vInboundNatPool.Name; Assert-AreEqual $ProtocolSet $vInboundNatPool.Protocol; Assert-AreEqual $FrontendPortRangeStartSet $vInboundNatPool.FrontendPortRangeStart; Assert-AreEqual $FrontendPortRangeEndSet $vInboundNatPool.FrontendPortRangeEnd; Assert-AreEqual $BackendPortSet $vInboundNatPool.BackendPort; $listInboundNatPool = Get-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listInboundNatPool | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Add-AzLoadBalancerInboundNatPoolConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $ProtocolAdd -FrontendPortRangeStart $FrontendPortRangeStartAdd -FrontendPortRangeEnd $FrontendPortRangeEndAdd -BackendPort $BackendPortAdd; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vInboundNatPool = Get-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; Assert-NotNull $vInboundNatPool; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerInboundNatPoolConfig" $vInboundNatPool }; Assert-AreEqual $rnameAdd $vInboundNatPool.Name; Assert-AreEqual $ProtocolAdd $vInboundNatPool.Protocol; Assert-AreEqual $FrontendPortRangeStartAdd $vInboundNatPool.FrontendPortRangeStart; Assert-AreEqual $FrontendPortRangeEndAdd $vInboundNatPool.FrontendPortRangeEnd; Assert-AreEqual $BackendPortAdd $vInboundNatPool.BackendPort; $listInboundNatPool = Get-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listInboundNatPool | Where-Object { $_.Name -eq $rnameAdd }); Assert-ThrowsContains { Add-AzLoadBalancerInboundNatPoolConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $ProtocolAdd -FrontendPortRangeStart $FrontendPortRangeStartAdd -FrontendPortRangeEnd $FrontendPortRangeEndAdd -BackendPort $BackendPortAdd } "already exists"; $vLoadBalancer = Remove-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; $vLoadBalancer = Remove-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Remove-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer -Name $rname } "Sequence contains no matching element"; Assert-ThrowsContains { Set-AzLoadBalancerInboundNatPoolConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $ProtocolSet -FrontendPortRangeStart $FrontendPortRangeStartSet -FrontendPortRangeEnd $FrontendPortRangeEndSet -BackendPort $BackendPortSet } "does not exist"; } finally { Clean-ResourceGroup $rgname; } } function Test-InboundNatPoolCRUDAllParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $rnameAdd = "${rname}Add"; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers"; $Protocol = "Udp"; $FrontendPortRangeStart = 555; $FrontendPortRangeEnd = 999; $BackendPort = 987; $IdleTimeoutInMinutes = 15; $EnableFloatingIP = $true; $EnableTcpReset = $false; $ProtocolSet = "Tcp"; $FrontendPortRangeStartSet = 777; $FrontendPortRangeEndSet = 888; $BackendPortSet = 789; $IdleTimeoutInMinutesSet = 30; $EnableFloatingIPSet = $false; $EnableTcpResetSet = $false; $ProtocolAdd = "Tcp"; $FrontendPortRangeStartAdd = 444; $FrontendPortRangeEndAdd = 445; $BackendPortAdd = 8080; $IdleTimeoutInMinutesAdd = 5; $EnableFloatingIPAdd = $false; $EnableTcpResetAdd = $false; $PublicIPAddressName = "PublicIPAddressName"; $PublicIPAddressAllocationMethod = "Static"; $FrontendIPConfigurationName = "FrontendIPConfigurationName"; try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $PublicIPAddress = New-AzPublicIPAddress -ResourceGroupName $rgname -Location $location -Name $PublicIPAddressName -AllocationMethod $PublicIPAddressAllocationMethod; $FrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationName -PublicIpAddress $PublicIPAddress; $vInboundNatPool = New-AzLoadBalancerInboundNatPoolConfig -Name $rname -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $Protocol -FrontendPortRangeStart $FrontendPortRangeStart -FrontendPortRangeEnd $FrontendPortRangeEnd -BackendPort $BackendPort -IdleTimeoutInMinutes $IdleTimeoutInMinutes -EnableFloatingIP; Assert-NotNull $vInboundNatPool; Assert-True { Check-CmdletReturnType "New-AzLoadBalancerInboundNatPoolConfig" $vInboundNatPool }; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -InboundNatPool $vInboundNatPool -FrontendIPConfiguration $FrontendIPConfiguration -Location $location; Assert-NotNull $vLoadBalancer; Assert-NotNull $vLoadBalancer.FrontendIpConfigurations; Assert-True { $vLoadBalancer.FrontendIpConfigurations.Length -gt 0 }; Assert-AreEqual $rname $vInboundNatPool.Name; Assert-AreEqual $Protocol $vInboundNatPool.Protocol; Assert-AreEqual $FrontendPortRangeStart $vInboundNatPool.FrontendPortRangeStart; Assert-AreEqual $FrontendPortRangeEnd $vInboundNatPool.FrontendPortRangeEnd; Assert-AreEqual $BackendPort $vInboundNatPool.BackendPort; Assert-AreEqual $IdleTimeoutInMinutes $vInboundNatPool.IdleTimeoutInMinutes; Assert-AreEqual $EnableFloatingIP $vInboundNatPool.EnableFloatingIP; Assert-AreEqual $EnableTcpReset $vInboundNatPool.EnableTcpReset; $vInboundNatPool = Get-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vInboundNatPool; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerInboundNatPoolConfig" $vInboundNatPool }; Assert-AreEqual $rname $vInboundNatPool.Name; Assert-AreEqual $Protocol $vInboundNatPool.Protocol; Assert-AreEqual $FrontendPortRangeStart $vInboundNatPool.FrontendPortRangeStart; Assert-AreEqual $FrontendPortRangeEnd $vInboundNatPool.FrontendPortRangeEnd; Assert-AreEqual $BackendPort $vInboundNatPool.BackendPort; Assert-AreEqual $IdleTimeoutInMinutes $vInboundNatPool.IdleTimeoutInMinutes; Assert-AreEqual $EnableFloatingIP $vInboundNatPool.EnableFloatingIP; Assert-AreEqual $EnableTcpReset $vInboundNatPool.EnableTcpReset; $listInboundNatPool = Get-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listInboundNatPool | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Set-AzLoadBalancerInboundNatPoolConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $ProtocolSet -FrontendPortRangeStart $FrontendPortRangeStartSet -FrontendPortRangeEnd $FrontendPortRangeEndSet -BackendPort $BackendPortSet -IdleTimeoutInMinutes $IdleTimeoutInMinutesSet; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vInboundNatPool = Get-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vInboundNatPool; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerInboundNatPoolConfig" $vInboundNatPool }; Assert-AreEqual $rname $vInboundNatPool.Name; Assert-AreEqual $ProtocolSet $vInboundNatPool.Protocol; Assert-AreEqual $FrontendPortRangeStartSet $vInboundNatPool.FrontendPortRangeStart; Assert-AreEqual $FrontendPortRangeEndSet $vInboundNatPool.FrontendPortRangeEnd; Assert-AreEqual $BackendPortSet $vInboundNatPool.BackendPort; Assert-AreEqual $IdleTimeoutInMinutesSet $vInboundNatPool.IdleTimeoutInMinutes; Assert-AreEqual $EnableFloatingIPSet $vInboundNatPool.EnableFloatingIP; Assert-AreEqual $EnableTcpResetSet $vInboundNatPool.EnableTcpReset; $listInboundNatPool = Get-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listInboundNatPool | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Add-AzLoadBalancerInboundNatPoolConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $ProtocolAdd -FrontendPortRangeStart $FrontendPortRangeStartAdd -FrontendPortRangeEnd $FrontendPortRangeEndAdd -BackendPort $BackendPortAdd -IdleTimeoutInMinutes $IdleTimeoutInMinutesAdd; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vInboundNatPool = Get-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; Assert-NotNull $vInboundNatPool; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerInboundNatPoolConfig" $vInboundNatPool }; Assert-AreEqual $rnameAdd $vInboundNatPool.Name; Assert-AreEqual $ProtocolAdd $vInboundNatPool.Protocol; Assert-AreEqual $FrontendPortRangeStartAdd $vInboundNatPool.FrontendPortRangeStart; Assert-AreEqual $FrontendPortRangeEndAdd $vInboundNatPool.FrontendPortRangeEnd; Assert-AreEqual $BackendPortAdd $vInboundNatPool.BackendPort; Assert-AreEqual $IdleTimeoutInMinutesAdd $vInboundNatPool.IdleTimeoutInMinutes; Assert-AreEqual $EnableFloatingIPAdd $vInboundNatPool.EnableFloatingIP; Assert-AreEqual $EnableTcpResetAdd $vInboundNatPool.EnableTcpReset; $listInboundNatPool = Get-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listInboundNatPool | Where-Object { $_.Name -eq $rnameAdd }); Assert-ThrowsContains { Add-AzLoadBalancerInboundNatPoolConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $ProtocolAdd -FrontendPortRangeStart $FrontendPortRangeStartAdd -FrontendPortRangeEnd $FrontendPortRangeEndAdd -BackendPort $BackendPortAdd -IdleTimeoutInMinutes $IdleTimeoutInMinutesAdd } "already exists"; $vLoadBalancer = Remove-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; $vLoadBalancer = Remove-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Remove-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancerInboundNatPoolConfig -LoadBalancer $vLoadBalancer -Name $rname } "Sequence contains no matching element"; Assert-ThrowsContains { Set-AzLoadBalancerInboundNatPoolConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIpConfiguration $FrontendIPConfiguration -Protocol $ProtocolSet -FrontendPortRangeStart $FrontendPortRangeStartSet -FrontendPortRangeEnd $FrontendPortRangeEndSet -BackendPort $BackendPortSet -IdleTimeoutInMinutes $IdleTimeoutInMinutesSet } "does not exist"; } finally { Clean-ResourceGroup $rgname; } } function Test-OutboundRuleCRUDMinimalParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $rnameAdd = "${rname}Add"; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers"; $Protocol = "Udp"; $ProtocolSet = "Tcp"; $ProtocolAdd = "All"; $PublicIPAddressName = "PublicIPAddressName"; $PublicIPAddressNameAdd = "PublicIPAddressNameAdd"; $PublicIPAddressAllocationMethod = "Static"; $PublicIPAddressSku = "Standard"; $FrontendIPConfigurationName = "FrontendIPConfigurationName"; $FrontendIPConfigurationNameAdd = "FrontendIPConfigurationNameAdd"; $BackendAddressPoolName = "BackendAddressPoolName"; $BackendAddressPoolNameAdd = "BackendAddressPoolNameAdd"; $LoadBalancerSku = "Standard"; try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $PublicIPAddress = New-AzPublicIPAddress -ResourceGroupName $rgname -Location $location -Name $PublicIPAddressName -AllocationMethod $PublicIPAddressAllocationMethod -Sku $PublicIPAddressSku; $FrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationName -PublicIpAddress $PublicIPAddress; $BackendAddressPool = New-AzLoadBalancerBackendAddressPoolConfig -Name $BackendAddressPoolName; $PublicIPAddressAdd = New-AzPublicIPAddress -ResourceGroupName $rgname -Location $location -Name $PublicIPAddressNameAdd -AllocationMethod $PublicIPAddressAllocationMethod -Sku $PublicIPAddressSku; $FrontendIPConfigurationAdd = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationNameAdd -PublicIpAddress $PublicIPAddressAdd; $BackendAddressPoolAdd = New-AzLoadBalancerBackendAddressPoolConfig -Name $BackendAddressPoolNameAdd; $vOutboundRule = New-AzLoadBalancerOutboundRuleConfig -Name $rname -FrontendIPConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Protocol $Protocol; Assert-NotNull $vOutboundRule; Assert-True { Check-CmdletReturnType "New-AzLoadBalancerOutboundRuleConfig" $vOutboundRule }; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -OutboundRule $vOutboundRule -Sku $LoadBalancerSku -FrontendIPConfiguration @($FrontendIPConfiguration, $FrontendIPConfigurationAdd) -BackendAddressPool @($BackendAddressPool, $BackendAddressPoolAdd) -Location $location; Assert-NotNull $vLoadBalancer; Assert-NotNull $vLoadBalancer.FrontendIpConfigurations; Assert-True { $vLoadBalancer.FrontendIpConfigurations.Length -gt 0 }; Assert-NotNull $vLoadBalancer.BackendAddressPools; Assert-True { $vLoadBalancer.BackendAddressPools.Length -gt 0 }; Assert-AreEqual $rname $vOutboundRule.Name; Assert-AreEqual $Protocol $vOutboundRule.Protocol; $vOutboundRule = Get-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vOutboundRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerOutboundRuleConfig" $vOutboundRule }; Assert-AreEqual $rname $vOutboundRule.Name; Assert-AreEqual $Protocol $vOutboundRule.Protocol; $listOutboundRule = Get-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listOutboundRule | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Set-AzLoadBalancerOutboundRuleConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIPConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Protocol $ProtocolSet; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vOutboundRule = Get-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vOutboundRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerOutboundRuleConfig" $vOutboundRule }; Assert-AreEqual $rname $vOutboundRule.Name; Assert-AreEqual $ProtocolSet $vOutboundRule.Protocol; $listOutboundRule = Get-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listOutboundRule | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Add-AzLoadBalancerOutboundRuleConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIPConfiguration $FrontendIPConfigurationAdd -BackendAddressPool $BackendAddressPoolAdd -Protocol $ProtocolAdd; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-NotNull $vLoadBalancer.FrontendIpConfigurations; Assert-True { $vLoadBalancer.FrontendIpConfigurations.Length -gt 0 }; Assert-NotNull $vLoadBalancer.BackendAddressPools; Assert-True { $vLoadBalancer.BackendAddressPools.Length -gt 0 }; $vOutboundRule = Get-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; Assert-NotNull $vOutboundRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerOutboundRuleConfig" $vOutboundRule }; Assert-AreEqual $rnameAdd $vOutboundRule.Name; Assert-AreEqual $ProtocolAdd $vOutboundRule.Protocol; $listOutboundRule = Get-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listOutboundRule | Where-Object { $_.Name -eq $rnameAdd }); Assert-ThrowsContains { Add-AzLoadBalancerOutboundRuleConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIPConfiguration $FrontendIPConfigurationAdd -BackendAddressPool $BackendAddressPoolAdd -Protocol $ProtocolAdd } "already exists"; $vLoadBalancer = Remove-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; $vLoadBalancer = Remove-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Remove-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer -Name $rname } "Sequence contains no matching element"; Assert-ThrowsContains { Set-AzLoadBalancerOutboundRuleConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIPConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Protocol $ProtocolSet } "does not exist"; } finally { Clean-ResourceGroup $rgname; } } function Test-OutboundRuleCRUDAllParameters { $rgname = Get-ResourceGroupName; $rglocation = Get-ProviderLocation ResourceManagement; $rname = Get-ResourceName; $rnameAdd = "${rname}Add"; $location = Get-ProviderLocation "Microsoft.Network/loadBalancers"; $Protocol = "Udp"; $AllocatedOutboundPort = 8; $EnableTcpReset = $false; $IdleTimeoutInMinutes = 15; $ProtocolSet = "Tcp"; $AllocatedOutboundPortSet = 16; $EnableTcpResetSet = $false; $IdleTimeoutInMinutesSet = 20; $ProtocolAdd = "All"; $AllocatedOutboundPortAdd = 24; $EnableTcpResetAdd = $false; $IdleTimeoutInMinutesAdd = 30; $PublicIPAddressName = "PublicIPAddressName"; $PublicIPAddressNameAdd = "PublicIPAddressNameAdd"; $PublicIPAddressAllocationMethod = "Static"; $PublicIPAddressSku = "Standard"; $FrontendIPConfigurationName = "FrontendIPConfigurationName"; $FrontendIPConfigurationNameAdd = "FrontendIPConfigurationNameAdd"; $BackendAddressPoolName = "BackendAddressPoolName"; $BackendAddressPoolNameAdd = "BackendAddressPoolNameAdd"; $LoadBalancerSku = "Standard"; try { $resourceGroup = New-AzResourceGroup -Name $rgname -Location $rglocation; $PublicIPAddress = New-AzPublicIPAddress -ResourceGroupName $rgname -Location $location -Name $PublicIPAddressName -AllocationMethod $PublicIPAddressAllocationMethod -Sku $PublicIPAddressSku; $FrontendIPConfiguration = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationName -PublicIpAddress $PublicIPAddress; $BackendAddressPool = New-AzLoadBalancerBackendAddressPoolConfig -Name $BackendAddressPoolName; $PublicIPAddressAdd = New-AzPublicIPAddress -ResourceGroupName $rgname -Location $location -Name $PublicIPAddressNameAdd -AllocationMethod $PublicIPAddressAllocationMethod -Sku $PublicIPAddressSku; $FrontendIPConfigurationAdd = New-AzLoadBalancerFrontendIpConfig -Name $FrontendIPConfigurationNameAdd -PublicIpAddress $PublicIPAddressAdd; $BackendAddressPoolAdd = New-AzLoadBalancerBackendAddressPoolConfig -Name $BackendAddressPoolNameAdd; $vOutboundRule = New-AzLoadBalancerOutboundRuleConfig -Name $rname -FrontendIPConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Protocol $Protocol -AllocatedOutboundPort $AllocatedOutboundPort -IdleTimeoutInMinutes $IdleTimeoutInMinutes; Assert-NotNull $vOutboundRule; Assert-True { Check-CmdletReturnType "New-AzLoadBalancerOutboundRuleConfig" $vOutboundRule }; $vLoadBalancer = New-AzLoadBalancer -ResourceGroupName $rgname -Name $rname -OutboundRule $vOutboundRule -Sku $LoadBalancerSku -FrontendIPConfiguration @($FrontendIPConfiguration, $FrontendIPConfigurationAdd) -BackendAddressPool @($BackendAddressPool, $BackendAddressPoolAdd) -Location $location; Assert-NotNull $vLoadBalancer; Assert-NotNull $vLoadBalancer.FrontendIpConfigurations; Assert-True { $vLoadBalancer.FrontendIpConfigurations.Length -gt 0 }; Assert-NotNull $vLoadBalancer.BackendAddressPools; Assert-True { $vLoadBalancer.BackendAddressPools.Length -gt 0 }; Assert-AreEqual $rname $vOutboundRule.Name; Assert-AreEqual $Protocol $vOutboundRule.Protocol; Assert-AreEqual $AllocatedOutboundPort $vOutboundRule.AllocatedOutboundPorts; Assert-AreEqual $EnableTcpReset $vOutboundRule.EnableTcpReset; Assert-AreEqual $IdleTimeoutInMinutes $vOutboundRule.IdleTimeoutInMinutes; $vOutboundRule = Get-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vOutboundRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerOutboundRuleConfig" $vOutboundRule }; Assert-AreEqual $rname $vOutboundRule.Name; Assert-AreEqual $Protocol $vOutboundRule.Protocol; Assert-AreEqual $AllocatedOutboundPort $vOutboundRule.AllocatedOutboundPorts; Assert-AreEqual $EnableTcpReset $vOutboundRule.EnableTcpReset; Assert-AreEqual $IdleTimeoutInMinutes $vOutboundRule.IdleTimeoutInMinutes; $listOutboundRule = Get-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listOutboundRule | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Set-AzLoadBalancerOutboundRuleConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIPConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Protocol $ProtocolSet -AllocatedOutboundPort $AllocatedOutboundPortSet -IdleTimeoutInMinutes $IdleTimeoutInMinutesSet; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; $vOutboundRule = Get-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; Assert-NotNull $vOutboundRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerOutboundRuleConfig" $vOutboundRule }; Assert-AreEqual $rname $vOutboundRule.Name; Assert-AreEqual $ProtocolSet $vOutboundRule.Protocol; Assert-AreEqual $AllocatedOutboundPortSet $vOutboundRule.AllocatedOutboundPorts; Assert-AreEqual $EnableTcpResetSet $vOutboundRule.EnableTcpReset; Assert-AreEqual $IdleTimeoutInMinutesSet $vOutboundRule.IdleTimeoutInMinutes; $listOutboundRule = Get-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listOutboundRule | Where-Object { $_.Name -eq $rname }); $vLoadBalancer = Add-AzLoadBalancerOutboundRuleConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIPConfiguration $FrontendIPConfigurationAdd -BackendAddressPool $BackendAddressPoolAdd -Protocol $ProtocolAdd -AllocatedOutboundPort $AllocatedOutboundPortAdd -IdleTimeoutInMinutes $IdleTimeoutInMinutesAdd; Assert-NotNull $vLoadBalancer; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-NotNull $vLoadBalancer.FrontendIpConfigurations; Assert-True { $vLoadBalancer.FrontendIpConfigurations.Length -gt 0 }; Assert-NotNull $vLoadBalancer.BackendAddressPools; Assert-True { $vLoadBalancer.BackendAddressPools.Length -gt 0 }; $vOutboundRule = Get-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; Assert-NotNull $vOutboundRule; Assert-True { Check-CmdletReturnType "Get-AzLoadBalancerOutboundRuleConfig" $vOutboundRule }; Assert-AreEqual $rnameAdd $vOutboundRule.Name; Assert-AreEqual $ProtocolAdd $vOutboundRule.Protocol; Assert-AreEqual $AllocatedOutboundPortAdd $vOutboundRule.AllocatedOutboundPorts; Assert-AreEqual $EnableTcpResetAdd $vOutboundRule.EnableTcpReset; Assert-AreEqual $IdleTimeoutInMinutesAdd $vOutboundRule.IdleTimeoutInMinutes; $listOutboundRule = Get-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer; Assert-NotNull ($listOutboundRule | Where-Object { $_.Name -eq $rnameAdd }); Assert-ThrowsContains { Add-AzLoadBalancerOutboundRuleConfig -Name $rnameAdd -LoadBalancer $vLoadBalancer -FrontendIPConfiguration $FrontendIPConfigurationAdd -BackendAddressPool $BackendAddressPoolAdd -Protocol $ProtocolAdd -AllocatedOutboundPort $AllocatedOutboundPortAdd -IdleTimeoutInMinutes $IdleTimeoutInMinutesAdd } "already exists"; $vLoadBalancer = Remove-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer -Name $rnameAdd; $vLoadBalancer = Remove-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Remove-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer -Name $rname; $vLoadBalancer = Set-AzLoadBalancer -LoadBalancer $vLoadBalancer; Assert-NotNull $vLoadBalancer; Assert-ThrowsContains { Get-AzLoadBalancerOutboundRuleConfig -LoadBalancer $vLoadBalancer -Name $rname } "Sequence contains no matching element"; Assert-ThrowsContains { Set-AzLoadBalancerOutboundRuleConfig -Name $rname -LoadBalancer $vLoadBalancer -FrontendIPConfiguration $FrontendIPConfiguration -BackendAddressPool $BackendAddressPool -Protocol $ProtocolSet -AllocatedOutboundPort $AllocatedOutboundPortSet -IdleTimeoutInMinutes $IdleTimeoutInMinutesSet } "does not exist"; } finally { Clean-ResourceGroup $rgname; } }
combined_dataset/train/non-malicious/sample_40_85.ps1
sample_40_85.ps1
# # Module manifest for module 'OCI.PSModules.Identitydataplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Identitydataplane.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '0db2e619-5a8a-4c35-906a-750fbc5977b8' # 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 Identitydataplane 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 = '81.0.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Identitydataplane.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 = 'New-OCIIdentitydataplaneScopedAccessToken', 'New-OCIIdentitydataplaneUserSecurityToken' # 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','Identitydataplane' # 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/226.ps1
226.ps1
function Get-AsciiReaction { [cmdletbinding()] Param ( [Parameter()] [ValidateSet( 'Shrug', 'Disapproval', 'TableFlip', 'TableBack', 'TableFlip2', 'TableBack2', 'TableFlip3', 'Denko', 'BlowKiss', 'Lenny', 'Angry', 'DontKnow')] [string]$Name ) $OutputEncoding = [System.Text.Encoding]::unicode function Write-Ascii { [CmdletBinding()] Param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [string]$Ascii ) Add-Type -Assembly PresentationCore $clipText = ($Ascii).ToString() | Out-String -Stream [Windows.Clipboard]::SetText($clipText) Write-Output $clipText } Switch ($Name) { 'Shrug' { [char[]]@(175, 92, 95, 40, 12484, 41, 95, 47, 175) -join '' | Write-Ascii } 'Disapproval' { [char[]]@(3232, 95, 3232) -join '' | Write-Ascii } 'TableFlip' { [char[]]@(40, 9583, 176, 9633, 176, 65289, 9583, 65077, 32, 9531, 9473, 9531, 41) -join '' | Write-Ascii } 'TableBack' { [char[]]@(9516, 9472, 9472, 9516, 32, 175, 92, 95, 40, 12484, 41) -join '' | Write-Ascii } 'TableFlip2' { [char[]]@(9531, 9473, 9531, 32, 65077, 12541, 40, 96, 1044, 180, 41, 65417, 65077, 32, 9531, 9473, 9531) -join '' | Write-Ascii } 'TableBack2' { [char[]]@(9516, 9472, 9516, 12494, 40, 32, 186, 32, 95, 32, 186, 12494, 41) -join '' | Write-Ascii } 'TableFlip3' { [char[]]@(40, 12494, 3232, 30410, 3232, 41, 12494, 24417, 9531, 9473, 9531) -join '' | Write-Ascii } 'Denko' { [char[]]@(40, 180, 65381, 969, 65381, 96, 41) -join '' | Write-Ascii } 'BlowKiss' { [char[]]@(40, 42, 94, 51, 94, 41, 47, 126, 9734) -join '' | Write-Ascii } 'Lenny' { [char[]]@(40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41) -join '' | Write-Ascii } 'Angry' { [char[]]@(40, 65283, 65439, 1044, 65439, 41) -join '' | Write-Ascii } 'DontKnow' { [char[]]@(9488, 40, 39, 65374, 39, 65307, 41, 9484) -join '' | Write-Ascii } default { [PSCustomObject][ordered]@{ 'Shrug' = [char[]]@(175, 92, 95, 40, 12484, 41, 95, 47, 175) -join '' | Write-Ascii 'Disapproval' = [char[]]@(3232, 95, 3232) -join '' | Write-Ascii 'TableFlip' = [char[]]@(40, 9583, 176, 9633, 176, 65289, 9583, 65077, 32, 9531, 9473, 9531, 41) -join '' | Write-Ascii 'TableBack' = [char[]]@(9516, 9472, 9472, 9516, 32, 175, 92, 95, 40, 12484, 41) -join '' | Write-Ascii 'TableFlip2' = [char[]]@(9531, 9473, 9531, 32, 65077, 12541, 40, 96, 1044, 180, 41, 65417, 65077, 32, 9531, 9473, 9531) -join '' | Write-Ascii 'TableBack2' = [char[]]@(9516, 9472, 9516, 12494, 40, 32, 186, 32, 95, 32, 186, 12494, 41) -join '' | Write-Ascii 'TableFlip3' = [char[]]@(40, 12494, 3232, 30410, 3232, 41, 12494, 24417, 9531, 9473, 9531) -join '' | Write-Ascii 'Denko' = [char[]]@(40, 180, 65381, 969, 65381, 96, 41) -join '' | Write-Ascii 'BlowKiss' = [char[]]@(40, 42, 94, 51, 94, 41, 47, 126, 9734) -join '' | Write-Ascii 'Lenny' = [char[]]@(40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 41) -join '' | Write-Ascii 'Angry' = [char[]]@(40, 65283, 65439, 1044, 65439, 41) -join '' | Write-Ascii 'DontKnow' = [char[]]@(9488, 40, 39, 65374, 39, 65307, 41, 9484) -join '' | Write-Ascii } } } }
combined_dataset/train/non-malicious/Hack ESX MOTD_1.ps1
Hack ESX MOTD_1.ps1
$screen = @" You see here a virtual switch. ------------ ------ #...........| |....| --------------- ###------------ |...(| |..%...........|########## ###-@...| |...%...........### # ## |....| +.......<......| ### ### |..!.| --------------- ### ### ------ ---.----- ### |.......|#### --------- . Clyde the Sysadmin St:7 Dx:9 Co:10 In:18 Wi:18 Ch:6 Chaotic Evil Dlvl:3 $:120 HP:39(41) Pw:36(36) AC:6 Exp:5 T:1073 "@ Set-VMHostAdvancedConfiguration -name Annotations.WelcomeMessage -value $screen
combined_dataset/train/non-malicious/1955.ps1
1955.ps1
Describe "Register-EngineEvent" -Tags "CI" { Context "Check return type of Register-EngineEvent" { It "Should return System.Management.Automation.PSEventJob as return type of Register-EngineEvent" { Register-EngineEvent -SourceIdentifier PesterTestRegister -Action {Write-Output registerengineevent} | Should -BeOfType System.Management.Automation.PSEventJob Unregister-Event -sourceidentifier PesterTestRegister } } }
combined_dataset/train/non-malicious/sample_56_54.ps1
sample_56_54.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ ## ## TODO: Refactor the certificate generation and installation in smaller ## functions and move them (including enums) to ClusterSetupUtilities.psm1 module. ## param ( [Parameter(Mandatory=$True, ParameterSetName = "Install")] [switch] $Install, [Parameter(Mandatory=$True, ParameterSetName = "Clean")] [switch] $Clean, [Parameter(Mandatory=$False)] [string] $CertSubjectName = "CN=ServiceFabricDevClusterCert" ) function Cleanup-Cert([string] $CertSubjectName) { Write-Host "Cleaning existing certificates..." $cerLocations = @("cert:\LocalMachine\My", "cert:\LocalMachine\root", "cert:\LocalMachine\CA", "cert:\CurrentUser\My") foreach($cerLoc in $cerLocations) { Get-ChildItem -Path $cerLoc | ? { $_.Subject -like "*$CertSubjectName*" } | Remove-Item } Write-Host "Certificates removed." } $warningMessage = @" This will install certificate with '$CertSubjectName' in following stores: # LocalMachine\My # LocalMachine\root & # CurrentUser\My The CleanCluster.ps1 will clean these certificates or you can clean them up using script 'CertSetup.ps1 -Clean -CertSubjectName $CertSubjectName'. "@ $X509KeyUsageFlags = @{ DIGITAL_SIGNATURE = 0x80 KEY_ENCIPHERMENT = 0x20 DATA_ENCIPHERMENT = 0x10 } $X509KeySpec = @{ NONE = 0 KEYEXCHANGE = 1 SIGNATURE = 2 } $X509PrivateKeyExportFlags = @{ EXPORT_NONE = 0 EXPORT_FLAG = 0x1 PLAINTEXT_EXPORT_FLAG = 0x2 ARCHIVING_FLAG = 0x4 PLAINTEXT_ARCHIVING_FLAG = 0x8 } $X509CertificateEnrollmentContext = @{ USER = 0x1 MACHINE = 0x2 ADMINISTRATOR_FORCE_MACHINE = 0x3 } $EncodingType = @{ STRING_BASE64HEADER = 0 STRING_BASE64 = 0x1 STRING_BINARY = 0x2 STRING_BASE64REQUESTHEADER = 0x3 STRING_HEX = 0x4 STRING_HEXASCII = 0x5 STRING_BASE64_ANY = 0x6 STRING_ANY = 0x7 STRING_HEX_ANY = 0x8 STRING_BASE64X509CRLHEADER = 0x9 STRING_HEXADDR = 0xa STRING_HEXASCIIADDR = 0xb STRING_HEXRAW = 0xc STRING_NOCRLF = 0x40000000 STRING_NOCR = 0x80000000 } $InstallResponseRestrictionFlags = @{ ALLOW_NONE = 0x00000000 ALLOW_NO_OUTSTANDING_REQUEST = 0x00000001 ALLOW_UNTRUSTED_CERTIFICATE = 0x00000002 ALLOW_UNTRUSTED_ROOT = 0x00000004 } if($Install) { #cleanup previous installs of the certificate Cleanup-Cert -CertSubjectName $CertSubjectName Write-Host "Installing new certificates..." Write-Warning $warningMessage $identity = [Security.Principal.WindowsIdentity]::GetCurrent() $name = new-object -com "X509Enrollment.CX500DistinguishedName" $name.Encode($CertSubjectName, 0x00100000) $key = new-object -com "X509Enrollment.CX509PrivateKey.1" $key.ProviderName = "Microsoft RSA SChannel Cryptographic Provider" $key.ExportPolicy = $X509PrivateKeyExportFlags.PLAINTEXT_EXPORT_FLAG $key.KeySpec = $X509KeySpec.KEYEXCHANGE $key.Length = 1024 $sd = "D:PAI(A;;0xd01f01ff;;;SY)(A;;0xd01f01ff;;;BA)(A;;0xd01f01ff;;;NS)(A;;0xd01f01ff;;;" + $identity.User.Value + ")" $key.SecurityDescriptor = $sd $key.MachineContext = $TRUE $key.Create() #set server auth keyspec $serverauthoid = new-object -com "X509Enrollment.CObjectId.1" $serverauthoid.InitializeFromValue("1.3.6.1.5.5.7.3.1") $ekuoids = new-object -com "X509Enrollment.CObjectIds.1" $ekuoids.add($serverauthoid) $clientauthoid = new-object -com "X509Enrollment.CObjectId.1" $clientauthoid.InitializeFromValue("1.3.6.1.5.5.7.3.2") $ekuoids.add($clientauthoid) $ekuext = new-object -com "X509Enrollment.CX509ExtensionEnhancedKeyUsage.1" $ekuext.InitializeEncode($ekuoids) $keyUsageExt = New-Object -ComObject X509Enrollment.CX509ExtensionKeyUsage $keyUsageExt.InitializeEncode($X509KeyUsageFlags.KEY_ENCIPHERMENT -bor $X509KeyUsageFlags.DIGITAL_SIGNATURE) $certTemplateName = "" $cert = new-object -com "X509Enrollment.CX509CertificateRequestCertificate.1" $cert.InitializeFromPrivateKey($X509CertificateEnrollmentContext.MACHINE, $key, $certTemplateName) $cert.Subject = $name $cert.Issuer = $cert.Subject $notbefore = get-date $ts = new-timespan -Days 2 $cert.NotBefore = $notbefore.Subtract($ts) $cert.NotAfter = $cert.NotBefore.AddYears(1) $cert.X509Extensions.Add($ekuext) $cert.X509Extensions.Add($keyUsageExt) $cert.Encode() #install certificate in LocalMachine My store $enrollment = new-object -com "X509Enrollment.CX509Enrollment.1" $enrollment.InitializeFromRequest($cert) $certdata = $enrollment.CreateRequest($EncodingType.STRING_BASE64HEADER) $password = "" $enrollment.InstallResponse($InstallResponseRestrictionFlags.ALLOW_UNTRUSTED_CERTIFICATE, $certdata, $EncodingType.STRING_BASE64HEADER, $password) if (!$?) { Write-Warning "Failed to create certificates required for cluster" return } $srcStoreScope = "LocalMachine" $srcStoreName = "My" $srcStore = New-Object System.Security.Cryptography.X509Certificates.X509Store $srcStoreName, $srcStoreScope $srcStore.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadOnly) $cert = $srcStore.certificates -match "$CertSubjectName" $dstStoreScope = "LocalMachine" $dstStoreName = "root" #copy cert to root store so chain build succeeds $dstStore = New-Object System.Security.Cryptography.X509Certificates.X509Store $dstStoreName, $dstStoreScope $dstStore.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite) foreach($c in $cert) { $dstStore.Add($c) } $dstStore.Close() $dstStoreScope = "CurrentUser" $dstStoreName = "My" $dstStore = New-Object System.Security.Cryptography.X509Certificates.X509Store $dstStoreName, $dstStoreScope $dstStore.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite) foreach($c in $cert) { $dstStore.Add($c) } $srcStore.Close() $dstStore.Close() } if($Clean) { Cleanup-Cert -CertSubjectName $CertSubjectName } # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAGpzFgtkUmO6NZ # gQoc/sFlY42MkN6RwnHH2QV8eo6TbqCCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4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FRpbWUtU3RhbXAgUENBIDIw # MTACEzMAAAHqmiRy1Vk/YWMAAQAAAeowIgQgsV1fCbmmH75BMy5zjZ1PndqDSqvv # 7W5NXnU6epaRVyIwDQYJKoZIhvcNAQELBQAEggIATkJm/SEz0RQkQXykIM34WFyt # jzw4Khmm2yoMyyiyXSqeHKErRMkeIMYR4wUPTMRD9uGTxFm5W5tu396/I6N43wQQ # vPUukFt10iALsOrOoOdcb0TsD60IDT2T90Jd+2vbEXKB+7/9b0FSfISjPuvckiDn # wBe5KFkVVigesGCNFhCcwlWkhbQBuIWRiOi7N73+xltWc9k+ctkm9xTRHcdVZkQK # d/qZ5GvbgUYsXxcbVwkATg5PqQDjD0cGgV3ixaUsaZImKoD/FC7PALfxomWZjfJn # loCtOTXsrksd2l0nDiIe/8GT0W5p60TI1KlBOh8A9n7RKEs65mkHBE/S3fsDTFys # t+YEvLbO8IRetXxbol+qqVhtMBirp5/rLQ2/Oh/xXTx/Mf55Q8lW8XeVshyt6rlO # auMBDdixzdpWiFyz/aRkcQrNJOf1T16A5r4iAaYCVADHBet+rcOf6vY4eCLOdI+o # VuQJDQFEAfkQ35lc4Af6g8ywoW+DpPA8G3jPGO9Ufi7Q16Jd6LlbzV65LnFj8K4/ # cC24V3Sx3y82M1XIeeRyLwz0Lyov6ntQE+W5NbJjCbQvL9xtQsJx4e01eE+4gecY # CHvaWIhScV3AdnKT/lvpA94yqi69bIps2CmJR6U/aL43aGA4bca6HhsVGJMd78Ex # VmNdKOFY+3k5N5cXiEM= # SIG # End signature block
combined_dataset/train/non-malicious/sample_46_97.ps1
sample_46_97.ps1
# # Module manifest for module 'OCI.PSModules.Tenantmanagercontrolplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Tenantmanagercontrolplane.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '6b57c3ab-69f1-4092-a5c1-380523593dd4' # 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 Tenantmanagercontrolplane 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.1.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Tenantmanagercontrolplane.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-OCITenantmanagercontrolplaneGovernance', 'Enable-OCITenantmanagercontrolplaneOrder', 'Get-OCITenantmanagercontrolplaneAssignedSubscription', 'Get-OCITenantmanagercontrolplaneAssignedSubscriptionLineItemsList', 'Get-OCITenantmanagercontrolplaneAssignedSubscriptionsList', 'Get-OCITenantmanagercontrolplaneAvailableRegionsList', 'Get-OCITenantmanagercontrolplaneDomain', 'Get-OCITenantmanagercontrolplaneDomainGovernance', 'Get-OCITenantmanagercontrolplaneDomainGovernancesList', 'Get-OCITenantmanagercontrolplaneDomainsList', 'Get-OCITenantmanagercontrolplaneLink', 'Get-OCITenantmanagercontrolplaneLinksList', 'Get-OCITenantmanagercontrolplaneOrder', 'Get-OCITenantmanagercontrolplaneOrganization', 'Get-OCITenantmanagercontrolplaneOrganizationsList', 'Get-OCITenantmanagercontrolplaneOrganizationTenanciesList', 'Get-OCITenantmanagercontrolplaneOrganizationTenancy', 'Get-OCITenantmanagercontrolplaneRecipientInvitation', 'Get-OCITenantmanagercontrolplaneRecipientInvitationsList', 'Get-OCITenantmanagercontrolplaneSenderInvitation', 'Get-OCITenantmanagercontrolplaneSenderInvitationsList', 'Get-OCITenantmanagercontrolplaneSubscription', 'Get-OCITenantmanagercontrolplaneSubscriptionLineItemsList', 'Get-OCITenantmanagercontrolplaneSubscriptionMapping', 'Get-OCITenantmanagercontrolplaneSubscriptionMappingsList', 'Get-OCITenantmanagercontrolplaneSubscriptionsList', 'Get-OCITenantmanagercontrolplaneWorkRequest', 'Get-OCITenantmanagercontrolplaneWorkRequestErrorsList', 'Get-OCITenantmanagercontrolplaneWorkRequestLogsList', 'Get-OCITenantmanagercontrolplaneWorkRequestsList', 'Invoke-OCITenantmanagercontrolplaneApproveOrganizationTenancyForTransfer', 'Invoke-OCITenantmanagercontrolplaneIgnoreRecipientInvitation', 'Invoke-OCITenantmanagercontrolplaneUnapproveOrganizationTenancyForTransfer', 'New-OCITenantmanagercontrolplaneChildTenancy', 'New-OCITenantmanagercontrolplaneDomain', 'New-OCITenantmanagercontrolplaneDomainGovernance', 'New-OCITenantmanagercontrolplaneSenderInvitation', 'New-OCITenantmanagercontrolplaneSubscriptionMapping', 'Receive-OCITenantmanagercontrolplaneRecipientInvitation', 'Remove-OCITenantmanagercontrolplaneDomain', 'Remove-OCITenantmanagercontrolplaneDomainGovernance', 'Remove-OCITenantmanagercontrolplaneGovernance', 'Remove-OCITenantmanagercontrolplaneLink', 'Remove-OCITenantmanagercontrolplaneOrganizationTenancy', 'Remove-OCITenantmanagercontrolplaneSubscriptionMapping', 'Restore-OCITenantmanagercontrolplaneOrganizationTenancy', 'Stop-OCITenantmanagercontrolplaneSenderInvitation', 'Update-OCITenantmanagercontrolplaneDomain', 'Update-OCITenantmanagercontrolplaneDomainGovernance', 'Update-OCITenantmanagercontrolplaneOrganization', 'Update-OCITenantmanagercontrolplaneRecipientInvitation', 'Update-OCITenantmanagercontrolplaneSenderInvitation' # 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','Tenantmanagercontrolplane' # 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/DS L Order brneanew game.ps1
DS L Order brneanew game.ps1
# Version: 0.1 # Author: Stefan Stranger # Description: Retrieve Dell Order Status # Start Page Order Status USA: https://support.dell.com/support/order/status.aspx?c=us&cs=19&l=en&s=dhs&~ck=pn # Start Page Order Status EMEA(nl): http://support.euro.dell.com/support/index.aspx?c=nl&l=nl&s=gen&~ck=bt # Example Dell Order Status URL: http://support.euro.dell.com/support/order/emea/OrderStatus.aspx?c=nl&l=nl&s=gen&ir=[IR Number]&ea=[emailaddress]' #param ([string]$url = $(read-host "Please enter Dell Order Status URL")) $wc = New-Object System.Net.WebClient $url = 'http://support.euro.dell.com/support/order/emea/OrderStatus.aspx?c=nl&l=nl&s=gen&ir=NL0131-8510-29070&[email protected]' $RawResult = $wc.DownloadString($url) # $RawResult = gc orderstatus.txt # Search for the Estimated Delivery Date in the url that starts with the word "lever" (Levering is the Dutch word for Delivery" and # and ends with </B></TD></TR> # You should probable need to change the string "Lever" in "Deliv" or something $r = New-Object regex('Lever.*?(\\d+-\\d+-\\d{4})</B></TD></TR>','SingleLine' ) # String block with the Estimated Delivery Date $m = $r.Matches($RawResult) # Extract Delivery Date from string block $date = ($m |% {$_.groups[1].value }) # Search for Current Order Status ("In preproduction" is Dutch for "In preproduction" $r = New-Object regex('target="popup:640x480">(.*?)</a>' ) $m = $r.Matches($RawResult) $status = ($m |% {$_.groups[1].value }) $Orderstatus = 1 | select @{name='Status';expression={$status[0]}},@{name='Estimated Delivery Date';expression={$date}} $Orderstatus | ft -a #[string]$output = $orderstatus $startdate = "16-09-2007" $startdate $currentdate = (get-date).ToString('MM-dd-yyyy') $currentdate $date
combined_dataset/train/non-malicious/Findup_9.ps1
Findup_9.ps1
using System; using System.Collections; using System.Collections.Generic; 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; } public byte[] SHA512_1st1K = new byte[64]; public byte[] SHA512_All = new byte[64]; public FileInfo FI { get; private set; } public bool Checked { get; set; } public bool SHA512_1st1KSet { get; set; } public bool SHA512_AllSet { get; set; } } class Recurse // Add FileInfoExt objects of files matching filenames, file specifications (E.G. *.txt), and in directories in pathRec, to returnList { 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); foreach (FileInfo addf in (Dir.GetFiles(searchPattern))) { returnList.Add(new FileInfoExt(addf)); } } 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 { try { 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); } } catch (Exception e) { Console.WriteLine("Parse error on: " + pathRec); Console.WriteLine("Make sure you don't end a directory with a \\\\ when using quotes. The console arg parser doesn't accept that."); Console.WriteLine("Exception: " + e.Message); return; } } return; } } class Findup { 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; System.Boolean b4b = 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(" -b4b - do a byte-for-byte comparison, instead of SHA-512 hashing. Might be much slower, but most secure."); 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(" findup.exe c:\\\\data .\\\\*.txt c:\\\\reports\\\\quarter.doc -recurse -b4b"); 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; } if (System.String.Compare(args[i], "-b4b", true) == 0) { b4b = 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; } RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); rng.GetBytes(randomNumber); // get 512-bit SHA-512 salt. 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 (System.String.Compare(fs[i].FI.FullName, fs[c].FI.FullName, true) == 0) // don't count the same file as a match. continue; if (fs[i].SHA512_1st1KSet == false) // check/hash first 1K first. if (Compute1KHash(fs[i]) == false) continue; if (fs[c].SHA512_1st1KSet == false) if (Compute1KHash(fs[c]) == false) continue; if (CompareHash(fs[i].SHA512_1st1K, fs[c].SHA512_1st1K) == false) // if the 1st 1K has the same hash.. continue; if (b4b == true) // byte for byte comparison specified? { if (B4b(fs[i].FI.FullName, fs[c].FI.FullName) == false) // call the byte for byte comparison function continue; } else if (fs[i].FI.Length > 1024) // skip hashing the file again if < 1024 bytes. { if (fs[i].SHA512_AllSet == false) // check/hash the rest of the files. if (ComputeFullHash(fs[i]) == false) continue; if (fs[c].SHA512_AllSet == false) if (ComputeFullHash(fs[c]) == false) continue; if (CompareHash(fs[i].SHA512_All, fs[c].SHA512_All) == false) 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 : {0:N0}", fs.Count); Console.WriteLine("Duplicate files : {0:N0}", numOfDupes); Console.WriteLine("Duplicate bytes : {0:N0}", bytesInDupes); Console.WriteLine("Duplicates deleted : {0:N0}", delFiles); Console.WriteLine("Recovered bytes : {0:N0}", bytesRec); return; } private static Boolean B4b(string path1, string path2) { try { using (var stream = File.OpenRead(path1)) { using (var stream2 = File.OpenRead(path2)) { System.Boolean EOF = false; do { var length = stream.Read(largeBuf, 0, largeBuf.Length); var length2 = stream2.Read(largeBuf2, 0, largeBuf2.Length); if (length != length2) return false; if (length != largeBuf.Length) EOF = true; int i = 0; while (i < length) { if (largeBuf[i] != largeBuf2[i]) return false; i++; } } while (EOF == false); } } return true; } catch (Exception e) { Console.WriteLine("Byte for Byte comparison failed: " + e.Message); return false; } } private static Boolean CompareHash(byte[] hash1, byte[] hash2) { int i = 0; while (i < hash1.Length) { if (hash1[i] != hash2[i]) return false; i++; } return true ; } private static readonly byte[] readBuf = new byte[1024 + 64]; private static readonly byte[] largeBuf = new byte[10240 + 64]; private static readonly byte[] largeBuf2 = new byte[10240 + 64]; private static readonly byte[] randomNumber = new byte[64]; private static byte[] hash = new byte[64]; private static bool Compute1KHash(FileInfoExt path) { Buffer.BlockCopy(randomNumber, 0, readBuf, 0, randomNumber.Length); try { using (var stream = File.OpenRead(path.FI.FullName)) { var length = stream.Read(readBuf, hash.Length, readBuf.Length - hash.Length); hash = SHA512.Create().ComputeHash(readBuf, 0, length + hash.Length); Buffer.BlockCopy(hash, 0, path.SHA512_1st1K, 0, hash.Length); path.SHA512_1st1KSet = true; return true; } } catch (Exception e) { Console.WriteLine("Hash Error: " + e.Message); return false; } } private static bool ComputeFullHash(FileInfoExt path) { Buffer.BlockCopy(randomNumber, 0, largeBuf, 0, randomNumber.Length); try { var _SHA = SHA512.Create(); using (var stream = File.OpenRead(path.FI.FullName)) { System.Boolean EOF = false; while (EOF == false) { var length = stream.Read(largeBuf, hash.Length, largeBuf.Length - hash.Length); if (length != (largeBuf.Length - hash.Length)) EOF = true; hash = _SHA.ComputeHash(largeBuf, 0, length + hash.Length); Buffer.BlockCopy(hash, 0, largeBuf, 0, hash.Length); } } Buffer.BlockCopy(hash, 0, path.SHA512_All, 0, hash.Length); path.SHA512_AllSet = true; return true; } catch (Exception e) { Console.WriteLine("Hash error: " + e.Message); return false; } } } }
combined_dataset/train/non-malicious/Asp.net-Using httpConext.ps1
Asp.net-Using httpConext.ps1
@@ Default.aspx @@---------------- Partial Class _Default Inherits System.Web.UI.Page Dim var1 As String Dim var2 As String Protected Sub lnk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnk.Click Context.Items("Nome") = var1 Context.Items("Email") = var2 Server.Transfer("pagina3.aspx") End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load var1 = "20091005" var2 = "20091106" End Sub End Class @@pagina3.aspx @@-------------------------- Partial Class pagina3 Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim context As HttpContext = HttpContext.Current Label1.Text = CStr(context.Items("Nome")) Label2.Text = CStr(context.Items("Email")) End Sub End Class
combined_dataset/train/non-malicious/Script logging_1.ps1
Script logging_1.ps1
#region Log File Management $ScriptName = $MyInvocation.mycommand.name $LocalAppDir = "$(gc env:LOCALAPPDATA)\\PS_Data" $LogName = $ScriptName.replace(".ps1", ".log") $MaxLogFileSizeMB = 5 # After a log file reaches this size it will archive the existing and create a new one trap [Exception] { sendl "error: $($_.Exception.GetType().Name) - $($_.Exception.Message)" } function LogFileCheck { if (!(Test-Path $LocalAppDir)) # Check if log file directory exists - if not, create and then create log file for this script. { mkdir $LocalAppDir New-Item "$LocalAppDir\\$LogName" -type file break } if (Test-Path "$LocalAppDir\\$LogName") { if (((gci "$LocalAppDir\\$LogName").length/1MB) -gt $MaxLogFileSizeMB) # Check size of log file - to stop unweildy size, archive existing file if over limit and create fresh. { $NewLogFile = $LogName.replace(".log", " ARCHIVED $(Get-Date -Format dd-MM-yyy-hh-mm-ss).log") ren "$LocalAppDir\\$LogName" "$LocalAppDir\\$NewLogFile" } } } function sendl ([string]$message) # Send to log file { $toOutput = "$(get-date) > $message " | Out-File "$LocalAppDir\\$LogName" -append -NoClobber } LogFileCheck #endregion Log File Management
combined_dataset/train/non-malicious/sample_53_27.ps1
sample_53_27.ps1
@{ IncludeRules = @( 'PSPlaceOpenBrace', 'PSPlaceCloseBrace', 'PSUseConsistentWhitespace', 'PSUseConsistentIndentation', 'PSAlignAssignmentStatement', 'PSUseCorrectCasing' ) Rules = @{ PSPlaceOpenBrace = @{ Enable = $true OnSameLine = $true NewLineAfter = $true IgnoreOneLineBlock = $true } PSPlaceCloseBrace = @{ Enable = $true NewLineAfter = $false IgnoreOneLineBlock = $true NoEmptyLineBefore = $false } PSUseConsistentIndentation = @{ Enable = $true Kind = 'space' PipelineIndentation = 'IncreaseIndentationForFirstPipeline' IndentationSize = 4 } PSUseConsistentWhitespace = @{ Enable = $true CheckInnerBrace = $true CheckOpenBrace = $true CheckOpenParen = $true CheckOperator = $true CheckPipe = $true CheckPipeForRedundantWhitespace = $false CheckSeparator = $true CheckParameter = $false IgnoreAssignmentOperatorInsideHashTable = $true } PSAlignAssignmentStatement = @{ Enable = $true CheckHashtable = $true } PSUseCorrectCasing = @{ Enable = $true } } } # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAI8gKQk1kVoYVw # cFLKG0RL87T8Ef5MACemSJTShv5MC6CCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgN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AecwIgQgqlaTCWOaa+AAu/C0Mo9z8XcL # sbQmklFVAz7qc+93mXMwDQYJKoZIhvcNAQELBQAEggIAmRm9R01OuYn9JDPNjrJ9 # jl8jpsNCczEDPZ8QBkibXhIpGjEaT7Xxad8lzC0FP/rKeHy2/YaUX/7gvVZFO3kv # BX1fdo2MflGzwrlD38slXjyZw/Lj7c8z8grEPrsOnr/XxWtdqKVWkKllwW15K4vg # vQnx7M2QCQJh7O6s2pEYpLSsDVfqFsVjbuIo5q/Q02WxRPXTAOsBoU+FJ59qGVxU # V3emwh+WD2Vx0sC8N9rOdFV39/hBRd/qZbp44ls5C3o3b1NX7IICE4PYVfrVUKVs # 2WvJoGaq6f0/5MbJXvRzswrA+cNDnEP1XFQ1mDzeH5vlS5iJMv/nZjdOfHWU0YJ5 # neXIjMo33vT169JBcyknZmVLVy4NnYtoXFwDeKbmxihr5lNOtKcrIHif3s/iFEf+ # ok3XGg4l4A38yptz/Q3QJoAQgAbGyRyZdmLjpRhULVru0RVkeU8gyQJ50gfxX5lj # Q9AqVssnQZMUJ9Loz91xc4VxpprrbyYzG+E6N3VBFucTvJiwkch4YkKNqr2ZFsNa # 4OoJZL5V6ohjClORqFX0Do09XMPhzJ3KHJPDEOwmlzASuDgxWETC1O6mZtsP9lnQ # 2PYIbDmpArT6kdsif/mWz1Gw4NuJfPDty57xjIVTqVtvsBEFfWtSuIQYlTEEZkEA # cgexJbz8PCq60kUWVTKjHoA= # SIG # End signature block
combined_dataset/train/non-malicious/NPS Server Synchronize_1.ps1
NPS Server Synchronize_1.ps1
###Network Policy Server Synchronization Script #This script copies the configuration from the NPS Master Server and imports it on this server. #The Account that this script runs under must have Local Administrator rights to the NPS Master. #This was designed to be run as a scheduled task on the NPS Secondary Servers on an hourly,daily, or as-needed basis. #Last Modified 01 Dec 2009 by JGrote <jgrote AT enpointe NOSPAM-DOTCOM> ###Variables #NPSMaster - Your Primary Network Policy Server you want to copy the config from. $NPSMaster = "Server1" #NPSConfigTempFile - A temporary location to store the XML config. Use a UNC path so that the primary can save the XML file across the network. Be sure to set secure permissions on this folder, as the configuration including pre-shared keys is temporarily stored here during the import process. $NPSConfigTempFile = "\\\\server2\\C$\\Temp\\NPSConfigTemp\\NPSConfig-$NPSMaster.xml" #Create an NPS Sync Event Source if it doesn't already exist if (!(get-eventlog -logname "System" -source "NPS-Sync")) {new-eventlog -logname "System" -source "NPS-Sync"} #Write an error and exit the script if an exception is ever thrown trap {write-eventlog -logname "System" -eventID 1 -source "NPS-Sync" -EntryType "Error" -Message "An Error occured during NPS Sync: $_. Script run from $($MyInvocation.MyCommand.Definition)"; exit} #Connect to NPS Master and export configuration $configExportResult = invoke-command -ComputerName $NPSMaster -ArgumentList $NPSConfigTempFile -scriptBlock {param ($NPSConfigTempFile) netsh nps export filename = $NPSConfigTempFile exportPSK = yes} #Verify that the import XML file was created. If it is not there, it will throw an exception caught by the trap above that will exit the script. $NPSConfigTest = Get-Item $NPSConfigTempFile #Clear existing configuration and import new NPS config $configClearResult = netsh nps reset config $configImportResult = netsh nps import filename = $NPSConfigTempFile #Delete Temporary File remove-item -path $NPSConfigTempFile #Compose and Write Success Event $successText = "Network Policy Server Configuration successfully synchronized from $NPSMaster. Export Results: $configExportResult Import Results: $configImportResult Script was run from $($MyInvocation.MyCommand.Definition)" write-eventlog -logname "System" -eventID 1 -source "NPS-Sync" -EntryType "Information" -Message $successText
combined_dataset/train/non-malicious/1155.ps1
1155.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldResolveBuiltinIdentity { $identity = Resolve-Identity -Name 'Administrators' Assert-Equal 'BUILTIN\Administrators' $identity.FullName Assert-Equal 'BUILTIN' $identity.Domain Assert-Equal 'Administrators' $identity.Name Assert-NotNull $identity.Sid Assert-Equal 'Alias' $identity.Type } function Test-ShouldResolveNTAuthorityIdentity { $identity = Resolve-Identity -Name 'NetworkService' Assert-Equal 'NT AUTHORITY\NETWORK SERVICE' $identity.FullName Assert-Equal 'NT AUTHORITY' $identity.Domain Assert-Equal 'NETWORK SERVICE' $identity.Name Assert-NotNull $identity.Sid Assert-Equal 'WellKnownGroup' $identity.Type } function Test-ShouldResolveEveryone { $identity = Resolve-Identity -Name 'Everyone' Assert-Equal 'Everyone' $identity.FullName Assert-Equal '' $identity.Domain Assert-Equal 'Everyone' $identity.Name Assert-NotNull $identity.Sid Assert-Equal 'WellKnownGroup' $identity.Type } function Test-ShouldNotResolveMadeUpName { $Error.Clear() $fullName = Resolve-Identity -Name 'IDONotExist' -ErrorAction SilentlyContinue Assert-GreaterThan $Error.Count 0 Assert-Like $Error[0].Exception.Message '*not found*' Assert-Null $fullName } function Test-ShouldResolveLocalSystem { Assert-Equal 'NT AUTHORITY\SYSTEM' (Resolve-Identity -Name 'localsystem').FullName } function Test-ShouldResolveDotAccounts { foreach( $user in (Get-User) ) { $id = Resolve-Identity -Name ('.\{0}' -f $user.SamAccountName) Assert-NoError Assert-NotNull $id Assert-Equal $id.Domain $user.ConnectedServer Assert-Equal $id.Name $user.SamAccountName } } function Test-ShouldResolveSid { @( 'NT AUTHORITY\SYSTEM', 'Everyone', 'BUILTIN\Administrators' ) | ForEach-Object { $id = Resolve-Identity -Name $_ $idFromSid = Resolve-Identity -Sid $id.Sid Assert-Equal $id $idFromSid } } function Test-ShouldResolveUnknownSid { $id = Resolve-Identity -SID 'S-1-5-21-2678556459-1010642102-471947008-1017' -ErrorAction SilentlyContinue Assert-Error -Last -Regex 'not found' Assert-Null $id } function Test-ShouldResolveSidByByteArray { $id = Resolve-Identity -Name 'Administrators' Assert-NotNull $id $sidBytes = New-Object 'byte[]' $id.Sid.BinaryLength $id.Sid.GetBinaryForm( $sidBytes, 0 ) $idBySid = Resolve-Identity -SID $sidBytes Assert-NotNull $idBySid Assert-NoError Assert-Equal $id $idBySid } function Test-ShouldHandleInvalidSddl { $Error.Clear() $id = Resolve-Identity -SID 'iamnotasid' -ErrorAction SilentlyContinue Assert-Error 'exception converting' Assert-Error -Count 2 Assert-Null $id } function Test-ShouldHandleInvalidBinarySid { $Error.Clear() $id = Resolve-Identity -SID (New-Object 'byte[]' 28) -ErrorAction SilentlyContinue Assert-Error 'exception converting' Assert-Error -Count 2 Assert-Null $id }
combined_dataset/train/non-malicious/sample_25_73.ps1
sample_25_73.ps1
# Copyright (c) 2020 Ansible Project # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) Function Get-AnsibleWindowsWebRequest { <# .SYNOPSIS Creates a System.Net.WebRequest object based on common URL module options in Ansible. .DESCRIPTION Will create a WebRequest based on common input options within Ansible. This can be used manually or with Invoke-AnsibleWindowsWebRequest. .PARAMETER Uri The URI to create the web request for. .PARAMETER UrlMethod The protocol method to use, if omitted, will use the default value for the URI protocol specified. .PARAMETER FollowRedirects Whether to follow redirect reponses. This is only valid when using a HTTP URI. all - Will follow all redirects none - Will follow no redirects safe - Will only follow redirects when GET or HEAD is used as the UrlMethod .PARAMETER Headers A hashtable or dictionary of header values to set on the request. This is only valid for a HTTP URI. .PARAMETER HttpAgent A string to set for the 'User-Agent' header. This is only valid for a HTTP URI. .PARAMETER MaximumRedirection The maximum number of redirections that will be followed. This is only valid for a HTTP URI. .PARAMETER UrlTimeout The timeout in seconds that defines how long to wait until the request times out. .PARAMETER ValidateCerts Whether to validate SSL certificates, default to True. .PARAMETER ClientCert The path to PFX file to use for X509 authentication. This is only valid for a HTTP URI. This path can either be a filesystem path (C:\folder\cert.pfx) or a PSPath to a credential (Cert:\CurrentUser\My\<thumbprint>). .PARAMETER ClientCertPassword The password for the PFX certificate if required. This is only valid for a HTTP URI. .PARAMETER ForceBasicAuth Whether to set the Basic auth header on the first request instead of when required. This is only valid for a HTTP URI. .PARAMETER UrlUsername The username to use for authenticating with the target. .PARAMETER UrlPassword The password to use for authenticating with the target. .PARAMETER UseDefaultCredential Whether to use the current user's credentials if available. This will only work when using Become, using SSH with password auth, or WinRM with CredSSP or Kerberos with credential delegation. .PARAMETER UseProxy Whether to use the default proxy defined in IE (WinINet) for the user or set no proxy at all. This should not be set to True when ProxyUrl is also defined. .PARAMETER ProxyUrl An explicit proxy server to use for the request instead of relying on the default proxy in IE. This is only valid for a HTTP URI. .PARAMETER ProxyUsername An optional username to use for proxy authentication. .PARAMETER ProxyPassword The password for ProxyUsername. .PARAMETER ProxyUseDefaultCredential Whether to use the current user's credentials for proxy authentication if available. This will only work when using Become, using SSH with password auth, or WinRM with CredSSP or Kerberos with credential delegation. .PARAMETER Module The AnsibleBasic module that can be used as a backup parameter source or a way to return warnings back to the Ansible controller. .EXAMPLE $spec = @{ options = @{} } $module = [Ansible.Basic.AnsibleModule]::Create($args, $spec, @(Get-AnsibleWindowsWebRequestSpec)) $web_request = Get-AnsibleWindowsWebRequest -Module $module #> [CmdletBinding()] [OutputType([System.Net.WebRequest])] Param ( [Alias("url")] [System.Uri] $Uri, [Alias("url_method")] [System.String] $UrlMethod, [Alias("follow_redirects")] [ValidateSet("all", "none", "safe")] [System.String] $FollowRedirects = "safe", [System.Collections.IDictionary] $Headers, [Alias("http_agent")] [System.String] $HttpAgent = "ansible-httpget", [Alias("maximum_redirection")] [System.Int32] $MaximumRedirection = 50, [Alias("url_timeout")] [System.Int32] $UrlTimeout = 30, [Alias("validate_certs")] [System.Boolean] $ValidateCerts = $true, # Credential params [Alias("client_cert")] [System.String] $ClientCert, [Alias("client_cert_password")] [System.String] $ClientCertPassword, [Alias("force_basic_auth")] [Switch] $ForceBasicAuth, [Alias("url_username")] [System.String] $UrlUsername, [Alias("url_password")] [System.String] $UrlPassword, [Alias("use_default_credential")] [Switch] $UseDefaultCredential, # Proxy params [Alias("use_proxy")] [System.Boolean] $UseProxy = $true, [Alias("proxy_url")] [System.String] $ProxyUrl, [Alias("proxy_username")] [System.String] $ProxyUsername, [Alias("proxy_password")] [System.String] $ProxyPassword, [Alias("proxy_use_default_credential")] [Switch] $ProxyUseDefaultCredential, [ValidateScript({ $_.GetType().FullName -eq 'Ansible.Basic.AnsibleModule' })] [System.Object] $Module ) # Set module options for parameters unless they were explicitly passed in. if ($Module) { foreach ($param in $PSCmdlet.MyInvocation.MyCommand.Parameters.GetEnumerator()) { if ($PSBoundParameters.ContainsKey($param.Key)) { # Was set explicitly we want to use that value continue } foreach ($alias in @($Param.Key) + $param.Value.Aliases) { if ($Module.Params.ContainsKey($alias)) { $var_value = $Module.Params.$alias -as $param.Value.ParameterType Set-Variable -Name $param.Key -Value $var_value break } } } } # Disable certificate validation if requested # FUTURE: set this on ServerCertificateValidationCallback of the HttpWebRequest once .NET 4.5 is the minimum if (-not $ValidateCerts) { [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true } } # Enable TLS1.1/TLS1.2 if they're available but disabled (eg. .NET 4.5) # This mess is required to enable TLS 1.1, 1.2 on versions older than # .NET Framework 4.7. It also forces a PSRemoting PowerShell host to use # the OS TLS protocol policies rather than a hardcoded set of TLS 1.0, # 1.1, and 1.2 only. # https://github.com/ansible-collections/ansible.windows/pull/573#issuecomment-1865477707 $security_protocols = [System.Net.ServicePointManager]::SecurityProtocol if ([System.Net.SecurityProtocolType].GetMember("Tls13")) { # If the Tls13 member is present we are on .NET Framework 4.8 so using # the SystemDefault setting will use the OS policies. If it's not set # to SystemDefault already we are running in a PSRemoting WSMan host # and need some reflection to reconfigure the policies to allow this. if ($security_protocols -ne 'SystemDefault') { # https://learn.microsoft.com/en-us/dotnet/framework/network-programming/tls#switchsystemnetdontenablesystemdefaulttlsversions $disableSystemTlsField = [System.Net.ServicePointManager].GetField( 's_disableSystemDefaultTlsVersions', [System.Reflection.BindingFlags]'NonPublic, Static') if ($disableSystemTlsField -and $disableSystemTlsField.GetValue($null)) { $disableSystemTlsField.SetValue($null, $false) } [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::SystemDefault } } else { # We are on .NET 4.7 or older, as TLS 1.2 is the max version we can # use here we just manually enable the protocols known to the runtime. if ([System.Net.SecurityProtocolType].GetMember("Tls11")) { $security_protocols = $security_protocols -bor [System.Net.SecurityProtocolType]::Tls11 } if ([System.Net.SecurityProtocolType].GetMember("Tls12")) { $security_protocols = $security_protocols -bor [System.Net.SecurityProtocolType]::Tls12 } [System.Net.ServicePointManager]::SecurityProtocol = $security_protocols } $web_request = [System.Net.WebRequest]::Create($Uri) if ($UrlMethod) { $web_request.Method = $UrlMethod } $web_request.Timeout = $UrlTimeout * 1000 if ($UseDefaultCredential -and $web_request -is [System.Net.HttpWebRequest]) { $web_request.UseDefaultCredentials = $true } elseif ($UrlUsername) { if ($ForceBasicAuth) { $auth_value = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $UrlUsername, $UrlPassword))) $web_request.Headers.Add("Authorization", "Basic $auth_value") } else { $credential = New-Object -TypeName System.Net.NetworkCredential -ArgumentList $UrlUsername, $UrlPassword $web_request.Credentials = $credential } } if ($ClientCert) { # Expecting either a filepath or PSPath (Cert:\CurrentUser\My\<thumbprint>) $cert = Get-Item -LiteralPath $ClientCert -ErrorAction SilentlyContinue if ($null -eq $cert) { Write-Error -Message "Client certificate '$ClientCert' does not exist" -Category ObjectNotFound return } $crypto_ns = 'System.Security.Cryptography.X509Certificates' if ($cert.PSProvider.Name -ne 'Certificate') { try { $cert = New-Object -TypeName "$crypto_ns.X509Certificate2" -ArgumentList @( $ClientCert, $ClientCertPassword ) } catch [System.Security.Cryptography.CryptographicException] { Write-Error -Message "Failed to read client certificate at '$ClientCert'" -Exception $_.Exception -Category SecurityError return } } $web_request.ClientCertificates = New-Object -TypeName "$crypto_ns.X509Certificate2Collection" -ArgumentList @( $cert ) } if (-not $UseProxy) { $proxy = $null } elseif ($ProxyUrl) { $proxy = New-Object -TypeName System.Net.WebProxy -ArgumentList $ProxyUrl, $true } else { $proxy = $web_request.Proxy } # $web_request.Proxy may return $null for a FTP web request. We only set the credentials if we have an actual # proxy to work with, otherwise just ignore the credentials property. if ($null -ne $proxy) { if ($ProxyUseDefaultCredential) { # Weird hack, $web_request.Proxy returns an IWebProxy object which only gurantees the Credentials # property. We cannot set UseDefaultCredentials so we just set the Credentials to the # DefaultCredentials in the CredentialCache which does the same thing. $proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials } elseif ($ProxyUsername) { $proxy.Credentials = New-Object -TypeName System.Net.NetworkCredential -ArgumentList @( $ProxyUsername, $ProxyPassword ) } else { $proxy.Credentials = $null } } $web_request.Proxy = $proxy # Some parameters only apply when dealing with a HttpWebRequest if ($web_request -is [System.Net.HttpWebRequest]) { if ($Headers) { foreach ($header in $Headers.GetEnumerator()) { switch ($header.Key) { Accept { $web_request.Accept = $header.Value } Connection { $web_request.Connection = $header.Value } Content-Length { $web_request.ContentLength = $header.Value } Content-Type { $web_request.ContentType = $header.Value } Expect { $web_request.Expect = $header.Value } Date { $web_request.Date = $header.Value } Host { $web_request.Host = $header.Value } If-Modified-Since { $web_request.IfModifiedSince = $header.Value } Range { $web_request.AddRange($header.Value) } Referer { $web_request.Referer = $header.Value } Transfer-Encoding { $web_request.SendChunked = $true $web_request.TransferEncoding = $header.Value } User-Agent { continue } default { $web_request.Headers.Add($header.Key, $header.Value) } } } } # For backwards compatibility we need to support setting the User-Agent if the header was set in the task. # We just need to make sure that if an explicit http_agent module was set then that takes priority. if ($Headers -and $Headers.ContainsKey("User-Agent")) { $options = (Get-AnsibleWindowsWebRequestSpec).options if ($HttpAgent -eq $options.http_agent.default) { $HttpAgent = $Headers['User-Agent'] } elseif ($null -ne $Module) { $Module.Warn("The 'User-Agent' header and the 'http_agent' was set, using the 'http_agent' for web request") } } $web_request.UserAgent = $HttpAgent switch ($FollowRedirects) { none { $web_request.AllowAutoRedirect = $false } safe { if ($web_request.Method -in @("GET", "HEAD")) { $web_request.AllowAutoRedirect = $true } else { $web_request.AllowAutoRedirect = $false } } all { $web_request.AllowAutoRedirect = $true } } if ($MaximumRedirection -eq 0) { $web_request.AllowAutoRedirect = $false } else { $web_request.MaximumAutomaticRedirections = $MaximumRedirection } } return $web_request } Function Invoke-AnsibleWindowsWebRequest { <# .SYNOPSIS Invokes a ScriptBlock with the WebRequest. .DESCRIPTION Invokes the ScriptBlock and handle extra information like accessing the response stream, closing those streams safely as well as setting common module return values. .PARAMETER Module The Ansible.Basic module to set the return values for. This will set the following return values; elapsed - The total time, in seconds, that it took to send the web request and process the response msg - The human readable description of the response status code status_code - An int that is the response status code .PARAMETER Request The System.Net.WebRequest to call. This can either be manually crafted or created with Get-AnsibleWindowsWebRequest. .PARAMETER Script The ScriptBlock to invoke during the web request. This ScriptBlock should take in the params Param ([System.Net.WebResponse]$Response, [System.IO.Stream]$Stream) This scriptblock should manage the response based on what it need to do. .PARAMETER Body An optional Stream to send to the target during the request. .PARAMETER IgnoreBadResponse By default a WebException will be raised for a non 2xx status code and the Script will not be invoked. This parameter can be set to process all responses regardless of the status code. .EXAMPLE Basic module that downloads a file $spec = @{ options = @{ path = @{ type = "path"; required = $true } } } $module = Ansible.Basic.AnsibleModule]::Create($args, $spec, @(Get-AnsibleWindowsWebRequestSpec)) $web_request = Get-AnsibleWindowsWebRequest -Module $module Invoke-AnsibleWindowsWebRequest -Module $module -Request $web_request -Script { Param ([System.Net.WebResponse]$Response, [System.IO.Stream]$Stream) $fs = [System.IO.File]::Create($module.Params.path) try { $Stream.CopyTo($fs) $fs.Flush() } finally { $fs.Dispose() } } #> [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [System.Object] [ValidateScript({ $_.GetType().FullName -eq 'Ansible.Basic.AnsibleModule' })] $Module, [Parameter(Mandatory = $true)] [System.Net.WebRequest] $Request, [Parameter(Mandatory = $true)] [ScriptBlock] $Script, [AllowNull()] [System.IO.Stream] $Body, [Switch] $IgnoreBadResponse ) $start = Get-Date if ($null -ne $Body) { $request_st = $Request.GetRequestStream() try { $Body.CopyTo($request_st) $request_st.Flush() } finally { $request_st.Close() } } try { try { $web_response = $Request.GetResponse() } catch [System.Net.WebException] { # A WebResponse with a status code not in the 200 range will raise a WebException. We check if the # exception raised contains the actual response and continue on if IgnoreBadResponse is set. We also # make sure we set the status_code return value on the Module object if possible if ($_.Exception.PSObject.Properties.Name -match "Response") { $web_response = $_.Exception.Response if (-not $IgnoreBadResponse -or $null -eq $web_response) { $Module.Result.msg = $_.Exception.StatusDescription $Module.Result.status_code = $_.Exception.Response.StatusCode throw $_ } } else { throw $_ } } if ($Request.RequestUri.IsFile) { # A FileWebResponse won't have these properties set $Module.Result.msg = "OK" $Module.Result.status_code = 200 } else { $Module.Result.msg = $web_response.StatusDescription $Module.Result.status_code = $web_response.StatusCode } $response_stream = $web_response.GetResponseStream() try { # Invoke the ScriptBlock and pass in WebResponse and ResponseStream &$Script -Response $web_response -Stream $response_stream } finally { $response_stream.Dispose() } } finally { if ($web_response) { $web_response.Close() } $Module.Result.elapsed = ((Get-date) - $start).TotalSeconds } } Function Get-AnsibleWindowsWebRequestSpec { <# .SYNOPSIS Used by modules to get the argument spec fragment for AnsibleModule. .EXAMPLES $spec = @{ options = @{} } $module = [Ansible.Basic.AnsibleModule]::Create($args, $spec, @(Get-AnsibleWindowsWebRequestSpec)) .NOTES The options here are reflected in the doc fragment 'ansible.windows.web_request' at 'plugins/doc_fragments/web_request.py'. #> @{ options = @{ url_method = @{ type = 'str' } follow_redirects = @{ type = 'str'; choices = @('all', 'none', 'safe'); default = 'safe' } headers = @{ type = 'dict' } http_agent = @{ type = 'str'; default = 'ansible-httpget' } maximum_redirection = @{ type = 'int'; default = 50 } url_timeout = @{ type = 'int'; default = 30 } validate_certs = @{ type = 'bool'; default = $true } # Credential options client_cert = @{ type = 'str' } client_cert_password = @{ type = 'str'; no_log = $true } force_basic_auth = @{ type = 'bool'; default = $false } url_username = @{ type = 'str' } url_password = @{ type = 'str'; no_log = $true } use_default_credential = @{ type = 'bool'; default = $false } # Proxy options use_proxy = @{ type = 'bool'; default = $true } proxy_url = @{ type = 'str' } proxy_username = @{ type = 'str' } proxy_password = @{ type = 'str'; no_log = $true } proxy_use_default_credential = @{ type = 'bool'; default = $false } } } } $export_members = @{ Function = "Get-AnsibleWindowsWebRequest", "Get-AnsibleWindowsWebRequestSpec", "Invoke-AnsibleWindowsWebRequest" } Export-ModuleMember @export_members
combined_dataset/train/non-malicious/sample_62_55.ps1
sample_62_55.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. param( [ValidateSet('Hang', 'Fail')] $TestHook ) $waitTimeoutSeconds = 300 switch ($TestHook) { 'Hang' { $waitTimeoutSeconds = 10 $jobScript = { Start-Sleep -Seconds 600 } } 'Fail' { $jobScript = { throw "This job script should fail" } } default { $jobScript = { # This registers Microsoft Update via a predifened GUID with the Windows Update Agent. # https://learn.microsoft.com/windows/win32/wua_sdk/opt-in-to-microsoft-update $serviceManager = (New-Object -ComObject Microsoft.Update.ServiceManager) $isRegistered = $serviceManager.QueryServiceRegistration('7971f918-a847-4430-9279-4a52d1efe18d').Service.IsRegisteredWithAu if (!$isRegistered) { Write-Verbose -Verbose "Opting into Microsoft Update as the Autmatic Update Service" # 7 is the combination of asfAllowPendingRegistration, asfAllowOnlineRegistration, asfRegisterServiceWithAU # AU means Automatic Updates $null = $serviceManager.AddService2('7971f918-a847-4430-9279-4a52d1efe18d', 7, '') } else { Write-Verbose -Verbose "Microsoft Update is already registered for Automatic Updates" } $isRegistered = $serviceManager.QueryServiceRegistration('7971f918-a847-4430-9279-4a52d1efe18d').Service.IsRegisteredWithAu # Return if it was successful, which is the opposite of Pending. return $isRegistered } } } Write-Verbose "Running job script: $jobScript" -Verbose $job = Start-ThreadJob -ScriptBlock $jobScript Write-Verbose "Waiting on Job for $waitTimeoutSeconds seconds" -Verbose $null = Wait-Job -Job $job -Timeout $waitTimeoutSeconds if ($job.State -ne 'Running') { Write-Verbose "Job finished. State: $($job.State)" -Verbose $result = Receive-Job -Job $job -Verbose Write-Verbose "Result: $result" -Verbose if ($result) { Write-Verbose "Registration succeeded" -Verbose exit 0 } else { Write-Verbose "Registration failed" -Verbose # at the time this was written, the MSI is ignoring the exit code exit 1 } } else { Write-Verbose "Job timed out" -Verbose Write-Verbose "Stopping Job. State: $($job.State)" -Verbose Stop-Job -Job $job # at the time this was written, the MSI is ignoring the exit code exit 258 } # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCKVny4bI+osaoc # I2htF+wfukTKR2MeatDVPmfofAOKNqCCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQDOS8s1ra6f0YGtg0OhEaQa/t3Q+q1MEHhWJhqQVuO5amYXQpy8MDPNoJYk+FWA # hePP5LxwcSge5aen+f5Q6WNPd6EDxGzotvVpNi5ve0H97S3F7C/axDfKxyNh21MG # 0W8Sb0vxi/vorcLHOL9i+t2D6yvvDzLlEefUCbQV/zGCBjXGlYJcUj6RAzXyeNAN # xSpKXAGd7Fh+ocGHPPphcD9LQTOJgG7Y7aYztHqBLJiQQ4eAgZNU4ac6+8LnEG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dOOtwJ1B7MmMuwNfb9mNXUYmzcOFY0/SG+SNrHKH4QF # bHTy # SIG # End signature block
combined_dataset/train/non-malicious/Ping Alert Script_2.ps1
Ping Alert Script_2.ps1
#Email Alert Parameters $to = "[email protected]" $from = "[email protected]" $smtpserver = "my_exchange_server" #Array of computers to test $Computers = ("comp1" , "comp2" , "comp3" , "comp4") #Variable to hold INT value 0 $zero = 0 Foreach ($Computer in $Computers) { if ( #Checks for a file with the host computers name in the Reports folder and if it doesn't exist creates it with content 0 Test-Path $("C:\\Reports\\" + $Computer + ".txt") ) { } else { $zero > $("C:\\Reports\\" + $Computer + ".txt") } #Reads the content of the file and saves to variable as text $FailedPings = Get-Content $("C:\\Reports\\" + $Computer + ".txt") #Converts the value to INT $INT_FailedPings = [INT]$FailedPings #Actually runs the ping test $PingTest = Test-Connection -ComputerName $Computer -count 1 if ( #If ping is unsuccessful $PingTest.StatusCode -ne "0" ) { if ( #If previous failed pings value is less or equal to 3 $INT_FailedPings -le 3 ) { #Increment the value by 1 $INT_FailedPings++ #Write the value out to the reports folder file for this host $INT_FailedPings > $("C:\\Reports\\" + $Computer + ".txt") #Send an alert of failed ping Send-MailMessage -to $to -subject "Warning, Host $Computer is down. You will only receive 4 of these messages!" -from $from -body "Ping to $Computer failed, you will only receive 3 of these messages!" -smtpserver $smtpserver } } elseif ( #If previous checks have failed the value will be non zero, as checks are now working sets the value back to zero and alerts that host is back up $INT_FailedPings -ne 0 ) { $zero > $("C:\\Reports\\" + $Computer + ".txt") Send-MailMessage -to $to -subject "Host $Computer is back up" -from $from -body "Panic over" -smtpserver $smtpserver } else #If ping is successful and past pings were successful do nothing { } }
combined_dataset/train/non-malicious/Windows Startup Script_4.ps1
Windows Startup Script_4.ps1
<#====================================================================================== File Name : Startup.ps1 Original Author : Kenneth C. Mazie : Description : This is a Windows start-up script with pop-up notification and checks to : assure things are not executed if already running or set. It can be run : as a personal start-up script or as a domain start-up (with some editing). : It is intended to be executed from the Start Menu "All Programs\\Startup" folder. : : The script will Start programs, map shares, set routes, and can email the results : if desired. The email subroutine is commented out. You'll need to edit it yourself. : When run with the "debug" variable set to TRUE it also displays status in the : PowerShell command window. Other wise all operation statuses are displayed in pop-up : balloons near the system tray. : : 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 edit all sections to suit your needs before executing. Be sure to : enable sections you wish to run by un-commenting them at the bottom of the script. : : Route setting is done as a function of selecting a specific Network Adapter with the intent : of manually altering your routes for hardline or WiFi connectivity. This section you will : need to customize to suit your needs or leave commented out. This allowed me to : alter the routing for my office (Wifi) or lab (hardline) by detecting whether my : laptop was docked or not. The hardline is ALWAYS favored as written. : : To identify process names to use run "get-process" by itself to list process : names that PowerShell will be happy with, just make sure each app you want to : identify a process name for is already running first. : : A 2 second sleep delay is added to smooth out processing but can be removed if needed. : Notes : Sample script is safe to run as written, it will only load task manager and Firefox. : In general, I did not write this script for ease of readability. Most commands are : one-liner style, sorry if that causes you grief. : Warnings : Drive mapping passwords are clear text within the script. : : Last Update by : Kenneth C. Mazie (kcmjr AT kcmjr.com to report issues) Version History : v1.0 - 05-03-12 - Original Change History : v2.0 - 11-15-12 - Minor edits : v3.0 - 12-10-12 - Converted application commands to arrays : v4.0 - 02-14-13 - Converted all other sections to arrays : v4.1 - 02-17-13 - Corrected error with pop-up notifications =======================================================================================#> clear-host $Debug = $True $CloudStor = $False $ScriptName = "Startup Script" #--[ Prep Pop-up Notifications ]-- [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") $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 $Notify.visible = $true #--[ Force to execute with admin priviledge ]-- $identity = [Security.Principal.WindowsIdentity]::GetCurrent() $principal = new-object Security.Principal.WindowsPrincipal $identity if ($principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) -eq $false) {$Args = '-noprofile -nologo -executionpolicy bypass -file "{0}"' -f $MyInvocation.MyCommand.Path;Start-Process -FilePath 'powershell.exe' -ArgumentList $Args -Verb RunAs;exit} if ($debug){write-host "`n------[ Running with Admin Privileges ]------`n" -ForegroundColor DarkCyan} $Notify.ShowBalloonTip(2500,$ScriptName,"Script is running with full admin priviledges",[system.windows.forms.tooltipicon]::Info) if ($debug){write-host "Running in DEBUG Mode..." -ForegroundColor DarkCyan} function Pause-Host { #--[ Only use if you need a countdown timer ]-- param($Delay = 10) $counter = 0; While(!$host.UI.RawUI.KeyAvailable -and ($Delay-- -ne $counter )) #--count down #While(!$host.UI.RawUI.KeyAvailable -and ($counter++ -lt $Delay )) #--count up { clear-host if ($debug){Write-Host "testing... $Delay"} #--count down #Write-Host "testing... $counter" #--count up [Threading.Thread]::Sleep(1000) } } Function SetRoutes { #--[ Array consists of Network, Mask ]-- $RouteArray = @() $RouteArray += , @("10.0.0.0","255.0.0.0") $RouteArray += , @("172.1.0.0","255.255.0.0") $RouteArray += , @("192.168.1.0","255.255.255.0") #--[ Add more route entries here... ]-- $Index = 0 Do { $RouteNet = $ShareArray[$Index][0] $RouteMask = $ShareArray[$Index][1] iex "route delete $RouteNet" Sleep (2) iex "route add $RouteNet mask $RouteMask $IP" Sleep (2) $Index++ } While ($Index -lt $RouteArray.length) } Function SetMappings { #--[ Array consists of Drive Letter, Path, User, and Password ]-- $ShareArray = @() $ShareArray += , @("J:","\\\\192.168.1.250\\Share1","username","password") $ShareArray += , @("K:","\\\\192.168.1.250\\Share2","username","password") #--[ Add more mapping entries here... ]-- $Index = 0 Do { $MapDrive = $ShareArray[$Index][0] $MapPath = $ShareArray[$Index][1] $MapUser = $ShareArray[$Index][2] $MapPassword = $ShareArray[$Index][3] $net = $(New-Object -Com WScript.Network) if ( Exists-Drive $MapDrive){$Notify.ShowBalloonTip(2500,$ScriptName,"Drive $MapDrive is already mapped...",[system.windows.forms.tooltipicon]::Info);if ($debug){write-host "Drive $MapDrive already mapped" -ForegroundColor DarkRed}}else{if (test-path $MapPath){$net.MapNetworkDrive($MapDrive, $MapPath, "False",$MapUser,$MapPassword);$Notify.ShowBalloonTip(2500,$ScriptName,"Mapping Drive $MapDrive...",[system.windows.forms.tooltipicon]::Info);if ($debug){write-host "Mapping Drive $MapDrive" -ForegroundColor DarkGreen}}else{$Notify.ShowBalloonTip(2500,$ScriptName,"Cannot Map Drive $MapDrive - Target Not Found...",[system.windows.forms.tooltipicon]::Info);if ($debug){write-host "Cannot Map Drive $MapDrive - Target Not Found" -ForegroundColor DarkRed}}} Sleep (2) $Index++ }While ($Index -lt $ShareArray.length) } Function Exists-Drive { param($driveletter) (New-Object System.IO.DriveInfo($driveletter)).DriveType -ne 'NoRootDirectory' } Function LoadApps { #--[ Array consists of Process Name, File Path, Arguements, Title ]-- $AppArray = @() $AppArray += , @("firefox","C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe","https://www.google.com","FireFox") #--[ Add more app entries here... ]-- #--[ Cloud Storage Provider Subsection ]-- if (!$CloudStor ){$Notify.ShowBalloonTip(2500,$ScriptName,"Cloud Providers Bypassed...",[system.windows.forms.tooltipicon]::Info);if ($debug){write-host "Cloud Providers Bypassed..." -ForegroundColor Magenta;}} else { $AppArray += , @("googledrivesync","C:\\Program Files (x86)\\Google\\Drive\\googledrivesync.exe","/autostart","GoogleDrive") #--[ Add more cloud entries here... ]-- } $AppArray += , @("taskmgr","C:\\Windows\\System32\\taskmgr.exe"," ","Task Manager") #--[ Add more app entries here... ]-- $Index = 0 Do { $AppProcess = $AppArray[$Index][0] $AppExe = $AppArray[$Index][1] $AppArgs = $AppArray[$Index][2] $AppName = $AppArray[$Index][3] If((get-process -Name $AppProcess -ea SilentlyContinue) -eq $Null){start-process -FilePath $AppExe -ArgumentList $AppArgs ;$Notify.ShowBalloonTip(2500,$ScriptName,"$AppName is loading...",[system.windows.forms.tooltipicon]::Info);if ($debug){write-host "Loading" $AppName "..." -ForegroundColor DarkGreen}}else{$Notify.ShowBalloonTip(2500,$ScriptName,"$AppName is already running...",[system.windows.forms.tooltipicon]::Info);if ($debug){write-host "$AppName Already Running..." -ForegroundColor DarkRed } } Sleep (2) $Index++ } While ($Index -lt $AppArray.length) } <# function SendMail { #param($strTo, $strFrom, $strSubject, $strBody, $smtpServer) param($To, $From, $Subject, $Body, $smtpServer) $msg = new-object Net.Mail.MailMessage $smtp = new-object Net.Mail.SmtpClient($smtpServer) $msg.From = $From $msg.To.Add($To) $msg.Subject = $Subject $msg.IsBodyHtml = 1 $msg.Body = $Body $smtp.Send($msg) } #> Function IdentifyNics { $Domain1 = "LabDomain.com" $Domain2 = "OfficeDomain.com" #--[ Detect Network Adapters ]-- $Wired = get-wmiobject -class "Win32_NetworkAdapterConfiguration" | where {$_.IPAddress -like "192.168.1.*" } #--[ Alternate detection methods]-- #$Wired = get-wmiobject -class "Win32_NetworkAdapterConfiguration" | where {$_.IPAddress -like "192.168.1.*" } | where {$_.DNSDomainSuffixSearchOrder -match $Domain2} #$Wired = get-wmiobject -class "Win32_NetworkAdapterConfiguration" | where {$_.Description -like "Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller" } $WiredIP = ([string]$Wired.IPAddress).split(" ") $WiredDesc = $Wired.Description if ($debug){ write-host "Name: " $Wired.Description`n"DNS Domain: " $Wired.DNSDomainSuffixSearchOrder`n"IPv4: " $WiredIP[0]`n"IPv6: " $WiredIP[1]`n"" if ($WiredIP[0]){$Notify.ShowBalloonTip(2500,$ScriptName,"Detected $WiredDesc",[system.windows.forms.tooltipicon]::Info)}else{$Notify.ShowBalloonTip(2500,$ScriptName,"Hardline not detected",[system.windows.forms.tooltipicon]::Info)} } sleep (2) $WiFi = get-wmiobject -class "Win32_NetworkAdapterConfiguration" | where {$_.Description -like "Intel(R) Centrino(R) Advanced-N 6250 AGN" } $WiFiIP = ([string]$WiFi.IPAddress).split(" ") $WiFiDesc = $WiFi.Description write-host "Name: " $WiFi.Description`n"DNS Domain: " $WiFi.DNSDomainSuffixSearchOrder`n"IPv4: " $WiFiIP[0]`n"IPv6: " $WiFiIP[1] if ($WiFiIP[0]){$Notify.ShowBalloonTip(2500,$ScriptName,"Detected $WiFiDesc",[system.windows.forms.tooltipicon]::Info)}else{$Notify.ShowBalloonTip(2500,$ScriptName,"WiFi not detected",[system.windows.forms.tooltipicon]::Info)} sleep (2) #--[ Set Routes ]-- if ($WiredIP[0]) { #--[ The hardline is connected. Favor the hardline if both connected ]-- $IP = $WiredIP[0] if ($Wired.DNSDomainSuffixSearchOrder -like $Domain1 -or $Wired.DNSDomainSuffixSearchOrder -like $Domain2) { #--[ the hardline is connected ]-- write-host ""`n"Setting routes for hardline"`n"" $Notify.ShowBalloonTip(2500,$ScriptName,"Setting routes for hardline...",[system.windows.forms.tooltipicon]::Info) #SetRoutes $IP } } else { if ($WiFiIP[0]) { if ($WiFi.DNSDomainSuffixSearchOrder -like $Domain2) { #--[ The wifi is connected --] $IP = $WiFiIP[0] write-host ""`n"Setting routes for wifi"`n"" $Notify.ShowBalloonTip(2500,$ScriptName,"Setting routes for wifi...",[system.windows.forms.tooltipicon]::Info) #SetRoutes $IP } } } } #Write-Host $IP #IdentifyNics #SetMappings #Pause-Host LoadApps If ($debug){write-host "Completed All Operations..." -ForegroundColor DarkCyan}
combined_dataset/train/non-malicious/sample_27_90.ps1
sample_27_90.ps1
# # Module manifest for module 'OCI.PSModules.Disasterrecovery' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Disasterrecovery.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = 'c43e3d16-09c4-4426-9ab9-cdda84fd5f2c' # 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 Disasterrecovery 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.Disasterrecovery.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-OCIDisasterrecoveryDrPlan', 'Get-OCIDisasterrecoveryDrPlanExecution', 'Get-OCIDisasterrecoveryDrPlanExecutionsList', 'Get-OCIDisasterrecoveryDrPlansList', 'Get-OCIDisasterrecoveryDrProtectionGroup', 'Get-OCIDisasterrecoveryDrProtectionGroupsList', 'Get-OCIDisasterrecoveryWorkRequest', 'Get-OCIDisasterrecoveryWorkRequestErrorsList', 'Get-OCIDisasterrecoveryWorkRequestLogsList', 'Get-OCIDisasterrecoveryWorkRequestsList', 'Invoke-OCIDisasterrecoveryAssociateDrProtectionGroup', 'Invoke-OCIDisasterrecoveryDisassociateDrProtectionGroup', 'Invoke-OCIDisasterrecoveryIgnoreDrPlanExecution', 'Invoke-OCIDisasterrecoveryPauseDrPlanExecution', 'Invoke-OCIDisasterrecoveryResumeDrPlanExecution', 'Invoke-OCIDisasterrecoveryRetryDrPlanExecution', 'Move-OCIDisasterrecoveryDrProtectionGroupCompartment', 'New-OCIDisasterrecoveryDrPlan', 'New-OCIDisasterrecoveryDrPlanExecution', 'New-OCIDisasterrecoveryDrProtectionGroup', 'Remove-OCIDisasterrecoveryDrPlan', 'Remove-OCIDisasterrecoveryDrPlanExecution', 'Remove-OCIDisasterrecoveryDrProtectionGroup', 'Stop-OCIDisasterrecoveryDrPlanExecution', 'Stop-OCIDisasterrecoveryWorkRequest', 'Update-OCIDisasterrecoveryDrPlan', 'Update-OCIDisasterrecoveryDrPlanExecution', 'Update-OCIDisasterrecoveryDrProtectionGroup', 'Update-OCIDisasterrecoveryDrProtectionGroupRole' # 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','Disasterrecovery' # 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_41_76.ps1
sample_41_76.ps1
##------------------------------------------------------------------ ## <copyright file="GMATenantJsonHelper.psm1" company="Microsoft"> ## Copyright (C) Microsoft. All rights reserved. ## </copyright> ##------------------------------------------------------------------ ## Import ObservabilityGMAEventSource Add-Type -Path "$PSScriptRoot\Microsoft.AzureStack.Observability.GenevaMonitoringAgent.dll" -Verbose Add-Type -Path "$PSScriptRoot\Microsoft.AzureStack.Observability.ObservabilityCommon.dll" -Verbose Add-Type -Path "$PSScriptRoot\Newtonsoft.Json.dll" -Verbose #region Constant vairables $global:ErrorConstants = @{ DefaultErrorMessage = @{ Code = 1 Name = "DefaultErrorMessage" Message = "An unhandled exception has occurred." } ManagementClusterNameNotFound = @{ Code = 2 Name = "ManagementClusterNameNotFound" Message = "ManagementClusterName not found in Cloud config." } CannotCopyUtcExporterDll = @{ Code = 3 Name = 'CannotCopyUtcExporterDll' Message = "Failed to copy UtcExporterDll file." } CannotStartService = @{ Code = 4 Name = 'CannotStartService' Message = "Observability related service cannot be started after multiple retries." } CannotStopService = @{ Code = 5 Name = 'CannotStopService' Message = "Observability related service cannot be stopped after multiple retries." } ConfigFolderDoesNotExist = @{ Code = 6 Name = 'ConfigFolderDoesNotExists' Message = "Config folder doesn't exist." } HandlerEnvJsonDoesNotExist = @{ Code = 8 Name = 'HandlerEnvJsonDoesNotExist' Message = "HandlerEnvironment.json file doesn't exist." } InsufficientDiskSpaceForGMACache = @{ Code = 9 Name = 'InsufficientDiskSpaceForGMACache' Message = "There is insufficient disk space available on the drive (Current size = {0} GB on {1} drive). To proceed with the extension installation, please delete some files to free up space." } LogFolderDoesNotExist = @{ Code = 10 Name = 'LogFolderDoesNotExist' Message = "Log folder doesn't exist." } StatusFolderDoesNotExist = @{ Code = 11 Name = 'StatusFolderDoesNotExist' Message = "Status folder doesn't exist." } GetAzureStackHCICmdletNotAvailable = @{ Code = 12 Name = 'GetAzureStackHCICmdletNotAvailable' Message = "If either the Get-AzureStackHCI or Get-ClusterNode cmdlet is not available to retrieve the necessary information, the tenant JSON configuration files will not be created." } InvalidScheduledTaskScriptPath = @{ Code = 13 Name = 'InvalidScheduledTaskScriptPath' Message = 'Invalid script path provided for scheduled task creation.' } TelemetryDisabled = @{ Code = 14 Name = 'TelemetryDisabled' Message = 'Telemetry is disabled.' } CannotRegisterService = @{ Code = 15 Name = 'CannotRegisterService' Message = 'Observability related service cannot be registered.' } MetricsRegionalNamespaceNotFound = @{ Code = 16 Name = 'RegionalMetricNamespaceNotFound' Message = 'Regional Metric Namespaces not found.' } DeviceTypeValueNotFound = @{ Code = 17 Name = "DeviceTypeValueNotFound" Message = "Device type value not found. It is required for extension's functionality." } InvalidDeviceTypeValue = @{ Code = 18 Name = "InvalidDeviceTypeValue" Message = "The device type value is invalid. It's not something we've added support for." } VCRedistInstallFailed= @{ Code = 19 Name = 'VCRedistInstallFailed' Message = "Failed to install VC Redistributable VC_redist.x64.exe. Exit code is {0}" } GcsConfigFilesNotFound = @{ Code = 20 Name = 'GcsConfigFilesNotFound' Message = "GCSConfig files are not found. Please check the logs for further investigation." } } $global:MiscConstants = @{ CloudNames = @{ <# HCI RP Azure Environment (a.k.a Cloud) constants = https://msazure.visualstudio.com/One/_git/AzSHCI-Usage?path=/src/common/ServiceCommon/Models/CommonConstants.cs&version=GBdevelopment&line=25&lineEnd=35&lineStartColumn=1&lineEndColumn=2&lineStyle=plain&_a=contents #> AzurePublicCloud = @("AzurePublicCloud", "AzureCloud") AzureUSGovernmentCloud = @("AzureUSGovernmentCloud", "AzureUSGovernment") AzureChinaCloud = @("AzureChinaCloud") AzureGermanCloud = @("AzureGermanCloud") USNat = @("USNat") USSec = @("USSec") AzureCanary = @("AzureCanary") AzurePPE = @("AzurePPE") } CIRegKey = @{ Path = 'HKLM:\Software\Microsoft\SQMClient\' Name = 'IsCIEnv' } SddcRegKey = @{ Path = 'HKLM:\SOFTWARE\Microsoft\SQMClient' Name = 'IsTest' } ArcARegKey = @{ Path = 'HKLM:\Software\Microsoft\ArcA\' Name = 'IsArcAEnv' PropertyType = 'DWORD' Value = 1 } ConfigTypes = @{ Telemetry = 'Telemetry' Diagnostics = 'Diagnostics' Health = 'Health' Security = 'Security' Metrics = 'Metrics' } DeviceTypes = @{ ArcAutonomous = "ArcAutonomous" AzureEdge = "AzureEdge" HCI = "HCI" EnvValidatorStandAlone = "EnvValidatorStandAlone" } DeviceTypeRegKey = @{ Path = "HKLM:\SOFTWARE\Microsoft\AzureStack" Name = "DeviceType" PropertyType = "String" ## Value = "Purposefully not setting value as it will be on demand." } DiagTrackRegKey = @{ Path = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack' Name = 'AllowExporters' PropertyType = 'DWORD' Value = 1 } HciDiagnosticLevel = @{ Off = "off" Basic = "basic" Enhanced = "enhanced" } ErrorActionPreference = @{ Ignore = "Ignore" Stop = "Stop" SilentlyContinue = "SilentlyContinue" } GCSEnvironment = @{ Test = "Test" Ppe = "Ppe" ArcAPpe = "ArcAPpe" Prod = "Prod" Fairfax = "Fairfax" Mooncake = "Mooncake" } GCSRegionName = @{ EastUS = 'eastus' WestEurope = 'westeurope' } GenevaExporterRegKey = @{ Path = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack\exporters\GenevaExporter' Name = 'DllPath' PropertyType = 'String' } GenevaNamespaceRegKey = @{ Name = 'GenevaNamespace' PropertyType = 'String' Value = 'NAMESPACE_PLACEHOLDER' } EnvironmentVariableNames = @{ ClusterName = "CLUSTER_NAME" HciResourceUri = "HCI_RESOURCE_URI" AssemblyBuildVersion = "ASSEMBLY_BUILD_VERSION" OsBuildVersion = "OS_BUILD_VERSION" MetricsArcResourceUri = "METRICS_ARC_RESOURCE_URI" MetricsShoeboxAccount = "METRICS_SHOEBOX_ACCOUNT" } HCITelemetryRegKey = @{ Path = 'HKLM:\SYSTEM\Software\Microsoft\MAWatchdogService\HCITelemetry' Name = 'AllowTelemetry' PropertyType = 'String' Value = 'True' } GMAScenarioRegKey = @{ # Registry is not set for ASZ scenario, "Bootstrap" for Bootstrap Scenario, "1P" for 1P scenario Path = 'HKLM:\Software\Microsoft\AzureStack\Observability' Name = 'GMAScenario' PropertyType = 'String' Bootstrap = 'Bootstrap' OneP = '1P' } Level = @{ Debug = "DEBUG" Fatal = "FATAL" Error = "ERROR" Info = "INFO" Verbose = "VERBOSE" Warning = "WARN" } LogCollectionConfigs = @{ DiagLogRoleConfigJson = "DiagnosticLogRoleConfiguration.json" } ObsScheduledTaskDetails = @{ TaskName = "Get-TelemetryStatusAndEditConfigsInJsonDropLocation" TaskPath = "\Microsoft\AzureStack\Observability\" TranscriptsFolderName = "ObsScheduledTaskTranscripts" Description = "Runs every hour to determine telemetry status and based on that either adds or removes Telemetry config from JsonDropLocation." ScriptFileName = "GetTelemetryStatusAndEditConfigs.ps1" } Status = @{ Error = 'error' Success = 'success' Transitioning = "transitioning" Warning = "warning" } TestHooksRegKey = @{ Path = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack\TestHooks' Name = 'SkipSignatureMitigation' PropertyType = 'DWORD' Value = 1 } ValidationFunctionNames = @{ AssertNoObsGMAProcessIsRunning = "Assert-NoObsGMAProcessIsRunning" AssertSufficientDiskSpaceAvailableForGMACache = "Assert-SufficientDiskSpaceAvailableForGMACache" } WorkLoadName = @{ Install = 'Install-Extension' Enable = 'Enable-Extension' Disable = 'Disable-Extension' Uninstall = 'Uninstall-Extension' Update = 'Update-Extension' } ObsServiceDetails = @{ DiagTrack = @{ Name = 'diagtrack' } WatchdogAgent = @{ Name = 'WatchdogAgent' DisplayName = 'Arc Extension MA Watchdog' BinaryFileName = 'Microsoft.AzureStack.Solution.Diagnostics.MaWatchdog.exe' } ObsAgent = @{ Name = "AzureStack Observability Agent" DisplayName = "AzureStack Arc Extension Observability Agent" BinaryFileName = "Microsoft.AzureStack.Common.Infrastructure.HostModel.WinSvcHost.exe" } } Logman = @{ ComponentProviderGuids = @{ Microsoft_AzureStack_SupportBridgeController_LogCollector = "8a460ad6-c898-51da-3b87-5195076be95c" # Obs Agent Microsoft_AzureStack_Observability_LogOrchestrator = "c1b24b80-e724-5f0c-da1f-6521a3f002eb" Microsoft_AzureStack_LogParsingEngineManager = "e9809dda-e2ab-5961-2368-958f996b4fd8" Microsoft_AzureStack_LogParsingEngine_LogParser = "e1950b60-b861-500c-81bf-0d29ac999695" Microsoft_AzureStack_LogParsingEngine_GenevaConnector = "9d526935-090c-5c06-2afa-7886238ae238" FDA = "80072b42-cf7a-51a7-ee38-195a10c39d6e" } MaxLogFileSizeInMB = 500 OutputFilePath ="$($env:SystemDrive)\Observability\ObservabilityLogmanTraces\observabilityLogmanTraces.etl" TraceName = "observabilityLogmanTraces" } VCRedistRegKeys = @{ Paths = ( "HKLM:\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\X64", "HKLM:\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\X64" ) Name = "Version" } IdentityParamsToFetchFromPublicSettings = @{ DeviceArmResourceUri = "DeviceArmResourceUri" StampId = "StampId" ClusterName = "ClusterName" AssemblyVersion = "AssemblyVersion" NodeId = "NodeId" } ProActiveLogCollectionStates = @{ Enabled = "enabled" Disabled = "disabled" } TenantJsonPropertyNames = @{ Version = "Version" GcsAuthIdType = "GcsAuthIdType" GcsEnvironment = "GcsEnvironment" GcsGenevaAccount = "GcsGenevaAccount" GcsNamespace = "GcsNamespace" GcsRegion = "GcsRegion" GenevaConfigVersion = "GenevaConfigVersion" LocalPath = "LocalPath" DisableUpdate = "DisableUpdate" DisableCustomImds = "DisableCustomImds" MONITORING_AEO_REGION = "MONITORING_AEO_REGION" MONITORING_AEO_DEVICE_ARM_RESOURCE_URI = "MONITORING_AEO_DEVICE_ARM_RESOURCE_URI" MONITORING_AEO_STAMPID = "MONITORING_AEO_STAMPID" MONITORING_AEO_CLUSTER_NAME = "MONITORING_AEO_CLUSTER_NAME" MONITORING_AEO_OSBUILD = "MONITORING_AEO_OSBUILD" MONITORING_AEO_ASSEMBLYBUILD = "MONITORING_AEO_ASSEMBLYBUILD" MONITORING_AEO_NODEID = "MONITORING_AEO_NODEID" MONITORING_AEO_NODE_ARC_RESOURCE_URI = "MONITORING_AEO_NODE_ARC_RESOURCE_URI" MONITORING_AEO_CLUSTER_NODE_NAME = "MONITORING_AEO_CLUSTER_NODE_NAME" } AvailableDiskSpaceLimitInGB = 20 DefaultManagementClusterName = 'Test_Extension_ClusterName' DiagTrackExportersRegKeyPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack\exporters' FDAOutputDirectory = "C:\Observability\FleetDiagnosticsAgent\FDAOutput" GMAHostProcessNameRegex = "MonAgentHost*" HandlerLogFileName = 'ObservabilityExtension.log' MAWatchDogAppAppConfigName = 'Microsoft.AzureStack.Solution.Diagnostics.MaWatchdog.exe.config' MonAgentHostExeName = 'MonAgentHost.exe' GMAMultiTenantModeCmdParam = '-serviceMode' AMAModeCmdParam = '-mcsmode' Retries = 3 SuccessCode = 0 UtcExporterDestinationDirectory = 'C:\Windows\System32\UtcExporters' UtcxporterDllName = 'UtcGenevaExporter.dll' VCRuntimeExeName = 'VC_redist.x64.exe' VCRedistInstallationLogFileName = "VCRedistInstallation.log" WatchdogTimerFrequencyInSeconds = '90' WatchdogStatusFileName = 'WatchdogStatus.json' } #endregion Constant vairables #region Functions function Get-AssemblyVersion { [CmdletBinding()] [OutputType([System.String])] Param ( [Parameter(Mandatory=$false)] [System.String] $LogFile ) $functionName = $MyInvocation.MyCommand.Name Write-Log "[$functionName] Entering." -LogFile $LogFile $assemblyVersion = [System.String]::Empty try { Import-Module EceClient -ErrorAction $MiscConstants.ErrorActionPreference.SilentlyContinue if (Get-Command Create-ECEClusterServiceClient -ErrorAction $MiscConstants.ErrorActionPreference.SilentlyContinue) { Write-Log "[$functionName] Getting current assembly build version." -LogFile $LogFile $ececlient = Create-ECEClusterServiceClient $assemblyVersion = $ececlient.GetStampVersion().GetAwaiter().GetResult() Set-GlobalEnvironmentVariable ` -EnvVariableName $MiscConstants.EnvironmentVariableNames.AssemblyBuildVersion ` -EnvVariableValue $assemblyVersion ` -LogFile $LogFile } else { Write-Log "[$functionName] Cannot get Assembly version due to either the EceClient is not available or the module couldn't be loaded." -LogFile $LogFile } } catch { $exceptionDetails = Get-ExceptionDetails -ErrorObject $_ Write-Log "[$functionName] AssemblyVersion value will be empty as exception occured, details are as follows: $exceptionDetails" -LogFile $LogFile } Write-Log "[$functionName] Exiting. Returning: {assemblyVersion = $assemblyVersion}" -LogFile $LogFile return $assemblyVersion } function Get-ExceptionDetails { [CmdLetBinding()] Param ( [Parameter(Mandatory, ValueFromPipeline)] [System.Management.Automation.ErrorRecord] $ErrorObject ) return @{ Errormsg = $ErrorObject.ToString() Exception = $ErrorObject.Exception.ToString() Stacktrace = $ErrorObject.ScriptStackTrace Failingline = $ErrorObject.InvocationInfo.Line Positionmsg = $ErrorObject.InvocationInfo.PositionMessage PScommandpath = $ErrorObject.InvocationInfo.PSCommandPath Failinglinenumber = $ErrorObject.InvocationInfo.ScriptLineNumber Scriptname = $ErrorObject.InvocationInfo.ScriptName } | ConvertTo-Json # The ConvetTo-Json will return the entire hashtable as string. } function Get-OsBuildVersion { [CmdletBinding()] [OutputType([System.String])] Param ( [Parameter(Mandatory=$false)] [System.String] $LogFile ) $functionName = $MyInvocation.MyCommand.Name Write-Log "[$functionName] Entering." -LogFile $LogFile $osVersion = (Get-CimInstance -ClassName Win32_OperatingSystem -Property Version).Version $ntoskrnl = (Get-Item -Path (Join-Path -Path ([System.Environment]::SystemDirectory) -ChildPath 'ntoskrnl.exe')).VersionInfo.ProductVersion $osBuildVersion = "$osVersion.$($ntoskrnl.Split('.')[-1])" Set-GlobalEnvironmentVariable ` -EnvVariableName $MiscConstants.EnvironmentVariableNames.OsBuildVersion ` -EnvVariableValue $osBuildVersion ` -LogFile $LogFile Write-Log "[$functionName] Exiting. Returning: {osBuildVersion = $osBuildVersion}" -LogFile $LogFile return $osBuildVersion } function Get-ArcAgentResourceInfo { [CmdletBinding()] [OutputType([System.String])] Param( [Parameter(Mandatory=$false)] [System.String] $LogFile ) $functionName = $MyInvocation.MyCommand.Name Write-Log "[$functionName] Entering." -LogFile $LogFile if ($null -eq $global:ArcAgentResourceInfo) { try { # Fetch Arc ResourceID for metrics $arcAgentExePath = "$($env:ProgramW6432)\AzureConnectedMachineAgent\azcmagent.exe" $arcshow = & $arcAgentExePath show -j $global:ArcAgentResourceInfo = $arcshow | ConvertFrom-Json if ($global:ArcAgentResourceInfo) { Write-Log "[$functionName] Successfully retrieved arc agent information and saved it in global:ArcAgentResourceInfo. Value is $($global:ArcAgentResourceInfo)" -LogFile $LogFile } else { throw "No return information recieved when calling arc agent." } } catch { $exceptionDetails = Get-ExceptionDetails -ErrorObject $_ Write-Log "[$functionName] Unhandled exception occured while fetching arc resource information: Exception is as follows: $exceptionDetails" -LogFile $LogFile } } else { Write-Log "[$functionName] global:ArcAgentResourceInfo object has value, returning it." -LogFile $LogFile } Write-Log "[$functionName] Exiting." -LogFile $LogFile return $global:ArcAgentResourceInfo } function Get-MetricsNamespaceRegionMapping { [CmdletBinding()] [OutputType([System.String])] Param( [Parameter(Mandatory=$false)] [System.String] $LogFile, [Parameter(Mandatory=$true)] [System.Object] $MetricsNamespace, [Parameter(Mandatory=$false)] [System.String] $region ) $functionName = $MyInvocation.MyCommand.Name Write-Log "[$functionName] Entering. Params: {MetricsNamespace = $MetricsNamespace | Region = $region}" -LogFile $LogFile if ($null -eq $MetricsNamespace) { throw $ErrorConstants.MetricsRegionalNamespaceNotFound.Name } $metricsRegionalNamespace = [System.String]::Empty if ([System.String]::IsNullOrEmpty($region)) { Write-Log "[$functionName] As region is empty, defaulting prefix to eastus." -LogFile $LogFile $metricsRegionalNamespace = $MetricsNamespace.Prefix + "eastus" } else { if ($MetricsNamespace.Region -contains $region) { $metricsRegionalNamespace = $MetricsNamespace.Prefix + $region Write-Log "[$functionName] Found supported region = $metricsRegionalNamespace." -LogFile $LogFile } else { Write-Log "[$functionName] Region $region not fully supported. Falling back to default region" -LogFile $LogFile $metricsRegionalNamespace = $MetricsNamespace.Prefix + $MetricsNamespace.Default } } Write-Log "[$functionName] Exiting. Returning: {MetricsRegionalNamespace = $metricsRegionalNamespace}" -LogFile $LogFile return $metricsRegionalNamespace } function Get-ArcAgentResourceId { [CmdletBinding()] [OutputType([System.String])] Param( [Parameter(Mandatory=$true)] [System.Object] $ArcAgentInfo, [Parameter(Mandatory=$false)] [System.String] $LogFile ) $functionName = $MyInvocation.MyCommand.Name Write-Log "[$functionName] Entering. Params: {ArcAgentInfo = $ArcAgentInfo}" -LogFile $LogFile $arcAgentResourceId = [System.String]::Empty if ($null -eq $arcAgentInfo) { Write-Log "[$functionName] ArcResourceInfo object null" -LogFile $LogFile } else { if ($arcAgentInfo.ResourceId) { $arcAgentResourceId = $arcAgentInfo.ResourceId } else { $arcAgentResourceId = "/Subscriptions/$($arcAgentInfo.SubscriptionID)/resourceGroups/$($arcAgentInfo.ResourceGroup)/providers/Microsoft.HybridCompute/Machines/$($arcAgentInfo.ResourceName)" } # Set machine env variable for metric access Set-GlobalEnvironmentVariable ` -EnvVariableName $MiscConstants.EnvironmentVariableNames.MetricsArcResourceUri ` -EnvVariableValue $arcAgentResourceId ` -LogFile $LogFile } Write-Log "[$functionName] Exiting. Returning: {ArcAgentResourceId = $arcAgentResourceId}" -LogFile $LogFile return $arcAgentResourceId } function Set-GlobalEnvironmentVariable { [CmdletBinding()] Param( [Parameter(Mandatory=$False)] [System.string] $LogFile, [Parameter(Mandatory=$False)] [System.string] $EnvVariableName, [Parameter(Mandatory=$False)] [System.string] $EnvVariableValue ) $functionName = $MyInvocation.MyCommand.Name Write-Log "[$functionName] Entering. Params: {EnvVariableName = $EnvVariableName | EnvVariableValue = $EnvVariableValue}" -LogFile $LogFile if (Confirm-IsStringNotEmpty $EnvVariableName) { if (Confirm-IsStringNotEmpty $EnvVariableValue) { # Set machine env variable for health agent to access setx /m $EnvVariableName $EnvVariableValue | Out-Null Write-Log "[$functionName] Set $EnvVariableName to $([Environment]::GetEnvironmentVariable($EnvVariableName, 'Machine'))." -LogFile $LogFile } else { Write-Log "[$functionName] Connot set environment variable as EnvVariableValue param is either null or empty." -LogFile $LogFile } } else { Write-Log "[$functionName] Connot set environment variable as EnvVariableName param is either null or empty." -LogFile $LogFile } Write-Log "[$functionName] Exiting." -LogFile $LogFile } function Get-MetricsShoeboxAccountName { [CmdletBinding()] [OutputType([System.String])] Param( [Parameter(Mandatory=$false)] [System.String] $LogFile, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [System.String] $ShoeboxAccountPrefix, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [System.Object] $MetricsNamespace, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [System.String] $Region ) $functionName = $MyInvocation.MyCommand.Name $shoeboxAccountName = [System.String]::Empty Write-Log "[$functionName] Entering. Params: {ShoeboxAccountPrefix = $ShoeboxAccountPrefix | MetricsNamespace = $MetricsNamespace | Region = $Region}" -LogFile $LogFile # Shoebox account name and region mapping if ($MetricsNamespace.Region -contains $Region) { Write-Log "[$functionName] Found supported region $Region." -LogFile $LogFile $shoeboxAccountName = $ShoeboxAccountPrefix + $Region } else { Write-Log "[$functionName] Region $Region not fully supported. Falling back to default region." -LogFile $LogFile $shoeboxAccountName = $ShoeboxAccountPrefix + $MetricsNamespace.Default } # Set machine env variable for health agent to access Set-GlobalEnvironmentVariable ` -EnvVariableName $MiscConstants.EnvironmentVariableNames.MetricsShoeboxAccount ` -EnvVariableValue $shoeboxAccountName ` -LogFile $LogFile Write-Log "[$functionName] Exiting. Returning: {ShoeboxAccountName: $shoeboxAccountName}" -LogFile $LogFile return $shoeboxAccountName } function New-ScheduledTaskForObservability { [CmdletBinding()] Param ( [Parameter(Mandatory)] [System.String] $TaskName, [Parameter(Mandatory=$false)] [System.String] $Description, [Parameter(Mandatory)] [System.String] $ScriptPath, [Parameter(Mandatory)] [System.String] $ScriptArguments, [Parameter(Mandatory=$false)] [System.String] $TaskPath = "\Microsoft\AzureStack\Observability\", [Parameter(Mandatory=$false)] [System.String] $LogFile, [Parameter(Mandatory=$false)] [System.Management.Automation.SwitchParameter] $DisableOnRegistration ) $functionName = $MyInvocation.MyCommand.Name Write-Log "[$functionName] Entering. Params: {TaskName = $TaskName | Description = $Description | ScriptPath = $ScriptPath | ScriptArguments = $ScriptArguments | TaskPath = $TaskPath | DisableOnRegistration = $DisableOnRegistration}" -LogFile $LogFile if (([System.String]::IsNullOrEmpty($ScriptPath)) -or ` (-not (Test-Path -Path $ScriptPath -ErrorAction $MiscConstants.ErrorActionPreference.Ignore))) { throw $ErrorConstants.InvalidScheduledTaskScriptPath.Name } # Enable scheduled task event log $logChannelStatus = Get-WinEvent -ListLog "Microsoft-Windows-TaskScheduler/Operational" if (!$logChannelStatus.IsEnabled) { Write-Log "[$functionName] Enabling TaskScheduler event logs" -LogFile $logFile $logName = 'Microsoft-Windows-TaskScheduler/Operational' $log = New-Object System.Diagnostics.Eventing.Reader.EventLogConfiguration $logName $log.IsEnabled = $true $log.SaveChanges() } Write-Log "[$functionName] Setting up scheduled task ($TaskName) at path ($TaskPath)" -LogFile $logFile $action = New-ScheduledTaskAction -Execute "powershell.exe" ` -Argument "-windowstyle hidden -Command $ScriptPath $ScriptArguments" $principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount $trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Hours 1) $trigger.Repetition.StopAtDurationEnd = $false $settings = New-ScheduledTaskSettingsSet -ExecutionTimeLimit $(New-TimeSpan -Seconds 30) ` -RestartCount 3 ` -RestartInterval $(New-TimeSpan -Minutes 10) $object = New-ScheduledTask -Action $action ` -Principal $principal ` -Trigger $trigger ` -Settings $settings ` -Description $Description # If the task is already registered, unregister it first or otherwise it does not get overwritten. if ($null -ne (Get-ScheduledTask -TaskPath $TaskPath -TaskName $TaskName -Verbose:$false -ErrorAction $MiscConstants.ErrorActionPreference.SilentlyContinue)) { Unregister-ScheduledTask -TaskPath $TaskPath -TaskName $TaskName -Confirm:$false -Verbose:$false -ErrorAction $MiscConstants.ErrorActionPreference.Stop | Out-Null Write-Log "[$functionName] Unregistered already created scheduled task ($TaskName) at path ($TaskPath)." -LogFile $logFile } Register-ScheduledTask -TaskName $TaskName -TaskPath $TaskPath -InputObject $object -Verbose:$false -ErrorAction $MiscConstants.ErrorActionPreference.Stop | Out-Null Write-Log "[$functionName] Scheduled task creation ($TaskName) succeeded." -LogFile $logFile if ($DisableOnRegistration) { Disable-ScheduledTask -TaskPath $TaskPath -TaskName $TaskName -Verbose:$false -ErrorAction $MiscConstants.ErrorActionPreference.Stop | Out-Null Write-Log "[$functionName] ScheduledTask named ($($MiscConstants.ObsScheduledTaskDetails.TaskName)) is disabled." -LogFile $logFile } Write-Log "[$functionName] Exiting." -LogFile $LogFile } function Test-RegKeyExists { [CmdletBinding()] Param ( [Parameter(Mandatory)] [System.String] $Path, [Parameter(Mandatory)] [System.String] $Name, [Parameter(Mandatory = $False)] [System.String] $LogFile, [Parameter(Mandatory = $False)] [System.Management.Automation.SwitchParameter] $GetValueIfExists ) $functionName = $MyInvocation.MyCommand.Name Write-Log "[$functionName] Entering. Params: {Path = $Path | Name = $Name | GetValueIfExists = $GetValueIfExists}" -LogFile $LogFile $regKey = $(Get-ItemProperty -Path $Path -Name $Name -ErrorAction $MiscConstants.ErrorActionPreference.SilentlyContinue) if ($null -ne $regKey) { if ($GetValueIfExists) { $value = $regKey.$Name Write-Log "[$functionName] Obtained registry value '$value' from path '$Path' and name '$Name'. Exiting." -LogFile $LogFile return $value } Write-Log "[$functionName] Registry key found at path '$Path' with name '$Name'. Exiting." -LogFile $LogFile return $regKey } else { Write-Log "[$functionName] Registry key at path '$Path' with name '$Name' does not exist. Exiting." -LogFile $LogFile return $null } } function Get-ConfigTypeEnum { [CmdletBinding()] Param ( [Parameter(Mandatory=$True)] [System.String] $ConfigType, [Parameter(Mandatory=$False)] [System.String] $LogFile ) $functionName = $MyInvocation.MyCommand.Name Write-Log "[$functionName] Entering. Getting configTypeEnum for configType ($ConfigType)." -LogFile $LogFile $configTypeEnum = [Microsoft.AzureStack.Observability.ObservabilityCommon.TenantConfigGenerator.Contract.TenantConfigType]::Invalid switch($ConfigType) { $MiscConstants.ConfigTypes.Telemetry { $configTypeEnum = [Microsoft.AzureStack.Observability.ObservabilityCommon.TenantConfigGenerator.Contract.TenantConfigType]::Telemetry break } $MiscConstants.ConfigTypes.Diagnostics { $configTypeEnum = [Microsoft.AzureStack.Observability.ObservabilityCommon.TenantConfigGenerator.Contract.TenantConfigType]::Diagnostics break } $MiscConstants.ConfigTypes.Health { $configTypeEnum = [Microsoft.AzureStack.Observability.ObservabilityCommon.TenantConfigGenerator.Contract.TenantConfigType]::Health break } $MiscConstants.ConfigTypes.Security { $configTypeEnum = [Microsoft.AzureStack.Observability.ObservabilityCommon.TenantConfigGenerator.Contract.TenantConfigType]::Security break } $MiscConstants.ConfigTypes.Metrics { $configTypeEnum = [Microsoft.AzureStack.Observability.ObservabilityCommon.TenantConfigGenerator.Contract.TenantConfigType]::Metrics break } } Write-Log "[$functionName] Exiting. Returning: {configTypeEnum = $configTypeEnum}" -LogFile $LogFile return $configTypeEnum } function Set-TenantConfigRegistryKeys { [CmdletBinding()] Param( [Parameter(Mandatory=$True)] [ValidateSet("Telemetry", "Health", "Diagnostics", "Security", "Metrics")] [System.String] $ConfigType, [Parameter(Mandatory=$False)] [System.String] $LogFile, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $Version, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $GcsAuthIdType, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $GcsEnvironment, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $GcsGenevaAccount, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $GcsNamespace, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $GcsRegion, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $GenevaConfigVersion, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $LocalPath, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $DisableUpdate, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $DisableCustomImds, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $MONITORING_AEO_REGION, ## Some of the Identity parameters may be empty and so the AllowEmptyString() attribute is added. [Parameter(Mandatory=$True)] [AllowEmptyString()] [System.String] $MONITORING_AEO_DEVICE_ARM_RESOURCE_URI, [Parameter(Mandatory=$True)] [AllowEmptyString()] [System.String] $MONITORING_AEO_STAMPID, [Parameter(Mandatory=$True)] [AllowEmptyString()] [System.String] $MONITORING_AEO_CLUSTER_NAME, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $MONITORING_AEO_OSBUILD, [Parameter(Mandatory=$True)] [AllowEmptyString()] [System.String] $MONITORING_AEO_ASSEMBLYBUILD, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $MONITORING_AEO_NODEID, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $MONITORING_AEO_NODE_ARC_RESOURCE_URI, [Parameter(Mandatory=$True)] [ValidateNotNullOrEmpty()] [System.String] $MONITORING_AEO_CLUSTER_NODE_NAME ) $functionName = $MyInvocation.MyCommand.Name Write-Log "[$functionName] Entering. Setting Tenant config registry keys for $ConfigType" -LogFile $LogFile $configTypeEnum = Get-ConfigTypeEnum -ConfigType $ConfigType -LogFile $LogFile if ($LogFile) { [Microsoft.AzureStack.Observability.ObservabilityCommon.TenantConfigGenerator.TenantConfigRegistrySetter]::Current.SetTenantConfigRegistryKeys( $configTypeEnum, $LogFile, $Version, $GcsAuthIdType, $GcsEnvironment, $GcsGenevaAccount, $GcsNamespace, $GcsRegion, $GenevaConfigVersion, $LocalPath, $DisableUpdate, $DisableCustomImds, $MONITORING_AEO_REGION, $MONITORING_AEO_DEVICE_ARM_RESOURCE_URI, $MONITORING_AEO_STAMPID, $MONITORING_AEO_CLUSTER_NAME, $MONITORING_AEO_OSBUILD, $MONITORING_AEO_ASSEMBLYBUILD, $MONITORING_AEO_NODEID, $MONITORING_AEO_NODE_ARC_RESOURCE_URI, $MONITORING_AEO_CLUSTER_NODE_NAME) } else { [Microsoft.AzureStack.Observability.ObservabilityCommon.TenantConfigGenerator.TenantConfigRegistrySetter]::Current.SetTenantConfigRegistryKeys( $configTypeEnum, $Version, $GcsAuthIdType, $GcsEnvironment, $GcsGenevaAccount, $GcsNamespace, $GcsRegion, $GenevaConfigVersion, $LocalPath, $DisableUpdate, $DisableCustomImds, $MONITORING_AEO_REGION, $MONITORING_AEO_DEVICE_ARM_RESOURCE_URI, $MONITORING_AEO_STAMPID, $MONITORING_AEO_CLUSTER_NAME, $MONITORING_AEO_OSBUILD, $MONITORING_AEO_ASSEMBLYBUILD, $MONITORING_AEO_NODEID, $MONITORING_AEO_NODE_ARC_RESOURCE_URI, $MONITORING_AEO_CLUSTER_NODE_NAME) } Write-Log "[$functionName] Successfully set tenant config registry keys for $ConfigType. Exiting." -LogFile $LogFile } function Set-TenantConfigJsonFile { [CmdletBinding()] Param( [Parameter(Mandatory=$True)] [ValidateSet("Telemetry", "Health", "Diagnostics", "Security", "Metrics")] [System.String] $ConfigType, [Parameter(Mandatory=$True)] [System.String] $FilePath, [Parameter(Mandatory=$False)] [System.String] $LogFile ) $functionName = $MyInvocation.MyCommand.Name Write-Log "[$functionName] Entering. Setting $ConfigType tenant config json file at $FilePath." -LogFile $LogFile $configTypeEnum = Get-ConfigTypeEnum -ConfigType $ConfigType -LogFile $LogFile if($LogFile) { [Microsoft.AzureStack.Observability.ObservabilityCommon.TenantConfigGenerator.TenantConfigGenerator]::Current.GenerateConfig( $configTypeEnum, $LogFile, $FilePath) } else { [Microsoft.AzureStack.Observability.ObservabilityCommon.TenantConfigGenerator.TenantConfigGenerator]::Current.GenerateConfig( $configTypeEnum, $FilePath) } Write-Log "[$functionName] Successfully created tenant config json file for $ConfigType. Exiting." -LogFile $LogFile } function Write-Log { [CmdletBinding()] Param ( [Parameter(Mandatory, ValueFromPipeline)] [System.String] $Message, [Parameter(Mandatory=$False)] [ValidateSet("INFO","WARN","ERROR","FATAL","DEBUG","VERBOSE")] [System.String] $Level = "INFO", [Parameter(Mandatory=$False)] [System.String] $LogFile = $global:LogFile, [Parameter(Mandatory=$false)] [System.Management.Automation.SwitchParameter] $WriteToConsole ) $dateTimeStamp = [System.DateTime]::UtcNow.ToString('u') $formattedMessage = "$dateTimeStamp : $Level : $Message" if ($WriteToConsole -or (-not $LogFile)) { switch($Level.toUpper()) { "INFO" { Write-Host $formattedMessage break; } "DEBUG" { Write-Debug $formattedMessage break; } "VERBOSE" { Write-Verbose $formattedMessage break; } "WARN" { Write-Warning $formattedMessage break; } "ERROR" { Write-Error $formattedMessage break; } "FATAL" { Write-Error $formattedMessage break; } } } if ($LogFile) { Out-File -FilePath $LogFile -InputObject $formattedMessage -Append -Encoding utf8 } } function Write-ObservabilityGMAEventSource { param( [Parameter(Mandatory=$true)] [System.String] $Message, [Parameter(Mandatory=$False)] [ValidateSet("INFO","ERROR")] [System.String] $Level = "INFO", [Parameter(Mandatory=$False)] [System.String] $LogFile ) Write-Log -Message $Message -Level $Level -LogFile $LogFile -WriteToConsole ## WriteToConsole is used as it will just write to transcript file and not the output or error stream. This function is only used in TaskScheduler's script as of now. switch($Level.toUpper()) { "INFO" { [Microsoft.AzureStack.Observability.GenevaMonitoringAgent.ObservabilityGMAEventSource]::Log.InfoEvent($Message) break; } "ERROR" { [Microsoft.AzureStack.Observability.GenevaMonitoringAgent.ObservabilityGMAEventSource]::Log.ErrorEvent($Message) break; } } } function Confirm-IsStringNotEmpty { Param ( [Parameter(Mandatory=$False)] [System.String] $s ) return (-not (Confirm-IsStringEmpty $s)) } function Confirm-IsStringEmpty { Param ( [Parameter(Mandatory=$False)] [System.String] $s ) return ([System.String]::IsNullOrEmpty($s) -and [System.String]::IsNullOrWhiteSpace($s)) } function Confirm-ClusterCmdletsAreAvailable { return ( (Confirm-GetAzureStackHciIsAvailable) -and ` (Confirm-GetClusterIsAvailable) -and ` (Confirm-GetClusterNodeIsAvailable) ) } function Confirm-GetAzureStackHciIsAvailable { return ( (Get-Command Get-AzureStackHCI -ErrorAction $MiscConstants.ErrorActionPreference.SilentlyContinue) -and ` [System.Convert]::ToString((Get-AzureStackHCI).ClusterStatus).ToLower() -ne "notyet" -and ` [System.Convert]::ToString((Get-AzureStackHCI).RegistrationStatus).ToLower() -ne "notyet" ) } function Confirm-GetClusterIsAvailable { return ( (Get-Command Get-Cluster ` -ErrorAction $MiscConstants.ErrorActionPreference.SilentlyContinue) -and ` (Get-Cluster ` -ErrorAction $MiscConstants.ErrorActionPreference.SilentlyContinue ` -ErrorVariable clusterError ` -WarningAction $MiscConstants.ErrorActionPreference.SilentlyContinue ` -WarningVariable clusterWarning) -and ` $null -eq $clusterError[0] -and ` $null -eq $clusterWarning[0] ) } function Confirm-GetClusterNodeIsAvailable { return ( (Get-Command Get-ClusterNode ` -ErrorAction $MiscConstants.ErrorActionPreference.SilentlyContinue) -and ` (Get-ClusterNode ` -ErrorAction $MiscConstants.ErrorActionPreference.SilentlyContinue ` -ErrorVariable clusterNodeError ` -WarningAction $MiscConstants.ErrorActionPreference.SilentlyContinue ` -WarningVariable clusterNodeWarning) -and ` $null -eq $clusterNodeError[0] -and ` $null -eq $clusterNodeWarning[0] ) } function Set-ProactiveLogCollectionStatus { Param ( [Parameter(Mandatory=$True)] [System.String] $DiagnosticLevel, [Parameter(Mandatory=$False)] [System.String] $LogFile ) $functionName = $MyInvocation.MyCommand.Name Write-ObservabilityGMAEventSource "[$functionName] Entering. Params : {DiagnosticLevel = $DiagnosticLevel}" -LogFile $LogFile if (-not ((Get-Command Get-ProactiveLogCollectionState -ErrorAction $MiscConstants.ErrorActionPreference.SilentlyContinue) -and ` (Get-Command Enable-ProactiveLogCollection -ErrorAction $MiscConstants.ErrorActionPreference.SilentlyContinue) -and ` (Get-Command Disable-ProactiveLogCollection -ErrorAction $MiscConstants.ErrorActionPreference.SilentlyContinue))) { $diagnosticsInitializerPath = "$PSScriptRoot\..\ObsAgent\lib\DiagnosticsInitializer\DiagnosticsInitializer.psd1" Import-Module $diagnosticsInitializerPath | Out-Null Write-ObservabilityGMAEventSource "[$functionName] Enable or Disable-ProactiveLogCollection commands not found. Loading DiagnosticsInitializer from $diagnosticsInitializerPath." -LogFile $LogFile } if ($DiagnosticLevel -eq $MiscConstants.HciDiagnosticLevel.Enhanced) { if ((Get-ProactiveLogCollectionState -Verbose:$False) -eq $MiscConstants.ProActiveLogCollectionStates.Disabled) { Write-ObservabilityGMAEventSource "[$functionName] DiagnosticLevel = $DiagnosticLevel and ProActiveLogCollectionState is $($MiscConstants.ProActiveLogCollectionStates.Disabled). Enabling ProactiveLogCollection." -LogFile $LogFile Enable-ProactiveLogCollection | Out-Null } } else { if ((Get-ProactiveLogCollectionState -Verbose:$False) -eq $MiscConstants.ProActiveLogCollectionStates.Enabled) { Write-ObservabilityGMAEventSource "[$functionName] DiagnosticLevel = $DiagnosticLevel and ProActiveLogCollectionState is $($MiscConstants.ProActiveLogCollectionStates.Enabled). Disabing ProactiveLogCollection." -LogFile $LogFile Disable-ProactiveLogCollection | Out-Null } } Write-ObservabilityGMAEventSource "[$functionName] Exiting." -LogFile $LogFile } function Get-ContentAsJson { Param ( [Parameter(Mandatory=$True)] [System.String] $Path ) return Get-Content -Path $Path | ConvertFrom-Json } #endregion Functions #region Exports ## Variable exports Export-ModuleMember -Variable ErrorConstants Export-ModuleMember -Variable MiscConstants ## Function exports Export-ModuleMember -Function Get-ArcAgentResourceId Export-ModuleMember -Function Get-ArcAgentResourceInfo Export-ModuleMember -Function Get-AssemblyVersion Export-ModuleMember -Function Get-ExceptionDetails Export-ModuleMember -Function Get-MetricsNamespaceRegionMapping Export-ModuleMember -Function Get-OsBuildVersion Export-ModuleMember -Function New-ScheduledTaskForObservability Export-ModuleMember -Function Set-TenantConfigRegistryKeys Export-ModuleMember -Function Set-TenantConfigJsonFile Export-ModuleMember -Function Test-RegKeyExists Export-ModuleMember -Function Write-Log Export-ModuleMember -Function Write-ObservabilityGMAEventSource Export-ModuleMember -Function Get-MetricsShoeboxAccountName Export-ModuleMember -Function Set-GlobalEnvironmentVariable Export-ModuleMember -Function Confirm-IsStringNotEmpty Export-ModuleMember -Function Confirm-IsStringEmpty Export-ModuleMember -Function Confirm-ClusterCmdletsAreAvailable Export-ModuleMember -Function Confirm-GetAzureStackHciIsAvailable Export-ModuleMember -Function Confirm-GetClusterIsAvailable Export-ModuleMember -Function Confirm-GetClusterNodeIsAvailable Export-ModuleMember -Function Set-ProactiveLogCollectionStatus Export-ModuleMember -Function Get-ContentAsJson #endregion Exports # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCD0HXdZfoCb+T7t # ESNAkNY2nIpibsH70C8sJTxKPjj2F6CCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAA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vbmQxHjAcBgNVBAoTFU1pY3Jvc29m # dCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENB # IDIwMTACEzMAAAHr4BhstbbvOO0AAQAAAeswIgQgSZ+doyWD+RmpVksUHUQMZ+kz # pobpuBsBXOyPSrKzQLswDQYJKoZIhvcNAQELBQAEggIAL28M7CN5JV0AOUpu2sKZ # au/Rfiu0krMIHmygifApRmW+JXzIXlOaNCb6eO7r2KilCZVQ90IMclnXY/Xcytdh # YUGM1MiaiOZ1JpbJmfYd0XDr3QRulNUG73YsJN+8Ille6ca4CodFZc/PEAblm27Q # fZVtUblADB/WpkUdXKkeLzsQ/jZu5vcyD6KsbQgDjcevcxOtBK+m9+g1R6UtesOW # Qc6FUWL5hIhMifiUlikBCeCIav36ukbSwqgqm06UUtToNOzKi9J65mTJkbldqUt+ # 5zCeSLM8vVSYAed3oLqZDroxrODjBmfNhgpXQRQ9rqE5MiaPPP3HgP7ralK9R371 # q0gjl50hA1oTRFDLXTxBL8cJYfRPeUnkr6U5ZtvkiShUOQCmlxoO5F3hdAZHslL1 # onH78foOJOeqrNMS+FXrRdfEHCtaiKyCVscnovq0hO7x76Xj6BnJ17VLLPpvV7z/ # XrWKmQxYt4TRn+6aAbSqLnlmhXdf3/lby6MFBg5IUgQQ/4KrZ9qp86gLCuZdhzVP # xYuIPBJcCESJUrRrjhCmsXi4fGkgDLgnMGpMeDJFxFKcoFjCZtdUuwMGzgocfvbJ # FlDOHF8aabjsymskRjqCTkz16yKyAu2J9b50dQEpRE9LFzlrtrWrQXRSklA5n8GC # i/JyZ762PVcwZ5Kcl/zzhCw= # SIG # End signature block
combined_dataset/train/non-malicious/966.ps1
966.ps1
$rgName='MyResourceGroup' $location='eastus' $cred = Get-Credential -Message 'Enter a username and password for the virtual machine.' New-AzResourceGroup -Name $rgName -Location $location $fesubnet = New-AzVirtualNetworkSubnetConfig -Name 'MySubnet-FrontEnd' -AddressPrefix 10.0.1.0/24 $besubnet = New-AzVirtualNetworkSubnetConfig -Name 'MySubnet-BackEnd' -AddressPrefix 10.0.2.0/24 $dmzsubnet = New-AzVirtualNetworkSubnetConfig -Name 'MySubnet-Dmz' -AddressPrefix 10.0.0.0/24 $vnet = New-AzVirtualNetwork -ResourceGroupName $rgName -Name 'MyVnet' -AddressPrefix 10.0.0.0/16 ` -Location $location -Subnet $fesubnet, $besubnet, $dmzsubnet $rule1 = New-AzNetworkSecurityRuleConfig -Name 'Allow-HTTP-ALL' -Description 'Allow HTTP' ` -Access Allow -Protocol Tcp -Direction Inbound -Priority 100 ` -SourceAddressPrefix Internet -SourcePortRange * ` -DestinationAddressPrefix * -DestinationPortRange 80 $rule2 = New-AzNetworkSecurityRuleConfig -Name 'Allow-HTTPS-All' -Description 'Allow HTTPS' ` -Access Allow -Protocol Tcp -Direction Inbound -Priority 200 ` -SourceAddressPrefix Internet -SourcePortRange * ` -DestinationAddressPrefix * -DestinationPortRange 443 $nsg = New-AzNetworkSecurityGroup -ResourceGroupName $RgName -Location $location ` -Name 'MyNsg-FrontEnd' -SecurityRules $rule1,$rule2 Set-AzVirtualNetworkSubnetConfig -VirtualNetwork $vnet -Name 'MySubnet-FrontEnd' ` -AddressPrefix '10.0.1.0/24' -NetworkSecurityGroup $nsg $publicip = New-AzPublicIpAddress -ResourceGroupName $rgName -Name 'MyPublicIP-Firewall' ` -location $location -AllocationMethod Dynamic $nicVMFW = New-AzNetworkInterface -ResourceGroupName $rgName -Location $location -Name 'MyNic-Firewall' ` -PublicIpAddress $publicip -Subnet $vnet.Subnets[2] -EnableIPForwarding $vmConfig = New-AzVMConfig -VMName 'MyVm-Firewall' -VMSize Standard_DS2 | ` Set-AzVMOperatingSystem -Windows -ComputerName 'MyVm-Firewall' -Credential $cred | ` Set-AzVMSourceImage -PublisherName MicrosoftWindowsServer -Offer WindowsServer ` -Skus 2016-Datacenter -Version latest | Add-AzVMNetworkInterface -Id $nicVMFW.Id $vm = New-AzVM -ResourceGroupName $rgName -Location $location -VM $vmConfig $route = New-AzRouteConfig -Name 'RouteToBackEnd' -AddressPrefix 10.0.2.0/24 ` -NextHopType VirtualAppliance -NextHopIpAddress $nicVMFW.IpConfigurations[0].PrivateIpAddress $route2 = New-AzRouteConfig -Name 'RouteToInternet' -AddressPrefix 0.0.0.0/0 ` -NextHopType VirtualAppliance -NextHopIpAddress $nicVMFW.IpConfigurations[0].PrivateIpAddress $routeTableFEtoBE = New-AzRouteTable -Name 'MyRouteTable-FrontEnd' -ResourceGroupName $rgName ` -location $location -Route $route, $route2 Set-AzVirtualNetworkSubnetConfig -VirtualNetwork $vnet -Name 'MySubnet-FrontEnd' -AddressPrefix 10.0.1.0/24 ` -NetworkSecurityGroup $nsg -RouteTable $routeTableFEtoBE $route = New-AzRouteConfig -Name 'RouteToFrontEnd' -AddressPrefix '10.0.1.0/24' -NextHopType VirtualAppliance ` -NextHopIpAddress $nicVMFW.IpConfigurations[0].PrivateIPAddress $route2 = New-AzRouteConfig -Name 'RouteToInternet' -AddressPrefix '0.0.0.0/0' -NextHopType VirtualAppliance ` -NextHopIpAddress $nicVMFW.IpConfigurations[0].PrivateIPAddress $routeTableBE = New-AzRouteTable -Name 'MyRouteTable-BackEnd' -ResourceGroupName $rgName ` -location $location -Route $route, $route2 Set-AzVirtualNetworkSubnetConfig -VirtualNetwork $vnet -Name 'MySubnet-BackEnd' ` -AddressPrefix '10.0.2.0/24' -RouteTable $routeTableBE
combined_dataset/train/non-malicious/LibraryInputComparison.p.ps1
LibraryInputComparison.p.ps1
## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n\nSet-StrictMode -Version Latest\n\n## Process each element in the pipeline, using a\n## foreach statement to visit each element in $input\nfunction Get-InputWithForeach($identifier)\n{\n Write-Host "Beginning InputWithForeach (ID: $identifier)"\n\n foreach($element in $input)\n {\n Write-Host "Processing element $element (ID: $identifier)"\n $element\n }\n\n Write-Host "Ending InputWithForeach (ID: $identifier)"\n}\n\n## Process each element in the pipeline, using the\n## cmdlet-style keywords to visit each element in $input\nfunction Get-InputWithKeyword($identifier)\n{\n begin\n {\n Write-Host "Beginning InputWithKeyword (ID: $identifier)"\n }\n\n process\n {\n Write-Host "Processing element $_ (ID: $identifier)"\n $_\n }\n\n end\n {\n Write-Host "Ending InputWithKeyword (ID: $identifier)"\n }\n}
combined_dataset/train/non-malicious/Invoke-Switch v0.9.ps1
Invoke-Switch v0.9.ps1
New-Variable castDictionaryEntries [System.Func[System.Collections.IEnumerable, System.Collections.Generic.IEnumerable[System.Collections.DictionaryEntry]]] ` $castDictionaryEntries = [System.Delegate]::CreateDelegate( [System.Func[System.Collections.IEnumerable, System.Collections.Generic.IEnumerable[System.Collections.DictionaryEntry]]], [System.Linq.Enumerable].GetMethod( 'Cast', @('Public, Static')).MakeGenericMethod( @([System.Collections.DictionaryEntry]))) Set-Variable castDictionaryEntries -Option ReadOnly function Invoke-Switch { [CmdletBinding()] Param( [Parameter(Position=0, Mandatory=$true)] [ValidateNotNullOrEmpty()] [System.Collections.IDictionary] $CaseMap, [Parameter(Position=1, Mandatory=$false)] [ValidateSet('Regex', 'Wildcard', 'Exact')] [string] $SwitchMode, [Parameter(Position=2, Mandatory=$false)] $DefaultCase, [Parameter(Position=3, Mandatory=$true, ValueFromPipeline=$true)] [AllowNull()] $InputObject, [Parameter()] [switch] $CaseSensitive) begin { New-Variable mode; [string] $mode = $null if($PSBoundParameters.ContainsKey('SwitchMode')) { $mode = " -$SwitchMode" } New-Variable caseOption; [string] $caseOption = $null if($CaseSensitive.IsPresent) { $caseOption = ' -CaseSensitive' } Set-Variable mode, caseOption -Option ReadOnly New-Variable value New-Variable cases; [string] $cases = $castDictionaryEntries.Invoke($CaseMap) ` | % { $value = $_.Value; return $_.Key } ` | repr ` | % { return $_ } ` -End { if($PSBoundParameters.TryGetValue( 'DefaultCase', [ref] $value)) { Write-Output default } } ` | % { return "$_ { Write-Output (,$(repr $value)) }" } ` | Join-String -Separator ' ' Set-Variable cases -Option ReadOnly New-Variable switchScript; [scriptblock] ` $switchScript = $PSCmdlet.InvokeCommand.NewScriptBlock( "switch$mode$caseOption (`$InputObject) { $cases }") Set-Variable switchScript -Option ReadOnly $PSCmdlet.WriteDebug($switchScript) } process { . $switchScript | % { $PSCmdlet.WriteObject($_) } } }
combined_dataset/train/non-malicious/Test-Server_1.ps1
Test-Server_1.ps1
Function Test-Server{ [cmdletBinding()] param( [parameter(Mandatory=$true,ValueFromPipeline=$true)] [string[]]$ComputerName, [parameter(Mandatory=$false)] [switch]$CredSSP, [Management.Automation.PSCredential] $Credential) begin{ $total = Get-Date $results = @() if($credssp){if(!($credential)){Write-Host "must supply Credentials with CredSSP test";break}} } process{ foreach($name in $computername) { $dt = $cdt= Get-Date Write-verbose "Testing: $Name" $failed = 0 try{ $DNSEntity = [Net.Dns]::GetHostEntry($name) $domain = ($DNSEntity.hostname).replace("$name.","") $ips = $DNSEntity.AddressList | %{$_.IPAddressToString} } catch { $rst = "" | select Name,IP,Domain,Ping,WSMAN,CredSSP,RemoteReg,RPC,RDP $rst.name = $name $results += $rst $failed = 1 } Write-verbose "DNS: $((New-TimeSpan $dt ($dt = get-date)).totalseconds)" if($failed -eq 0){ foreach($ip in $ips) { $rst = "" | select Name,IP,Domain,Ping,WSMAN,CredSSP,RemoteReg,RPC,RDP $rst.name = $name $rst.ip = $ip $rst.domain = $domain ####RDP Check (firewall may block rest so do before ping try{ $socket = New-Object Net.Sockets.TcpClient($name, 3389) if($socket -eq $null) { $rst.RDP = $false } else { $rst.RDP = $true $socket.close() } } catch { $rst.RDP = $false } Write-verbose "RDP: $((New-TimeSpan $dt ($dt = get-date)).totalseconds)" #########ping if(test-connection $ip -count 1 -Quiet) { Write-verbose "PING: $((New-TimeSpan $dt ($dt = get-date)).totalseconds)" $rst.ping = $true try{############wsman Test-WSMan $ip | Out-Null $rst.WSMAN = $true } catch {$rst.WSMAN = $false} Write-verbose "WSMAN: $((New-TimeSpan $dt ($dt = get-date)).totalseconds)" if($rst.WSMAN -and $credssp) ########### credssp { try{ Test-WSMan $ip -Authentication Credssp -Credential $cred $rst.CredSSP = $true } catch {$rst.CredSSP = $false} Write-verbose "CredSSP: $((New-TimeSpan $dt ($dt = get-date)).totalseconds)" } try ########remote reg { [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, $ip) | Out-Null $rst.remotereg = $true } catch {$rst.remotereg = $false} Write-verbose "remote reg: $((New-TimeSpan $dt ($dt = get-date)).totalseconds)" try ######### wmi { $w = [wmi] '' $w.psbase.options.timeout = 15000000 $w.path = "\\\\$Name\\root\\cimv2:Win32_ComputerSystem.Name='$Name'" $w | select none | Out-Null $rst.RPC = $true } catch {$rst.rpc = $false} Write-verbose "WMI: $((New-TimeSpan $dt ($dt = get-date)).totalseconds)" } else { $rst.ping = $false $rst.wsman = $false $rst.credssp = $false $rst.remotereg = $false $rst.rpc = $false } $results += $rst }} Write-Verbose "Time for $($Name): $((New-TimeSpan $cdt ($dt)).totalseconds)" Write-Verbose "----------------------------" } } end{ Write-Verbose "Time for all: $((New-TimeSpan $total ($dt)).totalseconds)" Write-Verbose "----------------------------" return $results } }
combined_dataset/train/non-malicious/339.ps1
339.ps1
function Get-PSFConfig { [OutputType([PSFramework.Configuration.Config])] [CmdletBinding(DefaultParameterSetName = "FullName", HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFConfig')] Param ( [Parameter(ParameterSetName = "FullName", Position = 0)] [string] $FullName = "*", [Parameter(ParameterSetName = "Module", Position = 1)] [string] $Name = "*", [Parameter(ParameterSetName = "Module", Position = 0)] [string] $Module = "*", [switch] $Force ) switch ($PSCmdlet.ParameterSetName) { "Module" { $Name = $Name.ToLower() $Module = $Module.ToLower() [PSFramework.Configuration.ConfigurationHost]::Configurations.Values | Where-Object { ($_.Name -like $Name) -and ($_.Module -like $Module) -and ((-not $_.Hidden) -or ($Force)) } | Sort-Object Module, Name } "FullName" { [PSFramework.Configuration.ConfigurationHost]::Configurations.Values | Where-Object { ("$($_.Module).$($_.Name)" -like $FullName) -and ((-not $_.Hidden) -or ($Force)) } | Sort-Object Module, Name } } }
combined_dataset/train/non-malicious/IniFile Functions 1.0.ps1
IniFile Functions 1.0.ps1
function Get-IniSection($inifile,$section) { $sections = select-string "^\\[.*\\]" $inifile if(!$section) { return $sections | %{$_.Line.Trim("[]")} } $start = 0 switch($sections){ {$_.Line.Trim() -eq "[$section]"}{ $start = $_.LineNumber -1 } default { if($start){ return (gc $inifile)[($start)..($start + ($_.LineNumber-2 - $start))] } } } $lines = gc $inifile return $lines[$start..($lines.length-1)] } function Get-IniValue($inifile,$section,$name) { $section = Get-IniSection $inifile $section ($section | Select-String "^\\s*$name\\s*=").Line.Split("=",2)[1] } function Set-IniValue($inifile,$section,$name,$value) { $lines = gc $inifile $sections = select-string "^\\[.*\\]" $inifile $start,$end = 0,0 for($l=0; $l -lt $sections.Count; ++$l){ if($sections[$l].Line.Trim() -eq "[$section]") { $start = $sections[$l].LineNumber if($l+1 -ge $sections.Count) { $end = $lines.length-1; } else { $end = $sections[$l+1].LineNumber -2 } } } if($start -and $end) { $done = $false for($l=$start;$l -le $end;++$l){ if( $lines[$l] -match "^\\s*$name\\s*=" ) { $lines[$l] = "{0} = {1}" -f $name, $value $done = $true break; } } if(!$done) { $output = $lines[0..$start] $output += "{0} = {1}" -f $name, $value $output += $lines[($start+1)..($lines.Length-1)] $lines = $output } } Set-Content $inifile $lines } ## ## This is a ... different way of doing it, ## which will be faster if you need to read lots of values #### HOWEVER #### ## I don't recommend using Set-IniFile, because it will loose any comments etc ## function Get-IniFile { param([string]$inifile=$(Throw "You must specify the name of an ini file!")) $INI = @{} $s,$k,$v = $null foreach($line in (gc $inifile | ? {$_[0] -ne ";" -and $_.Trim().Length -gt 0})) { $k,$v = $line.Split("=",2) if($v -eq $null) { $s = $k.Trim("[]") $INI[$s] = @{} } else { $INI[$s][$k.Trim()] = $v.Trim() } } return $INI } function Set-IniFile { param([HashTable]$ini,[string]$inifile=$(Throw "You must specify the name of an ini file!")) [string[]]$inistring = @() foreach($section in $ini.Keys) { #Add-Content $inifile ("[{0}]" -f $section) $inistring += ("`n[{0}]" -f $section) foreach($key in $ini[$section].Keys) { $inistring += ("{0} = {1}" -f $key, $ini[$section][$key]) } } # make the write be atomic ... Set-Content $inifile $inistring }
combined_dataset/train/non-malicious/Get-LeaderBoard.ps1
Get-LeaderBoard.ps1
<# .SYNOPSIS Pulls down the leaderboards for the 2011 Scripting Games .DESCRIPTION Quick and dirty script to pull down the leaderboards for the 2011 scripting games. Can choose either beginner or advanced via a command line switch. .PARAMETER Level The leaderboard to parse .EXAMPLE Get-LeaderBoard -Level Beginner Retrieves the beginner leaderboard. .EXAMPLE Get-LeaderBoard -Level Advanced Retrieves the advanced leaderboard #> function Get-LeaderBoard { param( [Parameter( Position = 0, Mandatory = $true, HelpMessage = "Leaderboard to parse. Advanced, or Beginner")] [ValidateSet("Advanced","Beginner")] [String]$Level="Advanced" ) # create a webclient $WebClient = New-Object System.Net.WebClient # download the page $LeaderPage = $WebClient.DownloadString("http://2011sg.poshcode.org/Reports/TopUsers?filter=$Level") # create a horrific looking regular expression $RegEx = '<a href="/Scripts/By/\\d{1,3}">(?<UserName>[\\w\\s]*)</a>\\s*</td>\\s*<td>\\s*(?<TotalPoints>\\d{1,2}\\.\\d{1,2})\\s*</td>\\s*<td>\\s*(?<ScriptsRated>\\d*)' # split the page into seperate objects so we can parse each invidual $LeaderPage -split "<tr>" | ForEach { # match the regex $_ -match $RegEx | Out-Null # create a new PSObject, supply a hashtable with the properties New-Object PSObject -Property @{ "UserName" = $Matches.UserName "ScriptsRated" = $Matches.ScriptsRated "TotalPoints" = $Matches.TotalPoints "AverageRating" = if ($Matches.ScriptsRated -gt 0) { # get average round to two decimal places "{0:N2}" -f ($Matches.TotalPoints / $Matches.ScriptsRated) } } # clear matches if ($Matches) { $Matches.Clear() } # get our objects in a specific order. } | select -Unique UserName,ScriptsRated,AverageRating,TotalPoints }
combined_dataset/train/non-malicious/265.ps1
265.ps1
function Get-LocalGroupMember { [CmdletBinding()] PARAM ( [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [System.String[]]$ComputerName = $env:COMPUTERNAME, [System.String]$GroupName = "Administrators" ) BEGIN { TRY { Add-Type -AssemblyName System.DirectoryServices.AccountManagement -ErrorAction 'Stop' -ErrorVariable ErrorBeginAddType $ctype = [System.DirectoryServices.AccountManagement.ContextType]::Machine } CATCH { Write-Warning -Message "[BEGIN] Something wrong happened" IF ($ErrorBeginAddType) { Write-Warning -Message "[BEGIN] Error while loading the Assembly: System.DirectoryServices.AccountManagement" } Write-Warning -Message $Error[0].Exception.Message } } PROCESS { FOREACH ($Computer in $ComputerName) { TRY { $context = New-Object -TypeName System.DirectoryServices.AccountManagement.PrincipalContext -ArgumentList $ctype, $computer $idtype = [System.DirectoryServices.AccountManagement.IdentityType]::SamAccountName $group = [System.DirectoryServices.AccountManagement.GroupPrincipal]::FindByIdentity($context, $idtype, $GroupName) $group.Members | Select-Object *, @{ Label = 'Server'; Expression = { $computer } }, @{ Label = 'Domain'; Expression = { $_.Context.Name } } } CATCH { Write-Warning -Message "[PROCESS] Something wrong happened" Write-Warning -Message $Error[0].Exception.Message } } } }
combined_dataset/train/non-malicious/2144.ps1
2144.ps1
Describe "Redirection operator now supports encoding changes" -Tags "CI" { BeforeAll { $asciiString = "abc" if ( $IsWindows ) { $asciiCR = "`r`n" } else { $asciiCR = [string][char]10 } $SavedValue = $null $oldDefaultParameterValues = $psDefaultParameterValues.Clone() $psDefaultParameterValues = @{} } AfterAll { $global:psDefaultParameterValues = $oldDefaultParameterValues } BeforeEach { $psdefaultParameterValues.Remove("Out-File:Encoding") } AfterEach { $psdefaultParameterValues.Remove("Out-File:Encoding") } It "If encoding is unset, redirection should be UTF8 without bom" { $asciiString > TESTDRIVE:\file.txt $bytes = Get-Content -AsByteStream TESTDRIVE:\file.txt $encoding = [Text.UTF8Encoding]::new($false) $TXT = $encoding.GetBytes($asciiString) $CR = $encoding.GetBytes($asciiCR) $expectedBytes = .{ $TXT; $CR } $bytes.Count | Should -Be $expectedBytes.count for($i = 0; $i -lt $bytes.count; $i++) { $bytes[$i] | Should -Be $expectedBytes[$i] } } $availableEncodings = (Get-Command Out-File).Parameters["Encoding"].Attributes.ValidValues foreach($encoding in $availableEncodings) { $skipTest = $false if ($encoding -eq "default") { $skipTest = $true } $enc = [System.Text.Encoding]::$encoding if ( $enc ) { $msg = "Overriding encoding for Out-File is respected for $encoding" $BOM = $enc.GetPreamble() $TXT = $enc.GetBytes($asciiString) $CR = $enc.GetBytes($asciiCR) $expectedBytes = .{ $BOM; $TXT; $CR } $psdefaultparameterValues["Out-File:Encoding"] = "$encoding" $asciiString > TESTDRIVE:/file.txt $observedBytes = Get-Content -AsByteStream TESTDRIVE:/file.txt It $msg -Skip:$skipTest { $observedBytes.Count | Should -Be $expectedBytes.Count for($i = 0;$i -lt $observedBytes.Count; $i++) { $observedBytes[$i] | Should -Be $expectedBytes[$i] } } } } } Describe "File redirection mixed with Out-Null" -Tags CI { It "File redirection before Out-Null should work" { "some text" > $TestDrive\out.txt | Out-Null Get-Content $TestDrive\out.txt | Should -BeExactly "some text" Write-Output "some more text" > $TestDrive\out.txt | Out-Null Get-Content $TestDrive\out.txt | Should -BeExactly "some more text" } } Describe "File redirection should have 'DoComplete' called on the underlying pipeline processor" -Tags CI { BeforeAll { $originalErrorView = $ErrorView $ErrorView = "NormalView" } AfterAll { $ErrorView = $originalErrorView } It "File redirection should result in the same file as Out-File" { $object = [pscustomobject] @{ one = 1 } $redirectFile = Join-Path $TestDrive fileRedirect.txt $outFile = Join-Path $TestDrive outFile.txt $object > $redirectFile $object | Out-File $outFile $redirectFileContent = Get-Content $redirectFile -Raw $outFileContent = Get-Content $outFile -Raw $redirectFileContent | Should -BeExactly $outFileContent } It "File redirection should not mess up the original pipe" { $outputFile = Join-Path $TestDrive output.txt $otherStreamFile = Join-Path $TestDrive otherstream.txt $result = & { $(Get-Command NonExist; 1234) > $outputFile *> $otherStreamFile; "Hello" } $result | Should -BeExactly "Hello" $outputContent = Get-Content $outputFile -Raw $outputContent.Trim() | Should -BeExactly '1234' $errorContent = Get-Content $otherStreamFile | ForEach-Object { $_.Trim() } $errorContent = $errorContent -join "" $errorContent | Should -Match "CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand" } }
combined_dataset/train/non-malicious/sample_18_1.ps1
sample_18_1.ps1
<ManagementPack SchemaVersion="2.0" ContentReadable="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Manifest> <Identity> <ID>Microsoft.SCOMMIAccelerator</ID> <Version>1.0.0.5</Version> </Identity> <Name>Microsoft.SCOMMIAccelerator</Name> <References> <Reference Alias="SC"> <ID>Microsoft.SystemCenter.Library</ID> <Version>6.1.7221.0</Version> <PublicKeyToken>31bf3856ad364e35</PublicKeyToken> </Reference> <Reference Alias="SCOL"> <ID>Microsoft.SystemCenter.OperationsManager.Library</ID> <Version>7.0.8560.0</Version> <PublicKeyToken>31bf3856ad364e35</PublicKeyToken> </Reference> <Reference Alias="Windows"> <ID>Microsoft.Windows.Library</ID> <Version>6.1.7221.0</Version> <PublicKeyToken>31bf3856ad364e35</PublicKeyToken> </Reference> <Reference Alias="System"> <ID>System.Library</ID> <Version>6.1.7221.0</Version> <PublicKeyToken>31bf3856ad364e35</PublicKeyToken> </Reference> <Reference Alias="Health"> <ID>System.Health.Library</ID> <Version>6.1.7221.0</Version> <PublicKeyToken>31bf3856ad364e35</PublicKeyToken> </Reference> <Reference Alias="Visualization"> <ID>Microsoft.SystemCenter.Visualization.Library</ID> <Version>7.1.10226.1015</Version> <PublicKeyToken>31bf3856ad364e35</PublicKeyToken> </Reference> </References> </Manifest> <TypeDefinitions> <EntityTypes> <ClassTypes> <ClassType ID="Microsoft.SCOMMIAccelerator.DestinationManagementServer" Base="SC!Microsoft.SystemCenter.ManagementServer" Hosted="true" Accessibility="Public" Abstract="false" Singleton="false"> <!--Property ID="ServerName" Key="true" Type="string" /--> </ClassType> <ClassType ID="Microsoft.SCOMMIMigration.ManagementBase" Base="Windows!Microsoft.Windows.LocalApplication" Accessibility="Public" Abstract="false" Hosted="true" Singleton="false"></ClassType> <ClassType ID="Microsoft.SCOMMIAccelerator.ManagementPack" Base="Windows!Microsoft.Windows.ApplicationComponent" Accessibility="Public" Abstract="false" Hosted="true" Singleton="false"> <Property ID="MPID" Key="true" Type="string" /> <Property ID="MPName" Key="false" Type="string" /> <Property ID="Version" Key="false" Type="string" /> <Property ID="StoreVersion" Key="false" Type="string" /> <Property ID="Sealed" Key="false" Type="bool" /> <Property ID="DownloadUri" Key="false" Type="string" /> <Property ID="Dependencies" Key="false" Type="string" MaxLength="2147483647" /> </ClassType> <ClassType ID="Microsoft.SCOMMIAccelerator.SourceManagementServer" Base="SC!Microsoft.SystemCenter.ManagementServer" Hosted="true" Accessibility="Public" Abstract="false" Singleton="false"> <Property ID="DestinationServerName" Key="false" Type="string" /> <Property ID="DestinationServerVersion" Key="false" Type="string" /> </ClassType> </ClassTypes> <RelationshipTypes> <RelationshipType ID="Microsoft.SCOMMIAccelerator.DestinationManagementServerHostsManagementPacks" Base="System!System.Hosting" Abstract="false" Accessibility="Internal"> <Source ID="Source" Type="Microsoft.SCOMMIAccelerator.DestinationManagementServer" /> <Target ID="Target" Type="Microsoft.SCOMMIAccelerator.ManagementPack" /> </RelationshipType> </RelationshipTypes> </EntityTypes> <ModuleTypes> <DataSourceModuleType ID="Microsoft.SCOMMIAccelerator.ManagemetnPackDestinationStateMonitor.DataSource" Accessibility="Public" Batching="false"> <Configuration> <xsd:element minOccurs="1" name="IntervalSeconds" type="xsd:integer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> <xsd:element minOccurs="0" name="SyncTime" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> </Configuration> <OverrideableParameters> <OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int" /> <OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string" /> </OverrideableParameters> <ModuleImplementation Isolation="Any"> <Composite> <MemberModules> <DataSource ID="DS_Scheduler" TypeID="System!System.SimpleScheduler"> <IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds> <SyncTime>$Config/SyncTime$</SyncTime> </DataSource> <ProbeAction ID="Script" TypeID="Microsoft.SCOMMIAccelerator.ManagemetnPackDestinationStateMonitor.ProbeAction"></ProbeAction> </MemberModules> <Composition> <Node ID="Script"> <Node ID="DS_Scheduler" /> </Node> </Composition> </Composite> </ModuleImplementation> <OutputType>System!System.PropertyBagData</OutputType> </DataSourceModuleType> <DataSourceModuleType ID="Microsoft.SCOMMIAccelerator.ManagementPackDiscovery.DataSource" Accessibility="Internal"> <Configuration> <xsd:element minOccurs="1" name="IntervalSeconds" type="xsd:unsignedInt" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> <xsd:element minOccurs="1" name="TimeoutSeconds" type="xsd:unsignedInt" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> </Configuration> <OverrideableParameters> <OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int" /> <OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int" /> </OverrideableParameters> <ModuleImplementation Isolation="Any"> <Composite> <MemberModules> <DataSource ID="Scheduler" TypeID="System!System.Discovery.Scheduler"> <Scheduler> <SimpleReccuringSchedule> <Interval Unit="Seconds">$Config/IntervalSeconds$</Interval> </SimpleReccuringSchedule> <ExcludeDates /> </Scheduler> </DataSource> <ProbeAction ID="PowerShellServerDiscoveryProbe" TypeID="Windows!Microsoft.Windows.PowerShellDiscoveryProbe"> <ScriptName>ManagementPackDiscovery.ps1</ScriptName> <ScriptBody>param ( $sourceID, $managedEntityID, $destinationServerName, $destinationServerVersion ) #region Script Scope Variables Import-Module OperationsManager $momapi = New-Object -comObject "MOM.ScriptAPI" $momapi.LogScriptEvent("ManagementPackDiscovery.ps1",101,0,"Management pack discovery started, parameters - SourceId: [$sourceID]; ManagedEntityId: [$managedEntityID]; DestinationServerName: [$destinationServerName]; DestinationServerVersion: [$destinationServerVersion]") $discoveryData = $momapi.CreateDiscoveryData(0, $sourceID, $managedEntityId) $ExportPath = "C:\temp" $connectedToOC = $false $AllMPObjects = @() $arrInboxMPs = @( 'Microsoft.SystemCenter.NetworkDevice.Library', 'Microsoft.SystemCenter.TaskTemplates', 'Microsoft.SystemCenter.Visualization.Library', 'Microsoft.SystemCenter.Internal.Tasks', 'Microsoft.SystemCenter.OperationsManager.Internal', 'Microsoft.SystemCenter.RuleTemplates', 'Microsoft.SystemCenter.DataWarehouse.Report.Library', 'Microsoft.SystemCenter.ClientMonitoring.Library', 'Microsoft.SystemCenter.WebApplicationTest.Library', 'Microsoft.SystemCenter.SyntheticTransactions.Library', 'Microsoft.SystemCenter.WebApplication.Library', 'Microsoft.SystemCenter.NTService.Library', 'Microsoft.SystemCenter.ACS.Internal', 'Microsoft.SystemCenter.Apm.Infrastructure', 'Microsoft.SystemCenter.ProcessMonitoring.Library', 'Microsoft.SystemCenter.2007', 'Microsoft.SystemCenter.Advisor.Internal', 'Microsoft.SystemCenter.Visualization.Network.Library', 'System.NetworkManagement.Library', 'Microsoft.SystemCenter.DataProviders.Library', 'Microsoft.SystemCenter.WorkflowFoundation.Library', 'Microsoft.SystemCenter.ServiceDesigner.Library', 'System.Software.Library', 'System.Hardware.Library', 'Microsoft.SystemCenter.DataWarehouse.ApmReports.Library', 'System.Health.Library', 'System.AdminItem.Library', 'System.Virtualization.Library', 'System.Snmp.Library', 'System.ApplicationLog.Library', 'System.Health.Internal', 'Microsoft.SystemCenter.Datawarehouse.OLAP.Base', 'System.Performance.Library', 'System.BaseliningTasks.Library', 'Microsoft.Windows.Image.Library', 'Microsoft.SystemCenter.Library', 'Microsoft.SystemCenter.Image.Library', 'Microsoft.SystemCenter.InstanceGroup.Library', 'Microsoft.SystemCenter.WSManagement.Library', 'Microsoft.SystemCenter.Internal', 'Microsoft.SystemCenter.ApplicationMonitoring.Library', 'Microsoft.SystemCenter.OperationsManager.Library', 'Microsoft.SystemCenter.DataWarehouse.Library', 'Microsoft.Windows.Library', 'Microsoft.SystemCenter.Visualization.Internal', 'Microsoft.SystemCenter.Advisor.Resources.ENU', 'Microsoft.SystemCenter.WebApplicationSolutions.Library.Resources.ENU', 'Microsoft.SystemCenter.Notifications.Library', 'Microsoft.SystemCenter.OperationsManager.SummaryDashboard', 'Microsoft.SystemCenter.OperationsManager.Infra', 'Microsoft.SystemCenter.OperationsManager.DataAccessService', 'Microsoft.SystemCenter.Reports.Deployment', 'Microsoft.SystemCenter.Visualization.Component.Library', 'Microsoft.SystemCenter.ClientMonitoring.Overrides', 'Microsoft.SystemCenter.Apm.Wcf', 'Microsoft.SystemCenter.Visualization.Network.Dashboard', 'System.NetworkManagement.Reports', 'Microsoft.SystemCenter.Apm.Infrastructure.Monitoring', 'Microsoft.SystemCenter.Notifications.Internal', 'Microsoft.SystemCenter.ApplicationMonitoring.360.Template.Dashboards', 'Microsoft.Unix.Views', 'Microsoft.SystemCenter.SecureReferenceOverride', 'Microsoft.SystemCenter.ManagementPack.Recommendations', 'Microsoft.Unix.Image.Library', 'Microsoft.Unix.ConsoleLibrary', 'Microsoft.SystemCenter.OperationsManager.DefaultUser', 'System.NetworkManagement.Monitoring', 'Microsoft.SystemCenter.Apm.NTServices', 'Microsoft.SystemCenter.Apm.Web', 'Microsoft.SystemCenter.Visualization.Configuration.Library', 'Microsoft.SystemCenter.DataWarehouse.ServiceLevel.Report.Library', 'Microsoft.SystemCenter.DataWarehouse.Reports', 'Microsoft.SystemCenter.ClientMonitoring.Views.Internal', 'Microsoft.SystemCenter.OperationsManager.Reports.2007', 'Microsoft.SystemCenter.WebApplicationSolutions.Library', 'Microsoft.SystemCenter.NetworkDiscovery.Internal', 'System.NetworkManagement.Templates', 'Microsoft.SystemCenter.HtmlDashboard.Library', 'Microsoft.SystemCenter.Internal.UI.Tasks', 'Microsoft.SystemCenter.Apm.Library', 'Microsoft.SystemCenter.OperationsManager.2007', 'Microsoft.SystemCenter.OperationsManager.AM.DR.2007', 'Microsoft.SystemCenter.DataWarehouse.Internal', 'Microsoft.SystemCenter.Advisor', 'Microsoft.SystemCenter.GTM.Summary.Dashboard.Template', 'Microsoft.SystemCenter.Visualization.ServiceLevelComponents', 'Microsoft.SystemCenter.ClientMonitoring.Internal', 'Microsoft.SystemCenter.ApplicationMonitoring.360.Template.Library', 'System.Image.Library', 'System.Library', 'Microsoft.SystemCenter.Orchestrator', 'Microsoft.SystemCenter.Orchestrator.Library', 'Microsoft.SystemCenter.DataWarehouse.ChangeTrackingReport.Library', 'Microsoft.Windows.Cluster.Library', 'Microsoft.Windows.Server.NetworkDiscovery', 'Microsoft.Windows.Client.NetworkDiscovery', 'Microsoft.SystemCenter.ApplicationMonitoring.360.SLA', 'Microsoft.Unix.Library', 'Microsoft.Unix.Process.Library', 'Microsoft.Unix.LogFile.Library', 'Microsoft.Unix.ShellCommand.Library', 'ODR', 'Microsoft.SystemCenter.Advisor.GroupDiscovery', "Microsoft.SystemCenter.ApplicationMonitoring.360.SLA") ## Connect to online catalog web service... try { $momapi.LogScriptEvent("ManagementPackDiscovery.ps1",101,0,"Connecting to online catalog web service") $ocServiceUri = "https://www.microsoft.com/mpdownload/ManagementPackCatalogWebService.asmx?wsdl" $ocServiceClient = New-WebServiceProxy -Uri $ocServiceUri -Namespace "OCWebService" -Class "OCWebServiceClass" -UseDefaultCredential -ErrorAction SilentlyContinue -ErrorVariable OCErrs if($OCErrs -ne $null -and $OCErrs.Count -gt 0) { ## If public URL fails, Use LB address to connect to OC web service... $ocServiceUri = "https://lb-onlinecatalog.eastus.cloudapp.azure.com/mpdownload/managementPackCatalogWebService.asmx?wsdl" $ocServiceClient = New-WebServiceProxy -Uri $ocServiceUri -Namespace "OCWebService" -Class "OCWebServiceClass" -UseDefaultCredential -ErrorAction SilentlyContinue -ErrorVariable LBErrs if($LBErrs -ne $null -and $LBErrs.Count -gt 0) { $Ex = $LBErrs[0].Exception $momapi.LogScriptEvent("ManagementPackDiscovery.ps1",101,1,"Failed to connect to online catalog service, error details: $($Ex.ToString())") } } ## Get SCOM Product Details to pass to OC Web Service calls... $ProductVersion = $destinationServerVersion $productInfo = [OCWebService.ProductInfo]::new() $productInfo.ProductVersion = $ProductVersion $productInfo.ProductName = "Operations Manager" $momapi.LogScriptEvent("ManagementPackDiscovery.ps1",101,0,"Connected to online catalog web service") $connectedToOC = $true } catch { $momapi.LogScriptEvent("ManagementPackDiscovery.ps1",101,1,"Failed to connect to online catalog service, error details: $($_.Exception.ToString())") } #endregion Script scope variables #region Functions function Get-AllReferenceMPs { param ( $MP, $Order = 0 ) $AllMPReferences = @() $MP.Order = $Order $AllMPReferences += $MP $MPDetails = Get-SCOMManagementPack -Id $MP.Id $MPReferences = @($MPDetails.References.Values | ? {$_.Name -notin $arrInboxMPs}) foreach($MPReference in $MPReferences) { $Order += 1 $ReferenceMP = $AllMPObjects | ? {$_.Id -eq $MPReference.Id} $ReferenceMP.Order = $Order $AllMPReferences += @(Get-AllReferenceMPs -MP $ReferenceMP -Order $ReferenceMP.Order) } return $AllMPReferences } function Get-MPOCVersion { param ( $MP ) if($MP.DownloadUri -ne $null) { $webClient = New-Object System.Net.WebClient $webClient.UseDefaultCredentials = $true $exportFilePath = "{0}\{1}" -f $ExportPath, (Split-path $MP.DownloadUri -leaf) try { if([System.IO.File]::Exists($exportFilePath)) { Remove-Item -Path $exportFilePath -ErrorAction SilentlyContinue -Force | Out-Null } $webClient.DownloadFile($MP.DownloadUri, $exportFilePath) $OCMPVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($exportFilePath).FileVersion if($OCMPVersion -eq $null) { $OCMPVersion = (Get-SCOMManagementPack -BundleFile $exportFilePath).Version.ToString() } $MP.OCVersion = $OCMPVersion $MP.MigrationStatus = "ReadyToMigrate" } catch { $momapi.LogScriptEvent("ManagementPackDiscovery.ps1",101,1,"DownloadUrl: [$($MP.DownloadUri)]; Failed to get OC Version for the MP, Error details : $($_.Exception.ToString())") $MP.Reason = "Failed to get OC Version for the MP, Error details : $($_.Exception.ToString())" $MP.MigrationStatus = "Failed" } finally { if([System.IO.File]::Exists($exportFilePath)) { Remove-Item -Path $exportFilePath -ErrorAction SilentlyContinue -Force | Out-Null } } } return $MP } function Get-AllManagementPacksFromOC { param ( $MPGroup ) $ManagementPacksInOC = @() $managementPackIdentities = @() foreach($MP in $MPGroup) { $managementPackIdentitiy = [OCWebService.CatalogManagementPackIdentity]::new() $managementPackIdentitiy.Version = $MP.Version $managementPackIdentitiy.VersionIndependentGuid = $MP.Id $managementPackIdentities += $managementPackIdentitiy } if($managementPackIdentities -ne $null -and $managementPackIdentities.Count -gt 0 -and $managementPackIdentities[0] -ne $null) { $ocResults = @($ocServiceClient.GetManagementPacks($managementPackIdentities,$productInfo,"ENU")) if($ocResults -ne $null -and $ocResults.Count -gt 0 -and $ocResults[0] -ne $null) { foreach($MP in $MPGroup) { $MPsFromOC = @($ocResults | ? {$_.SystemName -eq $MP.Name}) if($MPsFromOC -ne $null -and $MPsFromOC.Count -gt 0 -and $MPsFromOC[0] -ne $null) { ## OC returns multiple versions of MP, so let's just get the latest one... $MPFromOC = $MPsFromOC | Sort CatalogItemId -Descending | Select -First 1 $MP.DownloadUri = $MPFromOC.DownloadLink } else { $MP.Reason = "The management pack is not available in online catalog" $MP.MigrationStatus = "CannotbeMigrated" } } } else { foreach($MP in $MPGroup) { $MP.Reason = "The management pack is not available in online catalog" $MP.MigrationStatus = "CannotbeMigrated" } } } return $MPGroup } function New-MPObject { param ( $MPObject ) $MPProperties = [Ordered]@{ Id = $MPObject.Id.Guid; Name = $MPObject.Name; DisplayName = $MPObject.DisplayName; Sealed = $MPObject.Sealed; Version = $MPObject.Version; Reason = $null; DownloadUri = $null; OCVersion = $null; MPContent = $null; MigrationStatus = "NotMigrated"; Order = -1; Dependencies = $null } $MP = New-Object PSObject -Property $MPProperties return $MP } #endregion Functions #region Main Module ## Get all SCOM Management packs except inbox mps $mps = @(Get-SCOMManagementPack | ? {$_.Name -notin $arrInboxMPs}) foreach($mp in $mps) { $thisMPObject = New-MPObject -MPObject $mp $AllMPObjects += $thisMPObject } ## Get Content for unSealed MPs $allUnsealedMPs = @($AllMPObjects | ? {$_.Sealed -eq $false}) $momapi.LogScriptEvent("ManagementPackDiscovery.ps1",101,0,"Processing unsealed management packs, total count: [$($allUnsealedMPs.Count)]") foreach($UnsealedMP in $allUnsealedMPs) { ## Export and download the MP file (xml) try { $val = Get-SCOMManagementPack -Id $UnsealedMP.Id | Export-SCOMManagementPack -Path $ExportPath $exportFilePath = "{0}\{1}.xml" -f $ExportPath, $UnsealedMP.Name if([System.IO.File]::Exists($exportFilePath)) { $file = [System.IO.File]::ReadAllBytes($exportFilePath) $base64String = [Convert]::ToBase64String($file) $UnsealedMP.MPContent = $base64String $UnsealedMP.MigrationStatus = "ReadyToMigrate" } else { $UnsealedMP.Reason = "Failed to export the management pack" $UnsealedMP.MigrationStatus = "Failed" } } catch { $UnsealedMP.Reason = "Failed to export the management pack, Error details : $($_.Exception.ToString())" $UnsealedMP.MigrationStatus = "Failed" } finally { Remove-Item -Path $exportFilePath -ErrorAction SilentlyContinue -Force | Out-Null } } $momapi.LogScriptEvent("ManagementPackDiscovery.ps1",101,0,"Finshing processing unsealed management packs") ## Get download Uri for Sealed Managementpacks $allSealedManagementPacks = @($AllMPObjects | ? {$_.Sealed -eq $true}) $momapi.LogScriptEvent("ManagementPackDiscovery.ps1",101,0,"Processing Sealed management packs, total count: [$($allSealedManagementPacks.Count)]") if($connectedToOC -eq $true) { $batchCount = 50 for($i=0; $i -lt $allSealedManagementPacks.Count; $i+= $batchCount) { $MPBatchToCheckInOC = @($allSealedManagementPacks[$i..($i + $batchCount - 1)]) $MPBatchToCheckInOC = @(Get-AllManagementPacksFromOC -MPGroup $MPBatchToCheckInOC) } ## Get MP OC Version foreach($SealedMP in $allSealedManagementPacks) { if($SealedMP.DownloadUri -ne $null) { $SealedMP = Get-MPOCVersion -MP $SealedMP } } } else { foreach($SealedMP in $allSealedManagementPacks) { $SealedMP.Reason = "Cannot process this management pack, failed to connect to online catalog web service" $SealedMP.MigrationStatus = "Failed" } } $momapi.LogScriptEvent("ManagementPackDiscovery.ps1",101,0,"Finished processing Sealed management packs") ## Get all the dependencies $utf8 = New-Object System.Text.UTF8Encoding foreach($mp in $AllMPObjects) { $MPDependencies = @() $referenceMPs = @(Get-AllReferenceMPs -MP $mp) $uniqueReferenceMPs = @($AllMPObjects | ? {$_.Id -in @($referenceMPs.Id)}) $mp.Dependencies = [Convert]::ToBase64String($utf8.GetBytes([System.Management.Automation.PSSerializer]::Serialize($uniqueReferenceMPs))) } ## Finally add MPs to discovered instances foreach($mp in $AllMPObjects) { $mpDiscovered = $discoveryData.CreateClassinstance("$MPElement[Name='Microsoft.SCOMMIAccelerator.ManagementPack']$") $mpDiscovered.AddProperty("$MPElement[Name='Microsoft.SCOMMIAccelerator.ManagementPack']/MPID$",$mp.Id) $mpDiscovered.AddProperty("$MPElement[Name='Microsoft.SCOMMIAccelerator.ManagementPack']/MPName$", $mp.Name) $mpDiscovered.AddProperty("$MPElement[Name='Microsoft.SCOMMIAccelerator.ManagementPack']/Version$", $mp.Version) $mpDiscovered.AddProperty("$MPElement[Name='Microsoft.SCOMMIAccelerator.ManagementPack']/StoreVersion$", $mp.OCVersion) $mpDiscovered.AddProperty("$MPElement[Name='Microsoft.SCOMMIAccelerator.ManagementPack']/Sealed$", $mp.Sealed) $mpDiscovered.AddProperty("$MPElement[Name='Microsoft.SCOMMIAccelerator.ManagementPack']/DownloadUri$", $mp.DownloadUri) $mpDiscovered.AddProperty("$MPElement[Name='Microsoft.SCOMMIAccelerator.ManagementPack']/Dependencies$", $mp.Dependencies) $mpDiscovered.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$",$destinationServerName) if([string]::IsNullOrEmpty($mp.DisplayName) -eq $false) { $mpDisplayName = $mp.DisplayName } else { $mpDisplayName = $mp.Name } $mpDiscovered.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$",$mpDisplayName) $discoveryData.AddInstance($mpDiscovered) } #endregion Main Module $momapi.LogScriptEvent("ManagementPackDiscovery.ps1",101,0,"Management pack discovery completed") # Return found data $discoveryData</ScriptBody> <Parameters> <Parameter> <Name>sourceID</Name> <Value>$MPElement$</Value> </Parameter> <Parameter> <Name>managedEntityID</Name> <Value>$Target/Id$</Value> </Parameter> <Parameter> <Name>destinationServerName</Name> <Value>$Target/Property[Type="Microsoft.SCOMMIAccelerator.SourceManagementServer"]/DestinationServerName$</Value> </Parameter> <Parameter> <Name>destinationServerVersion</Name> <Value>$Target/Property[Type="Microsoft.SCOMMIAccelerator.SourceManagementServer"]/DestinationServerVersion$</Value> </Parameter> </Parameters> <TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds> <StrictErrorHandling>false</StrictErrorHandling> </ProbeAction> </MemberModules> <Composition> <Node ID="PowerShellServerDiscoveryProbe"> <Node ID="Scheduler" /> </Node> </Composition> </Composite> </ModuleImplementation> <OutputType>System!System.Discovery.Data</OutputType> </DataSourceModuleType> <DataSourceModuleType ID="Microsoft.SCOMMIAccelerator.ManagemetnPackDestinationStateMonitor.DataSource.Filtered" Accessibility="Public" Batching="false"> <Configuration> <xsd:element minOccurs="1" name="IntervalSeconds" type="xsd:unsignedInt" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> <xsd:element minOccurs="1" name="SyncTime" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> <xsd:element minOccurs="1" name="MPID" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> </Configuration> <OverrideableParameters> <OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int" /> <OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string" /> </OverrideableParameters> <ModuleImplementation Isolation="Any"> <Composite> <MemberModules> <DataSource ID="DS" TypeID="Microsoft.SCOMMIAccelerator.ManagemetnPackDestinationStateMonitor.DataSource"> <IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds> <SyncTime>$Config/SyncTime$</SyncTime> </DataSource> <ConditionDetection ID="Filter" TypeID="System!System.ExpressionFilter"> <Expression> <SimpleExpression> <ValueExpression> <XPathQuery Type="String">Property[@Name='MPID']</XPathQuery> </ValueExpression> <Operator>Equal</Operator> <ValueExpression> <Value Type="String">$Config/MPID$</Value> </ValueExpression> </SimpleExpression> </Expression> </ConditionDetection> </MemberModules> <Composition> <Node ID="Filter"> <Node ID="DS" /> </Node> </Composition> </Composite> </ModuleImplementation> <OutputType>System!System.PropertyBagData</OutputType> </DataSourceModuleType> <ProbeActionModuleType ID="Microsoft.SCOMMIAccelerator.ManagemetnPackDestinationStateMonitor.ProbeAction" Accessibility="Public" Batching="false"> <Configuration></Configuration> <ModuleImplementation> <Composite> <MemberModules> <ProbeAction ID="Script" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagTriggerOnlyProbe"> <ScriptName>MonitorManagementPacksOnDestination.ps1</ScriptName> <ScriptBody>Import-Module OperationsManager $momapi = New-Object -comObject "MOM.ScriptAPI" $momapi.LogScriptEvent("MonitorManagementPacksonDestionation.ps1",101,0,"Monitoring script started") ## Get failure Migration Events... $MigrationFailureEvents = @(Get-EventLog -LogName "Operations Manager" -Source "Health Service Script" -EntryType Error -After (Get-Date).AddMinutes(-6) | ? {$_.EventID -eq 201}) function Get-MPMigrationStatus { param ( $MPID, $MPName, $Version, $StoreVersion, $Sealed, $DownlaodUri, $Dependencies, $MigrationFailureEvents ) $utf8 = New-Object System.Text.UTF8Encoding $MPList = [System.Management.Automation.PSSerializer]::Deserialize($utf8.GetString([Convert]::FromBase64String($Dependencies))) $thisMP = $MPList | ? {$_.Id -eq $MPID} $MP = Get-SCOMManagementPack -Id $MPID if($MP -ne $null) { if([string]::IsNullOrEmpty($StoreVersion)) { if($MP.Version -ge [version]$Version) { $MigrationStatus = "Migrated" } else { if($thisMP.MigrationStatus -ne "Failed" -and $thisMP.MigrationStatus -ne "CannotbeMigrated") { ## Check if there was a previous attempt to migrate the management pack $MPMigrationFailureEvents = @($MigrationFailureEvents | ? {$_.Message.Contains($MPID)}) if($MPMigrationFailureEvents -ne $null -and $MPMigrationFailureEvents.Count -gt 0 -and $MPMigrationFailureEvents[0] -ne $null) { $MigrationStatus = "Failed" } else { $MigrationStatus = "ReadyToMigrate" } } else { $MigrationStatus = $thisMP.MigrationStatus } } } else { if($MP.Version -ge [version]$StoreVersion) { $MigrationStatus = "Migrated" } else { if($thisMP.MigrationStatus -ne "Failed" -and $thisMP.MigrationStatus -ne "CannotbeMigrated") { ## Check if there was a previous attempt to migrate the management pack $MPMigrationFailureEvents = @($MigrationFailureEvents | ? {$_.Message.Contains($MPID)}) if($MPMigrationFailureEvents -ne $null -and $MPMigrationFailureEvents.Count -gt 0 -and $MPMigrationFailureEvents[0] -ne $null) { $MigrationStatus = "Failed" } else { $MigrationStatus = "ReadyToMigrate" } } else { $MigrationStatus = $thisMP.MigrationStatus } } } } else { if($thisMP.MigrationStatus -ne "Failed" -and $thisMP.MigrationStatus -ne "CannotbeMigrated") { ## Check if there was a previous attempt to migrate the management pack $MPMigrationFailureEvents = @($MigrationFailureEvents | ? {$_.Message.Contains($MPID)}) if($MigrationFailureEvents -ne $null -and $MigrationFailureEvents.Count -gt 0 -and $MigrationFailureEvents[0] -ne $null) { $MigrationStatus = "Failed" } else { $MigrationStatus = "ReadyToMigrate" } } else { $MigrationStatus = $thisMP.MigrationStatus } } if($MigrationStatus -eq "CannotbeMigrated") { $MigrationStatus = "Failed" } return $MigrationStatus } $Class = Get-SCOMClass -Name Microsoft.SCOMMIAccelerator.ManagementPack $ClassInstances = @(Get-SCOMMonitoringObject -Class $Class) foreach($ClassInstance in $ClassInstances) { $StoreVersion = $null $DownloadUri = $null $dependencies = $null if($ClassInstance[$Class,"StoreVersion"].Value -ne $null) { $StoreVersion = $ClassInstance[$Class,"StoreVersion"].Value.ToString() } if($ClassInstance[$Class,"DownlaodUri"].Value -ne $null) { $DownloadUri = $ClassInstance[$Class,"DownlaodUri"].Value.ToString() } if($ClassInstance[$Class,"Dependencies"].Value -ne $null) { $dependencies = $ClassInstance[$Class,"Dependencies"].Value.ToString() } $InstanceMigrationStatus = Get-MPMigrationStatus -MPID $ClassInstance[$Class,"MPID"].Value.ToString() -MPName $ClassInstance[$Class,"MPName"].Value.ToString() -Version $ClassInstance[$Class,"Version"].Value.ToString() -StoreVersion $StoreVersion -Sealed $ClassInstance[$Class,"Sealed"].Value.ToString() -DownlaodUri $DownloadUri -Dependencies $dependencies -MigrationFailureEvents $MigrationFailureEvents #Write-Host ("MPName: {0} MigrationStatus: {1}" -f $ClassInstance[$Class,"MPName"].Value, $InstanceMigrationStatus) ## Create Property Bag $bag = $momapi.CreatePropertyBag() $MPID = $ClassInstance[$Class,"MPID"].Value.ToString() $bag.AddValue("MPID", $MPID) $bag.AddValue("Result", $InstanceMigrationStatus) ## Return bag $bag } $momapi.LogScriptEvent("MonitorManagementPacksonDestionation.ps1",101,0,"Monitoring script completed")</ScriptBody> <SnapIns /> <TimeoutSeconds>300</TimeoutSeconds> </ProbeAction> </MemberModules> <Composition> <Node ID="Script"></Node> </Composition> </Composite> </ModuleImplementation> <OutputType>System!System.PropertyBagData</OutputType> <TriggerOnly>true</TriggerOnly> </ProbeActionModuleType> <WriteActionModuleType ID="Microsoft.SCOMMIAccelerator.PowerShellWriteAction.Prerequisites" Accessibility="Public"> <Configuration> <xsd:element name="Dependencies" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> <xsd:element name="OverwriteStoreVersion" type="xsd:boolean" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> <xsd:element name="TimeoutSeconds" type="xsd:integer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> </Configuration> <OverrideableParameters> <OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int" /> <OverrideableParameter ID="OverwriteStoreVersion" Selector="$Config/OverwriteStoreVersion$" ParameterType="bool" /> </OverrideableParameters> <ModuleImplementation Isolation="Any"> <Composite> <MemberModules> <WriteAction ID="PowerShellWriteAction" TypeID="Windows!Microsoft.Windows.PowerShellWriteAction"> <ScriptName>MigrateManagementPack.ps1</ScriptName> <ScriptBody>param ( $Dependencies, $OverwriteStoreVersion ) Import-Module OperationsManager $momapi = New-Object -comObject "MOM.ScriptAPI" $momapi.LogScriptEvent("MigrateManagementPack.ps1",101,0,"Management pack migration started") $ExportPath = "C:\temp" $utf8 = New-Object System.Text.UTF8Encoding $MPsToMigrate = [System.Management.Automation.PSSerializer]::Deserialize($utf8.GetString([Convert]::FromBase64String($Dependencies))) $MPsToMigrate = $MPsToMigrate | Sort Order -Desc ## Least dependent MPs first $output = "Starting Management Pack migration" $importStatus = @{} foreach($MP in $MPsToMigrate) { $importStatus[$MP.Order] = $false ## Five attempts with an interval of 1 minute each, this will help in case multiple MPs are migrated with same dependencies for($attempt = 0; $attempt -lt 5; $attempt++) { ## Check if MP can be imported if($MP.MigrationStatus -eq "CannotbeMigrated") { $status = "Management pack - [$($MP.Name)] canot be migrated. Reason - $($MP.Reason)" $output += [System.Environment]::NewLine + $status $momapi.LogScriptEvent("MigrateManagementPack.ps1",201,1,$status) break; } $dependencies = @($MPsToMigrate | ? {$_.Order -gt $MP.Order}) $dependenciesImported = $true foreach($dependency in $dependencies) { if($importStatus[$dependency.Order] -eq $false) { $status = "Management pack - [$($MP.Name)] canot be migrated. Reason - Dependency management pack - [$($dependency.Name)] is not available." $output += [System.Environment]::NewLine + $status $dependenciesImported = $false break; } } if($dependenciesImported -eq $false) { break; } ## Check if MP is imported $ExistingMP = Get-SCOMManagementPack -Id $MP.Id if($ExistingMP -ne $null) { if([string]::IsNullOrEmpty($MP.OCVersion) -eq $false) { ## Check OC version if($ExistingMP.Version -ge [version]$MP.OCVersion) { $output += [System.Environment]::NewLine + "Management pack - [$($MP.Name)] is already migrated. Version: [$($ExistingMP.Version)], Store version: [$($MP.OCVersion)]." $importStatus[$MP.Order] = $true break; } else { if($OverwriteStoreVersion -eq $false) { $statusDetails = "The current version of Management pack - $($MP.Name) ({0}) is older than Store version ({1}). Please retry the task with override parameter 'OverwriteStoreVersion' set as TRUE to migrate this management pack." -f $ExistingMP.Version, $MP.OCVersion $status = "Management Pack Id:[{0}]; Name:[{1}]; Versoin:[{2}]; StoreVersion:[{3}]; Sealed:[{4}]; DownloadUri:[{5}]; MigrationStatus:[ReadyToMigrate]; StatusDetails:[{6}]" -f $MP.Id, $MP.Name, $MP.Version, $MP.OCVersion, $MP.Sealed, $MP.DownloadUri, $statusDetails $output += [System.Environment]::NewLine + $statusDetails + [System.Environment]::NewLine + $status break; } } } else { ## Check Version ($ExistingMP.Version -ge [version]$MP.OCVersion) { $output += [System.Environment]::NewLine + "Management pack - [$($MP.Name)] is already migrated. Version: [$($ExistingMP.Version)], Store version: [$($MP.OCVersion)]." $importStatus[$MP.Order] = $true break; } } } else { if([string]::IsNullOrEmpty($MP.OCVersion) -eq $false) { if($MP.Version -lt [version]$MP.OCVersion -and $OverwriteStoreVersion -eq $false) { $statusDetails = "The current version of Management pack - $($MP.Name) ({0}) is older than Store version ({1}). Please retry the task with override parameter 'OverwriteStoreVersion' set as TRUE to migrate this management pack." -f $MP.Version, $MP.OCVersion $status = "Management Pack Id:[{0}]; Name:[{1}]; Versoin:[{2}]; StoreVersion:[{3}]; Sealed:[{4}]; DownloadUri:[{5}]; MigrationStatus:[ReadyToMigrate]; StatusDetails:[{6}]" -f $MP.Id, $MP.Name, $MP.Version, $MP.OCVersion, $MP.Sealed, $MP.DownloadUri, $statusDetails $output += [System.Environment]::NewLine + $statusDetails + [System.Environment]::NewLine + $status break; } } } $exportFilePath = [string]::Empty $Reason = [string]::Empty try { if($MP.Sealed -eq $true) { ## Download $webClient = New-Object System.Net.WebClient $webClient.UseDefaultCredentials = $true $exportFilePath = "{0}\{1}" -f $ExportPath, (Split-path $MP.DownloadUri -leaf) if([System.IO.File]::Exists($exportFilePath)) { Remove-Item -Path $exportFilePath -ErrorAction SilentlyContinue -Force | Out-Null } $webClient.DownloadFile($MP.DownloadUri, $exportFilePath) } else { ## Save from MPContent if([string]::IsNullOrEmpty($MP.MPContent) -eq $false) { $exportFilePath = "{0}\{1}.xml" -f $ExportPath, $MP.Name if([System.IO.File]::Exists($exportFilePath)) { Remove-Item -Path $exportFilePath -ErrorAction SilentlyContinue -Force | Out-Null } $fileContent = [Convert]::FromBase64String($MP.MPContent) [System.IO.File]::WriteAllBytes($exportFilePath,$fileContent) } } ## Finally import if(([string]::IsNullOrEmpty($exportFilePath) -eq $false) -and ([System.IO.File]::Exists($exportFilePath))) { Import-SCOMManagementPack -Fullname $exportFilePath -ErrorVariable "importErrs" -ErrorAction SilentlyContinue ## Try to get proper reason... if($importErrs -ne $null -and $importErrs.Count -gt 0) { if($attempt -eq 4) { $Ex = $importErrs[0].Exception $Reason = $Ex.ToString() $InnerEx = $Ex.InnerException if($InnerEx -ne $null) { $Reason = $InnerEx.ToString() } $statusDetails = "Failed to import the managementpack - [$($MP.Name)], please check operations manager event log for more details. Possible error: [$Reason]" $status = "Management Pack Id:[{0}]; Name:[{1}]; Versoin:[{2}]; StoreVersion:[{3}]; Sealed:[{4}]; DownloadUri:[{5}]; MigrationStatus:[Failed]; StatusDetails:[{6}]" -f $MP.Id, $MP.Name, $MP.Version, $MP.OCVersion, $MP.Sealed, $MP.DownloadUri, $statusDetails $output += [System.Environment]::NewLine + $statusDetails + [System.Environment]::NewLine + $status $momapi.LogScriptEvent("MigrateManagementPack.ps1",201,1,$status) } } else { $output += [System.Environment]::NewLine + "Management pack - [$($MP.Name)] is now migrated. Version: [$($MP.Version)], Store Version: [$($MP.OCVersion)]." $importStatus[$MP.Order] = $true break; } } } catch { if($attempt -eq 4) { ## Last attempt, log the error $statusDetails = "Failed to import the managementpack - [$($MP.Name)], please check operations manager event log for more details. Possible error: [$Reason]" $status = "Management Pack Id:[{0}]; Name:[{1}]; Versoin:[{2}]; StoreVersion:[{3}]; Sealed:[{4}]; DownloadUri:[{5}]; MigrationStatus:[Failed]; StatusDetails:[{6}]" -f $MP.Id, $MP.Name, $MP.Version, $MP.OCVersion, $MP.Sealed, $MP.DownloadUri, $statusDetails $output += [System.Environment]::NewLine + $statusDetails + [System.Environment]::NewLine + $status $status = $status + " Error details: $($_.Exception.ToString())" $momapi.LogScriptEvent("MigrateManagementPack.ps1",201,1,$status) } } finally { if([System.IO.File]::Exists($exportFilePath)) { Remove-Item -Path $exportFilePath -ErrorAction SilentlyContinue -Force | Out-Null } } } Start-Sleep -Seconds 60 } ## Return output $output</ScriptBody> <Parameters> <Parameter> <Name>Dependencies</Name> <Value>$Config/Dependencies$</Value> </Parameter> <Parameter> <Name>OverwriteStoreVersion</Name> <Value>$Config/OverwriteStoreVersion$</Value> </Parameter> </Parameters> <TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds> </WriteAction> </MemberModules> <Composition> <Node ID="PowerShellWriteAction" /> </Composition> </Composite> </ModuleImplementation> <OutputType>System!System.BaseData</OutputType> <InputType>System!System.BaseData</InputType> </WriteActionModuleType> <WriteActionModuleType ID="Microsoft.SCOMMIAccelerator.WriteAction.Telemetry" Accessibility="Public" Batching="false"> <Configuration> <xsd:element name="ManagementGroupId" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> </Configuration> <OverrideableParameters /> <ModuleImplementation Isolation="Any"> <Managed> <Assembly>Res.Microsoft.SCOMMIAccelerator.ManagedModules</Assembly> <Type>Microsoft.SCOMMIAccelerator.ManagedModules.Telemetry.ReportTelemetryWriteAction</Type> </Managed> </ModuleImplementation> <InputType>System!System.BaseData</InputType> </WriteActionModuleType> </ModuleTypes> <MonitorTypes> <UnitMonitorType ID="Microsoft.SCOMMIAccelerator.ManagemetnPackDestinationStateMonitor.MonitorType" Accessibility="Public"> <MonitorTypeStates> <MonitorTypeState ID="Migrated" NoDetection="false" /> <MonitorTypeState ID="ReadyToMigrate" NoDetection="false" /> <MonitorTypeState ID="Failed" NoDetection="false" /> </MonitorTypeStates> <Configuration> <xsd:element minOccurs="1" name="IntervalSeconds" type="xsd:unsignedInt" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> <xsd:element minOccurs="1" name="SyncTime" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> <xsd:element minOccurs="1" name="MPID" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> </Configuration> <OverrideableParameters> <OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int" /> <OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string" /> </OverrideableParameters> <MonitorImplementation> <MemberModules> <DataSource ID="DS" TypeID="Microsoft.SCOMMIAccelerator.ManagemetnPackDestinationStateMonitor.DataSource.Filtered"> <IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds> <SyncTime>$Config/SyncTime$</SyncTime> <MPID>$Config/MPID$</MPID> </DataSource> <ProbeAction ID="Probe" TypeID="Microsoft.SCOMMIAccelerator.ManagemetnPackDestinationStateMonitor.ProbeAction"></ProbeAction> <ConditionDetection ID="CD_Migrated" TypeID="System!System.ExpressionFilter"> <Expression> <SimpleExpression> <ValueExpression> <XPathQuery Type="String">Property[@Name='Result']</XPathQuery> </ValueExpression> <Operator>Equal</Operator> <ValueExpression> <Value Type="String">Migrated</Value> </ValueExpression> </SimpleExpression> </Expression> </ConditionDetection> <ConditionDetection ID="CD_Failed" TypeID="System!System.ExpressionFilter"> <Expression> <SimpleExpression> <ValueExpression> <XPathQuery Type="String">Property[@Name='Result']</XPathQuery> </ValueExpression> <Operator>Equal</Operator> <ValueExpression> <Value Type="String">Failed</Value> </ValueExpression> </SimpleExpression> </Expression> </ConditionDetection> <ConditionDetection ID="CD_ReadyToMigrate" TypeID="System!System.ExpressionFilter"> <Expression> <SimpleExpression> <ValueExpression> <XPathQuery Type="String">Property[@Name='Result']</XPathQuery> </ValueExpression> <Operator>Equal</Operator> <ValueExpression> <Value Type="String">ReadyToMigrate</Value> </ValueExpression> </SimpleExpression> </Expression> </ConditionDetection> </MemberModules> <RegularDetections> <RegularDetection MonitorTypeStateID="ReadyToMigrate"> <Node ID="CD_ReadyToMigrate"> <Node ID="DS" /> </Node> </RegularDetection> <RegularDetection MonitorTypeStateID="Migrated"> <Node ID="CD_Migrated"> <Node ID="DS" /> </Node> </RegularDetection> <RegularDetection MonitorTypeStateID="Failed"> <Node ID="CD_Failed"> <Node ID="DS" /> </Node> </RegularDetection> </RegularDetections> </MonitorImplementation> </UnitMonitorType> </MonitorTypes> </TypeDefinitions> <Categories> <Category ID="Microsoft.ApplicationInsights.Assembly.Category" Target="Microsoft.ApplicationInsights.Assembly" Value="Visualization!Microsoft.SystemCenter.Visualization.WindowsAssembly" /> <Category ID="SCOMMIAccelerator.UI.Category" Target="Res.Microsoft.SCOMMIAccelerator.UI" Value="Visualization!Microsoft.SystemCenter.Visualization.WindowsAssembly" /> <Category ID="Microsoft.SCOMMIAccelerator.ManagedModules.Category" Target="Res.Microsoft.SCOMMIAccelerator.ManagedModules" Value="Visualization!Microsoft.SystemCenter.Visualization.WindowsAssembly" /> </Categories> <Monitoring> <Discoveries> <Discovery ID="Microsoft.SCOMMIAccelerator.ManagementPackDiscovery" Enabled="true" Target="Microsoft.SCOMMIAccelerator.SourceManagementServer" ConfirmDelivery="true" Remotable="true" Priority="Normal"> <Category>Discovery</Category> <DiscoveryTypes> <DiscoveryClass TypeID="Microsoft.SCOMMIAccelerator.ManagementPack"></DiscoveryClass> </DiscoveryTypes> <DataSource ID="DS" TypeID="Microsoft.SCOMMIAccelerator.ManagementPackDiscovery.DataSource"> <IntervalSeconds>86400</IntervalSeconds> <TimeoutSeconds>7200</TimeoutSeconds> </DataSource> </Discovery> </Discoveries> <Rules> <Rule ID="Microsoft.SCOMMIAccelerator.Rules.Telemetry" Enabled="true" Target="SC!Microsoft.SystemCenter.ManagementGroup"> <Category>Custom</Category> <DataSources> <DataSource ID="Scheduler" TypeID="System!System.Scheduler"> <Scheduler> <SimpleReccuringSchedule> <Interval Unit="Seconds">86400</Interval> </SimpleReccuringSchedule> <ExcludeDates /> </Scheduler> </DataSource> </DataSources> <WriteActions> <WriteAction ID="WA" TypeID="Microsoft.SCOMMIAccelerator.WriteAction.Telemetry"> <ManagementGroupId>$Target/Id$</ManagementGroupId> </WriteAction> </WriteActions> </Rule> </Rules> <Tasks> <Task ID="Microsoft.SCOMMIAccelerator.Tasks.MigrateManagementPack" Accessibility="Public" Enabled="true" Target="Microsoft.SCOMMIAccelerator.ManagementPack" Timeout="14400" Remotable="true"> <Category>Custom</Category> <WriteAction TypeID="Microsoft.SCOMMIAccelerator.PowerShellWriteAction.Prerequisites" ID="ExecuteScript" RunAs="SC!Microsoft.SystemCenter.PrivilegedMonitoringAccount"> <Dependencies> $Target/Property[Type="Microsoft.SCOMMIAccelerator.ManagementPack"]/Dependencies$ </Dependencies> <OverwriteStoreVersion>false</OverwriteStoreVersion> <TimeoutSeconds>14400</TimeoutSeconds> </WriteAction> </Task> </Tasks> <Monitors> <UnitMonitor ID="Microsoft.SCOMMIAccelerator.ManagementPackState.UnitMonitor" Accessibility="Public" Enabled="true" Target="Microsoft.SCOMMIAccelerator.ManagementPack" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SCOMMIAccelerator.ManagemetnPackDestinationStateMonitor.MonitorType" ConfirmDelivery="false"> <Category>AvailabilityHealth</Category> <OperationalStates> <OperationalState ID="ReadyToMigrate" MonitorTypeStateID="ReadyToMigrate" HealthState="Warning" /> <OperationalState ID="Migrated" MonitorTypeStateID="Migrated" HealthState="Success" /> <OperationalState ID="Failed" MonitorTypeStateID="Failed" HealthState="Error" /> </OperationalStates> <Configuration> <IntervalSeconds>300</IntervalSeconds> <SyncTime /> <MPID>$Target/Property[Type="Microsoft.SCOMMIAccelerator.ManagementPack"]/MPID$</MPID> </Configuration> </UnitMonitor> </Monitors> </Monitoring> <PresentationTypes> <ViewTypes> <ViewType ID="Microsoft.SCOMMIMigration.ConfigurationPageViewType" Accessibility="Public"> <Configuration></Configuration> <ViewImplementation> <Assembly>Res.Microsoft.SCOMMIAccelerator.UI</Assembly> <Type>Microsoft.SCOMMIAccelerator.UI.ConfigurationPage.MainConfigPage</Type> </ViewImplementation> </ViewType> </ViewTypes> </PresentationTypes> <Presentation> <Views> <View ID="Microsoft.SCOMMIMigration.ConfigurationPageView" Accessibility="Public" Enabled="true" Target="Microsoft.SCOMMIMigration.ManagementBase" TypeID="Microsoft.SCOMMIMigration.ConfigurationPageViewType" Visible="true"> <Category>Administration</Category> </View> <View ID="Microsoft.SCOMMIAccelerator.ManagementPacks" Accessibility="Public" Target="Microsoft.SCOMMIAccelerator.ManagementPack" TypeID="SC!Microsoft.SystemCenter.StateViewType" Visible="true" Enabled="true"> <Category>Custom</Category> <Criteria> <SeverityList> <Severity>Red</Severity> <Severity>Yellow</Severity> <Severity>Green</Severity> <Severity>Unknown</Severity> </SeverityList> <InMaintenanceMode>false</InMaintenanceMode> </Criteria> <Presentation> <ColumnInfo Index="0" SortIndex="0" Width="110" Grouped="false" Sorted="true" IsSortable="true" Visible="true" SortOrder="Descending"> <Name>State</Name> <Id>Microsoft.SCOMMIAccelerator.ManagementPack</Id> </ColumnInfo> <ColumnInfo Index="1" SortIndex="-1" Width="250" Grouped="false" Sorted="false" IsSortable="true" Visible="true" SortOrder="Ascending"> <Name>DisplayName</Name> <Id>DisplayName</Id> </ColumnInfo> <ColumnInfo Index="2" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="true" SortOrder="Ascending"> <Name>Sealed</Name> <Id>Sealed</Id> </ColumnInfo> <ColumnInfo Index="3" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="true" SortOrder="Ascending"> <Name>Version</Name> <Id>Version</Id> </ColumnInfo> <ColumnInfo Index="4" SortIndex="-1" Width="150" Grouped="false" Sorted="false" IsSortable="true" Visible="true" SortOrder="Ascending"> <Name>StoreVersion</Name> <Id>StoreVersion</Id> </ColumnInfo> </Presentation> </View> </Views> <Folders> <Folder ID="Microsoft.SCOMMIAccelerator.ViewFolder" Accessibility="Public" ParentFolder="SC!Microsoft.SystemCenter.Monitoring.ViewFolder.Root" /> </Folders> <FolderItems> <FolderItem ElementID="Microsoft.SCOMMIMigration.ConfigurationPageView" ID="Microsoft.SCOMMIMigration.ViewFolder.Root.Item" Folder="SCOL!Microsoft.SystemCenter.OperationsManager.Administration.Root" /> <FolderItem ElementID="Microsoft.SCOMMIAccelerator.ManagementPacks" Folder="Microsoft.SCOMMIAccelerator.ViewFolder" ID="Microsoft.SCOMMIAccelerator.ManagementPacks.Item" /> </FolderItems> </Presentation> <LanguagePacks> <LanguagePack ID="ENU" IsDefault="true"> <DisplayStrings> <DisplayString ElementID="SCOMMIAccelerator.UI.Category"> <Name>SCOM MI Accelerator UI Category</Name> <Description>SCOM MI Acclerator UI Category</Description> </DisplayString> <DisplayString ElementID="Res.Microsoft.SCOMMIAccelerator.UI"> <Name>Microsoft SCOMMIAccelerator UI Assembly</Name> <Description>Microsoft SCOMMIAccelerator UI Assembly</Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagedModules.Category"> <Name>Microsoft SCOMMIAccelerator ManagedModules Category</Name> <Description>Microsoft SCOMMIAccelerator ManagedModules Category</Description> </DisplayString> <DisplayString ElementID="Res.Microsoft.SCOMMIAccelerator.ManagedModules"> <Name>Microsoft SCOMMIAccelerator ManagedModules Assembly</Name> <Description>Microsoft SCOMMIAccelerator ManagedModules Assembly</Description> </DisplayString> <DisplayString ElementID="Microsoft.ApplicationInsights.Assembly.Category"> <Name>Assembly Category for Microsoft.ApplicationInsights DLL</Name> <Description>The Assembly Category associated with the Microsoft.ApplicationInsights DLL</Description> </DisplayString> <DisplayString ElementID="Microsoft.ApplicationInsights.Assembly"> <Name>Microsoft.ApplicationInsights Assembly</Name> <Description>The assembly used to send telemetry data for the Management Pack</Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.DestinationManagementServer"> <Name>Destination ManagementServer Class</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIMigration.ManagementBase"> <Name>ManagementGroup Class</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPack"> <Name>Management Pack</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPack" SubElementID="MPID"> <Name>Management Pack Id</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPack" SubElementID="MPName"> <Name>Management Pack Name</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPack" SubElementID="Sealed"> <Name>Sealed</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPack" SubElementID="Version"> <Name>Version</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPack" SubElementID="StoreVersion"> <Name>Store Version</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPack" SubElementID="Dependencies"> <Name>Dependencies</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPack" SubElementID="DownloadUri"> <Name>Download Url</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.SourceManagementServer"> <Name>Source Management Server Class</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.SourceManagementServer" SubElementID="DestinationServerName"> <Name>Destination Management Server</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.SourceManagementServer" SubElementID="DestinationServerVersion"> <Name>Destination Management Server Product Version</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator"> <Name>Azure Monitor SCOM MI Migration Accelerator</Name> <Description>This management pack performs parallel migration of management packs.</Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPackDiscovery"> <Name>ManagementPack Discovery</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPackDiscovery.DataSource"> <Name>Microsoft.SCOMMIAccelerator.ManagementPackDiscovery.DataSource</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.PowerShellWriteAction.Prerequisites"> <Name>Microsoft.SCOMMIAcceleratorPOC.PowerShellWriteAction.Prerequisites</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.Rules.Telemetry"> <Name>Microsoft SCOM MI Accelerator Telemetry Rule</Name> <Description>Telemetry Rule for Microsoft SCOM MI Accelerator</Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.WriteAction.Telemetry"> <Name>Microsoft SCOM MI Accelerator Telemetry WriteAction</Name> <Description>Telemetry WriteAction for Microsoft SCOM MI Accelerator</Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.Tasks.MigrateManagementPack"> <Name>Migrate Management Pack</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPackState.UnitMonitor"> <Name>Management Packs State Monitor</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPackState.UnitMonitor" SubElementID="ReadyToMigrate"> <Name>ReadyToMigrate</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPackState.UnitMonitor" SubElementID="Migrated"> <Name>Migrated</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPackState.UnitMonitor" SubElementID="Failed"> <Name>Failed</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ViewFolder"> <Name>Azure Monitor SCOM MI Migration Accelerator</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIMigration.ConfigurationPageView"> <Name>Azure Monitor SCOM MI Migration Accelerator</Name> <Description>Azure Monitor SCOM MI Migration Accelerator</Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIMigration.ConfigurationPageViewType"> <Name>Microsoft MP Migration Management Pack Configuration Page Type</Name> <Description>Microsoft MP Migration Management Pack Configuration Page Type</Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.ManagementPacks"> <Name>Management Packs</Name> <Description></Description> </DisplayString> <DisplayString ElementID="Microsoft.SCOMMIAccelerator.DestinationManagementServerHostsManagementPacks"> <Name>Destination Management Server Hosts Management Packs</Name> <Description></Description> </DisplayString> </DisplayStrings> <KnowledgeArticles> <KnowledgeArticle ElementID="Microsoft.SCOMMIAccelerator.ManagementPackState.UnitMonitor" Visible="true"> <MamlContent> <maml:section xmlns:maml="http://schemas.microsoft.com/maml/2004/10"> <maml:title>Summary</maml:title> <maml:para>This monitor view shows the availability of management packs in the destination management group. Management packs listed here are available in source management group.</maml:para> <maml:para /> <maml:para>Operational States:</maml:para> <maml:para>The operational state of the management packs can be ReadyToMigrate (Warning), Migrated (Success) or Failed (Error).</maml:para> </maml:section> <maml:section xmlns:maml="http://schemas.microsoft.com/maml/2004/10"> <maml:title>Causes</maml:title> <maml:para>Management packs which are migrated to destination management group are shown as healthy. Following are the causes for management pack status showing Warning (ReadyToMigrate) or Error (Failed).</maml:para> <maml:list> <maml:listItem> <maml:para>A Warning status indicates the management pack is ready to be migrated to destination management group. You can run the 'Migrate Management Pack' task to import the management pack. If the specified Version of the management pack is older than the Store Version, you need to override the OverwriteStoreVersion parameter and set its value as TRUE.</maml:para> </maml:listItem> <maml:listItem> <maml:para>An Error status indicates either management pack cannot be migrated or failed to migrate. When you run the Migrate Management Pack task, you will see the reason in task output.</maml:para> </maml:listItem> <maml:listItem> <maml:para>Management packs which are not available in store cannot be migrated.</maml:para> </maml:listItem> </maml:list> </maml:section> <maml:section xmlns:maml="http://schemas.microsoft.com/maml/2004/10"> <maml:title>Resolutions</maml:title> <maml:para>You can try the following options for the management packs which can not be migrated or failed:</maml:para> <maml:list> <maml:listItem> <maml:para>Import the management packs manually to the destination management group. Once they are imported successfully, their operational state will be changed to Migrated (Healthy).</maml:para> </maml:listItem> <maml:listItem> <maml:para>Review the reasons mentioned in the Migrate Management Pack task output and troubleshoot the underlying causes.</maml:para> </maml:listItem> <maml:listItem> <maml:para>Run the Migrate Management Pack task again.</maml:para> </maml:listItem> </maml:list> <maml:para /> </maml:section> </MamlContent> </KnowledgeArticle> </KnowledgeArticles> </LanguagePack> </LanguagePacks> <Resources> <DeployableAssembly ID="Microsoft.ApplicationInsights.Assembly" FileName="Microsoft.ApplicationInsights.dll" QualifiedName="Microsoft.ApplicationInsights, Version=2.12.0.21496, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Accessibility="Public" HasNullStream="false" /> <DeployableAssembly ID="Res.Microsoft.SCOMMIAccelerator.UI" HasNullStream="false" Accessibility="Public" FileName="Microsoft.SCOMMIAccelerator.UI.dll" QualifiedName="Microsoft.SCOMMIAccelerator.UI, Version=1.0.0.5, Culture=neutral, PublicKeyToken=31bf3856ad364e35"></DeployableAssembly> <DeployableAssembly ID="Res.Microsoft.SCOMMIAccelerator.ManagedModules" HasNullStream="false" Accessibility="Public" FileName="Microsoft.SCOMMIAccelerator.ManagedModules.dll" QualifiedName="Microsoft.SCOMMIAccelerator.ManagedModules, Version=1.0.0.5, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <Dependency ID="Microsoft.ApplicationInsights.Assembly" /> </DeployableAssembly> </Resources> </ManagementPack>
combined_dataset/train/non-malicious/Get-IISLogLocation.ps1
Get-IISLogLocation.ps1
Function Get-IISLogLocation { <# .SYNOPSIS This function can be ran against a server or multiple servers to locate the log file location for each web site configured in IIS. .DESCRIPTION This function can be ran against a server or multiple servers to locate the log file location for each web site configured in IIS. .PARAMETER computer Name of computer to query log file location. .NOTES Name: Get-IISLogLocation Author: Boe Prox DateCreated: 11Aug2010 .LINK http://boeprox.wordpress.com .EXAMPLE Get-IISLogLocation -computer 'server1' Description ----------- This command will list the IIS log location for each website configured on 'Server1' #> [cmdletbinding( SupportsShouldProcess = $True, DefaultParameterSetName = 'computer', ConfirmImpact = 'low' )] param( [Parameter( Mandatory = $False, ParameterSetName = 'computer', ValueFromPipeline = $True)] [string[]]$computer ) Begin { $report = @() } Process { ForEach ($c in $Computer) { If (Test-Connection -comp $c -count 1) { $sites = [adsi]"IIS://$c/W3SVC" $children = $sites.children ForEach ($child in $children) { If ($child.KeyType -eq "IIsWebServer") { $temp = "" | Select Server, WebSite, LogLocation $temp.Server = $c $temp.WebSite = $child.ServerComment $temp.LogLocation = $child.LogFileDirectory } $report += $temp } } } } End { $report } }
combined_dataset/train/non-malicious/sample_59_69.ps1
sample_59_69.ps1
# # Module manifest for module 'OCI.PSModules.Functions' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Functions.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '21b96577-939f-4757-b9c9-34f5b0c1c54b' # 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 Functions 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.Functions.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-OCIFunctionsApplication', 'Get-OCIFunctionsApplicationsList', 'Get-OCIFunctionsFunction', 'Get-OCIFunctionsList', 'Get-OCIFunctionsPbfListing', 'Get-OCIFunctionsPbfListingsList', 'Get-OCIFunctionsPbfListingVersion', 'Get-OCIFunctionsPbfListingVersionsList', 'Get-OCIFunctionsTriggersList', 'Invoke-OCIFunctionsFunction', 'Move-OCIFunctionsApplicationCompartment', 'New-OCIFunctionsApplication', 'New-OCIFunctionsFunction', 'Remove-OCIFunctionsApplication', 'Remove-OCIFunctionsFunction', 'Update-OCIFunctionsApplication', 'Update-OCIFunctionsFunction' # 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','Functions' # 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_9_76.ps1
sample_9_76.ps1
#************************************************ # TS_KernelAuthRPCCheck.ps1 # Version 1.0 # Date: 5-1-2012 # Author: davidcop # Description: Checks for kernel-mode authentication mismatch between server, web site, and /rpc virtual directory #************************************************ $varx = Get-CimInstance -query "select * from win32_service where name = 'tsgateway' and started = 'True'" if (($OSVersion.Major -ge 6) -and ($null -ne $varx)) { $var = $null $var2 = $null $var3 = $null $var4 = $null $var5 = $null $var6 = $null $var7 = $null $var8 = $null $var9 = $null $var10 = $null $var11 = $null $var12 = $null $var13 = $null Import-LocalizedData -BindingVariable ScriptVariable $InformationCollected = new-object PSObject Write-DiagProgress -Activity $ScriptVariable.ID_CTSKernelAuthRPCCheck -Status $ScriptVariable.ID_CTSKernelAuthRPCCheckDescription $RootCauseName = "RC_KernelAuthRPCCheck" $RootCauseDetected=$false $OutputFile = $ComputerName + "_Networking.TXT" $ScriptVariable.ID_CTSKernelAuthRPCCheck >> $OutputFile $ScriptVariable.ID_CTSKernelAuthRPCCheckDescription >> $OutputFile $var4 = invoke-Expression "$env:windir\\system32\\inetsrv\\appcmd list config -section:windowsAuthentication" if ($null -ne $var4) { foreach ($var5 in $var4) { $var6 = $var5.tolower() If ($var6.contains("<windowsauthentication") -and $var6.contains("enabled=""true""") -and $var6.contains("usekernelmode=""true"">")) { $var7 = $true } else { If ($var6.contains("<windowsauthentication") -and $var6.contains("enabled=""true""") -and $var6.contains("usekernelmode=""false"">")) { $var7 = $false } else { If ($var6.contains("<windowsauthentication") -and $var6.contains("enabled=""true""")) { $var7 = $true } } } if ($null -eq $var7) { $var7 = $false } } } else { $var7 = $true } if (test-path -path "HKLM:\SOFTWARE\Microsoft\RPC\RpcProxy") { $var = (get-itemproperty -path "HKLM:\SOFTWARE\Microsoft\RPC\RpcProxy").Website if ($null -eq $var) { $var = "default web site" } } else { $var = "default web site" } $var13 = "`"" + $var + "`"" $var3 = invoke-Expression "$env:windir\\system32\\inetsrv\\appcmd list config $var13 -section:windowsAuthentication" if ($null -ne $var3) { foreach ($var9 in $var3) { $var10 = $var9.tolower() If ($var10.contains("<windowsauthentication") -and $var10.contains("enabled=""true""") -and $var10.contains("usekernelmode=""true"">")) { $var11 = $true } else { If ($var10.contains("<windowsauthentication") -and $var10.contains("enabled=""true""") -and $var10.contains("usekernelmode=""false"">")) { $var11 = $false } else { If ($var10.contains("<windowsauthentication") -and $var10.contains("enabled=""true""")) { $var11 = $true } } if ($null -eq $var11) { $var11 = $false } } } } $var2 = "`"" + $var + "/rpc`"" $var3 = invoke-Expression "$env:windir\\system32\\inetsrv\\appcmd list config $var2 -section:windowsAuthentication" if ($null -ne $var3) { foreach ($var9 in $var3) { $var10 = $var9.tolower() If ($var10.contains("<windowsauthentication") -and $var10.contains("enabled=""true""") -and $var10.contains("usekernelmode=""true"">")) { $var12 = $true } else { If ($var10.contains("<windowsauthentication") -and $var10.contains("enabled=""true""") -and $var10.contains("usekernelmode=""false"">")) { $var12 = $false } else { If ($var10.contains("<windowsauthentication") -and $var10.contains("enabled=""true""") -and $var11 -eq $true) { $var12 = $true } } if ($null -eq $var12) { $var12 = $false } } } } if (($var7 -eq $true -and $var11 -eq $true -and $var12 -eq $false) -or ($var7 -eq $true -and $var11 -eq $false -and $var12 -eq $true) -or ($var7 -eq $false -and $var11 -eq $false -and $var12 -eq $true) -or ($var7 -eq $false -and $var11 -eq $true -and $var12 -eq $false) -or ($var7 -eq $true -and $var11 -eq $false -and $var12 -eq $false) -or ($var7 -eq $false -and $var11 -eq $true -and $var12 -eq $true)) { $string = "`tKernelmodeauth settings are mismatched between server, web site, and /rpc virtual directory" $string >> $OutputFile Update-DiagRootCause -id $RootCauseName -Detected $true Write-GenericMessage -RootCauseId $RootCauseName -InternalContentURL "https://vkbexternal.partners.extranet.microsoft.com/VKBWebService/ViewContent.aspx?scid=B;EN-US;2578756" -Verbosity "Warning" -InformationCollected $InformationCollected -Visibility 4 -SupportTopicsID 8041 } else { $string = "`tIssue Not Detected`r`n" $string >> $OutputFile Update-DiagRootCause -id $RootCauseName -Detected $false } $var = $null $var2 = $null $var3 = $null $var4 = $null $var5 = $null $var6 = $null $var7 = $null $var8 = $null $var9 = $null $var10 = $null $var11 = $null $var12 = $null $var13 = $null $string = $null CollectFiles -filesToCollect $OutputFile -fileDescription "Networking Checks" -SectionDescription "KernelAuthRPCCheck" } ## 04/03: Added new Trap info #Trap{WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat;Continue} Trap [Exception] { WriteTo-ErrorDebugReport -ErrorRecord $_ continue } # SIG # Begin signature block # MIIoOwYJKoZIhvcNAQcCoIIoLDCCKCgCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCWqOjG/TaIHxun # SxidKfDe7LgJ/Pqf7RtOffOZ6jhLWqCCDYUwggYDMIID66AD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BMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG # A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQg # VGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAfI+MtdkrHCRlAABAAAB8jAiBCB6a18p # 52IZ3X4jWMQCIRSUNF3xHVAK5egsNzthwDzOsDANBgkqhkiG9w0BAQsFAASCAgCB # QAOPZKYnIWwPgbKaph88ogILevvVdeNnN5IDLgM6gS+M1+I5bbWtZ7DqmyrPnxMd # xAKxRiYNxl4FQupaoqyAPDoUP6YO1NDWbkaCAg3uSD8UE8WnF7QcNQZkJXmDBBRB # hFlVHCAnK5YhfS3zMumuE7Wg3rnVOKzCCsn5X62sdMe1KLfsyHhSEu1YJjd3uyTs # elJU9RSLfx//9oWCQjjjwH6GYTi4khd0H+d5ga+iwBtUvqu+Hq6Ma89TNQTPPfpu # Aa44P7i4qDq/7bEhzAw7k4Z7dVWtmdPR192Cgs4+4ssY/xL1cziSejBXofV5CUhB # tVQeWoHtA05tqCYcUTANAYY1Kynb8qrkDSWG5NxedC8PkLGtg/zmBjC+LBiiFdxL # h+lB1swDC9rFUG83TNE1V+/m07vkXtSMPCWw1o4rNGpiZ/BNq5zHdn/Nsp6k8F8/ # KqZiGa8mslyspJnTdkZlqLrKdz2ta8c9kqKS3ZHa1n1xxYKsPnC906oJ2weEDVkZ # h0le1DpXQqdRvR3dfg95vNSM/7eCOWHvFEPZuqF9GqBqUvB/NGqhO9Y6PHzg/FO9 # eRQcwj18zwSPs/r0o4K0DvV834fytPGhRMhEM7wiBapkOG+8dIEFbvgyqYIRiaF/ # g4aGdrzt0mxr5+9R5pZ1MYbTofN1TT4fhYkYVwIcgQ== # SIG # End signature block
combined_dataset/train/non-malicious/3087.ps1
3087.ps1
function Verify-Throw { param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [ScriptBlock]$ScriptBlock ) $exceptionThrown = $false try { $null = & $ScriptBlock } catch { $exceptionThrown = $true $_ } if (-not $exceptionThrown) { throw [Exception]"An exception was expected, but no exception was thrown!" } }
combined_dataset/train/non-malicious/sample_9_55.ps1
sample_9_55.ps1
#************************************************ # TS_HyperVKB2263829Check.ps1 #************************************************ Import-LocalizedData -BindingVariable RegKeyCheck Write-DiagProgress -Activity $RegKeyCheck.ID_HyperVKB2263829Check -Status $RegKeyCheck.ID_HyperVKB2263829CheckDesc $RootCauseDetected = $false $RootCauseName = "RC_HyperVKB2263829Check" #Rule ID 263 #----------- #http://sharepoint/sites/rules/_layouts/listform.aspx?PageType=4&ListId={9318793E-073A-415E-8FF5-C433133C2A9E}&ID=263&ContentTypeID=0x01008FE8F6282AC12B4DB4505EA8C2BDB8F8 # #Description #----------- # Checks if Windows Server 2008 R2 SP1, Hyper-V, and Hotfix 2263829 are installed if they are generate alert # #Related KB #---------- #2263829 # #Script Author #------------- # anecho #******************** #Data gathering #******************** $System32Folder = Join-Path $env:windir "System32" $Hvax64File = Join-Path $System32Folder "Hvax64.exe" Function isOSVersion { # <# # .SYNOPSIS # Checks if the Machine is Windows Server 2008 R2 SP1 # .DESCRIPTION # Checks to insure the machine is a server then checks that it is version 7601 (SP1) # .NOTES # .LINK # .EXAMPLE # .OUTPUTS # Boolean value: [true] if the current system is Windows Server 2008 R2 SP1 # otherwise [false] # .PARAMETER file # #> if ((Get-CimInstance -Class Win32_OperatingSystem).ProductType -eq 3 ) { if ($OSVersion.Build -eq 7601) { return $true } else { return $false } } else { return $false } } Function isHyperVFeature { # <# # .SYNOPSIS # Checks to see if HyperVFeature is installed # .DESCRIPTION # Uses Get-CimInstance to pull a list of the server features then filters the list by ID=20 # to see if HyperV Feature is present # .NOTES # .LINK # .EXAMPLE # .OUTPUTS # Boolean value indicating [true] if HyperV Feature is present and [false] if it is not # .PARAMETER file # #> if ((Get-CimInstance -Class Win32_OperatingSystem).ProductType -eq 3 ) { $vmmskey = "HKLM:\SYSTEM\CurrentControlSet\Services\vmms" if (Test-Path $vmmskey) { return $true } else { return $false } } else { return $false } } Function isHotfixInstalled { # <# # .SYNOPSIS # Checks to see if hotfix is installed # .DESCRIPTION # Uses CheckMinimalFileVersion to check the version number of the hotfix files # .NOTES # .LINK # .EXAMPLE # .OUTPUTS # Boolean value: [true] if the hotfix is present, [false] if it is not # .PARAMETER file # #> if ((CheckMinimalFileVersion "$Hvax64File" 6 1 7601 17579 -LDRGDR) -and (CheckMinimalFileVersion "$System32Folder\drivers\Hvboot.sys" 6 1 7601 17579 -LDRGDR) -and (CheckMinimalFileVersion "$System32Folder\Hvix64.exe" 6 1 7601 17579 -LDRGDR) -and (CheckMinimalFileVersion "$System32Folder\Hvax64.exe" 6 1 7601 21683 -LDRGDR) -and (CheckMinimalFileVersion "$System32Folder\drivers\Hvboot.sys" 6 1 7601 21683 -LDRGDR) -and (CheckMinimalFileVersion "$System32Folder\Hvix64.exe" 6 1 7601 21683 -LDRGDR)) { return $true } else { return $false } } Function getFileVersion($file) { $fileVersion = ([System.Diagnostics.FileVersionInfo]::GetVersionInfo($file)) return $fileVersion } #Information Collected node $InformationCollected = new-object PSObject #******************** #Detection Logic #******************** # Detect if OS version is equal to Windows Server 2008 R2 SP0 or SP1 # Check for the binaries specified @ KB2263829 if ((isOSVersion) -and (isHyperVFeature) -and (-not(isHotfixInstalled))) { $HasIssue = $true } else { $HasIssue = $false } #******************** #Alert Evaluation #******************** if($HasIssue) { #Hvax64 file version $Hvax64Version = getFileVersion($Hvax64File) add-member -inputobject $InformationCollected -membertype noteproperty -name "Hvax64.exe current version" -value (Get-FileVersionString($Hvax64File)) switch ($Hvax64Version.FilePrivatePart.ToString().Remove(2)) { "17" {$RequiredVersion = "6.1.7601.17579"} "21" {$RequiredVersion = "6.1.7601.21683"} } add-member -inputobject $InformationCollected -membertype noteproperty -name "Hvax64.exe required version" -value $RequiredVersion Update-DiagRootCause -id $RootCauseName -Detected $true Write-GenericMessage -RootCauseId $RootCauseName -PublicContentURL "http://support.microsoft.com/kb/2263829" -Verbosity "Error" -InformationCollected $InformationCollected -Visibility 4 -SupportTopicsID 8141 -MessageVersion 2 -Component "Hyper-V" } else { if ((isOSVersion) -and (isHyperVFeature)) { Update-DiagRootCause -id $RootCauseName -Detected $false } } # SIG # Begin signature block # MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAUUk/duSgHV/+A # 2FWJJoDaZc4E+ZGUReUQ8XwljlltLKCCDYUwggYDMIID66ADAgECAhMzAAAEA73V # lV0POxitAAAAAAQDMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjQwOTEyMjAxMTEzWhcNMjUwOTExMjAxMTEzWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQCfdGddwIOnbRYUyg03O3iz19XXZPmuhEmW/5uyEN+8mgxl+HJGeLGBR8YButGV # LVK38RxcVcPYyFGQXcKcxgih4w4y4zJi3GvawLYHlsNExQwz+v0jgY/aejBS2EJY # oUhLVE+UzRihV8ooxoftsmKLb2xb7BoFS6UAo3Zz4afnOdqI7FGoi7g4vx/0MIdi # kwTn5N56TdIv3mwfkZCFm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rvdNQbzUCTEVO # vaQIRPlW5u39NGqPssLLibvP8WbZqLzA03jK6E0R2QNvrgIlbp2QPqsjiVPcztp+ # yVuKfHujenj97cQ62A7WsqNCPhXGLm8oR/N3z8eu6fn9PwSuSp+tK2fXE772eX9z # Xcv1ESO5JVbgYMXLmDCdf0rMCy+yHPbJeNMxVN3420KNIZA/UNdULnVElU5BRiAs # 0RO12h0SaLZFlhE/fhN9z4CeAz1fCKulE5yMt3wNY+qFk3vJ6cAkn7HufVk9sVKv # oDqZ44nS9W83 # SIG # End signature block
combined_dataset/train/non-malicious/3758.ps1
3758.ps1
function Test-StartLogicApp { $resourceGroup = TestSetup-CreateResourceGroup $resourceGroupName = $resourceGroup.ResourceGroupName $location = Get-Location "Microsoft.Logic" "workflows" "West US" $workflowName = getAssetname $definitionFilePath = Join-Path "Resources" "TestSimpleWorkflowTriggerDefinition.json" $workflow = New-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -Location $location -DefinitionFilePath $definitionFilePath [int]$counter = 0 do { SleepInRecordMode 2000 $workflow = Get-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName } while ($workflow.State -ne "Enabled" -and $counter++ -lt 5) Start-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -TriggerName "httpTrigger" } function Test-GetAzLogicAppRunHistory { $resourceGroup = TestSetup-CreateResourceGroup $resourceGroupName = $resourceGroup.ResourceGroupName $location = Get-Location "Microsoft.Logic" "workflows" "West US" $workflowName = getAssetname $definitionFilePath = Join-Path "Resources" "TestSimpleWorkflowTriggerDefinition.json" $workflow = New-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -Location $location -DefinitionFilePath $definitionFilePath [int]$counter = 0 do { SleepInRecordMode 2000 $workflow = Get-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName } while ($workflow.State -ne "Enabled" -and $counter++ -lt 5) Start-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -TriggerName "httpTrigger" $runHistory = Get-AzLogicAppRunHistory -ResourceGroupName $resourceGroupName -Name $workflowName Assert-NotNull $runHistory $run = Get-AzLogicAppRunHistory -ResourceGroupName $resourceGroupName -Name $workflowName -RunName $runHistory[0].Name Assert-NotNull $run Assert-AreEqual $runHistory[0].Name $run.Name } function Test-GetAzLogicAppRunAction { $resourceGroup = TestSetup-CreateResourceGroup $resourceGroupName = $resourceGroup.ResourceGroupName $location = Get-Location "Microsoft.Logic" "workflows" "West US" $workflowName = getAssetname $definitionFilePath = Join-Path $TestOutputRoot "Resources\TestSimpleWorkflowTriggerDefinition.json" $workflow = New-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -Location $location -DefinitionFilePath $definitionFilePath [int]$counter = 0 do { SleepInRecordMode 2000 $workflow = Get-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName } while ($workflow.State -ne "Enabled" -and $counter++ -lt 5) Start-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -TriggerName "httpTrigger" $runHistory = Get-AzLogicAppRunHistory -ResourceGroupName $resourceGroupName -Name $workflowName Assert-NotNull $runHistory $actions = Get-AzLogicAppRunAction -ResourceGroupName $resourceGroupName -Name $workflowName -RunName $runHistory[0].Name Assert-NotNull $actions Assert-AreEqual 2 $actions.Count $action = Get-AzLogicAppRunAction -ResourceGroupName $resourceGroupName -Name $workflowName -RunName $runHistory[0].Name -ActionName "http" Assert-NotNull $action } function Test-StopAzLogicAppRun { $resourceGroup = TestSetup-CreateResourceGroup $resourceGroupName = $resourceGroup.ResourceGroupName $location = Get-Location "Microsoft.Logic" "workflows" "West US" $workflowName = getAssetname $definitionFilePath = Join-Path "Resources" "TestSimpleWorkflowTriggerDefinitionWithDelayAction.json" $workflow = New-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -Location $location -DefinitionFilePath $definitionFilePath [int]$counter = 0 do { SleepInRecordMode 2000 $workflow = Get-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName } while ($workflow.State -ne "Enabled" -and $counter++ -lt 5) Start-AzLogicApp -ResourceGroupName $resourceGroupName -Name $workflowName -TriggerName "httpTrigger" $runHistory = Get-AzLogicAppRunHistory -ResourceGroupName $resourceGroupName -Name $workflowName Stop-AzLogicAppRun -ResourceGroupName $resourceGroupName -Name $workflowName -RunName $runHistory[0].Name -Force }
combined_dataset/train/non-malicious/sample_43_71.ps1
sample_43_71.ps1
# # Module manifest for module 'OCI.PSModules.Bastion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Bastion.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '2e2ff643-43d5-47ff-a4d4-2f965b778f45' # 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 Bastion 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.1.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Bastion.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-OCIBastion', 'Get-OCIBastionSession', 'Get-OCIBastionSessionsList', 'Get-OCIBastionsList', 'Get-OCIBastionWorkRequest', 'Get-OCIBastionWorkRequestErrorsList', 'Get-OCIBastionWorkRequestLogsList', 'Get-OCIBastionWorkRequestsList', 'Move-OCIBastionCompartment', 'New-OCIBastion', 'New-OCIBastionSession', 'Remove-OCIBastion', 'Remove-OCIBastionSession', 'Update-OCIBastion', 'Update-OCIBastionSession' # 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','Bastion' # 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_29_40.ps1
sample_29_40.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/powershell73-help' } # SIG # Begin signature block # MIInwQYJKoZIhvcNAQcCoIInsjCCJ64CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCWNhoZaJT5e8B1 # Q5H12dpK/1OtcJflTmkUj5T5DHeB1KCCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UECh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xkwUIVN/XtGDjKYVP6 # E6BMWKM2DtPn4JuOZZ5Q7lZcikFnsPO624YbLAwfjJoRADCduanuEkNVOeiWRA3C # LPmpEapwK0CmkqiVJfPI71R37YpCHSaqOmP4ptXba6k7Os+rDCkrnd69bT4RVfEk # 3z+PfIP11zv+P4mHdWMHevdDH0nwjq85M+Vn6ncjOiTOgY9f6D+tdGbcFndFpjZF # VmOw+2VRwgc3PJhgqo7MaxcHEJGvbmd9w3Vk5PApDFfUd2ReykKOUSYtNzHgrNXs # AJ6QTruxOamdqcE+s2UYQeSJlJJqtO3gYpuwVq9H+VYlwZnV7N9ILvDCpA/tdKNI # oOP7/QdKEjA8VA6bicp4OWQJE0XOLIqRj2YSOPvlZaykvN0QL7vt7tx9X2DrDl2E # mAhZIng= # SIG # End signature block
combined_dataset/train/non-malicious/Get-DellWarranty_4.ps1
Get-DellWarranty_4.ps1
function Get-DellWarranty { <# .Synopsis Provides warranty information for one or more Dell service tags. .Description Queries the Dell Website for a list of service tags and returns the warranty information as a custom object. If a service tag has multiple warranties, they are returned as multiple separate objects. If no service tag is specified, it will attempt to retrieve and lookup the local system's service tag. The service tag can be provided to the command in several ways: 1. Using the -servicetag parameter 2. By passing one or more Service Tags via the pipeline 3. By passing objects that have either servicetag or serialnumber defined as a property, such as win32_bios WMI objects See examples for details. .Parameter ServiceTag ALIAS: serialnumber The Dell service tag you wish to query. Example: XYZ12A3 .Example C:\\PS> Get-DellWarranty Service Tag : XXXX123 Description : 4 Hour On-Site Service Provider : UNY Warranty Extension Notice * : No Start Date : 6/19/2009 End Date : 6/20/2011 Days Left : 140 Description ----------- If no service tags are provided, the script retrieves the local computer's serial number from WMI and queries for it. .Example C:\\PS> Get-DellWarranty -ServiceTag XXXX123 Service Tag : XXXX123 Description : 4 Hour On-Site Service Provider : UNY Warranty Extension Notice * : No Start Date : 6/19/2009 End Date : 6/20/2011 Days Left : 140 Description ----------- You can pass the service tag as a parameter, or as the first positional parameter (e.g. Get-DellWarranty XXXX123) .Example C:\\PS> "XXXX123","XXXX124","XXXX125" | get-dellwarranty Service Tag : XXXX123 Description : 4 Hour On-Site Service Provider : UNY Warranty Extension Notice * : No Start Date : 6/19/2009 End Date : 6/20/2011 Days Left : 140 Service Tag : XXXX124 Description : 4 Hour On-Site Service Provider : UNY Warranty Extension Notice * : No Start Date : 6/14/2009 End Date : 6/15/2011 Days Left : 145 Service Tag : XXXX125 Description : NBD On-Site Service Provider : DELL Warranty Extension Notice * : No Start Date : 6/14/2008 End Date : 6/15/2010 Days Left : 0 Description ----------- You can pass serial numbers via the pipeline either directly or as a variable. .Example C:\\PS> get-wmiobject win32_bios -computername "computer1","computer2","1.2.3.4" | get-dellwarranty Service Tag : XXXX123 Description : 4 Hour On-Site Service Provider : UNY Warranty Extension Notice * : No Start Date : 6/19/2009 End Date : 6/20/2011 Days Left : 140 Service Tag : XXXX124 Description : 4 Hour On-Site Service Provider : UNY Warranty Extension Notice * : No Start Date : 6/14/2009 End Date : 6/15/2011 Days Left : 145 Service Tag : XXXX125 Description : NBD On-Site Service Provider : DELL Warranty Extension Notice * : No Start Date : 6/14/2008 End Date : 6/15/2010 Days Left : 0 Description ----------- You can also pass any object that has a "serialnumber" or "servicetag" property. In this example, we query computers directly for their serial numbers, and pass those results (which are WMI objects that have a serialnumber property) via pipeline directly to the command to obtain warranty information. .Notes AUTHOR: Justin Grote <jgrote NOSPAM-AT allieddigital NOSPAM-DOT net> WARNING: Since Dell does not provide a formal API, this script works by screen-scraping the HTML from the Dell product support site. Any future change to the layout or logic of this site will break the script or cause unpredictable results. HISTORY: v1.0 [31 Jan 2011] - Initial Module Creatio .Link http://support.dell.com/support/topics/global.aspx/support/my_systems_info #> [CmdletBinding()] param( [Parameter(Mandatory=$False,Position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)] [alias("serialnumber")] [string[]]$ServiceTag ) PROCESS { # If nothing was passed, retrieve the local system service tag if ($ServiceTag -eq $null) { write-verbose "No Service Tags provided. Using Local Computer's Service Tag" write-verbose "START Obtaining Serial number via WMI for localhost" $ServiceTag = (get-wmiobject win32_bios).SerialNumber write-verbose "SUCCESS Obtaining Serial number via WMI for localhost - $ServiceTag" } # Detect if an array of service tags were passed via parameter and unwind them. foreach ($strServicetag in $servicetag) { write-verbose "START Querying Dell for Service Tag $_" Get-DellWarrantyWorker $strServicetag write-verbose "SUCCESS Querying Dell for Service Tag $_" } } } Function Get-DellWarrantyWorker { Param( [String]$serviceTag ) #Dell Warranty URL Path $URL = "http://support.dell.com/support/topics/global.aspx/support/my_systems_info/details?c=us&l=en&s=gen&ServiceTag=$serviceTag" trap [System.FormatException] { write-error -category invalidresult "The service tag $serviceTag was not found. This is either because you entered the tag incorrectly, it is not present in Dell's database, or Dell changed the format of their website causing this search to fail." -recommendedaction "Please check that you entered the service tag correctly" return; } #Screenscrape the HTML for the warranty Table $HTML = (New-Object Net.WebClient).DownloadString($URL) If ($HTML -Match '<table[\\w\\s\\d"=%]*contract_table">.+?</table>') { $htmltable = $Matches[0] } else { throw (New-Object System.FormatException) } $HtmlLines = $htmltable -Split "<tr" | Where-Object { $_ -Match '<td' } $Header = ($HtmlLines[0] -Split '<td') -Replace '[\\w\\s\\d"=%:;\\-]*>|</.*' | Where-Object { $_ -ne '' } #Convert the warranty table fields into a powershell object For ($i = 1; $i -lt $HtmlLines.Count; $i++) { $Output = New-Object PSObject $Output | Add-Member NoteProperty "Service Tag" -value $serviceTag $Values = ($HtmlLines[$i] -Split '<td') -Replace '[\\w\\s\\d"=%:;\\-]*>|</.*|<a.+?>' For ($j = 1; $j -lt $Values.Count; $j++) { $Output | Add-Member NoteProperty $Header[$j - 1] -Value $Values[$j] } #Minor formatting fix if days remaining on warranty is zero if ($output.'Days Left' -match '<<0') {write-host -fore darkgreen "match!";$output.'Days Left' = 0} return $Output } }
combined_dataset/train/non-malicious/2198.ps1
2198.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="Specify the full path to a text file containing the device models")] [ValidateNotNullOrEmpty()] [ValidatePattern("^[A-Za-z]{1}:\\\w+\\\w+")] [ValidateScript({ if ((Split-Path -Path $_ -Leaf).IndexOfAny([IO.Path]::GetInvalidFileNameChars()) -ge 0) { throw "$(Split-Path -Path $_ -Leaf) contains invalid characters" } else { if ([System.IO.Path]::GetExtension((Split-Path -Path $_ -Leaf)) -like ".txt") { if (-not(Test-Path -Path (Split-Path -Path $_) -PathType Container -ErrorAction SilentlyContinue)) { if ($PSBoundParameters["Force"]) { New-Item -Path (Split-Path -Path $_) -ItemType Directory | Out-Null return $true } else { throw "Unable to locate part of the specified path, use the -Force parameter to create it or specify a valid path" } } elseif (Test-Path -Path (Split-Path -Path $_) -PathType Container -ErrorAction SilentlyContinue) { return $true } else { throw "Unhandled error" } } else { throw "$(Split-Path -Path $_ -Leaf) contains unsupported file extension. Supported extension is '.xml'" } } })] [string]$FilePath, [parameter(Mandatory=$false, HelpMessage="Specify a prefix for the collection names")] [ValidateNotNullOrEmpty()] [string]$Prefix ) Begin { try { Write-Verbose "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 "SiteCode: $($SiteCode)" } } } catch [Exception] { throw "Unable to determine SiteCode" } $Models = Get-Content -Path $FilePath $Date = (Get-Date -Hour 00 -Minute 00 -Second 00).AddHours(7) $StartTime = [System.Management.ManagementDateTimeconverter]::ToDMTFDateTime($Date) } Process { $ModelCount = ($Models | Measure-Object).Count if ($ModelCount -ge 1) { foreach ($Model in $Models) { if ($PSBoundParameters["Prefix"]) { $FullCollectionName = $Prefix + " " + $Model } else { $FullCollectionName = $Model } $ValidateCollection = Get-WmiObject -Class "SMS_Collection" -Namespace "root\SMS\site_$($SiteCode)" -Filter "Name like '$($FullCollectionName)'" if (-not($ValidateCollection)) { try { $ScheduleToken = ([WMIClass]"\\$($SiteServer)\root\SMS\Site_$($SiteCode):SMS_ST_RecurInterval").CreateInstance() $ScheduleToken.DayDuration = 0 $ScheduleToken.DaySpan = 1 $ScheduleToken.HourDuration = 0 $ScheduleToken.HourSpan = 0 $ScheduleToken.IsGMT = $false $ScheduleToken.MinuteDuration = 0 $ScheduleToken.MinuteSpan = 0 $ScheduleToken.StartTime = $StartTime $NewDeviceCollection = ([WmiClass]"\\$($SiteServer)\root\SMS\Site_$($SiteCode):SMS_Collection").CreateInstance() $NewDeviceCollection.Name = "$($FullCollectionName)" $NewDeviceCollection.Comment = "Collection for $($FullCollectionName)" $NewDeviceCollection.OwnedByThisSite = $true $NewDeviceCollection.LimitToCollectionID = "SMS00001" $NewDeviceCollection.RefreshSchedule = $ScheduleToken $NewDeviceCollection.RefreshType = 2 $NewDeviceCollection.CollectionType = 2 $NewDeviceCollection.Put() | Out-Null Write-Verbose -Message "Successfully created the '$($FullCollectionName)' collection" } catch [Exception] { Write-Warning -Message "Failed to create collection '$($FullCollectionName)'" } $QueryExpression = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM.Model = '$($Model)'" $Collection = Get-WmiObject -Namespace "root\SMS\Site_$($SiteCode)" -Class SMS_Collection -Filter "Name like '$($FullCollectionName)' and CollectionType like '2'" $ValidateQuery = Invoke-WmiMethod -Namespace "root\SMS\site_$($SiteCode)" -Class SMS_CollectionRuleQuery -Name ValidateQuery -ArgumentList $QueryExpression if ($ValidateQuery) { $Collection.Get() try { $NewRule = ([WMIClass]"\\$($SiteServer)\root\SMS\Site_$($SiteCode):SMS_CollectionRuleQuery").CreateInstance() $NewRule.QueryExpression = $QueryExpression $NewRule.RuleName = "$($FullCollectionName)" $Collection.CollectionRules += $NewRule.psobject.baseobject $Collection.Put() | Out-Null $Collection.RequestRefresh() | Out-Null Write-Verbose -Message "Successfully added a Query Rule for collection '$($FullCollectionName)'" } catch { Write-Warning -Message "Failed to add a Query Rule for collection '$($FullCollectionName)'" } } } else { Write-Warning -Message "Collection '$($FullCollectionName)' already exists" } } } else { Write-Warning -Message "No items was found in specified text file" ; break } }
combined_dataset/train/non-malicious/sample_67_48.ps1
sample_67_48.ps1
\PrintAllTranslations प्रतिबंध का IgnoreTranslations प्रतिबंध के साथ उपयोग नहीं किया जा सकता.vआप परिकलित कालम '%{oii_column/}' को हाइब्रिड तालिका '%{oii_table/}' में नहीं जोड़ सकते. कृपया परिकलित कॉलम को निकालें.ˆआप हाइब्रिड तालिका '%{oii_table/}' में एकीकरण के लिए उपयोग किया गया 'alternateOf' कालम नहीं जोड़ सकते. कृपया 'alternateOf' कॉलम निकालें.óआप समूहन के लिए उपयोग किया जाने वाला एक 'alternateOf' कालम नहीं बना सकते जो हाइब्रिड तालिका '%{oii_baseTable/}' को उसके BaseTable के रूप में संदर्भित कर रहा है. या तो DirectQuery मोड में आधार तालिका का संदर्भ दें या 'alternateOf' कॉलम निकालें.uआप तालिका '%{oii_table/}' पर DirectQuery मोड में एकाधिक विभाजन नहीं बना सकते. केवल एकल DirectQuery विभाजन समर्थित है.Öआप प्रकार निकाय की हाइब्रिड तालिका '%{oii_table/}' पर विभाजन नहीं बना सकते, जो DirectQuery स्रोत के रूप में अन्य Power BI, SAP या Azure विश्लेषण सेवाएँ (AAS) डेटासेट को संदर्भित करता है. कृपया इस विभाजन को निकालें.ƿआप तालिका '%{oii_table/}' को रीयल-टाइम विभाजन के साथ वृद्धिशील-रीफ़्रेश तालिका के रूप में कॉन्फ़िगर नहीं कर सकते क्योंकि डेटा क्वेरी व्यंजक '%d{datasourceNumber/}' डेटा स्रोतों को संदर्भित करता है. वास्तविक समय विभाजन के साथ एक इन्क्रीमेंटल रीफ़्रेश तालिका केवल एक डेटा स्रोत का उपयोग कर सकती है. कृपया केवल एकल डेटा स्रोत का उपयोग करने के लिए तालिका व्यंजक को संशोधित करें. अधिक जानने के लिए https://go.microsoft.com/fwlink/?linkid=2172127 देखें.\पैरेंट प्रकार '%{type/}' के लिए ChangedProperty ऑब्जेक्ट में '%{property/}' का गुण असंगत है.pपैरेंट प्रकार '%{parentType/}' के लिए ExcludedArtifact ऑब्जेक्ट में '%{ArtifactType/}' का ArtifactType असंगत है.]FormatString changedProperty ऑब्जेक्ट संग्रह पहले से मौजूद है और डुप्लिकेट की अनुमति नहीं है.YCaption changedProperty ऑब्जेक्ट संग्रह पहले से मौजूद है और डुप्लिकेट की अनुमति नहीं हैं.Wविवरण changedProperty ऑब्जेक्ट संग्रह पहले से मौजूद है और डुप्लिकेट की अनुमति नहीं हैं._DisplayFolder changedProperty ऑब्जेक्ट संग्रह पहले से मौजूद है और डुप्लिकेट की अनुमति नहीं हैं.iगैर-groupby AlternateOf (जैसे Sum/Min/Max) की विवरण तालिका '%{oii_table/}' DirectQuery तालिका होनी चाहिए.}जब उसकी विवरण तालिका '%{oii_basetable/}' ड्युअल मोड में है, तो समूहन तालिका '%{oii_table/}' DirectQuery मोड में नहीं हो सकती.
combined_dataset/train/non-malicious/sample_47_87.ps1
sample_47_87.ps1
# # Module manifest for module 'OCI.PSModules.Objectstorage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Objectstorage.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '2d17e379-676f-4800-9582-5814d9a8df00' # 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 Objectstorage 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.2.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Objectstorage.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 = 'Copy-OCIObjectstorageObject', 'Get-OCIObjectstorageBucket', 'Get-OCIObjectstorageBucketsList', 'Get-OCIObjectstorageMultipartUploadPartsList', 'Get-OCIObjectstorageMultipartUploadsList', 'Get-OCIObjectstorageNamespace', 'Get-OCIObjectstorageNamespaceMetadata', 'Get-OCIObjectstorageObject', 'Get-OCIObjectstorageObjectLifecyclePolicy', 'Get-OCIObjectstorageObjectsList', 'Get-OCIObjectstorageObjectVersionsList', 'Get-OCIObjectstoragePreauthenticatedRequest', 'Get-OCIObjectstoragePreauthenticatedRequestsList', 'Get-OCIObjectstorageReplicationPoliciesList', 'Get-OCIObjectstorageReplicationPolicy', 'Get-OCIObjectstorageReplicationSourcesList', 'Get-OCIObjectstorageRetentionRule', 'Get-OCIObjectstorageRetentionRulesList', 'Get-OCIObjectstorageWorkRequest', 'Get-OCIObjectstorageWorkRequestErrorsList', 'Get-OCIObjectstorageWorkRequestLogsList', 'Get-OCIObjectstorageWorkRequestsList', 'Invoke-OCIObjectstorageCommitMultipartUpload', 'Invoke-OCIObjectstorageHeadBucket', 'Invoke-OCIObjectstorageHeadObject', 'Invoke-OCIObjectstorageMakeBucketWritable', 'Invoke-OCIObjectstorageReencryptBucket', 'Invoke-OCIObjectstorageReencryptObject', 'New-OCIObjectstorageBucket', 'New-OCIObjectstorageMultipartUpload', 'New-OCIObjectstoragePreauthenticatedRequest', 'New-OCIObjectstorageReplicationPolicy', 'New-OCIObjectstorageRetentionRule', 'Remove-OCIObjectstorageBucket', 'Remove-OCIObjectstorageObject', 'Remove-OCIObjectstorageObjectLifecyclePolicy', 'Remove-OCIObjectstoragePreauthenticatedRequest', 'Remove-OCIObjectstorageReplicationPolicy', 'Remove-OCIObjectstorageRetentionRule', 'Rename-OCIObjectstorageObject', 'Restore-OCIObjectstorageObjects', 'Stop-OCIObjectstorageMultipartUpload', 'Stop-OCIObjectstorageWorkRequest', 'Update-OCIObjectstorageBucket', 'Update-OCIObjectstorageNamespaceMetadata', 'Update-OCIObjectstorageRetentionRule', 'Update-OCIObjectstorageTier', 'Write-OCIObjectstorageObject', 'Write-OCIObjectstorageObjectLifecyclePolicy', 'Write-OCIObjectstoragePart', 'Write-OCIObjectstorageuploadmanagerObject' # 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','Objectstorage' # 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/2223.ps1
2223.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")] [ValidateNotNullOrEmpty()] [string]$SiteServer, [parameter(Mandatory=$true, HelpMessage="Specify installation method")] [ValidateNotNullOrEmpty()] [ValidateSet("Install","Uninstall")] [string]$Method, [parameter(Mandatory=$true, HelpMessage="Specify a valid path to where the Clean Software Update Groups script file will be stored")] [ValidateNotNullOrEmpty()] [ValidatePattern("^[A-Za-z]{1}:\\\w+")] [ValidateScript({ if ((Split-Path -Path $_ -Leaf).IndexOfAny([IO.Path]::GetInvalidFileNameChars()) -ge 0) { throw "$(Split-Path -Path $_ -Leaf) contains invalid characters" } else { if (Test-Path -Path $_ -PathType Container) { return $true } else { throw "Unable to locate part of or the whole specified path, specify a valid path" } } })] [string]$Path ) Begin { try { $CurrentIdentity = [Security.Principal.WindowsIdentity]::GetCurrent() $WindowsPrincipal = New-Object Security.Principal.WindowsPrincipal -ArgumentList $CurrentIdentity if (-not($WindowsPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))) { Write-Warning -Message "Script was not executed elevated, please re-launch." ; break } } catch { Write-Warning -Message $_.Exception.Message ; break } $ScriptRoot = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent if ($env:SMS_ADMIN_UI_PATH -ne $null) { try { if (Test-Path -Path $env:SMS_ADMIN_UI_PATH -PathType Container -ErrorAction Stop) { Write-Verbose -Message "ConfigMgr console environment variable detected: $($env:SMS_ADMIN_UI_PATH)" } } catch [Exception] { Write-Warning -Message $_.Exception.Message ; break } } else { Write-Warning -Message "ConfigMgr console environment variable was not detected" ; break } $XMLFile = "CleanSoftwareUpdateGroups.xml" $ScriptFile = "Clean-CMSoftwareUpdateGroups.ps1" $Node = "23e7a3fe-b0f0-4b24-813a-dc425239f9a2" if (-not(Test-Path -Path (Join-Path -Path $ScriptRoot -ChildPath $XMLFile) -PathType Leaf -ErrorAction SilentlyContinue)) { Write-Warning -Message "Unable to determine location for '$($XMLFile)'. Make sure it's present in '$($ScriptRoot)'." ; break } if (-not(Test-Path -Path (Join-Path -Path $ScriptRoot -ChildPath $ScriptFile) -PathType Leaf -ErrorAction SilentlyContinue)) { Write-Warning -Message "Unable to determine location for '$($ScriptFile)'. Make sure it's present in '$($ScriptRoot)'." ; break } $AdminConsoleRoot = ($env:SMS_ADMIN_UI_PATH).Substring(0,$env:SMS_ADMIN_UI_PATH.Length-9) $FolderList = New-Object -TypeName System.Collections.ArrayList $FolderList.AddRange(@( (Join-Path -Path $AdminConsoleRoot -ChildPath "XmlStorage\Extensions\Actions\$($Node)") )) | Out-Null foreach ($CurrentNode in $FolderList) { if (-not(Test-Path -Path $CurrentNode -PathType Container)) { Write-Verbose -Message "Creating folder: '$($CurrentNode)'" New-Item -Path $CurrentNode -ItemType Directory -Force | Out-Null } else { Write-Verbose -Message "Found folder: '$($CurrentNode)'" } } } Process { switch ($Method) { "Install" { if (Test-Path -Path (Join-Path -Path $ScriptRoot -ChildPath $XMLFile) -PathType Leaf -ErrorAction SilentlyContinue) { Write-Verbose -Message "Editing '$($XMLFile)' to contain the correct path to script file" $XMLDataFilePath = Join-Path -Path $ScriptRoot -ChildPath $XMLFile [xml]$XMLDataFile = Get-Content -Path $XMLDataFilePath $XMLDataFile.ActionDescription.ActionGroups.ActionDescription.Executable | Where-Object { $_.FilePath -like "*powershell.exe*" } | ForEach-Object { $_.Parameters = $_.Parameters.Replace(" } $XMLDataFile.Save($XMLDataFilePath) } else { Write-Warning -Message "Unable to load '$($XMLFile)' from '$($Path)'. Make sure the file is located in the same folder as the installation script." ; break } Write-Verbose -Message "Copying '$($XMLFile)' to Software Update Groups node action folder" $XMLStorageSUGArgs = @{ Path = Join-Path -Path $ScriptRoot -ChildPath $XMLFile Destination = Join-Path -Path $AdminConsoleRoot -ChildPath "XmlStorage\Extensions\Actions\$($Node)\$($XMLFile)" Force = $true } Copy-Item @XMLStorageSUGArgs Write-Verbose -Message "Copying '$($ScriptFile)' to: '$($Path)'" $ScriptFileArgs = @{ Path = Join-Path -Path $ScriptRoot -ChildPath $ScriptFile Destination = Join-Path -Path $Path -ChildPath $ScriptFile Force = $true } Copy-Item @ScriptFileArgs } "Uninstall" { Write-Verbose -Message "Removing '$($XMLFile)' from Software Update Groups node action folder" $XMLStorageSUGArgs = @{ Path = Join-Path -Path $AdminConsoleRoot -ChildPath "XmlStorage\Extensions\Actions\$($Node)\$($XMLFile)" Force = $true ErrorAction = "SilentlyContinue" } if (Test-Path -Path (Join-Path -Path $AdminConsoleRoot -ChildPath "XmlStorage\Extensions\Actions\$($Node)\$($XMLFile)")) { Remove-Item @XMLStorageSUGArgs } else { Write-Warning -Message "Unable to locate '$(Join-Path -Path $AdminConsoleRoot -ChildPath "XmlStorage\Extensions\Actions\$($Node)\$($XMLFile)")'" } Write-Verbose -Message "Removing '$($ScriptFile)' from '$($Path)'" $ScriptFileArgs = @{ Path = Join-Path -Path $Path -ChildPath $ScriptFile Force = $true } if (Test-Path -Path (Join-Path -Path $Path -ChildPath $ScriptFile)) { Remove-Item @ScriptFileArgs } else { Write-Warning -Message "Unable to locate '$(Join-Path -Path $Path -ChildPath $ScriptFile)'" } } } }