full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/Get-MACFromIP.ps1
Get-MACFromIP.ps1
Function Get-MACFromIP { param ($IPAddress) $sign = @" using System; using System.Collections.Generic; using System.Text; using System.Net; using System.Net.NetworkInformation; using System.Runtime.InteropServices; public static class NetUtils { [System.Runtime.InteropServices.DllImport("iphlpapi.dll", ExactSpelling = true)] static extern int SendARP(int DestIP, int SrcIP, byte[] pMacAddr, ref int PhyAddrLen); public static string GetMacAddress(String addr) { try { IPAddress IPaddr = IPAddress.Parse(addr); byte[] mac = new byte[6]; int L = 6; SendARP(BitConverter.ToInt32(IPaddr.GetAddressBytes(), 0), 0, mac, ref L); String macAddr = BitConverter.ToString(mac, 0, L); return (macAddr.Replace('-',':')); } catch (Exception ex) { return (ex.Message); } } } "@ $type = Add-Type -TypeDefinition $sign -Language CSharp -PassThru $type::GetMacAddress($IPAddress) }
combined_dataset/train/non-malicious/finddupe_7.ps1
finddupe_7.ps1
function Get-MD5([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.MD5CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.OpenRead(); $hashByteArray = $hashAlgorithm.ComputeHash($stream); $stream.Close(); ## We have to be sure that we close the file stream if any exceptions are thrown. trap { if ($stream -ne $null) { $stream.Close(); } break; } foreach ($byte in $hashByteArray) { if ($byte -lt 16) {$result += “0{0:X}” -f $byte } else { $result += “{0:X}” -f $byte }} return [string]$result; } write-host "Usage: finddupe.ps1 <directory/file #1> <directory/file #2> ... <directory/file #N> [-delete] [-noprompt]" $matches = 0 # initialize number of matches for summary. $files=$null $del = $false # delete duplicates $noprompt = $false # delete without prompting toggle for ($i=0;$i -ne $args.count; $i++) { if ($args[$i] -eq "-delete") { $del=$true;continue } else { if ($args[$i] -eq "-noprompt") { $noprompt=$true;continue } else { $files+=(dir $args[$i] -recurse | ? {$_.psiscontainer -ne $true}) } } } if ($files -eq $null) {write-host "No files found." -f red; exit} $files | % {$_.fullname} for ($i=0;$i -ne $files.count; $i++) # Cycle thru all files { if ($files[$i] -eq $null) {continue} $md5 = $null $filecheck = $files[$i] $files[$i] = $null for ($c=0;$c -ne $files.count; $c++) { if ($files[$c] -eq $null) {continue} # write-host "Comparing $filecheck and $($files[$c]) `r" -nonewline if ($filecheck.length -eq $files[$c].length) { #write-host "Comparing MD5 of $($filecheck.fullname) and $($files[$c].fullname) `r" -nonewline if ($md5 -eq $null) {$md5 = (get-md5 $filecheck)} if ($md5 -eq (get-md5 $files[$c])) { write-host "Size and MD5 match: " -fore red -nonewline "{0} and {1}" -f $filecheck.fullname, $files[$c].fullname $matches++ if ($del -eq $true) { if ($noprompt -eq $true) { del $files[$c].fullname;write-host "$($files[$c].fullname) deleted." -f Red } else { del $files[$c].fullname -confirm } } $files[$c] = $null } } } } write-host "" write-host "Number of Files checked: $($files.count)." # Display useful info; files checked and matches found. write-host "Number of matches found: $($matches)." write-host ""
combined_dataset/train/non-malicious/Start-ProcessAsAdministr.ps1
Start-ProcessAsAdministr.ps1
function Start-ProcessAsAdministrator { <# .ForwardHelpTargetName Start-Process .ForwardHelpCategory Cmdlet #> [CmdletBinding(DefaultParameterSetName='Default')] param( [Parameter(Mandatory=$true, Position=0)] [Alias('PSPath')] [ValidateNotNullOrEmpty()] [System.String] $FilePath, [Parameter(Position=1)] [Alias('Args')] [ValidateNotNullOrEmpty()] [System.String[]] $ArgumentList, [Parameter(ParameterSetName='Default')] [Alias('RunAs')] [ValidateNotNullOrEmpty()] [System.Management.Automation.PSCredential] $Credential, [ValidateNotNullOrEmpty()] [System.String] $WorkingDirectory, [Parameter(ParameterSetName='Default')] [Alias('Lup')] [Switch] $LoadUserProfile, [Parameter(ParameterSetName='Default')] [Alias('nnw')] [Switch] $NoNewWindow, [Switch] $PassThru, [Parameter(ParameterSetName='Default')] [Alias('RSE')] [ValidateNotNullOrEmpty()] [System.String] $RedirectStandardError, [Parameter(ParameterSetName='Default')] [Alias('RSI')] [ValidateNotNullOrEmpty()] [System.String] $RedirectStandardInput, [Parameter(ParameterSetName='Default')] [Alias('RSO')] [ValidateNotNullOrEmpty()] [System.String] $RedirectStandardOutput, [Switch] $Wait, [Parameter(ParameterSetName='UseShellExecute')] [ValidateNotNullOrEmpty()] [System.Diagnostics.ProcessWindowStyle] $WindowStyle, [Parameter(ParameterSetName='Default')] [Switch] $UseNewEnvironment ) process { $psBoundParameters = $psBoundParameters += @{"Verb"="runas"} Start-Process @psBoundParameters } }
combined_dataset/train/non-malicious/Deleted-ObjectsAD_2.ps1
Deleted-ObjectsAD_2.ps1
param( $Domen, [string[]]$ObjectsDeleted ) function Ping ($Name){ $ping = new-object System.Net.NetworkInformation.Ping if ($ping.send($Name).Status -eq "Success") {$True} else {$False} trap {Write-Verbose "Error Ping"; $False; continue} } [string[]]$ObjectPath [string[]]$Disks [string[]]$Info [string[]]$Computers $Computers = Get-QADComputer -Service $Domen -OSName '*XP*','*Vista*','*7*' -SizeLimit 0 -ErrorAction SilentlyContinue | Select-Object name -ExpandProperty name foreach ($Computer in $Computers){ $Alive = Ping $Computer if ($Alive -eq "True"){ Write-Host "Seach $Computer" -BackgroundColor Blue trap {Write-Host "Error WmiObject $Computer";Continue} $Disks += Get-WmiObject win32_logicaldisk -ComputerName $Computer -ErrorAction SilentlyContinue | Where-Object {$_.Size -ne $null} if ($Disks){ foreach ($Disk in $Disks){ if ($Disk.Name -like "*:*") { $Disk = $Disk.Name.Replace(":","$") } trap {Write-Host "Error ChildItem $Computer";Continue} $ObjectPath += Get-ChildItem "\\\\$Computer\\$Disk\\*" -Recurse -ErrorAction SilentlyContinue if ($ObjectPath){ foreach ($Object in $ObjectsDeleted){ $ObjectPath | Where-Object {$_.Name -like $Object} | % { $Path = $_.FullName; Remove-Item $_.FullName -Recurse -Force -ErrorAction SilentlyContinue; $Info += "" | Select-Object @{e={$Path};n='Path'},` @{e={"Delete"};n='Action'} } } } } } } } $Info | Format-Table -AutoSize -ErrorAction SilentlyContinue
combined_dataset/train/non-malicious/4178.ps1
4178.ps1
cls Set-Variable -Name App -Value $null Set-Variable -Name File -Force Set-Variable -Name GUID -Force Set-Variable -Name RelativePath -Scope Global -Force $MissingGUIDs = @() Function GetRelativePath { $Global:RelativePath=(split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\" } GetRelativePath $File = Import-Csv -Header GUID1 $Global:RelativePath"GUIDs.txt" Foreach ($GUID in $File) { $App = Get-WmiObject win32_product | Where-Object {$_.IdentifyingNumber -match $GUID.GUID1} $App If ($App.Name -like "") { $MissingGUIDs += $GUID.GUID1 } $App = $null } Write-Host Write-Host "Missing GUIDs" Write-Host "-------------" $MissingGUIDs Remove-Variable -Name App -Force Remove-Variable -Name File -Force Remove-Variable -Name GUID -Force Remove-Variable -Name MissingGUIDs -Force Remove-Variable -Name RelativePath -Scope Global -Force
combined_dataset/train/non-malicious/de04269d-38ca-4bb2-8559-9bd6072c319f.ps1
de04269d-38ca-4bb2-8559-9bd6072c319f.ps1
#========================================================================== # NAME: getunknownsids.ps1 # # AUTHOR: Stephen Wheet # Version: 4.0 # Date: 6/11/10 # # COMMENT: # This script was created to find unknown SIDs or old domain permissions # on folders. It ignores folders where inheirtance is turned on. # # This works on NETAPPS and WINDOWS servers. You will need the DLL's # # Version 2: completely changed the query method and ACL removal # Version 3: Added ability to query AD for servers, and handles getting # getting shares automatically from: # NETAPP FILERS # Windows servers # Version 4: Cleaned up folder checking and added checking for local # account checking so we could ignore. # #========================================================================== Function checkshare { Param($PassedShareName) Process { $path = "\\\\$serverFQDN\\$PassedShareName" $filename = $path.Replace("\\","-") + ".csv" #Place Headers on out-put file $list = "Task,Path,Access Entity," $list | format-table | Out-File "c:\\reports\\unknownsids\\$filename" #Populate Folders Array Write-Host "Writing results to : $filename" $date = Get-Date Write-Host $date Write-Host "Getting Folders in: $Path" #PSIscontainer means folders only [Array] $folders = Get-ChildItem -path $path -recurse | ? {$_.PSIsContainer} #Process data in array ForEach ($folder in [Array] $folders) { #Check to see if there are any folders If ($folder.pspath){ #Convert Powershell Provider Folder Path to standard folder path $PSPath = (Convert-Path $folder.pspath) Write-Host "Checking Dir: $PSPath" #Check to make sure valid If ($PSPath){ #Get the ACL's from each folder $error.clear() $acl = Get-Acl -Path $PSPath #Write log if no access if (!$?) { $errmsg = "Error,$PSPath,ACCESS DENIED" $errmsg | format-table | Out-File -append "$filename" } #end IF $ACL.Access | ?{!$_.IsInherited} | ?{ $_.IdentityReference -like $unknownsid -or $_.IdentityReference -like $olddomain } | % {$value = $_.IdentityReference.Value #Check for Local account $localsid = 0 If ($value -like $unknownsid){ $checkforlocal = $value.split("-") $total =$checkforlocal.count -1 @@ if ($checkforlocal[$total] -match "^100.$" -or $checkforlocal[$total] -match "^500"){ $localsid = 1 # You can uncomment the below if you want to report on local accounts. #$list = ("Local,$PSPath,$value") #$list | format-table | Out-File -append "$filename" } #end IF } #end IF If (!$localsid){ Write-host "Found - $PSPath - $value" $list = ("Found,$PSPath,$value") $list | format-table | Out-File -append "$filename" #Remove Bad SID if ($removeacl) { $ACL.RemoveAccessRuleSpecific($_) Write-host "Deleting - $PSPath - $value" $list = ("Deleting,$PSPath,$value") $list | format-table | Out-File -append "$filename" }#end IF if ($removeacl -and $value) { $date = Get-Date Write-Host $date Write-host "Setting - $PSPath" $list = ("Setting,$PSPath") $list | format-table | Out-File -append "$filename" Set-ACL $PSpath $ACL $value = "" } #end IF } #end if } #end foreachobj } #end if } #end if } #end ForEach }#end Process } #end function get-pssnapin -registered | add-pssnapin -passthru [void][Reflection.Assembly]::LoadFile('C:\\reports\\ManageOntap.dll') #Need this DLL from netapp 3.5SDK $ReqVersion = [version]"1.2.2.1254" $QadVersion = (Get-PSSnapin Quest.ActiveRoles.ADManagement).Version #Need Quest plugins installed if($QadVersion -lt $ReqVersion) { throw "Quest AD cmdlets version '$ReqVersion' is required. Please download the latest version" } #end If #Set variables $value = "" $unknownsid = "*S-1-5-21-*" #Broken SID Verify the Broken SID number on your system and replace $olddomain = "Domain.local*" #Old w2k/nt4 domain $ErrorActionPreference = "SilentlyContinue" $removeacl = 0 #change to 1 if you want to remove the SID, 0 for only logging $localsid = 0 #Get all the servers from the specified OU $Servers = get-QADComputer -SearchRoot 'domain.local/ou/Server' # change the container. Foreach ($server in $Servers ) { $serverFQDN = $server.dnsname write-host $serverFQDN #Test ping server to make sure it's up before querying it $ping = new-object System.Net.NetworkInformation.Ping $Reply = $ping.Send($serverFQDN) if ($Reply.status -eq "Success"){ Write-Host "Online" #Check for Netapp .. if found get the shares differently If ($serverFQDN -like "*netapp*"){ $server = new-object netapp.manage.naserver($serverFQDN,1,0) #pass authentication $server.Style = "RPC" # Issue command to get the shares $NaElement = New-Object NetApp.Manage.NaElement("system-cli") $arg = New-Object NetApp.Manage.NaElement("args") $arg.AddNewChild('arg','cifs') $arg.AddNewChild('arg','shares') $NaElement.AddChildElement($arg) $CifsString = $server.InvokeElem($NaElement).GetChildContent("cli-output") # Split the returned txt up .. the $null makes it skip a line $null,$null,$Lines = $CifsString.Split("`n") Foreach ($line in $Lines ) { # Had to trick it so skip the line with permissions, then exclude ETC$ adn c$ if (!$line.startswith(" ") -and $line -notlike "*Etc$*" -and $line -notlike "*C$*"){ $l= $line.Split(" ") checkshare -PassedShareName $l[0] #Pass share to function } #end if } #end foreach } #end if Else{ #Else if a Windows server query via WMI Get-WMIObject Win32_Share -Computer $serverFQDN | where {$_.Name -like "*$*" -and $_.Name -notlike "*ADMIN*" -and $_.Name -notlike "*IPC*" -and $_.Name -notlike "*lib*"} | %{ #Set path $sharename = $_.name checkshare -PassedShareName $sharename #Pass share to function } #end ForEachObj } #End Else } #End If } #end ForEach
combined_dataset/train/non-malicious/sample_24_44.ps1
sample_24_44.ps1
# # Module manifest for module 'OCI.PSModules.Servicemanagerproxy' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicemanagerproxy.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '01ac6ca4-c358-4958-baf9-455f6dd1de04' # 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 Servicemanagerproxy 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.Servicemanagerproxy.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-OCIServicemanagerproxyServiceEnvironment', 'Get-OCIServicemanagerproxyServiceEnvironmentsList' # 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','Servicemanagerproxy' # 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/Shell.ShellLink.ps1
Shell.ShellLink.ps1
## With thanks to Steve McMahon and his article: ## http://vbaccelerator.com/home/NET/Code/Libraries/Shell_Projects/Creating_and_Modifying_Shortcuts/article.asp ## ## After executing Add-Type, below, you'll be able to: ## new-object Shell.ShellLink ".\\Some Shortcut.lnk" Add-Type -Ref System.Drawing, System.Windows.Forms @' using System; using System.ComponentModel; using System.Drawing; using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Windows.Forms; namespace Shell { /// <summary> /// Enables extraction of icons for any file type from /// the Shell. /// </summary> public class FileIcon { #region UnmanagedCode private const int MAX_PATH = 260; [StructLayout(LayoutKind.Sequential)] private struct SHFILEINFO { public IntPtr hIcon; public int iIcon; public int dwAttributes; [MarshalAs(UnmanagedType.ByValTStr, SizeConst=MAX_PATH)] public string szDisplayName; [MarshalAs(UnmanagedType.ByValTStr, SizeConst=80)] public string szTypeName; } [DllImport("shell32")] private static extern int SHGetFileInfo ( string pszPath, int dwFileAttributes, ref SHFILEINFO psfi, uint cbFileInfo, uint uFlags); [DllImport("user32.dll")] private static extern int DestroyIcon(IntPtr hIcon); private const int FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x100; private const int FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x2000; private const int FORMAT_MESSAGE_FROM_HMODULE = 0x800; private const int FORMAT_MESSAGE_FROM_STRING = 0x400; private const int FORMAT_MESSAGE_FROM_SYSTEM = 0x1000; private const int FORMAT_MESSAGE_IGNORE_INSERTS = 0x200; private const int FORMAT_MESSAGE_MAX_WIDTH_MASK = 0xFF; [DllImport("kernel32")] private extern static int FormatMessage ( int dwFlags, IntPtr lpSource, int dwMessageId, int dwLanguageId, string lpBuffer, uint nSize, int argumentsLong); [DllImport("kernel32")] private extern static int GetLastError(); #endregion #region Member Variables private string fileName; private string displayName; private string typeName; private SHGetFileInfoConstants flags; private Icon fileIcon; #endregion #region Enumerations [Flags] public enum SHGetFileInfoConstants : int { SHGFI_ICON = 0x100, // get icon SHGFI_DISPLAYNAME = 0x200, // get display name SHGFI_TYPENAME = 0x400, // get type name SHGFI_ATTRIBUTES = 0x800, // get attributes SHGFI_ICONLOCATION = 0x1000, // get icon location SHGFI_EXETYPE = 0x2000, // return exe type SHGFI_SYSICONINDEX = 0x4000, // get system icon index SHGFI_LINKOVERLAY = 0x8000, // put a link overlay on icon SHGFI_SELECTED = 0x10000, // show icon in selected state SHGFI_ATTR_SPECIFIED = 0x20000, // get only specified attributes SHGFI_LARGEICON = 0x0, // get large icon SHGFI_SMALLICON = 0x1, // get small icon SHGFI_OPENICON = 0x2, // get open icon SHGFI_SHELLICONSIZE = 0x4, // get shell size icon //SHGFI_PIDL = 0x8, // pszPath is a pidl SHGFI_USEFILEATTRIBUTES = 0x10, // use passed dwFileAttribute SHGFI_ADDOVERLAYS = 0x000000020, // apply the appropriate overlays SHGFI_OVERLAYINDEX = 0x000000040 // Get the index of the overlay } #endregion #region Implementation /// <summary> /// Gets/sets the flags used to extract the icon /// </summary> public FileIcon.SHGetFileInfoConstants Flags { get { return flags; } set { flags = value; } } /// <summary> /// Gets/sets the filename to get the icon for /// </summary> public string FileName { get { return fileName; } set { fileName = value; } } /// <summary> /// Gets the icon for the chosen file /// </summary> public Icon ShellIcon { get { return fileIcon; } } /// <summary> /// Gets the display name for the selected file /// if the SHGFI_DISPLAYNAME flag was set. /// </summary> public string DisplayName { get { return displayName; } } /// <summary> /// Gets the type name for the selected file /// if the SHGFI_TYPENAME flag was set. /// </summary> public string TypeName { get { return typeName; } } /// <summary> /// Gets the information for the specified /// file name and flags. /// </summary> public void GetInfo() { fileIcon = null; typeName = ""; displayName = ""; SHFILEINFO shfi = new SHFILEINFO(); uint shfiSize = (uint)Marshal.SizeOf(shfi.GetType()); int ret = SHGetFileInfo( fileName, 0, ref shfi, shfiSize, (uint)(flags)); if (ret != 0) { if (shfi.hIcon != IntPtr.Zero) { fileIcon = System.Drawing.Icon.FromHandle(shfi.hIcon); // Now owned by the GDI+ object //DestroyIcon(shfi.hIcon); } typeName = shfi.szTypeName; displayName = shfi.szDisplayName; } else { int err = GetLastError(); Console.WriteLine("Error {0}", err); string txtS = new string('\\0', 256); int len = FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, IntPtr.Zero, err, 0, txtS, 256, 0); Console.WriteLine("Len {0} text {1}", len, txtS); // throw exception } } /// <summary> /// Constructs a new, default instance of the FileIcon /// class. Specify the filename and call GetInfo() /// to retrieve an icon. /// </summary> public FileIcon() { flags = SHGetFileInfoConstants.SHGFI_ICON | SHGetFileInfoConstants.SHGFI_DISPLAYNAME | SHGetFileInfoConstants.SHGFI_TYPENAME | SHGetFileInfoConstants.SHGFI_ATTRIBUTES | SHGetFileInfoConstants.SHGFI_EXETYPE; } /// <summary> /// Constructs a new instance of the FileIcon class /// and retrieves the icon, display name and type name /// for the specified file. /// </summary> /// <param name="fileName">The filename to get the icon, /// display name and type name for</param> public FileIcon(string fileName) : this() { this.fileName = fileName; GetInfo(); } /// <summary> /// Constructs a new instance of the FileIcon class /// and retrieves the information specified in the /// flags. /// </summary> /// <param name="fileName">The filename to get information /// for</param> /// <param name="flags">The flags to use when extracting the /// icon and other shell information.</param> public FileIcon(string fileName, FileIcon.SHGetFileInfoConstants flags) { this.fileName = fileName; this.flags = flags; GetInfo(); } #endregion } #region ShellLink Object /// <summary> /// Summary description for ShellLink. /// </summary> public class ShellLink : IDisposable { #region ComInterop for IShellLink #region IPersist Interface [ComImportAttribute()] [GuidAttribute("0000010C-0000-0000-C000-000000000046")] [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] private interface IPersist { [PreserveSig] //[helpstring("Returns the class identifier for the component object")] void GetClassID(out Guid pClassID); } #endregion #region IPersistFile Interface [ComImportAttribute()] [GuidAttribute("0000010B-0000-0000-C000-000000000046")] [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] private interface IPersistFile { // can't get this to go if I extend IPersist, so put it here: [PreserveSig] void GetClassID(out Guid pClassID); //[helpstring("Checks for changes since last file write")] void IsDirty(); //[helpstring("Opens the specified file and initializes the object from its contents")] void Load( [MarshalAs(UnmanagedType.LPWStr)] string pszFileName, uint dwMode); //[helpstring("Saves the object into the specified file")] void Save( [MarshalAs(UnmanagedType.LPWStr)] string pszFileName, [MarshalAs(UnmanagedType.Bool)] bool fRemember); //[helpstring("Notifies the object that save is completed")] void SaveCompleted( [MarshalAs(UnmanagedType.LPWStr)] string pszFileName); //[helpstring("Gets the current name of the file associated with the object")] void GetCurFile( [MarshalAs(UnmanagedType.LPWStr)] out string ppszFileName); } #endregion #region IShellLink Interface [ComImportAttribute()] [GuidAttribute("000214EE-0000-0000-C000-000000000046")] [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] private interface IShellLinkA { //[helpstring("Retrieves the path and filename of a shell link object")] void GetPath( [Out(), MarshalAs(UnmanagedType.LPStr)] StringBuilder pszFile, int cchMaxPath, ref _WIN32_FIND_DATAA pfd, uint fFlags); //[helpstring("Retrieves the list of shell link item identifiers")] void GetIDList(out IntPtr ppidl); //[helpstring("Sets the list of shell link item identifiers")] void SetIDList(IntPtr pidl); //[helpstring("Retrieves the shell link description string")] void GetDescription( [Out(), MarshalAs(UnmanagedType.LPStr)] StringBuilder pszFile, int cchMaxName); //[helpstring("Sets the shell link description string")] void SetDescription( [MarshalAs(UnmanagedType.LPStr)] string pszName); //[helpstring("Retrieves the name of the shell link working directory")] void GetWorkingDirectory( [Out(), MarshalAs(UnmanagedType.LPStr)] StringBuilder pszDir, int cchMaxPath); //[helpstring("Sets the name of the shell link working directory")] void SetWorkingDirectory( [MarshalAs(UnmanagedType.LPStr)] string pszDir); //[helpstring("Retrieves the shell link command-line arguments")] void GetArguments( [Out(), MarshalAs(UnmanagedType.LPStr)] StringBuilder pszArgs, int cchMaxPath); //[helpstring("Sets the shell link command-line arguments")] void SetArguments( [MarshalAs(UnmanagedType.LPStr)] string pszArgs); //[propget, helpstring("Retrieves or sets the shell link hot key")] void GetHotkey(out short pwHotkey); //[propput, helpstring("Retrieves or sets the shell link hot key")] void SetHotkey(short pwHotkey); //[propget, helpstring("Retrieves or sets the shell link show command")] void GetShowCmd(out uint piShowCmd); //[propput, helpstring("Retrieves or sets the shell link show command")] void SetShowCmd(uint piShowCmd); //[helpstring("Retrieves the location (path and index) of the shell link icon")] void GetIconLocation( [Out(), MarshalAs(UnmanagedType.LPStr)] StringBuilder pszIconPath, int cchIconPath, out int piIcon); //[helpstring("Sets the location (path and index) of the shell link icon")] void SetIconLocation( [MarshalAs(UnmanagedType.LPStr)] string pszIconPath, int iIcon); //[helpstring("Sets the shell link relative path")] void SetRelativePath( [MarshalAs(UnmanagedType.LPStr)] string pszPathRel, uint dwReserved); //[helpstring("Resolves a shell link. The system searches for the shell link object and updates the shell link path and its list of identifiers (if necessary)")] void Resolve( IntPtr hWnd, uint fFlags); //[helpstring("Sets the shell link path and filename")] void SetPath( [MarshalAs(UnmanagedType.LPStr)] string pszFile); } [ComImportAttribute()] [GuidAttribute("000214F9-0000-0000-C000-000000000046")] [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] private interface IShellLinkW { //[helpstring("Retrieves the path and filename of a shell link object")] void GetPath( [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile, int cchMaxPath, ref _WIN32_FIND_DATAW pfd, uint fFlags); //[helpstring("Retrieves the list of shell link item identifiers")] void GetIDList(out IntPtr ppidl); //[helpstring("Sets the list of shell link item identifiers")] void SetIDList(IntPtr pidl); //[helpstring("Retrieves the shell link description string")] void GetDescription( [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile, int cchMaxName); //[helpstring("Sets the shell link description string")] void SetDescription( [MarshalAs(UnmanagedType.LPWStr)] string pszName); //[helpstring("Retrieves the name of the shell link working directory")] void GetWorkingDirectory( [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszDir, int cchMaxPath); //[helpstring("Sets the name of the shell link working directory")] void SetWorkingDirectory( [MarshalAs(UnmanagedType.LPWStr)] string pszDir); //[helpstring("Retrieves the shell link command-line arguments")] void GetArguments( [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszArgs, int cchMaxPath); //[helpstring("Sets the shell link command-line arguments")] void SetArguments( [MarshalAs(UnmanagedType.LPWStr)] string pszArgs); //[propget, helpstring("Retrieves or sets the shell link hot key")] void GetHotkey(out short pwHotkey); //[propput, helpstring("Retrieves or sets the shell link hot key")] void SetHotkey(short pwHotkey); //[propget, helpstring("Retrieves or sets the shell link show command")] void GetShowCmd(out uint piShowCmd); //[propput, helpstring("Retrieves or sets the shell link show command")] void SetShowCmd(uint piShowCmd); //[helpstring("Retrieves the location (path and index) of the shell link icon")] void GetIconLocation( [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszIconPath, int cchIconPath, out int piIcon); //[helpstring("Sets the location (path and index) of the shell link icon")] void SetIconLocation( [MarshalAs(UnmanagedType.LPWStr)] string pszIconPath, int iIcon); //[helpstring("Sets the shell link relative path")] void SetRelativePath( [MarshalAs(UnmanagedType.LPWStr)] string pszPathRel, uint dwReserved); //[helpstring("Resolves a shell link. The system searches for the shell link object and updates the shell link path and its list of identifiers (if necessary)")] void Resolve( IntPtr hWnd, uint fFlags); //[helpstring("Sets the shell link path and filename")] void SetPath( [MarshalAs(UnmanagedType.LPWStr)] string pszFile); } #endregion #region ShellLinkCoClass [GuidAttribute("00021401-0000-0000-C000-000000000046")] [ClassInterfaceAttribute(ClassInterfaceType.None)] [ComImportAttribute()] private class CShellLink{} #endregion #region Private IShellLink enumerations private enum EShellLinkGP : uint { SLGP_SHORTPATH = 1, SLGP_UNCPRIORITY = 2 } [Flags] private enum EShowWindowFlags : uint { SW_HIDE = 0, SW_SHOWNORMAL = 1, SW_NORMAL = 1, SW_SHOWMINIMIZED = 2, SW_SHOWMAXIMIZED = 3, SW_MAXIMIZE = 3, SW_SHOWNOACTIVATE = 4, SW_SHOW = 5, SW_MINIMIZE = 6, SW_SHOWMINNOACTIVE = 7, SW_SHOWNA = 8, SW_RESTORE = 9, SW_SHOWDEFAULT = 10, SW_MAX = 10 } #endregion #region IShellLink Private structs [StructLayoutAttribute(LayoutKind.Sequential, Pack=4, Size=0, CharSet=CharSet.Unicode)] private struct _WIN32_FIND_DATAW { public uint dwFileAttributes; public _FILETIME ftCreationTime; public _FILETIME ftLastAccessTime; public _FILETIME ftLastWriteTime; public uint nFileSizeHigh; public uint nFileSizeLow; public uint dwReserved0; public uint dwReserved1; [MarshalAs(UnmanagedType.ByValTStr , SizeConst = 260)] // MAX_PATH public string cFileName; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)] public string cAlternateFileName; } [StructLayoutAttribute(LayoutKind.Sequential, Pack=4, Size=0, CharSet=CharSet.Ansi)] private struct _WIN32_FIND_DATAA { public uint dwFileAttributes; public _FILETIME ftCreationTime; public _FILETIME ftLastAccessTime; public _FILETIME ftLastWriteTime; public uint nFileSizeHigh; public uint nFileSizeLow; public uint dwReserved0; public uint dwReserved1; [MarshalAs(UnmanagedType.ByValTStr , SizeConst = 260)] // MAX_PATH public string cFileName; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)] public string cAlternateFileName; } [StructLayoutAttribute(LayoutKind.Sequential, Pack=4, Size=0)] private struct _FILETIME { public uint dwLowDateTime; public uint dwHighDateTime; } #endregion #region UnManaged Methods private class UnManagedMethods { [DllImport("Shell32", CharSet=CharSet.Auto)] internal extern static int ExtractIconEx ( [MarshalAs(UnmanagedType.LPTStr)] string lpszFile, int nIconIndex, IntPtr[] phIconLarge, IntPtr[] phIconSmall, int nIcons); [DllImport("user32")] internal static extern int DestroyIcon(IntPtr hIcon); } #endregion #endregion #region Enumerations /// <summary> /// Flags determining how the links with missing /// targets are resolved. /// </summary> [Flags] public enum EShellLinkResolveFlags : uint { /// <summary> /// Allow any match during resolution. Has no effect /// on ME/2000 or above, use the other flags instead. /// </summary> SLR_ANY_MATCH = 0x2, /// <summary> /// Call the Microsoft Windows Installer. /// </summary> SLR_INVOKE_MSI = 0x80, /// <summary> /// Disable distributed link tracking. By default, /// distributed link tracking tracks removable media /// across multiple devices based on the volume name. /// It also uses the UNC path to track remote file /// systems whose drive letter has changed. Setting /// SLR_NOLINKINFO disables both types of tracking. /// </summary> SLR_NOLINKINFO = 0x40, /// <summary> /// Do not display a dialog box if the link cannot be resolved. /// When SLR_NO_UI is set, a time-out value that specifies the /// maximum amount of time to be spent resolving the link can /// be specified in milliseconds. The function returns if the /// link cannot be resolved within the time-out duration. /// If the timeout is not set, the time-out duration will be /// set to the default value of 3,000 milliseconds (3 seconds). /// </summary> SLR_NO_UI = 0x1, /// <summary> /// Not documented in SDK. Assume same as SLR_NO_UI but /// intended for applications without a hWnd. /// </summary> SLR_NO_UI_WITH_MSG_PUMP = 0x101, /// <summary> /// Do not update the link information. /// </summary> SLR_NOUPDATE = 0x8, /// <summary> /// Do not execute the search heuristics. /// </summary> SLR_NOSEARCH = 0x10, /// <summary> /// Do not use distributed link tracking. /// </summary> SLR_NOTRACK = 0x20, /// <summary> /// If the link object has changed, update its path and list /// of identifiers. If SLR_UPDATE is set, you do not need to /// call IPersistFile::IsDirty to determine whether or not /// the link object has changed. /// </summary> SLR_UPDATE = 0x4 } public enum LinkDisplayMode : uint { edmNormal = EShowWindowFlags.SW_NORMAL, edmMinimized = EShowWindowFlags.SW_SHOWMINNOACTIVE, edmMaximized = EShowWindowFlags.SW_MAXIMIZE } #endregion #region Member Variables // Use Unicode (W) under NT, otherwise use ANSI private IShellLinkW linkW; private IShellLinkA linkA; private string shortcutFile = ""; #endregion #region Constructor /// <summary> /// Creates an instance of the Shell Link object. /// </summary> public ShellLink() { if (System.Environment.OSVersion.Platform == PlatformID.Win32NT) { linkW = (IShellLinkW)new CShellLink(); } else { linkA = (IShellLinkA)new CShellLink(); } } /// <summary> /// Creates an instance of a Shell Link object /// from the specified link file /// </summary> /// <param name="linkFile">The Shortcut file to open</param> public ShellLink(string linkFile) : this() { Open(linkFile); } #endregion #region Destructor and Dispose /// <summary> /// Call dispose just in case it hasn't happened yet /// </summary> ~ShellLink() { Dispose(); } /// <summary> /// Dispose the object, releasing the COM ShellLink object /// </summary> public void Dispose() { if (linkW != null ) { Marshal.ReleaseComObject(linkW); linkW = null; } if (linkA != null) { Marshal.ReleaseComObject(linkA); linkA = null; } } #endregion #region Implementation public string ShortCutFile { get { return this.shortcutFile; } set { this.shortcutFile = value; } } /// <summary> /// Gets a System.Drawing.Icon containing the icon for this /// ShellLink object. /// </summary> private Icon getIcon(bool large) { // Get icon index and path: int iconIndex = 0; // If there are no details set for the icon, then we must use // the shell to get the icon for the target: if (String.IsNullOrEmpty(IconPath)) { // Use the FileIcon object to get the icon: FileIcon.SHGetFileInfoConstants flags = FileIcon.SHGetFileInfoConstants.SHGFI_ICON | FileIcon.SHGetFileInfoConstants.SHGFI_ATTRIBUTES; if (large) { flags = flags | FileIcon.SHGetFileInfoConstants.SHGFI_LARGEICON; } else { flags = flags | FileIcon.SHGetFileInfoConstants.SHGFI_SMALLICON; } FileIcon fileIcon = new FileIcon(Target, flags); return fileIcon.ShellIcon; } else { // Use ExtractIconEx to get the icon: IntPtr[] hIconEx = new IntPtr[1] {IntPtr.Zero}; int iconCount = 0; if (large) { iconCount = UnManagedMethods.ExtractIconEx( IconPath, iconIndex, hIconEx, null, 1); } else { iconCount = UnManagedMethods.ExtractIconEx( IconPath, iconIndex, null, hIconEx, 1); } // If success then return as a GDI+ object Icon icon = null; if (hIconEx[0] != IntPtr.Zero) { icon = Icon.FromHandle(hIconEx[0]); //UnManagedMethods.DestroyIcon(hIconEx[0]); } return icon; } } /// <summary> /// Gets the path to the file containing the icon for this shortcut. /// </summary> public string IconPath { get { StringBuilder iconPath = new StringBuilder(260, 260); int iconIndex = 0; if (linkA == null) { linkW.GetIconLocation(iconPath, iconPath.Capacity, out iconIndex); } else { linkA.GetIconLocation(iconPath, iconPath.Capacity, out iconIndex); } if(iconIndex > 0) { iconPath.AppendFormat(",{0}",iconIndex); } return iconPath.ToString(); } set { StringBuilder iconPath = new StringBuilder(260, 260); String iconLocation = String.Empty; int iconIndex = 0; String[] oldPath = Regex.Split(value, ",(?=\\\\d+$)"); if(oldPath.Length > 1) { iconLocation = oldPath[0]; iconIndex = Int32.Parse(oldPath[1]); } else { iconLocation = value; } if(iconIndex == 0) { if (linkA == null) { linkW.GetIconLocation(iconPath, iconPath.Capacity, out iconIndex); } else { linkA.GetIconLocation(iconPath, iconPath.Capacity, out iconIndex); } if(!iconLocation.Equals(iconPath.ToString(), StringComparison.InvariantCulture)) { iconIndex = 0; } } if (linkA == null) { linkW.SetIconLocation(iconLocation, iconIndex); } else { linkA.SetIconLocation(iconLocation, iconIndex); } } } /// <summary> /// Gets the index of this icon within the icon path's resources /// </summary> public int IconIndex { get { StringBuilder iconPath = new StringBuilder(260, 260); int iconIndex = 0; if (linkA == null) { linkW.GetIconLocation(iconPath, iconPath.Capacity, out iconIndex); } else { linkA.GetIconLocation(iconPath, iconPath.Capacity, out iconIndex); } return iconIndex; } set { StringBuilder iconPath = new StringBuilder(260, 260); int iconIndex = 0; if (linkA == null) { linkW.GetIconLocation(iconPath, iconPath.Capacity, out iconIndex); } else { linkA.GetIconLocation(iconPath, iconPath.Capacity, out iconIndex); } if (linkA == null) { linkW.SetIconLocation(iconPath.ToString(), value); } else { linkA.SetIconLocation(iconPath.ToString(), value); } } } /// <summary> /// Gets/sets the fully qualified path to the link's target /// </summary> public string Target { get { StringBuilder target = new StringBuilder(260, 260); if (linkA == null) { _WIN32_FIND_DATAW fd = new _WIN32_FIND_DATAW(); linkW.GetPath(target, target.Capacity, ref fd, (uint)EShellLinkGP.SLGP_UNCPRIORITY); } else { _WIN32_FIND_DATAA fd = new _WIN32_FIND_DATAA(); linkA.GetPath(target, target.Capacity, ref fd, (uint)EShellLinkGP.SLGP_UNCPRIORITY); } return target.ToString(); } set { if (linkA == null) { linkW.SetPath(value); } else { linkA.SetPath(value); } } } /// <summary> /// Gets/sets the Working Directory for the Link /// </summary> public string WorkingDirectory { get { StringBuilder path = new StringBuilder(260, 260); if (linkA == null) { linkW.GetWorkingDirectory(path, path.Capacity); } else { linkA.GetWorkingDirectory(path, path.Capacity); } return path.ToString(); } set { if (linkA == null) { linkW.SetWorkingDirectory(value); } else { linkA.SetWorkingDirectory(value); } } } /// <summary> /// Gets/sets the description of the link /// </summary> public string Description { get { StringBuilder description = new StringBuilder(1024, 1024); if (linkA == null) { linkW.GetDescription(description, description.Capacity); } else { linkA.GetDescription(description, description.Capacity); } return description.ToString(); } set { if (linkA == null) { linkW.SetDescription(value); } else { linkA.SetDescription(value); } } } /// <summary> /// Gets/sets any command line arguments associated with the link /// </summary> public string Arguments { get { StringBuilder arguments = new StringBuilder(260, 260); if (linkA == null) { linkW.GetArguments(arguments, arguments.Capacity); } else { linkA.GetArguments(arguments, arguments.Capacity); } return arguments.ToString(); } set { if (linkA == null) { linkW.SetArguments(value); } else { linkA.SetArguments(value); } } } /// <summary> /// Gets/sets the initial display mode when the shortcut is /// run /// </summary> public LinkDisplayMode DisplayMode { get { uint cmd = 0; if (linkA == null) { linkW.GetShowCmd(out cmd); } else { linkA.GetShowCmd(out cmd); } return (LinkDisplayMode)cmd; } set { if (linkA == null) { linkW.SetShowCmd((uint)value); } else { linkA.SetShowCmd((uint)value); } } } /// <summary> /// Gets/sets the HotKey to start the shortcut (if any) /// </summary> public Keys HotKey { get { short key = 0; if (linkA == null) { linkW.GetHotkey(out key); } else { linkA.GetHotkey(out key); } return (Keys)key; } set { if (linkA == null) { linkW.SetHotkey((short)value); } else { linkA.SetHotkey((short)value); } } } /// <summary> /// Saves the shortcut to ShortCutFile. /// </summary> public void Save() { Save(shortcutFile); } /// <summary> /// Saves the shortcut to the specified file /// </summary> /// <param name="linkFile">The shortcut file (.lnk)</param> public void Save( string linkFile ) { // Save the object to disk if (linkA == null) { ((IPersistFile)linkW).Save(linkFile, true); shortcutFile = linkFile; } else { ((IPersistFile)linkA).Save(linkFile, true); shortcutFile = linkFile; } } /// <summary> /// Loads a shortcut from the specified file /// </summary> /// <param name="linkFile">The shortcut file (.lnk) to load</param> public void Open( string linkFile ) { Open(linkFile, IntPtr.Zero, (EShellLinkResolveFlags.SLR_ANY_MATCH | EShellLinkResolveFlags.SLR_NO_UI), 1); } /// <summary> /// Loads a shortcut from the specified file, and allows flags controlling /// the UI behaviour if the shortcut's target isn't found to be set. /// </summary> /// <param name="linkFile">The shortcut file (.lnk) to load</param> /// <param name="hWnd">The window handle of the application's UI, if any</param> /// <param name="resolveFlags">Flags controlling resolution behaviour</param> public void Open( string linkFile, IntPtr hWnd, EShellLinkResolveFlags resolveFlags ) { Open(linkFile, hWnd, resolveFlags, 1); } /// <summary> /// Loads a shortcut from the specified file, and allows flags controlling /// the UI behaviour if the shortcut's target isn't found to be set. If /// no SLR_NO_UI is specified, you can also specify a timeout. /// </summary> /// <param name="linkFile">The shortcut file (.lnk) to load</param> /// <param name="hWnd">The window handle of the application's UI, if any</param> /// <param name="resolveFlags">Flags controlling resolution behaviour</param> /// <param name="timeOut">Timeout if SLR_NO_UI is specified, in ms.</param> public void Open( string linkFile, IntPtr hWnd, EShellLinkResolveFlags resolveFlags, ushort timeOut ) { uint flags; if ((resolveFlags & EShellLinkResolveFlags.SLR_NO_UI) == EShellLinkResolveFlags.SLR_NO_UI) { flags = (uint)((int)resolveFlags | (timeOut << 16)); } else { flags = (uint)resolveFlags; } if (linkA == null) { ((IPersistFile)linkW).Load(linkFile, 0); //STGM_DIRECT) linkW.Resolve(hWnd, flags); this.shortcutFile = linkFile; } else { ((IPersistFile)linkA).Load(linkFile, 0); //STGM_DIRECT) linkA.Resolve(hWnd, flags); this.shortcutFile = linkFile; } } #endregion } #endregion } '@
combined_dataset/train/non-malicious/sample_53_65.ps1
sample_53_65.ps1
# # Module manifest for module 'OCI.PSModules.Dataflow' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dataflow.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '60441277-1663-4d77-af11-39ab99c7ac41' # 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 Dataflow 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 = '82.0.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Dataflow.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-OCIDataflowApplication', 'Get-OCIDataflowApplicationsList', 'Get-OCIDataflowPool', 'Get-OCIDataflowPoolsList', 'Get-OCIDataflowPrivateEndpoint', 'Get-OCIDataflowPrivateEndpointsList', 'Get-OCIDataflowRun', 'Get-OCIDataflowRunLog', 'Get-OCIDataflowRunLogsList', 'Get-OCIDataflowRunsList', 'Get-OCIDataflowSqlEndpoint', 'Get-OCIDataflowSqlEndpointsList', 'Get-OCIDataflowStatement', 'Get-OCIDataflowStatementsList', 'Get-OCIDataflowWorkRequest', 'Get-OCIDataflowWorkRequestErrorsList', 'Get-OCIDataflowWorkRequestLogsList', 'Get-OCIDataflowWorkRequestsList', 'Move-OCIDataflowApplicationCompartment', 'Move-OCIDataflowPoolCompartment', 'Move-OCIDataflowPrivateEndpointCompartment', 'Move-OCIDataflowRunCompartment', 'Move-OCIDataflowSqlEndpointCompartment', 'New-OCIDataflowApplication', 'New-OCIDataflowPool', 'New-OCIDataflowPrivateEndpoint', 'New-OCIDataflowRun', 'New-OCIDataflowSqlEndpoint', 'New-OCIDataflowStatement', 'Remove-OCIDataflowApplication', 'Remove-OCIDataflowPool', 'Remove-OCIDataflowPrivateEndpoint', 'Remove-OCIDataflowRun', 'Remove-OCIDataflowSqlEndpoint', 'Remove-OCIDataflowStatement', 'Start-OCIDataflowPool', 'Stop-OCIDataflowPool', 'Update-OCIDataflowApplication', 'Update-OCIDataflowPool', 'Update-OCIDataflowPrivateEndpoint', 'Update-OCIDataflowRun', 'Update-OCIDataflowSqlEndpoint' # 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','Dataflow' # 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/wpf datagrid xaml.ps1
wpf datagrid xaml.ps1
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="Window" Title="DataGrid Binding" Width="640" Height="480"> <Grid > <TextBlock Height="24" Margin="8,8,8,0" TextWrapping="Wrap" Text="DataGrid" VerticalAlignment="Top" FontSize="18.667" FontFamily="Arial" FontWeight="Bold"/> <DataGrid HorizontalAlignment="Left" Margin="8,82,0,8" Width="240" Name="HadesDevices" AutoGenerateColumns="True"> <DataGrid.Columns> <DataGridTextColumn Binding="{Binding Path=DeviceGroup}" Header="Manufacturer"></DataGridTextColumn> <DataGridTextColumn Binding="{Binding Path=Device}" Header="Model"></DataGridTextColumn> <DataGridTextColumn Binding="{Binding Path=Platform}" Header="Platform"></DataGridTextColumn> </DataGrid.Columns> </DataGrid> </Grid> </Window>
combined_dataset/train/non-malicious/2176.ps1
2176.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Specify the Primary Site server")] [ValidateScript({Test-Connection -ComputerName $_ -Count 2})] [string]$SiteServer = "$($env:COMPUTERNAME)", [parameter(Mandatory=$true, HelpMessage="Specify the name of a Distribution Point Group")] [string]$DPGName, [parameter(Mandatory=$false, HelpMessage="Specify the name of a Distribution Point Group")] [int]$CreatedDaysAgo = 1 ) 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" } try { Write-Verbose "Importing Configuration Manager module" Write-Debug ((($env:SMS_ADMIN_UI_PATH).Substring(0,$env:SMS_ADMIN_UI_PATH.Length-5)) + "\ConfigurationManager.psd1") Import-Module ((($env:SMS_ADMIN_UI_PATH).Substring(0,$env:SMS_ADMIN_UI_PATH.Length-5)) + "\ConfigurationManager.psd1") -Force -ErrorAction Stop -Verbose:$false if ((Get-PSDrive $SiteCode -ErrorAction SilentlyContinue -Verbose:$false | Measure-Object).Count -ne 1) { New-PSDrive -Name $SiteCode -PSProvider "AdminUI.PS.Provider\CMSite" -Root $SiteServer -ErrorAction Stop -Verbose:$false } Set-Location ($SiteCode + ":") -Verbose:$false } catch [Exception] { Throw $_.Exception.Message } } Process { try { $DPG = Get-WmiObject -Namespace "root\SMS\site_$($SiteCode)" -Class SMS_DistributionPointGroup -ComputerName $SiteServer -Filter "Name = '$($DPGName)'" if (($DPG | Measure-Object).Count -eq 1) { Write-Verbose "Found Distribution Point Group: $($DPG.Name)" } elseif (($DPG | Measure-Object).Count -gt 1) { Throw "Query for DPGs returned more than 1 object" } else { Throw "Unable to determine Distribution Point Group name from specified string for parameter 'DPGName'" } } catch [Exception] { Throw $_.Exception.Message } try { Write-Verbose "Enumerating applicable Applications" if ($PSBoundParameters["CreatedDaysAgo"]) { $Applications = Get-CMApplication -Verbose:$false | Select-Object LocalizedDisplayName, PackageID, DateCreated | Where-Object { $_.DateCreated -ge (Get-Date).AddDays(-$CreatedDaysAgo) } } else { $Applications = Get-CMApplication -Verbose:$false | Select-Object LocalizedDisplayName, PackageID } foreach ($Application in $Applications) { if (-not(Get-WmiObject -Namespace "root\SMS\site_$($SiteCode)" -Class SMS_DPGroupDistributionStatusDetails -ComputerName $SiteServer -Filter "PackageID = '$($Application.PackageID)'" -ErrorAction SilentlyContinue)) { if ($PSCmdlet.ShouldProcess("$($DPG.Name)", "Distribute Application: $($Application.LocalizedDisplayName)")) { $DPG.AddPackages($Application.PackageID) | Out-Null } } } Set-Location C: } catch [Exception] { Throw $_.Exception.Message } }
combined_dataset/train/non-malicious/chkhash_19.ps1
chkhash_19.ps1
# calculate SHA512 of file. function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.OpenRead(); $hashByteArray = $hashAlgorithm.ComputeHash($stream); $stream.Close(); ## We have to be sure that we close the file stream if any exceptions are thrown. trap { if ($stream -ne $null) { $stream.Close(); } break; } foreach ($byte in $hashByteArray) { if ($byte -lt 16) {$result += “0{0:X}” -f $byte } else { $result += “{0:X}” -f $byte }} return [string]$result; } function noequal ( $first, $second) { if (!($second) -or $second -eq "") {return $true} $first=join-path $first "\\" foreach($s in $second) { if ($first.tolower().startswith($s.tolower())) {return $false} } return $true } # chkhash.ps1 [file(s)/dir #1] [file(s)/dir #2] ... [file(s)/dir #3] [-u] [-h [path of .xml database]] # -u updates the XML file database and exits # otherwise, all files are checked against the XML file database. # -h specifies location of xml hash database $hashespath=".\\hashes.xml" del variable:\\args3 -ea 0 del variable:\\args2 -ea 0 del variable:\\xfiles -ea 0 del variable:\\files -ea 0 del variable:\\exclude -ea 0 $args3=@() $args2=@($args) $nu = 0 $errs = 0 $fc = 0 $fm = 0 $upd = $false $create = $false "ChkHash.ps1 - ChkHash.ps1 can create a .XML database of files and their SHA-512 hashes and check files against the database, " "in order to detect corrupt or hacked files." "" ".\\chkhash.ps1 -h for usage." "" for($i=0;$i -lt $args2.count; $i++) { if ($args2[$i] -like "-h*") # -help specified? { "Usage: .\\chkhash.ps1 [-h] [-u] [-c] [-x <file path of hashes .xml database>] [file(s)/dir #1] [file(s)/dir #2] ... [file(s)/dir #n] [-e <Dirs>]" "Options: -h - Help display." " -c - Create hash database. If .xml hash database does not exist, -c will be assumed." " -u - Update changed files and add new files to existing database." " -x - specifies .xml database file path to use. Default is .\\hashes.xml" " -e - exclude dirs. Put this after the files/dirs you want to check with SHA512 and needs to be fullpath (e.g. c:\\users\\bob not ..\\bob)." "" "Examples: PS>.\\chkhash.ps1 c:\\ d:\\ -c -x c:\\users\\bob\\hashes\\hashes.xml" " [hash all files on c:\\ and d:\\ and subdirs, create and store hashes in c:\\users\\bob\\hashes\\hashes.xml]" " PS>.\\chkhash.ps1 c:\\users\\alice\\pictures\\sunset.jpg -u -x c:\\users\\alice\\hashes\\pictureshashes.xml]" " [hash c:\\users\\alice\\pictures\\sunset.jpg and add or update the hash to c:\\users\\alice\\hashes\\picturehashes.xml" " PS>.\\chkhash.ps1 c:\\users\\eve\\documents d:\\media\\movies -x c:\\users\\eve\\hashes\\private.xml" " [hash all files in c:\\users\\eve\\documents and d:\\media\\movies, check against hashes stored in c:\\users\\eve\\hashes\\private.xml" " or create it and store hashes there if not present]" " PS>.\\chkhash.ps1 c:\\users\\eve -x c:\\users\\eve\\hashes\\private.xml -e c:\\users\\eve\\hashes" " [hash all files in c:\\users\\eve and subdirs, check hashes against c:\\users\\eve\\hashes\\private.xml or store if not present, exclude " " c:\\users\\eve\\hashes directory and subdirs]" " PS>.\\chkhash.p1s c:\\users\\ted\\documents\\f* d:\\data -x d:\\hashes.xml -e d:\\data\\test d:\\data\\favorites -u" " [hash all files starting with 'f' in c:\\users\\ted\\documents, and all files in d:\\data, add or update hashes to" " existing d:\\hashes.xml, exclude d:\\data\\test and d:\\data\\favorites and subdirs]" " PS>.\\chkhash -x c:\\users\\alice\\hashes\\hashes.xml" " [Load hashes.xml and check hashes of all files contained within.]" "" "Note: files in subdirectories of any specified directory are automatically processed." " if you specify only an -x option, or no option and .\\hash.xml exists, only files in the database will be checked." exit } if ($args2[$i] -like "-u*") {$upd=$true;continue} # Update and Add new files to database? if ($args2[$i] -like "-c*") {$create=$true;continue} # Create database specified? if ($args2[$i] -like "-x*") { $i++ # Get hashes xml database path if ($i -ge $args2.count) { write-host "-X specified but no file path of .xml database specified. Exiting." exit } $hashespath=$args2[$i] continue } if ($args2[$i] -like "-e*") # Exclude files, dirs { while (($i+1) -lt $args2.count) { $i++ if ($args2[$i] -like "-*") {break} $exclude+=@(join-path $args2[$i] "\\") # collect array of excluded directories. } continue } $args3+=@($args2[$i]) # Add files/dirs } if ($args3.count -ne 0) { # Get list of files and SHA512 hash them. "Enumerating files from specified locations..." $files=@(dir $args3 -recurse -ea 0 | ?{$_.mode -notmatch "d"} | ?{noequal $_.directoryname $exclude}) # Get list of files if ($files.count -eq 0) {"No files found. Exiting."; exit} if ($create -eq $true -or !(test-path $hashespath)) # Create database? { # Create SHA512 hashes of files and write to new database $files = $files | %{write-host "SHA-512 Hashing `"$($_.fullname)`" ...";add-member -inputobject $_ -name SHA512 -membertype noteproperty -value $(get-SHA512 $_.fullname) -passthru} $files |export-clixml $hashespath "Created $hashespath" "$($files.count) file hash(es) saved. Exiting." exit } write-host "Loading file hashes from $hashespath..." -nonewline $xfiles=@(import-clixml $hashespath|?{noequal $_.directoryname $exclude}) # Load database if ($xfiles.count -eq 0) {"No files specified and no files in Database. Exiting.";Exit} } else { if (!(test-path $hashespath)) {"No database found or specified, exiting."; exit} write-host "Loading file hashes from $hashespath..." -nonewline $xfiles=@(import-clixml $hashespath|?{noequal $_.directoryname $exclude}) # Load database and check it if ($xfiles.count -eq 0) {"No files specified and no files in Database. Exiting.";Exit} $files=$xfiles } "Loaded $($xfiles.count) file hash(es)." $hash=@{} for($x=0;$x -lt $xfiles.count; $x++) # Build dictionary (hash) of filenames and indexes into file array { if ($hash.contains($xfiles[$x].fullname)) {continue} $hash.Add($xfiles[$x].fullname,$x) } foreach($f in $files) { if ((get-item -ea 0 $f.fullname) -eq $null) {continue} # skip if file no longer exists. $n=($hash.($f.fullname)) if ($n -eq $null) { $nu++ # increment needs/needed updating count if ($upd -eq $false) {"Needs to be added: `"$($f.fullname)`"";continue} # if not updating, then continue "SHA-512 Hashing `"$($f.fullname)`" ..." # Create SHA512 hash of file $f=$f |%{add-member -inputobject $_ -name SHA512 -membertype noteproperty -value $(get-SHA512 $_.fullname) -passthru -force} $xfiles+=@($f) # then add file + hash to list continue } $f=$f |%{add-member -inputobject $_ -name SHA512 -membertype noteproperty -value $(get-SHA512 $_.fullname) -passthru -force} $fc++ # File checked increment. if ($xfiles[$n].SHA512 -eq $f.SHA512) # Check SHA512 for mixmatch. {$fm++;continue} # if matched, increment file matches and continue loop $errs++ # increment mixmatches if ($upd -eq $true) { $xfiles[$n]=$f; "Updated `"$($f.fullname)`"";continue} "Bad SHA-512 found: `"$($f.fullname)`"" } if ($upd -eq $true) # if database updated { $xfiles|export-clixml $hashespath # write xml database "Updated $hashespath" "$nu file hash(es) added to database." "$errs file hash(es) updated in database." exit } "$errs SHA-512 mixmatch(es) found." "$fm file(s) SHA512 matched." "$fc file(s) checked total." if ($nu -ne 0) {"$nu file(s) need to be added [run with -u option to Add file hashes to database]."}
combined_dataset/train/non-malicious/3626.ps1
3626.ps1
function Test-BasicDataClassificationOnSqlManagedDatabase { $testSuffix = getAssetName Create-ManagedDataClassificationTestEnvironment $testSuffix $params = Get-DataClassificationManagedTestEnvironmentParameters $testSuffix try { $recommendations = Get-AzSqlInstanceDatabaseSensitivityRecommendation -ResourceGroupName $params.rgname -InstanceName $params.serverName -DatabaseName $params.databaseName Assert-AreEqual 0 ($recommendations.SensitivityLabels).count Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.serverName $recommendations.InstanceName Assert-AreEqual $params.databaseName $recommendations.DatabaseName $recommendations = Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.serverName -Name $params.databaseName | Get-AzSqlInstanceDatabaseSensitivityRecommendation Assert-AreEqual 0 ($recommendations.SensitivityLabels).count Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.serverName $recommendations.InstanceName Assert-AreEqual $params.databaseName $recommendations.DatabaseName $allClassifications = Get-AzSqlInstanceDatabaseSensitivityClassification -ResourceGroupName $params.rgname -InstanceName $params.serverName -DatabaseName $params.databaseName Assert-AreEqual 0 ($allClassifications.SensitivityLabels).count Assert-AreEqual $params.rgname $allClassifications.ResourceGroupName Assert-AreEqual $params.serverName $allClassifications.InstanceName Assert-AreEqual $params.databaseName $allClassifications.DatabaseName $allClassifications = Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.serverName -Name $params.databaseName | Get-AzSqlInstanceDatabaseSensitivityClassification Assert-AreEqual 0 ($allClassifications.SensitivityLabels).count Assert-AreEqual $params.rgname $allClassifications.ResourceGroupName Assert-AreEqual $params.serverName $allClassifications.InstanceName Assert-AreEqual $params.databaseName $allClassifications.DatabaseName Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.serverName -Name $params.databaseName | Get-AzSqlInstanceDatabaseSensitivityRecommendation | Set-AzSqlInstanceDatabaseSensitivityClassification Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.serverName -Name $params.databaseName | Get-AzSqlInstanceDatabaseSensitivityClassification | Remove-AzSqlInstanceDatabaseSensitivityClassification } finally { Remove-DataClassificationManagedTestEnvironment $testSuffix } } function Test-DataClassificationOnSqlManagedDatabase { $testSuffix = getAssetName Create-ManagedDataClassificationTestEnvironment $testSuffix $params = Get-DataClassificationManagedTestEnvironmentParameters $testSuffix try { $recommendations = Get-AzSqlInstanceDatabaseSensitivityRecommendation -ResourceGroupName $params.rgname -InstanceName $params.ServerName -DatabaseName $params.databaseName Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.ServerName $recommendations.InstanceName Assert-AreEqual $params.databaseName $recommendations.DatabaseName $recommendationsCount = ($recommendations.SensitivityLabels).count Assert-AreEqual 4 $recommendationsCount $firstRecommendation = ($recommendations.SensitivityLabels)[0] $firstSchemaName = $firstRecommendation.SchemaName $firstTableName = $firstRecommendation.TableName $firstColumnName = $firstRecommendation.ColumnName $firstInformationType = $firstRecommendation.InformationType $firstSensitivityLabel = $firstRecommendation.SensitivityLabel Assert-AreEqual "dbo" $firstSchemaName Assert-AreEqual "Persons" $firstTableName Assert-NotNullOrEmpty $firstColumnName Assert-NotNullOrEmpty $firstInformationType Assert-NotNullOrEmpty $firstSensitivityLabel $secondRecommendation = ($recommendations.SensitivityLabels)[1] $secondSchemaName = $secondRecommendation.SchemaName $secondTableName = $secondRecommendation.TableName $secondColumnName = $secondRecommendation.ColumnName $secondInformationType = $secondRecommendation.InformationType $secondSensitivityLabel = $secondRecommendation.SensitivityLabel Assert-AreEqual "dbo" $secondSchemaName Assert-AreEqual "Persons" $secondTableName Assert-NotNullOrEmpty $secondColumnName Assert-NotNullOrEmpty $secondInformationType Assert-NotNullOrEmpty $secondSensitivityLabel Set-AzSqlInstanceDatabaseSensitivityClassification -ResourceGroupName $params.rgname -InstanceName $params.ServerName -DatabaseName $params.databaseName -SchemaName $firstSchemaName -TableName $firstTableName -ColumnName $firstColumnName -InformationType $firstInformationType -SensitivityLabel $firstSensitivityLabel Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.ServerName -Name $params.databaseName | Set-AzSqlInstanceDatabaseSensitivityClassification -SchemaName $secondSchemaName -TableName $secondTableName -ColumnName $secondColumnName -InformationType $secondInformationType -SensitivityLabel $secondSensitivityLabel $allClassifications = Get-AzSqlInstanceDatabaseSensitivityClassification -ResourceGroupName $params.rgname -InstanceName $params.ServerName -DatabaseName $params.databaseName $allClassificationsCount = ($allClassifications.SensitivityLabels).count Assert-AreEqual 2 $allClassificationsCount Assert-AreEqual $params.rgname $allClassifications.ResourceGroupName Assert-AreEqual $params.ServerName $allClassifications.InstanceName Assert-AreEqual $params.databaseName $allClassifications.DatabaseName $firstClassification = Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.ServerName -Name $params.databaseName | Get-AzSqlInstanceDatabaseSensitivityClassification -SchemaName $firstSchemaName -TableName $firstTableName -ColumnName $firstColumnName Assert-AreEqual 1 ($firstClassification.SensitivityLabels).count $classification = ($firstClassification.SensitivityLabels)[0] Assert-AreEqual $firstSchemaName $classification.SchemaName Assert-AreEqual $firstTableName $classification.TableName Assert-AreEqual $firstColumnName $classification.ColumnName Assert-AreEqual $firstInformationType $classification.InformationType Assert-AreEqual $firstSensitivityLabel $classification.SensitivityLabel $secondClassification = Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.ServerName -Name $params.databaseName | Get-AzSqlInstanceDatabaseSensitivityClassification -SchemaName $secondSchemaName -TableName $secondTableName -ColumnName $secondColumnName Assert-AreEqual 1 ($secondClassification.SensitivityLabels).count $classification = ($secondClassification.SensitivityLabels)[0] Assert-AreEqual $secondSchemaName $classification.SchemaName Assert-AreEqual $secondTableName $classification.TableName Assert-AreEqual $secondColumnName $classification.ColumnName Assert-AreEqual $secondInformationType $classification.InformationType Assert-AreEqual $secondSensitivityLabel $classification.SensitivityLabel $recommendations = Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.ServerName -Name $params.databaseName | Get-AzSqlInstanceDatabaseSensitivityRecommendation Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.ServerName $recommendations.InstanceName Assert-AreEqual $params.databaseName $recommendations.DatabaseName Assert-AreEqual 2 ($recommendations.SensitivityLabels).count Remove-AzSqlInstanceDatabaseSensitivityClassification -ResourceGroupName $params.rgname -InstanceName $params.ServerName -DatabaseName $params.databaseName -SchemaName $secondSchemaName -TableName $secondTableName -ColumnName $secondColumnName $allClassifications = Get-AzSqlInstanceDatabaseSensitivityClassification -ResourceGroupName $params.rgname -InstanceName $params.ServerName -DatabaseName $params.databaseName $allClassificationsCount = ($allClassifications.SensitivityLabels).count Assert-AreEqual 1 $allClassificationsCount Assert-AreEqual $params.rgname $allClassifications.ResourceGroupName Assert-AreEqual $params.ServerName $allClassifications.InstanceName Assert-AreEqual $params.databaseName $allClassifications.DatabaseName $recommendations = Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.ServerName -Name $params.databaseName | Get-AzSqlInstanceDatabaseSensitivityRecommendation Assert-AreEqual 3 ($recommendations.SensitivityLabels).count Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.ServerName $recommendations.InstanceName Assert-AreEqual $params.databaseName $recommendations.DatabaseName Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.ServerName -Name $params.databaseName | Get-AzSqlInstanceDatabaseSensitivityRecommendation | Set-AzSqlInstanceDatabaseSensitivityClassification $recommendations = Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.ServerName -Name $params.databaseName | Get-AzSqlInstanceDatabaseSensitivityRecommendation Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.ServerName $recommendations.InstanceName Assert-AreEqual $params.databaseName $recommendations.DatabaseName Assert-AreEqual 0 ($recommendations.SensitivityLabels).count $allClassifications = Get-AzSqlInstanceDatabaseSensitivityClassification -ResourceGroupName $params.rgname -InstanceName $params.ServerName -DatabaseName $params.databaseName $allClassificationsCount = ($allClassifications.SensitivityLabels).count Assert-AreEqual 4 $allClassificationsCount Assert-AreEqual $params.rgname $allClassifications.ResourceGroupName Assert-AreEqual $params.ServerName $allClassifications.InstanceName Assert-AreEqual $params.databaseName $allClassifications.DatabaseName Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.ServerName -Name $params.databaseName | Remove-AzSqlInstanceDatabaseSensitivityClassification -SchemaName $secondSchemaName -TableName $secondTableName -ColumnName $secondColumnName $allClassifications = Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.ServerName -Name $params.databaseName | Get-AzSqlInstanceDatabaseSensitivityClassification $allClassificationsCount = ($allClassifications.SensitivityLabels).count Assert-AreEqual 3 $allClassificationsCount Assert-AreEqual $params.rgname $allClassifications.ResourceGroupName Assert-AreEqual $params.ServerName $allClassifications.InstanceName Assert-AreEqual $params.databaseName $allClassifications.DatabaseName Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.ServerName -Name $params.databaseName | Get-AzSqlInstanceDatabaseSensitivityClassification | Remove-AzSqlInstanceDatabaseSensitivityClassification $allClassifications = Get-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.ServerName -Name $params.databaseName | Get-AzSqlInstanceDatabaseSensitivityClassification $allClassificationsCount = ($allClassifications.SensitivityLabels).count Assert-AreEqual 0 $allClassificationsCount Assert-AreEqual $params.rgname $allClassifications.ResourceGroupName Assert-AreEqual $params.ServerName $allClassifications.InstanceName Assert-AreEqual $params.databaseName $allClassifications.DatabaseName } finally { Remove-DataClassificationManagedTestEnvironment $testSuffix } } function Test-DataClassificationOnSqlDatabase { $testSuffix = getAssetName Create-SqlDataClassificationTestEnvironment $testSuffix $params = Get-DataClassificationTestEnvironmentParameters $testSuffix try { $recommendations = Get-AzSqlDatabaseSensitivityRecommendation -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.serverName $recommendations.ServerName Assert-AreEqual $params.databaseName $recommendations.DatabaseName $recommendationsCount = ($recommendations.SensitivityLabels).count Assert-AreEqual 4 $recommendationsCount $firstRecommendation = ($recommendations.SensitivityLabels)[0] $firstSchemaName = $firstRecommendation.SchemaName $firstTableName = $firstRecommendation.TableName $firstColumnName = $firstRecommendation.ColumnName $firstInformationType = $firstRecommendation.InformationType $firstSensitivityLabel = $firstRecommendation.SensitivityLabel Assert-AreEqual "dbo" $firstSchemaName Assert-AreEqual "Persons" $firstTableName Assert-NotNullOrEmpty $firstColumnName Assert-NotNullOrEmpty $firstInformationType Assert-NotNullOrEmpty $firstSensitivityLabel $secondRecommendation = ($recommendations.SensitivityLabels)[1] $secondSchemaName = $secondRecommendation.SchemaName $secondTableName = $secondRecommendation.TableName $secondColumnName = $secondRecommendation.ColumnName $secondInformationType = $secondRecommendation.InformationType $secondSensitivityLabel = $secondRecommendation.SensitivityLabel Assert-AreEqual "dbo" $secondSchemaName Assert-AreEqual "Persons" $secondTableName Assert-NotNullOrEmpty $secondColumnName Assert-NotNullOrEmpty $secondInformationType Assert-NotNullOrEmpty $secondSensitivityLabel Set-AzSqlDatabaseSensitivityClassification -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName -SchemaName $firstSchemaName -TableName $firstTableName -ColumnName $firstColumnName -InformationType $firstInformationType -SensitivityLabel $firstSensitivityLabel Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Set-AzSqlDatabaseSensitivityClassification -SchemaName $secondSchemaName -TableName $secondTableName -ColumnName $secondColumnName -InformationType $secondInformationType -SensitivityLabel $secondSensitivityLabel $allClassifications = Get-AzSqlDatabaseSensitivityClassification -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName $allClassificationsCount = ($allClassifications.SensitivityLabels).count Assert-AreEqual 2 $allClassificationsCount Assert-AreEqual $params.rgname $allClassifications.ResourceGroupName Assert-AreEqual $params.serverName $allClassifications.ServerName Assert-AreEqual $params.databaseName $allClassifications.DatabaseName $firstClassification = Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Get-AzSqlDatabaseSensitivityClassification -SchemaName $firstSchemaName -TableName $firstTableName -ColumnName $firstColumnName Assert-AreEqual 1 ($firstClassification.SensitivityLabels).count $classification = ($firstClassification.SensitivityLabels)[0] Assert-AreEqual $firstSchemaName $classification.SchemaName Assert-AreEqual $firstTableName $classification.TableName Assert-AreEqual $firstColumnName $classification.ColumnName Assert-AreEqual $firstInformationType $classification.InformationType Assert-AreEqual $firstSensitivityLabel $classification.SensitivityLabel $secondClassification = Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Get-AzSqlDatabaseSensitivityClassification -SchemaName $secondSchemaName -TableName $secondTableName -ColumnName $secondColumnName Assert-AreEqual 1 ($secondClassification.SensitivityLabels).count $classification = ($secondClassification.SensitivityLabels)[0] Assert-AreEqual $secondSchemaName $classification.SchemaName Assert-AreEqual $secondTableName $classification.TableName Assert-AreEqual $secondColumnName $classification.ColumnName Assert-AreEqual $secondInformationType $classification.InformationType Assert-AreEqual $secondSensitivityLabel $classification.SensitivityLabel $recommendations = Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Get-AzSqlDatabaseSensitivityRecommendation Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.serverName $recommendations.ServerName Assert-AreEqual $params.databaseName $recommendations.DatabaseName Assert-AreEqual 2 ($recommendations.SensitivityLabels).count Remove-AzSqlDatabaseSensitivityClassification -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName -SchemaName $secondSchemaName -TableName $secondTableName -ColumnName $secondColumnName $allClassifications = Get-AzSqlDatabaseSensitivityClassification -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName $allClassificationsCount = ($allClassifications.SensitivityLabels).count Assert-AreEqual 1 $allClassificationsCount Assert-AreEqual $params.rgname $allClassifications.ResourceGroupName Assert-AreEqual $params.serverName $allClassifications.ServerName Assert-AreEqual $params.databaseName $allClassifications.DatabaseName $recommendations = Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Get-AzSqlDatabaseSensitivityRecommendation Assert-AreEqual 3 ($recommendations.SensitivityLabels).count Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.serverName $recommendations.ServerName Assert-AreEqual $params.databaseName $recommendations.DatabaseName Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Get-AzSqlDatabaseSensitivityRecommendation | Set-AzSqlDatabaseSensitivityClassification $recommendations = Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Get-AzSqlDatabaseSensitivityRecommendation Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.serverName $recommendations.ServerName Assert-AreEqual $params.databaseName $recommendations.DatabaseName Assert-AreEqual 0 ($recommendations.SensitivityLabels).count $allClassifications = Get-AzSqlDatabaseSensitivityClassification -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName $allClassificationsCount = ($allClassifications.SensitivityLabels).count Assert-AreEqual 4 $allClassificationsCount Assert-AreEqual $params.rgname $allClassifications.ResourceGroupName Assert-AreEqual $params.serverName $allClassifications.ServerName Assert-AreEqual $params.databaseName $allClassifications.DatabaseName Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Remove-AzSqlDatabaseSensitivityClassification -SchemaName $secondSchemaName -TableName $secondTableName -ColumnName $secondColumnName $allClassifications = Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Get-AzSqlDatabaseSensitivityClassification $allClassificationsCount = ($allClassifications.SensitivityLabels).count Assert-AreEqual 3 $allClassificationsCount Assert-AreEqual $params.rgname $allClassifications.ResourceGroupName Assert-AreEqual $params.serverName $allClassifications.ServerName Assert-AreEqual $params.databaseName $allClassifications.DatabaseName Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Get-AzSqlDatabaseSensitivityClassification | Remove-AzSqlDatabaseSensitivityClassification $allClassifications = Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Get-AzSqlDatabaseSensitivityClassification $allClassificationsCount = ($allClassifications.SensitivityLabels).count Assert-AreEqual 0 $allClassificationsCount Assert-AreEqual $params.rgname $allClassifications.ResourceGroupName Assert-AreEqual $params.serverName $allClassifications.ServerName Assert-AreEqual $params.databaseName $allClassifications.DatabaseName } finally { Remove-DataClassificationTestEnvironment $testSuffix } } function Test-ErrorIsThrownWhenInvalidClassificationIsSet { $testSuffix = getAssetName Create-SqlDataClassificationTestEnvironment $testSuffix $params = Get-DataClassificationTestEnvironmentParameters $testSuffix try { $recommendations = Get-AzSqlDatabaseSensitivityRecommendation -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName $recommendation = ($recommendations.SensitivityLabels)[0] $schemaName = $recommendation.SchemaName $tableName = $recommendation.TableName $columnName = $recommendation.ColumnName $informationType = $recommendation.InformationType $sensitivityLabel = $recommendation.SensitivityLabel $badInformationType = $informationType + $informationType $badInformationTypeMessage = "Information Type '" + $badinformationType + "' is not part of Information Protection Policy. Please add '" + $badinformationType + "' to the Information Protection Policy, or use one of the following: " Assert-ThrowsContains -script { Set-AzSqlDatabaseSensitivityClassification -ResourceGroupName $params.rgname -ServerName $params.serverName ` -DatabaseName $params.databaseName -SchemaName $schemaName -TableName $tableName -ColumnName $columnName -InformationType $badInformationType ` -SensitivityLabel $sensitivityLabel} -message $badInformationTypeMessage $badSensitivityLabel = $sensitivityLabel + $sensitivityLabel $badSensitivityLabelMessage = "Sensitivity Label '" + $badSensitivityLabel + "' is not part of Information Protection Policy. Please add '" + $badSensitivityLabel + "' to the Information Protection Policy, or use one of the following: " Assert-ThrowsContains -script { Set-AzSqlDatabaseSensitivityClassification -ResourceGroupName $params.rgname -ServerName $params.serverName ` -DatabaseName $params.databaseName -SchemaName $schemaName -TableName $tableName -ColumnName $columnName -InformationType $badInformationType ` -SensitivityLabel $badSensitivityLabel} -message $badSensitivityLabelMessage $message = "Value is not specified neither for InformationType parameter nor for SensitivityLabel parameter" Assert-ThrowsContains -script { Set-AzSqlDatabaseSensitivityClassification -ResourceGroupName $params.rgname -ServerName $params.serverName ` -DatabaseName $params.databaseName -SchemaName $schemaName -TableName $tableName -ColumnName $columnName} -message $message } finally { Remove-DataClassificationTestEnvironment $testSuffix } } function Assert-NotNullOrEmpty ($str) { Assert-NotNull $str Assert-AreNotEqual "" $str } function Get-DataClassificationTestEnvironmentParameters ($testSuffix) { return @{ rgname = "dc-cmdlet-test-rg" +$testSuffix; serverName = "dc-cmdlet-server" +$testSuffix; databaseName = "dc-cmdlet-db" + $testSuffix; loginName = "testlogin"; pwd = "testp@ssMakingIt1007Longer"; } } function Get-DataClassificationManagedTestEnvironmentParameters ($testSuffix) { return @{ rgname = "cl_one"; serverName = "dc-cmdlet-server" +$testSuffix; databaseName = "dc-cmdlet-db" + $testSuffix; loginName = "testlogin"; pwd = "testp@ssMakingIt1007Longer"; } } function Create-ManagedDataClassificationTestEnvironment ($testSuffix, $location = "North Europe") { $params = Get-DataClassificationManagedTestEnvironmentParameters $testSuffix New-AzureRmResourceGroup -Name $params.rgname -Location $location $vnetName = "cl_initial" $subnetName = "Cool" $virtualNetwork1 = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $location $subnetId = $virtualNetwork1.Subnets.where({ $_.Name -eq $subnetName })[0].Id $credentials = Get-ServerCredential $licenseType = "BasePrice" $storageSizeInGB = 32 $vCore = 16 $skuName = "GP_Gen4" $collation = "SQL_Latin1_General_CP1_CI_AS" $managedInstance = New-AzSqlInstance -ResourceGroupName $params.rgname -Name $params.serverName ` -Location $location -AdministratorCredential $credentials -SubnetId $subnetId ` -LicenseType $licenseType -StorageSizeInGB $storageSizeInGB -Vcore $vCore -SkuName $skuName New-AzSqlInstanceDatabase -ResourceGroupName $params.rgname -InstanceName $params.serverName -Name $params.databaseName -Collation $collation } function Remove-DataClassificationManagedTestEnvironment ($testSuffix) { $params = Get-DataClassificationManagedTestEnvironmentParameters $testSuffix Remove-AzureRmResourceGroup -Name $params.rgname -Force } function Remove-DataClassificationTestEnvironment ($testSuffix) { $params = Get-DataClassificationTestEnvironmentParameters $testSuffix Remove-AzureRmResourceGroup -Name $params.rgname -Force } function Create-SqlDataClassificationTestEnvironment ($testSuffix, $location = "West Central US", $serverVersion = "12.0") { $params = Get-DataClassificationTestEnvironmentParameters $testSuffix New-AzResourceGroup -Name $params.rgname -Location $location $password = $params.pwd $secureString = ($password | ConvertTo-SecureString -asPlainText -Force) $credentials = new-object System.Management.Automation.PSCredential($params.loginName, $secureString) New-AzSqlServer -ResourceGroupName $params.rgname -ServerName $params.serverName -ServerVersion $serverVersion -Location $location -SqlAdministratorCredentials $credentials New-AzSqlServerFirewallRule -ResourceGroupName $params.rgname -ServerName $params.serverName -StartIpAddress 0.0.0.0 -EndIpAddress 255.255.255.255 -FirewallRuleName "dcRule" New-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -eq "Record") { $fullServerName = $params.serverName + ".database.windows.net" $login = $params.loginName $databaseName = $params.databaseName $connection = New-Object System.Data.SqlClient.SqlConnection $connection.ConnectionString = "Server=$fullServerName;uid=$login;pwd=$password;Database=$databaseName;Integrated Security=False;" try { $connection.Open() $command = $connection.CreateCommand() $command.CommandText = "CREATE TABLE Persons (PersonID int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255));" $command.ExecuteReader() } finally { $connection.Close() } } } function Test-EnableDisableRecommendationsOnSqlDatabase { $testSuffix = getAssetName Create-SqlDataClassificationTestEnvironment $testSuffix $params = Get-DataClassificationTestEnvironmentParameters $testSuffix try { $recommendations = Get-AzSqlDatabaseSensitivityRecommendation -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.serverName $recommendations.ServerName Assert-AreEqual $params.databaseName $recommendations.DatabaseName $recommendationsCount = ($recommendations.SensitivityLabels).count Assert-AreEqual 4 $recommendationsCount $firstRecommendation = ($recommendations.SensitivityLabels)[0] $firstSchemaName = $firstRecommendation.SchemaName $firstTableName = $firstRecommendation.TableName $firstColumnName = $firstRecommendation.ColumnName $firstInformationType = $firstRecommendation.InformationType $firstSensitivityLabel = $firstRecommendation.SensitivityLabel Assert-AreEqual "dbo" $firstSchemaName Assert-AreEqual "Persons" $firstTableName Assert-NotNullOrEmpty $firstColumnName Assert-NotNullOrEmpty $firstInformationType Assert-NotNullOrEmpty $firstSensitivityLabel $secondRecommendation = ($recommendations.SensitivityLabels)[1] $secondSchemaName = $secondRecommendation.SchemaName $secondTableName = $secondRecommendation.TableName $secondColumnName = $secondRecommendation.ColumnName $secondInformationType = $secondRecommendation.InformationType $secondSensitivityLabel = $secondRecommendation.SensitivityLabel Assert-AreEqual "dbo" $secondSchemaName Assert-AreEqual "Persons" $secondTableName Assert-NotNullOrEmpty $secondColumnName Assert-NotNullOrEmpty $secondInformationType Assert-NotNullOrEmpty $secondSensitivityLabel Disable-AzSqlDatabaseSensitivityRecommendation -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName -SchemaName $firstSchemaName -TableName $firstTableName -ColumnName $firstColumnName Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Disable-AzSqlDatabaseSensitivityRecommendation -SchemaName $secondSchemaName -TableName $secondTableName -ColumnName $secondColumnName $recommendations = Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Get-AzSqlDatabaseSensitivityRecommendation Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.serverName $recommendations.ServerName Assert-AreEqual $params.databaseName $recommendations.DatabaseName Assert-AreEqual 2 ($recommendations.SensitivityLabels).count Assert-AreNotEqual $firstColumnName ($recommendations.SensitivityLabels)[0].ColumnName Assert-AreNotEqual $firstColumnName ($recommendations.SensitivityLabels)[1].ColumnName Assert-AreNotEqual $secondColumnName ($recommendations.SensitivityLabels)[0].ColumnName Assert-AreNotEqual $secondColumnName ($recommendations.SensitivityLabels)[1].ColumnName Enable-AzSqlDatabaseSensitivityRecommendation -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName -SchemaName $secondSchemaName -TableName $secondTableName -ColumnName $secondColumnName $recommendations = Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Get-AzSqlDatabaseSensitivityRecommendation Assert-AreEqual 3 ($recommendations.SensitivityLabels).count Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.serverName $recommendations.ServerName Assert-AreEqual $params.databaseName $recommendations.DatabaseName Assert-AreNotEqual $firstColumnName ($recommendations.SensitivityLabels)[0].ColumnName Assert-AreNotEqual $firstColumnName ($recommendations.SensitivityLabels)[1].ColumnName Assert-AreNotEqual $firstColumnName ($recommendations.SensitivityLabels)[2].ColumnName Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Get-AzSqlDatabaseSensitivityRecommendation | Disable-AzSqlDatabaseSensitivityRecommendation $recommendations = Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Get-AzSqlDatabaseSensitivityRecommendation Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.serverName $recommendations.ServerName Assert-AreEqual $params.databaseName $recommendations.DatabaseName Assert-AreEqual 0 ($recommendations.SensitivityLabels).count Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Enable-AzSqlDatabaseSensitivityRecommendation -SchemaName $secondSchemaName -TableName $secondTableName -ColumnName $secondColumnName $recommendations = Get-AzSqlDatabase -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName | Get-AzSqlDatabaseSensitivityRecommendation Assert-AreEqual $params.rgname $recommendations.ResourceGroupName Assert-AreEqual $params.serverName $recommendations.ServerName Assert-AreEqual $params.databaseName $recommendations.DatabaseName Assert-AreEqual 1 ($recommendations.SensitivityLabels).count $recommendation = ($recommendations.SensitivityLabels)[0] Assert-AreEqual $secondSchemaName $recommendation.SchemaName Assert-AreEqual $secondTableName $recommendation.TableName Assert-AreEqual $secondColumnName $recommendation.ColumnName Assert-NotNullOrEmpty $recommendation.InformationType Assert-NotNullOrEmpty $recommendation.SensitivityLabel } finally { Remove-DataClassificationTestEnvironment $testSuffix } }
combined_dataset/train/non-malicious/sample_66_32.ps1
sample_66_32.ps1
# # Module manifest for module 'OCI.PSModules.Aidocument' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aidocument.dll' # Version number of this module. ModuleVersion = '85.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '48b9296a-b4a7-43bb-8d59-3eaf832baf2a' # 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 Aidocument Service' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '6.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @(@{ModuleName = 'OCI.PSModules.Common'; GUID = 'b3061a0d-375b-4099-ae76-f92fb3cdcdae'; RequiredVersion = '85.1.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Aidocument.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-OCIAidocumentModel', 'Get-OCIAidocumentModelsList', 'Get-OCIAidocumentProcessorJob', 'Get-OCIAidocumentProject', 'Get-OCIAidocumentProjectsList', 'Get-OCIAidocumentWorkRequest', 'Get-OCIAidocumentWorkRequestErrorsList', 'Get-OCIAidocumentWorkRequestLogsList', 'Get-OCIAidocumentWorkRequestsList', 'Invoke-OCIAidocumentAnalyzeDocument', 'Invoke-OCIAidocumentPatchModel', 'Move-OCIAidocumentModelCompartment', 'Move-OCIAidocumentProjectCompartment', 'New-OCIAidocumentModel', 'New-OCIAidocumentProcessorJob', 'New-OCIAidocumentProject', 'Remove-OCIAidocumentModel', 'Remove-OCIAidocumentProject', 'Stop-OCIAidocumentProcessorJob', 'Stop-OCIAidocumentWorkRequest', 'Update-OCIAidocumentModel', 'Update-OCIAidocumentProject' # 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','Aidocument' # 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/Network Config _ Excel.ps1
Network Config _ Excel.ps1
$excel = New-Object -comobject Excel.Application $excel.visible = $False #Change to True to see the excel build $wbook = $excel.Workbooks.Add() $wsheet = $wbook.Worksheets.Item(1) $wsheet.Cells.Item(1,1) = "Date" $wsheet.Cells.Item(1,2) = "Server" $wsheet.Cells.Item(1,3) = "NETID" $wsheet.Cells.Item(1,4) = "Description" $wsheet.Cells.Item(1,5) = "MAC" $wsheet.Cells.Item(1,6) = "IP" $wsheet.Cells.Item(1,7) = "DHCPEnabled" $wsheet.Cells.Item(1,8) = "DHCPServer" $wsheet.Cells.Item(1,9) = "DNSServerSearchOrder" $wsheet.Cells.Item(1,10) = "WINSPrimaryServer" $wsheet.Cells.Item(1,11) = "WINSSecondaryServer" $wsheet.Cells.Item(1,12) = "DomainDNSRegistrationEnabled" $wsheet.Cells.Item(1,13) = "FullDNSRegistrationEnabled" $wsheet.Cells.Item(1,14) = "WINSEnableLMHostsLookup" $range = $wsheet.UsedRange $range.Interior.ColorIndex = 19 $range.Font.ColorIndex = 11 $range.Font.Bold = $True $iRow = 2 $AllAdapters = @("") $InputFile = "C:\\Scripts\\Servers.txt" $Servers = Get-Content $InputFile ForEach($Server in $Servers) { $Adapters = Get-Wmiobject Win32_NetworkAdapterConfiguration -Computername ` $Server | Where-Object{$_.IPEnabled -eq $True} ForEach($Adapter In $Adapters) { [String]$DNSServers = "" $Adapters2 = Get-Wmiobject Win32_NetworkAdapter -Computername $Server ` | Where-Object{$_.Caption -eq $Adapter.Caption} [String]$NetID = $Adapters2.NetConnectionID If($Adapter.DNSServerSearchOrder -ne $Null){ForEach($Address In ` $Adapter.DNSServerSearchOrder){$DNSServers += "[" + $Address + "]"}} $wsheet.Cells.Item($iRow,1) = Get-Date $wsheet.Cells.Item($iRow,2) = $Server $wsheet.Cells.Item($iRow,3) = $NETID $wsheet.Cells.Item($iRow,4) = $Adapter.Description $wsheet.Cells.Item($iRow,5) = $Adapter.MACAddress $wsheet.Cells.Item($iRow,6) = $Adapter.IPAddress $wsheet.Cells.Item($iRow,7) = $Adapter.DHCPEnabled $wsheet.Cells.Item($iRow,8) = $Adapter.DHCPServer $wsheet.Cells.Item($iRow,9) = $DNSServers $wsheet.Cells.Item($iRow,10) = $Adapter.WINSPrimaryServer $wsheet.Cells.Item($iRow,11) = $Adapter.WINSSecondaryServer $wsheet.Cells.Item($iRow,12) = $Adapter.DomainDNSRegistrationEnabled $wsheet.Cells.Item($iRow,13) = $Adapter.FullDNSRegistrationEnabled $wsheet.Cells.Item($iRow,14) = $Adapter.WINSEnableLMHostsLookup $iRow = $iRow + 1 } } $range.EntireColumn.AutoFilter() $range.EntireColumn.AutoFit() $excel.ActiveWorkbook.SaveAs("C:\\Scripts\\NetworkScan.xls") $excel.ActiveWorkbook.Close $excel.Application.Quit
combined_dataset/train/non-malicious/sample_41_48.ps1
sample_41_48.ps1
# # Module manifest for module 'OCI.PSModules.Database' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Database.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = 'e1b520e7-13c2-41a0-be48-3eacc401dff5' # 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 Database 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.Database.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-OCIDatabaseStorageCapacityCloudExadataInfrastructure', 'Add-OCIDatabaseStorageCapacityExadataInfrastructure', 'Add-OCIDatabaseVirtualMachineToCloudVmCluster', 'Add-OCIDatabaseVirtualMachineToVmCluster', 'Complete-OCIDatabaseExternalBackupJob', 'Confirm-OCIDatabaseVmClusterNetwork', 'Disable-OCIDatabaseAutonomousDatabaseManagement', 'Disable-OCIDatabaseAutonomousDatabaseOperationsInsights', 'Disable-OCIDatabaseExternalContainerDatabaseDatabaseManagement', 'Disable-OCIDatabaseExternalContainerDatabaseStackMonitoring', 'Disable-OCIDatabaseExternalNonContainerDatabaseDatabaseManagement', 'Disable-OCIDatabaseExternalNonContainerDatabaseOperationsInsights', 'Disable-OCIDatabaseExternalNonContainerDatabaseStackMonitoring', 'Disable-OCIDatabaseExternalPluggableDatabaseDatabaseManagement', 'Disable-OCIDatabaseExternalPluggableDatabaseOperationsInsights', 'Disable-OCIDatabaseExternalPluggableDatabaseStackMonitoring', 'Disable-OCIDatabaseManagement', 'Disable-OCIDatabasePluggableDatabaseManagement', 'Edit-OCIDatabaseManagement', 'Edit-OCIDatabasePluggableDatabaseManagement', 'Enable-OCIDatabaseAutonomousDatabaseManagement', 'Enable-OCIDatabaseAutonomousDatabaseOperationsInsights', 'Enable-OCIDatabaseExadataInfrastructure', 'Enable-OCIDatabaseExternalContainerDatabaseDatabaseManagement', 'Enable-OCIDatabaseExternalContainerDatabaseStackMonitoring', 'Enable-OCIDatabaseExternalNonContainerDatabaseDatabaseManagement', 'Enable-OCIDatabaseExternalNonContainerDatabaseOperationsInsights', 'Enable-OCIDatabaseExternalNonContainerDatabaseStackMonitoring', 'Enable-OCIDatabaseExternalPluggableDatabaseDatabaseManagement', 'Enable-OCIDatabaseExternalPluggableDatabaseOperationsInsights', 'Enable-OCIDatabaseExternalPluggableDatabaseStackMonitoring', 'Enable-OCIDatabaseManagement', 'Enable-OCIDatabasePluggableDatabaseManagement', 'Get-OCIDatabase', 'Get-OCIDatabaseApplicationVip', 'Get-OCIDatabaseApplicationVipsList', 'Get-OCIDatabaseAutonomousContainerDatabase', 'Get-OCIDatabaseAutonomousContainerDatabaseDataguardAssociation', 'Get-OCIDatabaseAutonomousContainerDatabaseDataguardAssociationsList', 'Get-OCIDatabaseAutonomousContainerDatabaseResourceUsage', 'Get-OCIDatabaseAutonomousContainerDatabasesList', 'Get-OCIDatabaseAutonomousContainerDatabaseVersionsList', 'Get-OCIDatabaseAutonomousDatabase', 'Get-OCIDatabaseAutonomousDatabaseBackup', 'Get-OCIDatabaseAutonomousDatabaseBackupsList', 'Get-OCIDatabaseAutonomousDatabaseCharacterSetsList', 'Get-OCIDatabaseAutonomousDatabaseClonesList', 'Get-OCIDatabaseAutonomousDatabaseDataguardAssociation', 'Get-OCIDatabaseAutonomousDatabaseDataguardAssociationsList', 'Get-OCIDatabaseAutonomousDatabaseRefreshableClonesList', 'Get-OCIDatabaseAutonomousDatabaseRegionalWallet', 'Get-OCIDatabaseAutonomousDatabasesList', 'Get-OCIDatabaseAutonomousDatabaseSoftwareImage', 'Get-OCIDatabaseAutonomousDatabaseSoftwareImagesList', 'Get-OCIDatabaseAutonomousDatabaseWallet', 'Get-OCIDatabaseAutonomousDbPreviewVersionsList', 'Get-OCIDatabaseAutonomousDbVersionsList', 'Get-OCIDatabaseAutonomousExadataInfrastructure', 'Get-OCIDatabaseAutonomousExadataInfrastructureShapesList', 'Get-OCIDatabaseAutonomousExadataInfrastructuresList', 'Get-OCIDatabaseAutonomousPatch', 'Get-OCIDatabaseAutonomousVirtualMachine', 'Get-OCIDatabaseAutonomousVirtualMachinesList', 'Get-OCIDatabaseAutonomousVmCluster', 'Get-OCIDatabaseAutonomousVmClusterAcdResourceUsageList', 'Get-OCIDatabaseAutonomousVmClusterResourceUsage', 'Get-OCIDatabaseAutonomousVmClustersList', 'Get-OCIDatabaseBackup', 'Get-OCIDatabaseBackupDestination', 'Get-OCIDatabaseBackupDestinationList', 'Get-OCIDatabaseBackupsList', 'Get-OCIDatabaseCloudAutonomousVmCluster', 'Get-OCIDatabaseCloudAutonomousVmClusterAcdResourceUsageList', 'Get-OCIDatabaseCloudAutonomousVmClusterResourceUsage', 'Get-OCIDatabaseCloudAutonomousVmClustersList', 'Get-OCIDatabaseCloudExadataInfrastructure', 'Get-OCIDatabaseCloudExadataInfrastructuresList', 'Get-OCIDatabaseCloudExadataInfrastructureUnallocatedResources', 'Get-OCIDatabaseCloudVmCluster', 'Get-OCIDatabaseCloudVmClusterIormConfig', 'Get-OCIDatabaseCloudVmClustersList', 'Get-OCIDatabaseCloudVmClusterUpdate', 'Get-OCIDatabaseCloudVmClusterUpdateHistoryEntriesList', 'Get-OCIDatabaseCloudVmClusterUpdateHistoryEntry', 'Get-OCIDatabaseCloudVmClusterUpdatesList', 'Get-OCIDatabaseConsoleConnection', 'Get-OCIDatabaseConsoleConnectionsList', 'Get-OCIDatabaseConsoleHistoriesList', 'Get-OCIDatabaseConsoleHistory', 'Get-OCIDatabaseConsoleHistoryContent', 'Get-OCIDatabaseContainerDatabasePatchesList', 'Get-OCIDatabaseDataGuardAssociation', 'Get-OCIDatabaseDataGuardAssociationsList', 'Get-OCIDatabaseDbHome', 'Get-OCIDatabaseDbHomePatch', 'Get-OCIDatabaseDbHomePatchesList', 'Get-OCIDatabaseDbHomePatchHistoryEntriesList', 'Get-OCIDatabaseDbHomePatchHistoryEntry', 'Get-OCIDatabaseDbHomesList', 'Get-OCIDatabaseDbNode', 'Get-OCIDatabaseDbNodesList', 'Get-OCIDatabaseDbServer', 'Get-OCIDatabaseDbServersList', 'Get-OCIDatabaseDbSystem', 'Get-OCIDatabaseDbSystemComputePerformancesList', 'Get-OCIDatabaseDbSystemPatch', 'Get-OCIDatabaseDbSystemPatchesList', 'Get-OCIDatabaseDbSystemPatchHistoryEntriesList', 'Get-OCIDatabaseDbSystemPatchHistoryEntry', 'Get-OCIDatabaseDbSystemShapesList', 'Get-OCIDatabaseDbSystemsList', 'Get-OCIDatabaseDbSystemStoragePerformancesList', 'Get-OCIDatabaseDbSystemUpgradeHistoryEntriesList', 'Get-OCIDatabaseDbSystemUpgradeHistoryEntry', 'Get-OCIDatabaseDbVersionsList', 'Get-OCIDatabaseExadataInfrastructure', 'Get-OCIDatabaseExadataInfrastructureOcpus', 'Get-OCIDatabaseExadataInfrastructuresList', 'Get-OCIDatabaseExadataInfrastructureUnAllocatedResources', 'Get-OCIDatabaseExadataIormConfig', 'Get-OCIDatabaseExternalBackupJob', 'Get-OCIDatabaseExternalContainerDatabase', 'Get-OCIDatabaseExternalContainerDatabasesList', 'Get-OCIDatabaseExternalDatabaseConnector', 'Get-OCIDatabaseExternalDatabaseConnectorsList', 'Get-OCIDatabaseExternalNonContainerDatabase', 'Get-OCIDatabaseExternalNonContainerDatabasesList', 'Get-OCIDatabaseExternalPluggableDatabase', 'Get-OCIDatabaseExternalPluggableDatabasesList', 'Get-OCIDatabaseFlexComponentsList', 'Get-OCIDatabaseGiVersionsList', 'Get-OCIDatabaseInfrastructureTargetVersions', 'Get-OCIDatabaseKeyStore', 'Get-OCIDatabaseKeyStoresList', 'Get-OCIDatabaseMaintenanceRun', 'Get-OCIDatabaseMaintenanceRunHistory', 'Get-OCIDatabaseMaintenanceRunHistoryList', 'Get-OCIDatabaseMaintenanceRunsList', 'Get-OCIDatabaseOneoffPatch', 'Get-OCIDatabaseOneoffPatchesList', 'Get-OCIDatabasePdbConversionHistoryEntriesList', 'Get-OCIDatabasePdbConversionHistoryEntry', 'Get-OCIDatabasePluggableDatabase', 'Get-OCIDatabasePluggableDatabasesList', 'Get-OCIDatabasesList', 'Get-OCIDatabaseSoftwareImage', 'Get-OCIDatabaseSoftwareImagesList', 'Get-OCIDatabaseSystemVersionsList', 'Get-OCIDatabaseUpgradeHistoryEntriesList', 'Get-OCIDatabaseUpgradeHistoryEntry', 'Get-OCIDatabaseVmCluster', 'Get-OCIDatabaseVmClusterNetwork', 'Get-OCIDatabaseVmClusterNetworksList', 'Get-OCIDatabaseVmClusterPatch', 'Get-OCIDatabaseVmClusterPatchesList', 'Get-OCIDatabaseVmClusterPatchHistoryEntriesList', 'Get-OCIDatabaseVmClusterPatchHistoryEntry', 'Get-OCIDatabaseVmClustersList', 'Get-OCIDatabaseVmClusterUpdate', 'Get-OCIDatabaseVmClusterUpdateHistoryEntriesList', 'Get-OCIDatabaseVmClusterUpdateHistoryEntry', 'Get-OCIDatabaseVmClusterUpdatesList', 'Invoke-OCIDatabaseAutonomousDatabaseManualRefresh', 'Invoke-OCIDatabaseCheckExternalDatabaseConnectorConnectionStatus', 'Invoke-OCIDatabaseConfigureAutonomousDatabaseVaultKey', 'Invoke-OCIDatabaseConfigureSaasAdminUser', 'Invoke-OCIDatabaseConvertToPdb', 'Invoke-OCIDatabaseConvertToRegularPluggableDatabase', 'Invoke-OCIDatabaseDbNodeAction', 'Invoke-OCIDatabaseDownloadExadataInfrastructureConfigFile', 'Invoke-OCIDatabaseDownloadOneoffPatch', 'Invoke-OCIDatabaseDownloadValidationReport', 'Invoke-OCIDatabaseDownloadVmClusterNetworkConfigFile', 'Invoke-OCIDatabaseFailoverAutonomousContainerDatabaseDataguardAssociation', 'Invoke-OCIDatabaseFailOverAutonomousDatabase', 'Invoke-OCIDatabaseFailoverDataGuardAssociation', 'Invoke-OCIDatabaseLaunchAutonomousExadataInfrastructure', 'Invoke-OCIDatabaseLocalClonePluggableDatabase', 'Invoke-OCIDatabaseMigrateExadataDbSystemResourceModel', 'Invoke-OCIDatabaseMigrateVaultKey', 'Invoke-OCIDatabaseRefreshPluggableDatabase', 'Invoke-OCIDatabaseReinstateAutonomousContainerDatabaseDataguardAssociation', 'Invoke-OCIDatabaseReinstateDataGuardAssociation', 'Invoke-OCIDatabaseRemoteClonePluggableDatabase', 'Invoke-OCIDatabaseResizeVmClusterNetwork', 'Invoke-OCIDatabaseResourcePoolShapes', 'Invoke-OCIDatabaseRotateAutonomousContainerDatabaseEncryptionKey', 'Invoke-OCIDatabaseRotateAutonomousDatabaseEncryptionKey', 'Invoke-OCIDatabaseRotateAutonomousVmClusterOrdsCerts', 'Invoke-OCIDatabaseRotateAutonomousVmClusterSslCerts', 'Invoke-OCIDatabaseRotateCloudAutonomousVmClusterOrdsCerts', 'Invoke-OCIDatabaseRotateCloudAutonomousVmClusterSslCerts', 'Invoke-OCIDatabaseRotateOrdsCerts', 'Invoke-OCIDatabaseRotatePluggableDatabaseEncryptionKey', 'Invoke-OCIDatabaseRotateSslCerts', 'Invoke-OCIDatabaseRotateVaultKey', 'Invoke-OCIDatabaseSaasAdminUserStatus', 'Invoke-OCIDatabaseScanExternalContainerDatabasePluggableDatabases', 'Invoke-OCIDatabaseShrinkAutonomousDatabase', 'Invoke-OCIDatabaseSwitchoverAutonomousContainerDatabaseDataguardAssociation', 'Invoke-OCIDatabaseSwitchoverAutonomousDatabase', 'Invoke-OCIDatabaseSwitchoverDataGuardAssociation', 'Invoke-OCIDatabaseTerminateAutonomousContainerDatabase', 'Invoke-OCIDatabaseTerminateAutonomousExadataInfrastructure', 'Invoke-OCIDatabaseTerminateDbSystem', 'Invoke-OCIDatabaseUpgradeDatabase', 'Invoke-OCIDatabaseUpgradeDbSystem', 'Move-OCIDatabaseAutonomousContainerDatabaseCompartment', 'Move-OCIDatabaseAutonomousDatabaseCompartment', 'Move-OCIDatabaseAutonomousDatabaseSoftwareImageCompartment', 'Move-OCIDatabaseAutonomousExadataInfrastructureCompartment', 'Move-OCIDatabaseAutonomousVmClusterCompartment', 'Move-OCIDatabaseBackupDestinationCompartment', 'Move-OCIDatabaseCloudAutonomousVmClusterCompartment', 'Move-OCIDatabaseCloudExadataInfrastructureCompartment', 'Move-OCIDatabaseCloudVmClusterCompartment', 'Move-OCIDatabaseDataguardRole', 'Move-OCIDatabaseDbSystemCompartment', 'Move-OCIDatabaseDisasterRecoveryConfiguration', 'Move-OCIDatabaseExadataInfrastructureCompartment', 'Move-OCIDatabaseExternalContainerDatabaseCompartment', 'Move-OCIDatabaseExternalNonContainerDatabaseCompartment', 'Move-OCIDatabaseExternalPluggableDatabaseCompartment', 'Move-OCIDatabaseKeyStoreCompartment', 'Move-OCIDatabaseKeyStoreType', 'Move-OCIDatabaseOneoffPatchCompartment', 'Move-OCIDatabaseSoftwareImageCompartment', 'Move-OCIDatabaseVmClusterCompartment', 'New-OCIDatabase', 'New-OCIDatabaseApplicationVip', 'New-OCIDatabaseAutonomousContainerDatabase', 'New-OCIDatabaseAutonomousContainerDatabaseDataguardAssociation', 'New-OCIDatabaseAutonomousDatabase', 'New-OCIDatabaseAutonomousDatabaseBackup', 'New-OCIDatabaseAutonomousDatabaseSoftwareImage', 'New-OCIDatabaseAutonomousDatabaseWallet', 'New-OCIDatabaseAutonomousVmCluster', 'New-OCIDatabaseBackup', 'New-OCIDatabaseBackupDestination', 'New-OCIDatabaseCloudAutonomousVmCluster', 'New-OCIDatabaseCloudExadataInfrastructure', 'New-OCIDatabaseCloudVmCluster', 'New-OCIDatabaseConsoleConnection', 'New-OCIDatabaseConsoleHistory', 'New-OCIDatabaseDataGuardAssociation', 'New-OCIDatabaseDbHome', 'New-OCIDatabaseDbSystem', 'New-OCIDatabaseExadataInfrastructure', 'New-OCIDatabaseExternalBackupJob', 'New-OCIDatabaseExternalContainerDatabase', 'New-OCIDatabaseExternalDatabaseConnector', 'New-OCIDatabaseExternalNonContainerDatabase', 'New-OCIDatabaseExternalPluggableDatabase', 'New-OCIDatabaseKeyStore', 'New-OCIDatabaseMaintenanceRun', 'New-OCIDatabaseOneoffPatch', 'New-OCIDatabasePluggableDatabase', 'New-OCIDatabaseRecommendedVmClusterNetwork', 'New-OCIDatabaseSoftwareImage', 'New-OCIDatabaseVmCluster', 'New-OCIDatabaseVmClusterNetwork', 'Register-OCIDatabaseAutonomousDatabaseDataSafe', 'Remove-OCIDatabase', 'Remove-OCIDatabaseApplicationVip', 'Remove-OCIDatabaseAutonomousDatabase', 'Remove-OCIDatabaseAutonomousDatabaseBackup', 'Remove-OCIDatabaseAutonomousDatabaseSoftwareImage', 'Remove-OCIDatabaseAutonomousVmCluster', 'Remove-OCIDatabaseBackup', 'Remove-OCIDatabaseBackupDestination', 'Remove-OCIDatabaseCloudAutonomousVmCluster', 'Remove-OCIDatabaseCloudExadataInfrastructure', 'Remove-OCIDatabaseCloudVmCluster', 'Remove-OCIDatabaseConsoleConnection', 'Remove-OCIDatabaseConsoleHistory', 'Remove-OCIDatabaseDbHome', 'Remove-OCIDatabaseExadataInfrastructure', 'Remove-OCIDatabaseExternalContainerDatabase', 'Remove-OCIDatabaseExternalDatabaseConnector', 'Remove-OCIDatabaseExternalNonContainerDatabase', 'Remove-OCIDatabaseExternalPluggableDatabase', 'Remove-OCIDatabaseKeyStore', 'Remove-OCIDatabaseOneoffPatch', 'Remove-OCIDatabasePluggableDatabase', 'Remove-OCIDatabaseSoftwareImage', 'Remove-OCIDatabaseVirtualMachineFromCloudVmCluster', 'Remove-OCIDatabaseVirtualMachineFromVmCluster', 'Remove-OCIDatabaseVmCluster', 'Remove-OCIDatabaseVmClusterNetwork', 'Restart-OCIDatabaseAutonomousContainerDatabase', 'Restart-OCIDatabaseAutonomousDatabase', 'Restore-OCIDatabase', 'Restore-OCIDatabaseAutonomousDatabase', 'Start-OCIDatabaseAutonomousDatabase', 'Start-OCIDatabasePluggableDatabase', 'Stop-OCIDatabaseAutonomousDatabase', 'Stop-OCIDatabaseBackup', 'Stop-OCIDatabasePluggableDatabase', 'Unregister-OCIDatabaseAutonomousDatabaseDataSafe', 'Update-OCIDatabase', 'Update-OCIDatabaseAutonomousContainerDatabase', 'Update-OCIDatabaseAutonomousContainerDatabaseDataguardAssociation', 'Update-OCIDatabaseAutonomousDatabase', 'Update-OCIDatabaseAutonomousDatabaseBackup', 'Update-OCIDatabaseAutonomousDatabaseRegionalWallet', 'Update-OCIDatabaseAutonomousDatabaseSoftwareImage', 'Update-OCIDatabaseAutonomousDatabaseWallet', 'Update-OCIDatabaseAutonomousExadataInfrastructure', 'Update-OCIDatabaseAutonomousVmCluster', 'Update-OCIDatabaseBackupDestination', 'Update-OCIDatabaseCloudAutonomousVmCluster', 'Update-OCIDatabaseCloudExadataInfrastructure', 'Update-OCIDatabaseCloudVmCluster', 'Update-OCIDatabaseCloudVmClusterIormConfig', 'Update-OCIDatabaseConsoleConnection', 'Update-OCIDatabaseConsoleHistory', 'Update-OCIDatabaseDataGuardAssociation', 'Update-OCIDatabaseDbHome', 'Update-OCIDatabaseDbNode', 'Update-OCIDatabaseDbSystem', 'Update-OCIDatabaseExadataInfrastructure', 'Update-OCIDatabaseExadataIormConfig', 'Update-OCIDatabaseExternalContainerDatabase', 'Update-OCIDatabaseExternalDatabaseConnector', 'Update-OCIDatabaseExternalNonContainerDatabase', 'Update-OCIDatabaseExternalPluggableDatabase', 'Update-OCIDatabaseKeyStore', 'Update-OCIDatabaseMaintenanceRun', 'Update-OCIDatabaseOneoffPatch', 'Update-OCIDatabasePluggableDatabase', 'Update-OCIDatabaseSoftwareImage', 'Update-OCIDatabaseVmCluster', 'Update-OCIDatabaseVmClusterNetwork' # 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','Database' # 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_5_58.ps1
sample_5_58.ps1
// Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved. // ================================================================== // DCIM_FCCapabilities // ================================================================== [dynamic, provider("dcismprovider"), Description( "DCIM_FCCapabilities describes the capabilities of Fiber Channel and " "its port and partitions." )] class DCIM_FCCapabilities : CIM_Capabilities { [ Description ("A unique identifier for the instance."), Key ] string InstanceID; [ Description ("A string containing the Fully Qualified Device Description, a user-friendly name for the object."), Required ] string FQDD; [ Description ("This property represents the maximum number of I/Os per connection."), Required ] uint16 FCMaxIOsPerSession; [ Description ("This property represents the maximum number of logins per port."), Required ] uint16 FCMaxNumberLogins; [ Description ("This property represents the maximum number of exchanges."), Required ] uint16 FCMaxNumberExchanges; [ Description ("This property represents the maximum NPIV per port."), Required ] uint16 FCMaxNPIVPerPort; [ Description ("This property represents the maximum number of FC Targets supported."), Required ] uint16 FCMaxNumberOfFCTargets; [ Description ("This property represents the maximum number of outstanding commands across all connections."), Required ] uint16 FCMaxNumberOutStandingCommands; [ Description ("The property details FC's port's flex adddressing support."), Required, Valuemap { "0", "2", "3" }, Values { "Unknown", "Supported", "Not Supported" } ] uint8 FlexAddressingSupport; [ Description ("The property details FC's port's uEFI support."), Required, Valuemap { "0", "2", "3" }, Values { "Unknown", "Supported", "Not Supported" } ] uint8 uEFISupport; [ Description ("The property details FC's boot support."), Required, Valuemap { "0", "2", "3" }, Values { "Unknown", "Supported", "Not Supported" } ] uint8 FCBootSupport; [ Description ("The property details FC's on chip thermal sensor support."), Required, Valuemap { "0", "2", "3" }, Values { "Unknown", "Supported", "Not Supported" } ] uint8 OnChipThermalSensor; [ Description ("The property details FC's feature licensing support."), Required, Valuemap { "0", "2", "3" }, Values { "Unknown", "Supported", "Not Supported" } ] uint8 FeatureLicensingSupport; [ Description ("This property specifies if the card supports persistence policy."), Required, Valuemap { "0", "2", "3" }, Values { "Unknown", "Supported", "Not Supported" } ] uint8 PersistencePolicySupport; }; /* SIG # Begin signature block */ /* MIItDgYJKoZIhvcNAQcCoIIs/zCCLPsCAQExDzANBglghkgBZQMEAgEFADB5Bgor */ /* BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG */ /* KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCwzXfjuRPkSi9d */ /* 9H89BoAzRziBDGKoETPTHL5vV0SUPaCCEmMwggXfMIIEx6ADAgECAhBOQOQ3VO3m */ /* jAAAAABR05R/MA0GCSqGSIb3DQEBCwUAMIG+MQswCQYDVQQGEwJVUzEWMBQGA1UE */ /* ChMNRW50cnVzdCwgSW5jLjEoMCYGA1UECxMfU2VlIHd3dy5lbnRydXN0Lm5ldC9s */ /* ZWdhbC10ZXJtczE5MDcGA1UECxMwKGMpIDIwMD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gEFAKCB0TAa */ /* BgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwHAYJKoZIhvcNAQkFMQ8XDTI0MDky */ /* MDA3MDA1M1owKwYLKoZIhvcNAQkQAgwxHDAaMBgwFgQUZvArMsLCyQ+CXc6qisnG */ /* Txmcz0AwLwYJKoZIhvcNAQkEMSIEIKN3/P7k/BRHvLusx+jFQiwfkYKcFraBF3bE */ /* a1D9j4SPMDcGCyqGSIb3DQEJEAIvMSgwJjAkMCIEINL25G3tdCLM0dRAV2hBNm+C */ /* itpVmq4zFq9NGprUDHgoMA0GCSqGSIb3DQEBAQUABIICAAgl11EiiEAWUNQhkUAO */ /* s3+fbnS/B4BBFXHJ5ldTKjMDExlxD0+9Xi7MDM6Tp1lkxd9/is682DNf5JAfex4S */ /* Dsl3gBQd+erVarNJz+OPdXBeCS+YpveiL47lvxCeaanfvDyM/LM0B7zfxW/cX/8N */ /* xRTgZ2WixUFQJ7E9LFjgLC4/OZcOkppUa6bXXor46loWGoGmGA2/3ZktMlVW0T8p */ /* Zr15F5s85xk/La8N9GBNfak/e8X04Jj4vbT6taFQv5Zs8eGX8weoRpwALgsaJHjg */ /* ml1kE22o9XTFaT1NLUMIGKgwpxtFFeWeuifN363YoEAmPUtUzxk32SxZm4b+2p3H */ /* V4r/tN9k7+b9yApu48PDg54xU7R2RnkmPBVMxv5Bx91spxtqKkDltsX12gYFYW/n */ /* 5386cFflE2WyT8qrxkUE+6tlFBz94xTV0pmtk+WFcEvEWbDrNBOA64Hmm030ybsN */ /* HjeuWur7AD7wg8LjqeylPpUM+0hUSrOmp+LSUQWc+HN1He+zsWD+neRSKUa6ucWC */ /* lXeZ0vS31sqQu9UUHyZBDtp9GJCty3IchF5T2x0xwBw4DG7NrNEjYnPvpibiSTcy */ /* XtFdy7+3oEo0xpAlBqZi+7YWES8Qfky9ZvVcvjZKtEn4pZKBCiRO6HUSGdu9VyFM */ /* kW+rMqbo1wlpz/dc5BoqxQ0b */ /* SIG # End signature block */
combined_dataset/train/non-malicious/The Letter Diamond.ps1
The Letter Diamond.ps1
## Write a program which draws a diamond of the form illustrted ## below. The letter which is to appear at the widest point of the ## figure (E in the example) is to be specified as the input data. ## A ## B B ## C C ## D D ## E E ## D D ## C C ## B B ## A Param([char]$letter = "E") $start = [int][char]"B" $end = [int]$letter $outerpadding = ($end - $start) + 5 $innerpadding = -1 Write-Host "$(" " * $outerpadding)A" foreach($char in ([string[]][char[]]($start..$end))) { $innerpadding += 2 $outerpadding-- Write-Host "$(" " * $outerpadding)$char$(" " * $innerpadding)$char" } $end-- foreach($char in ([string[]][char[]]($end..$start))) { $innerpadding -= 2 $outerpadding++ Write-Host "$(" " * $outerpadding)$char$(" " * $innerpadding)$char" } Write-Host "$(" " * $outerpadding) A"
combined_dataset/train/non-malicious/sample_25_23.ps1
sample_25_23.ps1
# # Module manifest for module 'OCI.PSModules.Resourcesearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Resourcesearch.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '7fdc6e7d-ec41-48a8-9c23-5e5149a3e83b' # 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 Resourcesearch Service' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '6.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @(@{ModuleName = 'OCI.PSModules.Common'; GUID = 'b3061a0d-375b-4099-ae76-f92fb3cdcdae'; RequiredVersion = '80.0.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Resourcesearch.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-OCIResourcesearchResourceType', 'Get-OCIResourcesearchResourceTypesList', 'Invoke-OCIResourcesearchSearchResources' # 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','Resourcesearch' # 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_3_97.ps1
sample_3_97.ps1
@{ GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" NestedModules="Microsoft.PowerShell.Commands.Management.dll" HelpInfoURI = 'https://aka.ms/powershell72-help' FunctionsToExport = @() AliasesToExport = @("gcb", "gtz", "scb") CmdletsToExport=@("Add-Content", "Clear-Content", "Clear-ItemProperty", "Join-Path", "Convert-Path", "Copy-ItemProperty", "Get-ChildItem", "Get-Clipboard", "Set-Clipboard", "Get-Content", "Get-ItemProperty", "Get-ItemPropertyValue", "Move-ItemProperty", "Get-Location", "Set-Location", "Push-Location", "Pop-Location", "New-PSDrive", "Remove-PSDrive", "Get-PSDrive", "Get-Item", "New-Item", "Set-Item", "Remove-Item", "Move-Item", "Rename-Item", "Copy-Item", "Clear-Item", "Invoke-Item", "Get-PSProvider", "New-ItemProperty", "Split-Path", "Test-Path", "Get-Process", "Stop-Process", "Wait-Process", "Debug-Process", "Start-Process", "Test-Connection", "Remove-ItemProperty", "Rename-ItemProperty", "Resolve-Path", "Set-Content", "Set-ItemProperty", "Get-TimeZone", "Stop-Computer", "Restart-Computer") } # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDZALKsuUJ2I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ined_dataset/train/non-malicious/3518.ps1
3518.ps1
function Test-RecordSetCrud { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $createdRecord = New-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Ttl 100 -RecordType A -Metadata @{ tag1 ="val1"} Assert-NotNull $createdRecord Assert-NotNull $createdRecord.Etag Assert-AreEqual 100 $createdRecord.Ttl Assert-AreEqual $zoneName $createdRecord.ZoneName Assert-AreEqual $recordName $createdRecord.Name Assert-AreEqual $resourceGroup.ResourceGroupName $createdRecord.ResourceGroupName Assert-AreEqual 1 $createdRecord.Metadata.Count Assert-AreEqual 0 $createdRecord.Records.Count $retrievedRecord = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A Assert-NotNull $retrievedRecord Assert-AreEqual $recordName $retrievedRecord.Name Assert-AreEqual $zoneName $retrievedRecord.ZoneName Assert-AreEqual $resourceGroup.ResourceGroupName $retrievedRecord.ResourceGroupName Assert-AreEqual $retrievedRecord.Etag $createdRecord.Etag Assert-AreEqual 1 $retrievedRecord.Metadata.Count Assert-AreEqual 0 $retrievedRecord.Records.Count $createdRecord.Metadata = @{ tag1 = "val1"; tag2 = "val2"} $createdRecord.Ttl = 1300 $updatedRecord = $createdRecord | Add-AzPrivateDnsRecordConfig -Ipv4Address 13.13.0.13 | Set-AzPrivateDnsRecordSet Assert-NotNull $updatedRecord Assert-NotNull $updatedRecord.Etag Assert-AreEqual $recordName $updatedRecord.Name Assert-AreEqual $zoneName $updatedRecord.ZoneName Assert-AreEqual $resourceGroup.ResourceGroupName $updatedRecord.ResourceGroupName Assert-AreEqual 1300 $updatedRecord.Ttl Assert-AreNotEqual $updatedRecord.Etag $createdRecord.Etag Assert-AreEqual 2 $updatedRecord.Metadata.Count Assert-AreEqual 1 $updatedRecord.Records.Count Assert-AreEqual "13.13.0.13" $updatedRecord.Records[0].Ipv4Address $retrievedRecord = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A Assert-NotNull $retrievedRecord Assert-AreEqual $recordName $retrievedRecord.Name Assert-AreEqual $zoneName $retrievedRecord.ZoneName Assert-AreEqual $resourceGroup.ResourceGroupName $retrievedRecord.ResourceGroupName Assert-AreEqual $retrievedRecord.Etag $updatedRecord.Etag Assert-AreEqual 2 $retrievedRecord.Metadata.Count Assert-AreEqual 1 $retrievedRecord.Records.Count Assert-AreEqual "13.13.0.13" $retrievedRecord.Records[0].Ipv4Address $removed = Remove-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A -PassThru -Confirm:$false Assert-True { $removed } Assert-ThrowsLike { Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A } "*does not exist*" Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetCrudTrimsDotFromZoneName { $zoneName = Get-RandomZoneName $zoneNameWithDot = $zoneName + "." $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $createdRecord = New-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneNameWithDot -ResourceGroupName $resourceGroup.ResourceGroupName -Ttl 100 -RecordType A -Metadata @{tag1 = "val1"} Assert-NotNull $createdRecord Assert-AreEqual $zoneName $createdRecord.ZoneName Assert-AreEqual $recordName $createdRecord.Name Assert-AreEqual $resourceGroup.ResourceGroupName $createdRecord.ResourceGroupName $retrievedRecord = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneNameWithDot -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A Assert-NotNull $retrievedRecord Assert-AreEqual $recordName $retrievedRecord.Name Assert-AreEqual $zoneName $retrievedRecord.ZoneName Assert-AreEqual $resourceGroup.ResourceGroupName $retrievedRecord.ResourceGroupName $retrievedRecord = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneNameWithDot -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A Assert-NotNull $retrievedRecord Assert-AreEqual $recordName $retrievedRecord.Name Assert-AreEqual $zoneName $retrievedRecord.ZoneName Assert-AreEqual $resourceGroup.ResourceGroupName $retrievedRecord.ResourceGroupName $removed = Remove-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneNameWithDot -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A -PassThru -Confirm:$false Assert-True { $removed } Assert-ThrowsLike { Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A } "*does not exist*" Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetCrudWithPiping { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $updatedRecord = New-AzPrivateDnsRecordSet -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType A -Metadata @{tag1 = "val1"} | Add-AzPrivateDnsRecordConfig -Ipv4Address 13.13.0.13 | Set-AzPrivateDnsRecordSet $resourceGroupName = $updatedRecord.ResourceGroupName Assert-NotNull $updatedRecord Assert-NotNull $updatedRecord.Etag Assert-AreEqual $recordName $updatedRecord.Name Assert-AreEqual $zoneName $updatedRecord.ZoneName Assert-NotNull $updatedRecord.ResourceGroupName Assert-AreEqual 1 $updatedRecord.Metadata.Count Assert-AreEqual 1 $updatedRecord.Records.Count Assert-AreEqual "13.13.0.13" $updatedRecord.Records[0].Ipv4Address $removed = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $updatedRecord.ResourceGroupName -RecordType A | Remove-AzPrivateDnsRecordSet -PassThru -Confirm:$false Assert-True { $removed } Assert-ThrowsLike { Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $updatedRecord.ResourceGroupName -RecordType A } "*does not exist*" Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $updatedRecord.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroupName -Force } function Test-RecordSetCrudWithPipingTrimsDotFromZoneName { $zoneName = Get-RandomZoneName $zoneNameWithDot = $zoneName + "." $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $zoneObjectWithDot = New-Object Microsoft.Azure.Commands.PrivateDns.Models.PSPrivateDnsZone $zoneObjectWithDot.Name = $zoneNameWithDot $zoneObjectWithDot.ResourceGroupName = $zone.ResourceGroupName $createdRecord = New-AzPrivateDnsRecordSet -ZoneName $zoneObjectWithDot.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType A -Metadata @{ tag1 ="val1"} Assert-NotNull $createdRecord Assert-AreEqual $recordName $createdRecord.Name Assert-AreEqual $zoneName $createdRecord.ZoneName Assert-AreEqual $zone.ResourceGroupName $createdRecord.ResourceGroupName $recordObjectWithDot = New-Object Microsoft.Azure.Commands.PrivateDns.Models.PSPrivateDnsRecordSet $recordObjectWithDot.Name = $recordName $recordObjectWithDot.ZoneName = $zoneNameWithDot $recordObjectWithDot.ResourceGroupName = $zone.ResourceGroupName $recordObjectWithDot.Ttl = 60 $recordAfterAdd = $recordObjectWithDot | Add-AzPrivateDnsRecordConfig -Ipv4Address 13.13.0.13 Assert-AreEqual $zoneNameWithDot $recordAfterAdd.ZoneName $updatedRecord = $recordAfterAdd | Set-AzPrivateDnsRecordSet -Overwrite Assert-NotNull $updatedRecord Assert-AreEqual $recordName $updatedRecord.Name Assert-AreEqual $zoneName $updatedRecord.ZoneName Assert-AreEqual $zone.ResourceGroupName $updatedRecord.ResourceGroupName $retrievedRecord = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneNameWithDot -ResourceGroupName $zone.ResourceGroupName -RecordType A Assert-NotNull $retrievedRecord Assert-AreEqual $recordName $retrievedRecord.Name Assert-AreEqual $zoneName $retrievedRecord.ZoneName Assert-AreEqual $zone.ResourceGroupName $updatedRecord.ResourceGroupName $removed = $recordObjectWithDot | Remove-AzPrivateDnsRecordSet -Overwrite -PassThru -Confirm:$false Assert-True { $removed } Assert-ThrowsLike { Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $updatedRecord.ResourceGroupName -RecordType A } "*does not exist*" Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $zone.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $zone.ResourceGroupName -Force } function Test-RecordSetCrudWithZoneResourceId { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $createdRecord = New-AzPrivateDnsRecordSet -Name $recordName -ParentResourceId $zone.ResourceId -Ttl 100 -RecordType A -Metadata @{ tag1 ="val1"} Assert-NotNull $createdRecord Assert-NotNull $createdRecord.Etag Assert-AreEqual 100 $createdRecord.Ttl Assert-AreEqual $zoneName $createdRecord.ZoneName Assert-AreEqual $recordName $createdRecord.Name Assert-AreEqual $resourceGroup.ResourceGroupName $createdRecord.ResourceGroupName Assert-AreEqual 1 $createdRecord.Metadata.Count Assert-AreEqual 0 $createdRecord.Records.Count $retrievedRecord = Get-AzPrivateDnsRecordSet -Name $recordName -ParentResourceId $zone.ResourceId -RecordType A Assert-NotNull $retrievedRecord Assert-AreEqual $recordName $retrievedRecord.Name Assert-AreEqual $zoneName $retrievedRecord.ZoneName Assert-AreEqual $resourceGroup.ResourceGroupName $retrievedRecord.ResourceGroupName Assert-AreEqual $retrievedRecord.Etag $createdRecord.Etag Assert-AreEqual 1 $retrievedRecord.Metadata.Count Assert-AreEqual 0 $retrievedRecord.Records.Count $createdRecord.Metadata = @{ tag1 = "val1"; tag2 = "val2"} $createdRecord.Ttl = 1300 $updatedRecord = $createdRecord | Add-AzPrivateDnsRecordConfig -Ipv4Address 13.13.0.13 | Set-AzPrivateDnsRecordSet Assert-NotNull $updatedRecord Assert-NotNull $updatedRecord.Etag Assert-AreEqual $recordName $updatedRecord.Name Assert-AreEqual $zoneName $updatedRecord.ZoneName Assert-AreEqual $resourceGroup.ResourceGroupName $updatedRecord.ResourceGroupName Assert-AreEqual 1300 $updatedRecord.Ttl Assert-AreNotEqual $updatedRecord.Etag $createdRecord.Etag Assert-AreEqual 2 $updatedRecord.Metadata.Count Assert-AreEqual 1 $updatedRecord.Records.Count Assert-AreEqual "13.13.0.13" $updatedRecord.Records[0].Ipv4Address $retrievedRecord = Get-AzPrivateDnsRecordSet -Name $recordName -ParentResourceId $zone.ResourceId -RecordType A Assert-NotNull $retrievedRecord Assert-AreEqual $recordName $retrievedRecord.Name Assert-AreEqual $zoneName $retrievedRecord.ZoneName Assert-AreEqual $resourceGroup.ResourceGroupName $retrievedRecord.ResourceGroupName Assert-AreEqual $retrievedRecord.Etag $updatedRecord.Etag Assert-AreEqual 2 $retrievedRecord.Metadata.Count Assert-AreEqual 1 $retrievedRecord.Records.Count Assert-AreEqual "13.13.0.13" $retrievedRecord.Records[0].Ipv4Address $removed = Remove-AzPrivateDnsRecordSet -Name $recordName -Zone $zone -RecordType A -PassThru -Confirm:$false Assert-True { $removed } Assert-ThrowsLike { Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A } "*does not exist*" Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force Remove-AzResourceGroup -Name $zone.ResourceGroupName -Force } function Test-RecordSetA { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType A -PrivateDnsRecords @() $record = $record | Add-AzPrivateDnsRecordConfig -Ipv4Address 1.1.1.1 $record = $record | Add-AzPrivateDnsRecordConfig -Ipv4Address 2.2.2.2 $record = $record | Remove-AzPrivateDnsRecordConfig -Ipv4Address 1.1.1.1 $record = $record | Remove-AzPrivateDnsRecordConfig -Ipv4Address 3.3.3.3 $record | Set-AzPrivateDnsRecordSet $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A Assert-AreEqual 1 $getResult.Records.Count Assert-AreEqual "2.2.2.2" $getResult.Records[0].Ipv4Address $listResult = Get-AzPrivateDnsRecordSet -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A Assert-AreEqual 1 $listResult[0].Records.Count Assert-AreEqual "2.2.2.2" $listResult[0].Records[0].Ipv4Address $removed = $listResult[0] | Remove-AzPrivateDnsRecordSet -PassThru -Confirm:$false Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetANonEmpty { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $aRecords=@() $aRecords += New-AzPrivateDnsRecordConfig -IPv4Address "192.168.0.1" $aRecords += New-AzPrivateDnsRecordConfig -IPv4Address "192.168.0.2" $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType A -PrivateDnsRecords $aRecords $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A Assert-AreEqual 2 $getResult.Records.Count Assert-AreEqual "192.168.0.1" $getResult.Records[0].Ipv4Address Assert-AreEqual "192.168.0.2" $getResult.Records[1].Ipv4Address $listResult = Get-AzPrivateDnsRecordSet -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A Assert-AreEqual 2 $listResult[0].Records.Count Assert-AreEqual "192.168.0.1" $listResult[0].Records[0].Ipv4Address Assert-AreEqual "192.168.0.2" $listResult[0].Records[1].Ipv4Address $removed = $listResult[0] | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetAAAA { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType AAAA $record = $record | Add-AzPrivateDnsRecordConfig -Ipv6Address 1::11 $record = $record | Add-AzPrivateDnsRecordConfig -Ipv6Address 2::22 $record = $record | Add-AzPrivateDnsRecordConfig -Ipv6Address 4::44 $record = $record | Remove-AzPrivateDnsRecordConfig -Ipv6Address 2::22 $record = $record | Remove-AzPrivateDnsRecordConfig -Ipv6Address 3::33 $record | Set-AzPrivateDnsRecordSet $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType AAAA Assert-AreEqual 2 $getResult.Records.Count Assert-AreEqual "1::11" $getResult.Records[0].Ipv6Address Assert-AreEqual "4::44" $getResult.Records[1].Ipv6Address $listResult = Get-AzPrivateDnsRecordSet -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType AAAA Assert-AreEqual 2 $listResult[0].Records.Count Assert-AreEqual "1::11" $listResult[0].Records[0].Ipv6Address Assert-AreEqual "4::44" $listResult[0].Records[1].Ipv6Address $removed = $listResult[0] | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetAAAANonEmpty { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $aaaaRecords=@() $aaaaRecords += New-AzPrivateDnsRecordConfig -IPv6Address "2002::1" $aaaaRecords += New-AzPrivateDnsRecordConfig -IPv6Address "2002::2" $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType AAAA -PrivateDnsRecords $aaaaRecords $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType AAAA Assert-AreEqual 2 $getResult.Records.Count Assert-AreEqual "2002::1" $getResult.Records[0].Ipv6Address Assert-AreEqual "2002::2" $getResult.Records[1].Ipv6Address $removed = $getResult | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetCNAME { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType CNAME $record = $record | Add-AzPrivateDnsRecordConfig -Cname www.example.com $record = $record | Remove-AzPrivateDnsRecordConfig -Cname www.example.com $record = $record | Add-AzPrivateDnsRecordConfig -Cname www.contoso.com $record = $record | Remove-AzPrivateDnsRecordConfig -Cname gibberish $record | Set-AzPrivateDnsRecordSet $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType CNAME Assert-AreEqual 1 $getResult.Records.Count Assert-AreEqual "www.contoso.com" $getResult.Records[0].Cname $listResult = Get-AzPrivateDnsRecordSet -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType CNAME Assert-AreEqual 1 $listResult[0].Records.Count Assert-AreEqual "www.contoso.com" $listResult[0].Records[0].Cname $removed = $listResult[0] | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetCNAMENonEmpty { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $records = New-AzPrivateDnsRecordConfig -Cname "www.contoso.com" $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType CNAME -PrivateDnsRecords $records $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType CNAME Assert-AreEqual 1 $getResult.Records.Count Assert-AreEqual "www.contoso.com" $getResult.Records[0].Cname $removed = $getResult | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetMX { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $zone.ResourceGroupName -Name $recordName -Ttl 100 -RecordType MX $record = $record | Add-AzPrivateDnsRecordConfig -Exchange mail1.theg.com -Preference 10 $record = $record | Add-AzPrivateDnsRecordConfig -Exchange mail2.theg.com -Preference 10 $record = $record | Remove-AzPrivateDnsRecordConfig -Exchange mail1.theg.com -Preference 10 $record = $record | Remove-AzPrivateDnsRecordConfig -Exchange mail2.theg.com -Preference 15 $record | Set-AzPrivateDnsRecordSet $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType MX Assert-AreEqual 1 $getResult.Records.Count Assert-AreEqual "mail2.theg.com" $getResult.Records[0].Exchange Assert-AreEqual 10 $getResult.Records[0].Preference $listResult = Get-AzPrivateDnsRecordSet -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType MX Assert-AreEqual 1 $listResult[0].Records.Count Assert-AreEqual "mail2.theg.com" $listResult[0].Records[0].Exchange Assert-AreEqual 10 $listResult[0].Records[0].Preference $removed = $listResult[0] | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetMXNonEmpty { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $records = @(); $records += New-AzPrivateDnsRecordConfig -Exchange mail2.theg.com -Preference 0 $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType MX -PrivateDnsRecords $records $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType MX Assert-AreEqual 1 $getResult.Records.Count Assert-AreEqual "mail2.theg.com" $getResult.Records[0].Exchange Assert-AreEqual 0 $getResult.Records[0].Preference $removed = $getResult[0] | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetTXT { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType TXT $record = $record | Add-AzPrivateDnsRecordConfig -Value text1 $record = $record | Add-AzPrivateDnsRecordConfig -Value text2 $record = $record | Add-AzPrivateDnsRecordConfig -Value text3 $record = $record | Remove-AzPrivateDnsRecordConfig -Value text1 $record = $record | Remove-AzPrivateDnsRecordConfig -Value text4 $record | Set-AzPrivateDnsRecordSet $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType TXT Assert-AreEqual 2 $getResult.Records.Count Assert-AreEqual text2 $getResult.Records[0].Value Assert-AreEqual text3 $getResult.Records[1].Value $listResult = Get-AzPrivateDnsRecordSet -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType TXT Assert-AreEqual 2 $listResult[0].Records.Count Assert-AreEqual text2 $listResult[0].Records[0].Value Assert-AreEqual text3 $listResult[0].Records[1].Value $removed = $listResult[0] | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetTXTNonEmpty { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $records = @() $records += New-AzPrivateDnsRecordConfig -Value text2 $records += New-AzPrivateDnsRecordConfig -Value text3 $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType TXT -PrivateDnsRecords $records $record | Set-AzPrivateDnsRecordSet $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType TXT Assert-AreEqual 2 $getResult.Records.Count Assert-AreEqual text2 $getResult.Records[0].Value Assert-AreEqual text3 $getResult.Records[1].Value $removed = $getResult | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetTXTLegacyLengthValidation { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $longRecordTxt = Get-TxtOfSpecifiedLength 1025; $maxRecordTxt = Get-TxtOfSpecifiedLength 1024; $recordSet = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType TXT ; Assert-Throws {$recordSet | Add-AzPrivateDnsRecordConfig -Value $longRecordTxt } $recordSet = $recordSet | Add-AzPrivateDnsRecordConfig -Value $maxRecordTxt $setResult = $recordSet | Set-AzPrivateDnsRecordSet ; Assert-AreEqual $maxRecordTxt $setResult.Records[0].Value; $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType TXT ; Assert-AreEqual $maxRecordTxt $getResult.Records[0].Value; Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetTXTLengthValidation { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $longRecordTxt = Get-TxtOfSpecifiedLength 1025; Assert-Throws {New-AzPrivateDnsRecordConfig -Value $longRecordTxt } $maxRecordTxt = Get-TxtOfSpecifiedLength 1024; $maxRecord = New-AzPrivateDnsRecordConfig -Value $maxRecordTxt $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType TXT -PrivateDnsRecords $maxRecord ; Assert-AreEqual $maxRecordTxt $record.Records[0].Value; $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType TXT ; Assert-AreEqual $maxRecordTxt $getResult.Records[0].Value; Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetPTR { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType PTR $record = $record | Add-AzPrivateDnsRecordConfig -Ptrdname "contoso1.com" $record = $record | Add-AzPrivateDnsRecordConfig -Ptrdname "contoso2.com" $record = $record | Add-AzPrivateDnsRecordConfig -Ptrdname "contoso3.com" $record = $record | Remove-AzPrivateDnsRecordConfig -Ptrdname "contoso1.com" $record = $record | Remove-AzPrivateDnsRecordConfig -Ptrdname "contoso4.com" $record | Set-AzPrivateDnsRecordSet $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType PTR Assert-AreEqual 2 $getResult.Records.Count Assert-AreEqual "contoso2.com" $getResult.Records[0].Ptrdname Assert-AreEqual "contoso3.com" $getResult.Records[1].Ptrdname $listResult = Get-AzPrivateDnsRecordSet -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType PTR Assert-AreEqual 2 $listResult[0].Records.Count $removed = $listResult[0] | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetPTRNonEmpty { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $records = @() $records += New-AzPrivateDnsRecordConfig -PtrdName "contoso.com" $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType PTR -PrivateDnsRecords $records Assert-AreEqual 1 $record.Records.Count $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType PTR Assert-AreEqual 1 $getResult.Records.Count Assert-AreEqual "contoso.com" $getResult.Records[0].Ptrdname $removed = $getResult | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetSRV { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType SRV $record = $record | Add-AzPrivateDnsRecordConfig -Port 53 -Priority 1 -Target ns1.example.com -Weight 5 $record = $record | Add-AzPrivateDnsRecordConfig -Port 53 -Priority 2 -Target ns2.example.com -Weight 10 $record = $record | Remove-AzPrivateDnsRecordConfig -Port 53 -Priority 2 -Target ns2.example.com -Weight 10 $record = $record | Remove-AzPrivateDnsRecordConfig -Port 42 -Priority 999 -Target ns5.example.com -Weight 1600 $record | Set-AzPrivateDnsRecordSet $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType SRV Assert-AreEqual 1 $getResult.Records.Count Assert-AreEqual 53 $getResult.Records[0].Port Assert-AreEqual 1 $getResult.Records[0].Priority Assert-AreEqual ns1.example.com $getResult.Records[0].Target Assert-AreEqual 5 $getResult.Records[0].Weight $listResult = Get-AzPrivateDnsRecordSet -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType SRV Assert-AreEqual 1 $listResult[0].Records.Count Assert-AreEqual 53 $listResult[0].Records[0].Port Assert-AreEqual 1 $listResult[0].Records[0].Priority Assert-AreEqual ns1.example.com $listResult[0].Records[0].Target Assert-AreEqual 5 $listResult[0].Records[0].Weight $removed = $listResult[0] | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetSRVNonEmpty { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $records = @() $records += New-AzPrivateDnsRecordConfig -Port 53 -Priority 1 -Target ns1.example.com -Weight 5 $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType SRV -PrivateDnsRecords $records $record | Set-AzPrivateDnsRecordSet $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType SRV Assert-AreEqual 1 $getResult.Records.Count Assert-AreEqual 53 $getResult.Records[0].Port Assert-AreEqual 1 $getResult.Records[0].Priority Assert-AreEqual ns1.example.com $getResult.Records[0].Target Assert-AreEqual 5 $getResult.Records[0].Weight $removed = $getResult[0] | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetSOA { $zoneName = Get-RandomZoneName $recordName = "@" $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $record = $zone | Get-AzPrivateDnsRecordSet -Name $recordName -RecordType SOA Assert-Throws { New-AzPrivateDnsRecordSet -Name $recordName -RecordType SOA -ResourceGroupName $resourceGroup -ZoneName $zoneName -Ttl 100 } "There can be only one record set of type SOA, and it can be modified but not deleted." Assert-AreEqual 1 $record.Count $record.Records[0].RefreshTime = 13 $record.Records[0].RetryTime = 666 $record.Records[0].ExpireTime = 42 $record.Records[0].MinimumTtl = 321 $record.Ttl = 110901 $record | Set-AzPrivateDnsRecordSet $getResult = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType SOA Assert-AreEqual 1 $getResult.Records.Count Assert-AreEqual 13 $getResult.Records[0].RefreshTime Assert-AreEqual 666 $getResult.Records[0].RetryTime Assert-AreEqual 42 $getResult.Records[0].ExpireTime Assert-AreEqual 321 $getResult.Records[0].MinimumTtl Assert-AreEqual 110901 $getResult.Ttl $listResult = Get-AzPrivateDnsRecordSet -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType SOA Assert-AreEqual 1 $listResult[0].Records.Count Assert-AreEqual 13 $listResult[0].Records[0].RefreshTime Assert-AreEqual 666 $listResult[0].Records[0].RetryTime Assert-AreEqual 42 $listResult[0].Records[0].ExpireTime Assert-AreEqual 321 $listResult[0].Records[0].MinimumTtl Assert-AreEqual 110901 $listResult[0].Ttl Assert-Throws { $listResult[0] | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru } "Record sets of type 'SOA' with name '@' cannot be deleted." Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Validate-CAARecord( $record, [int] $flags, $tag, $value) { Assert-AreEqual $flags $record.Flags Assert-AreEqual $tag $record.Tag Assert-AreEqual $value $record.Value } function Test-RecordSetNewAlreadyExists { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $record = New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 100 -RecordType A | Add-AzPrivateDnsRecordConfig -Ipv4Address 1.2.9.8 $message = [System.String]::Format("The Record set {0} exists already and hence cannot be created again.", $recordName); Assert-Throws { New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 212 -RecordType A } $message New-AzPrivateDnsRecordSet -ZoneName $zone.Name -ResourceGroupName $resourceGroup.ResourceGroupName -Name $recordName -Ttl 999 -RecordType A -Overwrite -Confirm:$false $retrievedRecordSet = $zone | Get-AzPrivateDnsRecordSet -Name $recordName -RecordType A Assert-AreEqual 999 $retrievedRecordSet.Ttl Assert-AreEqual 0 $retrievedRecordSet.Records.Count $retrievedRecordSet | Remove-AzPrivateDnsRecordSet -Confirm:$false $zone | Remove-AzPrivateDnsZone -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetAddRecordTypeMismatch { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $recordSet = $zone | New-AzPrivateDnsRecordSet -Name $recordName -Ttl 100 -RecordType MX Assert-Throws { $recordSet | Add-AzPrivateDnsRecordConfig -Ipv6Address 3::90 } "Cannot add a record of type AAAA to a record set of type MX. The types must match." $recordSet | Remove-AzPrivateDnsRecordSet -Confirm:$false Remove-AzPrivateDnsZone -Name $recordSet.ZoneName -ResourceGroupName $recordSet.ResourceGroupName -Confirm:$false } function Test-RecordSetAddTwoCnames { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $recordSet = $zone | New-AzPrivateDnsRecordSet -Name $recordName -Ttl 100 -RecordType CNAME $resourceGroupName = $recordSet.ResourceGroupName $recordSet | Add-AzPrivateDnsRecordConfig -Cname www.goril.la Assert-Throws { $recordSet | Add-AzPrivateDnsRecordConfig -Cname rubadub.dub } "There already exists a CNAME record in this set. A CNAME record set can only contain one record." Assert-AreEqual 1 $recordSet.Records.Count $recordSet | Remove-AzPrivateDnsRecordConfig -Cname www.goril.la $recordSet | Add-AzPrivateDnsRecordConfig -Cname rubadub.dub Assert-AreEqual 1 $recordSet.Records.Count Assert-AreEqual rubadub.dub $recordSet.Records[0].Cname $recordSet | Remove-AzPrivateDnsRecordSet -Confirm:$false Remove-AzPrivateDnsZone -Name $recordSet.ZoneName -ResourceGroupName $recordSet.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroupName -Force } function Test-RecordSetRemoveRecordTypeMismatch { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $recordSet = $zone | New-AzPrivateDnsRecordSet -Name $recordName -Ttl 100 -RecordType TXT $resourceGroupName = $recordSet.ResourceGroupName Assert-Throws { $recordSet | Remove-AzPrivateDnsRecordConfig -Cname nsa.fed.gov } "Cannot remove a record of type CNAME from a record set of type TXT. The types must match." $recordSet | Remove-AzPrivateDnsRecordSet -Confirm:$false Remove-AzPrivateDnsZone -Name $recordSet.ZoneName -ResourceGroupName $recordSet.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroupName -Force } function Test-RecordSetRemoveUsingResourceId { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $recordSet = $zone | New-AzPrivateDnsRecordSet -Name $recordName -Ttl 100 -RecordType TXT $resourceGroupName = $recordSet.ResourceGroupName $removed = Remove-AzPrivateDnsRecordSet -ResourceId $recordSet.Id -PassThru -Confirm:$false Assert-True { $removed } Assert-ThrowsLike { Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A } "*does not exist*" $recordSet | Remove-AzPrivateDnsRecordSet -Confirm:$false Remove-AzPrivateDnsZone -Name $recordSet.ZoneName -ResourceGroupName $recordSet.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroupName -Force } function Test-RecordSetEtagMismatch { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $recordSet = $zone | New-AzPrivateDnsRecordSet -Name $recordName -Ttl 100 -RecordType AAAA $originalEtag = $recordSet.Etag $recordSet.Etag = "gibberish" $message = [System.String]::Format("The Record set {0} has been modified (etag mismatch).", $recordName); Assert-Throws { $recordSet | Set-AzPrivateDnsRecordSet } $message $updatedRecordSet = $recordSet | Set-AzPrivateDnsRecordSet -Overwrite Assert-AreNotEqual "gibberish" $updatedRecordSet.Etag Assert-AreNotEqual $recordSet.Etag $updatedRecordSet.Etag $message = [System.String]::Format("The Record set {0} has been modified (etag mismatch).", $recordName); Assert-Throws { $recordSet | Remove-AzPrivateDnsRecordSet -Confirm:$false } $message Assert-True { $recordSet | Remove-AzPrivateDnsRecordSet -Overwrite -Confirm:$false -PassThru } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $recordSet.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $recordSet.ResourceGroupName -Force } function Test-RecordSetGet { $zoneName = Get-RandomZoneName $recordName1 = getAssetname $recordName2 = getAssetname $recordName3 = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $soaRecords = Get-AzPrivateDnsRecordSet -Zone $zone -RecordType SOA Assert-AreEqual 1 $soaRecords.Count New-AzPrivateDnsRecordSet -Zone $zone -Name $recordName1 -Ttl 100 -RecordType AAAA New-AzPrivateDnsRecordSet -Zone $zone -Name $recordName2 -Ttl 1200 -RecordType AAAA New-AzPrivateDnsRecordSet -Zone $zone -Name $recordName3 -Ttl 1500 -RecordType MX $aaaaRecords = $zone | Get-AzPrivateDnsRecordSet -RecordType AAAA $mxRecords = $zone | Get-AzPrivateDnsRecordSet -RecordType MX Assert-AreEqual 2 $aaaaRecords.Count Assert-AreEqual 1 $mxRecords.Count $allRecords = Get-AzPrivateDnsRecordSet -Zone $zone Assert-AreEqual 4 $allRecords.Count $zone | Remove-AzPrivateDnsRecordSet -Name $recordName1 -RecordType AAAA -Confirm:$false $zone | Remove-AzPrivateDnsRecordSet -Name $recordName2 -RecordType AAAA -Confirm:$false $zone | Remove-AzPrivateDnsRecordSet -Name $recordName3 -RecordType MX -Confirm:$false $zone | Remove-AzPrivateDnsZone -Confirm:$false -Overwrite Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetGetWithEndsWith { $rootRecordName = "@" $recordSuffix = ".com" $anotherSuffix = ".con" $zoneName = Get-RandomZoneName $recordName1 = (getAssetname) + $recordSuffix $recordName2 = (getAssetname) + $anotherSuffix $recordName3 = (getAssetname) + $recordSuffix $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $rootRecords = $zone | Get-AzPrivateDnsRecordSet -EndsWith $rootRecordName Assert-AreEqual 2 $rootRecords.Count -Message ("Expected 2 root records. Actual: " + $rootRecords.Count) New-AzPrivateDnsRecordSet -Zone $zone -Name $recordName1 -Ttl 100 -RecordType AAAA New-AzPrivateDnsRecordSet -Zone $zone -Name $recordName2 -Ttl 1200 -RecordType AAAA New-AzPrivateDnsRecordSet -Zone $zone -Name $recordName3 -Ttl 1500 -RecordType MX $aaaaRecords = $zone | Get-AzPrivateDnsRecordSet -RecordType AAAA -EndsWith $recordSuffix $mxRecords = $zone | Get-AzPrivateDnsRecordSet -RecordType MX -EndsWith $recordSuffix Assert-AreEqual 1 $aaaaRecords.Count -Message ("Expected 1 AAAA record. Actual: " + $aaaaRecords.Count) Assert-AreEqual 1 $mxRecords.Count -Message ("Expected 1 MX record. Actual: " + $mxRecords.Count) $allRecords = $zone | Get-AzPrivateDnsRecordSet -EndsWith $recordSuffix Assert-AreEqual 2 $allRecords.Count -Message ("Expected 2 records across types. Actual: " + $allRecords.Count) $zone | Remove-AzPrivateDnsRecordSet -Name $recordName1 -RecordType AAAA -Confirm:$false $zone | Remove-AzPrivateDnsRecordSet -Name $recordName2 -RecordType AAAA -Confirm:$false $zone | Remove-AzPrivateDnsRecordSet -Name $recordName3 -RecordType MX -Confirm:$false $zone | Remove-AzPrivateDnsZone -Confirm:$false -Overwrite Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetEndsWithZoneName { $zoneName = Get-RandomZoneName $recordName = (getAssetname) + "." + $zoneName $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $message = "PSPrivateDnsRecordSet" $warning = (New-AzPrivateDnsRecordSet -Name $recordName -RecordType A -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Ttl 100)3>&1 | Out-String Write-Verbose $warning Remove-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType A -PassThru -Confirm:$false Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force } function Test-RecordSetNewRecordNoName { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $recordSet = New-AzPrivateDnsRecordSet -Name $recordName -Ttl 100 -RecordType MX -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $recordSet = Get-AzPrivateDnsRecordSet -ResourceGroupName $resourceGroup.ResourceGroupName -ZoneName $zoneName -RecordType MX $record1 = Add-AzPrivateDnsRecordConfig -Exchange mail1.theg.com -Preference 1 -RecordSet $recordSet $recordSet | Set-AzPrivateDnsRecordSet $getRecordSetOne = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType MX Assert-AreEqual 1 $getRecordSetOne.Records.Count $record2 = Add-AzPrivateDnsRecordConfig -Exchange mail2.theg.com -Preference 10 -RecordSet $getRecordSetOne $getRecordSetOne | Set-AzPrivateDnsRecordSet $getRecordSetTwo = Get-AzPrivateDnsRecordSet -Name $recordName -ZoneName $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -RecordType MX Assert-AreEqual 2 $getRecordSetTwo.Records.Count $record1 = $record1 | Remove-AzPrivateDnsRecordConfig -Exchange mail1.theg.com -Preference 1 $record2 = $record2 | Remove-AzPrivateDnsRecordConfig -Exchange mail2.theg.com -Preference 10 $removed = $getRecordSetTwo | Remove-AzPrivateDnsRecordSet -Confirm:$false -PassThru Assert-True { $removed } Remove-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Confirm:$false Remove-AzResourceGroup -Name $resourceGroup.ResourceGroupName -Force }
combined_dataset/train/non-malicious/1306.ps1
1306.ps1
function Test-CPathIsJunction { [CmdletBinding(DefaultParameterSetName='Path')] param( [Parameter(Mandatory=$true,ParameterSetName='Path',Position=0)] [string] $Path, [Parameter(Mandatory=$true,ParameterSetName='LiteralPath')] [string] $LiteralPath ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState if( $PSCmdlet.ParameterSetName -eq 'Path' ) { if( [Management.Automation.WildcardPattern]::ContainsWildcardCharacters($Path) ) { $junctions = Get-Item -Path $Path -Force | Where-Object { $_.PsIsContainer -and $_.IsJunction } return ($junctions -ne $null) } return Test-CPathIsJunction -LiteralPath $Path } if( Test-Path -LiteralPath $LiteralPath -PathType Container ) { return (Get-Item -LiteralPath $LiteralPath -Force).IsJunction } return $false }
combined_dataset/train/non-malicious/Get_Set Signature (CTP2)_2.ps1
Get_Set Signature (CTP2)_2.ps1
#Requires -version 2.0 ## Authenticode.psm1 #################################################################################################### ## Wrappers for the Get-AuthenticodeSignature and Set-AuthenticodeSignature cmdlets ## These properly parse paths, so they don't kill your pipeline and script if you include a folder ## ## Usage: ## ls | Get-AuthenticodeSignature ## Get all the signatures ## ## ls | Select-Signed -Mine -Broken | Set-AuthenticodeSignature ## Re-sign anything you signed before that has changed ## ## ls | Select-Signed -NotMine -ValidOnly | Set-AuthenticodeSignature ## Re-sign scripts that are hash-correct but not signed by me or by someone trusted ## #################################################################################################### ## History: ## 1.3 - Fixed some bugs in If-Signed and renamed it to Select-Signed ## - Added -MineOnly and -NotMineOnly switches to Select-Signed ## 1.2 - Added a hack workaround to make it appear as though we can sign and check PSM1 files ## It's important to remember that the signatures are NOT checked by PowerShell yet... ## 1.1 - Added a filter "If-Signed" that can be used like: ls | If-Signed ## - With optional switches: ValidOnly, InvalidOnly, BrokenOnly, TrustedOnly, UnsignedOnly ## - commented out the default Certificate which won't work for "you" ## 1.0 - first working version, includes wrappers for Get and Set ## ## YOU MUST CHANGE THIS ... # Set-Variable CertificateThumbprint "0DA3A2A2189CD74AE371E6C57504FEB9A59BB22E" -Scope Script -Option ReadOnly Set-Variable CertificateThumbprint "F05F583BB5EA4C90E3B9BF1BDD0B657701245BD5" -Scope Script -Option ReadOnly CMDLET Test-Signature { PARAM ( [Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)] # We can't actually require the type, or we won't be able to check the fake ones # [System.Management.Automation.Signature] $Signature , [Alias("Valid")] [Switch]$ForceValid ) return ( $Signature.Status -eq "Valid" -or ( !$ForceValid -and ($Signature.Status -eq "UnknownError") -and ($_.SignerCertificate.Thumbprint -eq $CertificateThumbprint) ) ) } CMDLET Set-AuthenticodeSignature -snapin Huddled.BetterDefaults { PARAM ( [Parameter(Position=1, Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [Alias("FullName")] [ValidateScript({ if((resolve-path $_).Provider.Name -ne "FileSystem") { throw "Specified Path is not in the FileSystem: '$_'" } if(!(Test-Path -PathType Leaf $_)) { throw "Specified Path is not a File: '$_'" } return $true })] [string] $Path , ## TODO: you should CHANGE THIS to a method which gets *your* default certificate [Parameter(Position=2, Mandatory=$false)] $Certificate = $(ls cert:\\CurrentUser\\my\\$CertificateThumbprint) ) PROCESS { if( ".psm1" -eq [IO.Path]::GetExtension($Path) ) { # function setpsm1sig($Path) { $ps1Path = "$Path.ps1" Rename-Item $Path (Split-Path $ps1Path -Leaf) $sig = Microsoft.PowerShell.Security\\Set-AuthenticodeSignature -Certificate $Certificate -FilePath $ps1Path | Select * Rename-Item $ps1Path (Split-Path $Path -Leaf) $sig.PSObject.TypeNames.Insert( 0, "System.Management.Automation.Signature" ) $sig.Path = $Path $sig } else { Microsoft.PowerShell.Security\\Set-AuthenticodeSignature -Certificate $Certificate -FilePath $Path } } } CMDLET Get-AuthenticodeSignature -snapin Huddled.BetterDefaults { PARAM ( [Parameter(Position=1, Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [Alias("FullName")] [ValidateScript({ if((resolve-path $_).Provider.Name -ne "FileSystem") { throw "Specified Path is not in the FileSystem: '$_'" } if(!(Test-Path -PathType Leaf $_)) { throw "Specified Path is not a File: '$_'" } return $true })] [string] $Path ) PROCESS { if( ".psm1" -eq [IO.Path]::GetExtension($Path) ) { # function getpsm1sig($Path) { $ps1Path = "$Path.ps1" Rename-Item $Path (Split-Path $ps1Path -Leaf) $sig = Microsoft.PowerShell.Security\\Get-AuthenticodeSignature -FilePath $ps1Path | select * Rename-Item $ps1Path (Split-Path $Path -Leaf) $sig.PSObject.TypeNames.Insert( 0, "System.Management.Automation.Signature" ) $sig.Path = $Path $sig } else { Microsoft.PowerShell.Security\\Get-AuthenticodeSignature -FilePath $Path } } } CMDLET Select-Signed -snapin Huddled.BetterDefaults { PARAM ( [Parameter(Position=1, Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [Alias("FullName")] [ValidateScript({ if((resolve-path $_).Provider.Name -ne "FileSystem") { throw "Specified Path is not in the FileSystem: '$_'" } return $true })] [string] $Path , [Parameter()] [switch]$MineOnly , [Parameter()] [switch]$NotMineOnly , [Parameter()] [switch]$BrokenOnly , [Parameter()] [switch]$TrustedOnly , [Parameter()] [switch]$ValidOnly , [Parameter()] [switch]$InvalidOnly , [Parameter()] [switch]$UnsignedOnly ) if(!(Test-Path -PathType Leaf $Path)) { # if($ErrorAction -ne "SilentlyContinue") { # Write-Error "Specified Path is not a File: '$Path'" # } } else { $sig = Get-AuthenticodeSignature $Path # Broken only returns ONLY things which are HashMismatch if($BrokenOnly -and $sig.Status -ne "HashMismatch") { Write-Debug "$($sig.Status) - Not Broken: $Path" return } # Trusted only returns ONLY things which are Valid if($TrustedOnly -and $sig.Status -ne "Valid") { Write-Debug "$($sig.Status) - Not Trusted: $Path" return } # AllValid returns only things that are SIGNED and not HashMismatch if($ValidOnly -and (($sig.Status -ne "HashMismatch") -or !$sig.SignerCertificate) ) { Write-Debug "$($sig.Status) - Not Valid: $Path" return } # NOTValid returns only things that are SIGNED and not HashMismatch if($InvalidOnly -and ($sig.Status -eq "Valid")) { Write-Debug "$($sig.Status) - Valid: $Path" return } # Unsigned returns only things that aren't signed # NOTE: we don't test using NotSigned, because that's only set for .ps1 or .exe files?? if($UnsignedOnly -and $sig.SignerCertificate ) { Write-Debug "$($sig.Status) - Signed: $Path" return } # Mine returns only things that were signed by MY CertificateThumbprint if($MineOnly -and (!($sig.SignerCertificate) -or ($sig.SignerCertificate.Thumbprint -ne $CertificateThumbprint))) { Write-Debug "Originally signed by someone else, thumbprint: $($sig.SignerCertificate.Thumbprint)" Write-Debug "Does not match your default certificate print: $CertificateThumbprint" Write-Debug " $Path" return } # NotMine returns only things that were signed by MY CertificateThumbprint if($NotMineOnly -and (!($sig.SignerCertificate) -or ($sig.SignerCertificate.Thumbprint -eq $CertificateThumbprint))) { if($sig.SignerCertificate) { Write-Debug "Originally signed by you, thumbprint: $($sig.SignerCertificate.Thumbprint)" Write-Debug "Matches your default certificate print: $CertificateThumbprint" Write-Debug " $Path" } return } if(!$BrokenOnly -and !$TrustedOnly -and !$ValidOnly -and !$InvalidOnly -and !$UnsignedOnly -and !($sig.SignerCertificate) ) { # Write-Debug ("You asked for Broken ({0}) or Trusted ({1}) or Valid ({2}) or Invalid ({3}) or Unsigned ({4}) and the cert is: ({5})" -f [int]$BrokenOnly, [int]$TrustedOnly, [int]$ValidOnly, [int]$InvalidOnly, [int]$UnsignedOnly, $sig.SignerCertificate) Write-Debug "$($sig.Status) - Not Signed: $Path" return } get-childItem $sig.Path } } Export-ModuleMember Set-AuthenticodeSignature,Get-AuthenticodeSignature,Test-Signature,Select-Signed # SIG # Begin signature block # MIIK0AYJKoZIhvcNAQcCoIIKwTCCCr0CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR # AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUlcaRTm+/m0Lma0cwCp9wfClq # laagggbEMIIGwDCCBKigAwIBAgIJAKpDRVMtv0LqMA0GCSqGSIb3DQEBBQUAMIHG # MQswCQYDVQQGEwJVUzERMA8GA1UECBMITmV3IFlvcmsxEjAQBgNVBAcTCVJv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T2MxEtAfkJC/Ok8l+Sa1MY # +uWRL6p+55IE8x5TeNl251IYIp7g4LsPAaFZtiDBERrXRxtBTDszAUyTNJXuDcwS # T1CYQtrTYpEJxH1uk7C+SbQnq/fu2LJMHZGTB2Smh0CygXRkUxuN6Zpq1VwIT/lB # N8BAmhjx6F/h/v8MdLvMXzV4jcATZp6ywCf6k9OfuqCOETDSl9b6Lxm//guHgmUV # mpzU7n21ZOBv8ElUGZLvIfQCsmZ/ON7obwpFfhamuFIsSJ0w # SIG # End signature block
combined_dataset/train/non-malicious/Connect-VMHost.ps1
Connect-VMHost.ps1
#requires -version 2 -pssnapin VMware.VimAutomation.Core Function Connect-VMHost { <# .Summary Used to Connect a disconnected host to vCenter. .Parameter VMHost VMHost to reconnect to virtual center .Example Get-VMHost | Where-Object {$_.state -eq "Disconnected"} | Connect-VMHost Will Attempt to reconnect any host that are currently disconnected. .Example Connect-VMHost -Name ESX1.get-admin.local Will reconnect ESX1 to vCenter #> [CmdletBinding( SupportsShouldProcess=$True, SupportsTransactions=$False, ConfirmImpact="low", DefaultParameterSetName="ByString" )] Param( [Parameter( Mandatory=$True, Valuefrompipeline=$true, ParameterSetName="ByObj" )] [VMware.VimAutomation.Client20.VMHostImpl[]] $VMHost, [Parameter( Mandatory=$True, Position=0, ParameterSetName="ByString" )] [string[]] $Name ) Begin { IF ($Name) { $VMHost = $Name|%{ Get-VMHost -Name $_ } } } process { Foreach ($VMHostImpl in ($VMHost|Get-View)) { $ReconnectSpec = New-Object VMware.Vim.HostConnectSpec $ReconnectSpec.HostName = $VMHostImpl.Summary.Config.Name $ReconnectSpec.Port = $VMHostImpl.Summary.Config.Port $ReconnectSpec.Force = $true if ($pscmdlet.ShouldProcess($VMHostImpl.name)) { $VMHostImpl.ReconnectHost_Task($ReconnectSpec) } } } }
combined_dataset/train/non-malicious/4244.ps1
4244.ps1
function Dump-NTDS { [cmdletbinding()] Param ( [string[]]$EmptyFolder ) if( (Get-ChildItem $EmptyFolder | Measure-Object).Count -eq 0) { if (Test-Administrator) { NTdsutil.exe "activate instance ntds" "ifm" "create full $($EmptyFolder) " "q" "q" } else { Write-Output "Not running in elevated mode - must run as administrator" } } else { Write-Output "Folder is not empty, must use an empty folder" } Write-Output "If successfull, Zip the files and download using - New-ZipFile c:\temp\test.zip c:\temp\test\" } function Test-Administrator { $user = [Security.Principal.WindowsIdentity]::GetCurrent(); (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) }
combined_dataset/train/non-malicious/VMware _ Windows Admin.ps1
VMware _ Windows Admin.ps1
#======================================================================== # Created on: 5/17/2012 2:03 PM # Created by: Clint Jones # Organization: Virtually Genius! # Filename: Get-VMHostVersions #======================================================================== #Import modules Add-PSSnapin "Vmware.VimAutomation.Core" #Path to the log files $log = "C:\\Scripts\\VMware\\Logs\\hostversions.txt" #Creates directory structure for log files $pathverif = Test-Path -Path c:\\scripts\\vmware\\logs switch ($pathverif) { True {} False {New-Item "c:\\scripts\\vmware\\logs" -ItemType directory} default {Write-Host "An error has occured when checking the file structure"} } #Connect to VMware servers $viserver = Read-Host "Enter VMware server:" $creds = Get-Credential Connect-ViServer -Server $viserver -Credential $creds #Get the version number of the host Get-VMHost | Select-Object Name, Version | Format-Table -AutoSize | Out-File -FilePath $log -Append
combined_dataset/train/non-malicious/sample_52_87.ps1
sample_52_87.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 # MIIlpQYJKoZIhvcNAQcCoIIlljCCJZICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCABOtUhuRLDSJsH # 5LjfiBWymKYbjYNumRKF78V/LI3Gd6CCC2IwggTvMIID16ADAgECAhMzAAAK69Nl # RIMWPjjtAAAAAArrMA0GCSqGSIb3DQEBCwUAMHkx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mtWgmWQHK/u6Id+QnIA= # SIG # End signature block
combined_dataset/train/non-malicious/8fad46f9-26e1-4da7-8cc9-eb8a10d893dc.ps1
8fad46f9-26e1-4da7-8cc9-eb8a10d893dc.ps1
$devEnvArgs = '"' + "$pwd"+"\\Installer\\myInstaller.sln" + '"'; $devSwitches = '"' + "/rebuild Release 2>&1" + '"'; $output = &$vsExe $devEnvArgs $devSwitches;
combined_dataset/train/non-malicious/sample_61_72.ps1
sample_61_72.ps1
# # Module manifest for module 'OCI.PSModules.Fleetsoftwareupdate' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Fleetsoftwareupdate.dll' # Version number of this module. ModuleVersion = '86.2.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = 'e830226f-46c5-4916-992f-740cc29d35ab' # 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 Fleetsoftwareupdate Service' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '6.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module RequiredModules = @(@{ModuleName = 'OCI.PSModules.Common'; GUID = 'b3061a0d-375b-4099-ae76-f92fb3cdcdae'; RequiredVersion = '86.2.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Fleetsoftwareupdate.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-OCIFleetsoftwareupdateFsuCollectionTargets', 'Get-OCIFleetsoftwareupdateFsuAction', 'Get-OCIFleetsoftwareupdateFsuActionOutputContent', 'Get-OCIFleetsoftwareupdateFsuActionsList', 'Get-OCIFleetsoftwareupdateFsuCollection', 'Get-OCIFleetsoftwareupdateFsuCollectionsList', 'Get-OCIFleetsoftwareupdateFsuCollectionTargetsList', 'Get-OCIFleetsoftwareupdateFsuCycle', 'Get-OCIFleetsoftwareupdateFsuCyclesList', 'Get-OCIFleetsoftwareupdateFsuDiscoveriesList', 'Get-OCIFleetsoftwareupdateFsuDiscovery', 'Get-OCIFleetsoftwareupdateFsuDiscoveryTargetsList', 'Get-OCIFleetsoftwareupdateFsuJob', 'Get-OCIFleetsoftwareupdateFsuJobOutputContent', 'Get-OCIFleetsoftwareupdateFsuJobOutputsList', 'Get-OCIFleetsoftwareupdateFsuJobsList', 'Get-OCIFleetsoftwareupdateWorkRequest', 'Get-OCIFleetsoftwareupdateWorkRequestErrorsList', 'Get-OCIFleetsoftwareupdateWorkRequestLogsList', 'Get-OCIFleetsoftwareupdateWorkRequestsList', 'Invoke-OCIFleetsoftwareupdateCloneFsuCycle', 'Invoke-OCIFleetsoftwareupdateResumeFsuAction', 'Invoke-OCIFleetsoftwareupdateRetryFsuJob', 'Move-OCIFleetsoftwareupdateFsuActionCompartment', 'Move-OCIFleetsoftwareupdateFsuCollectionCompartment', 'Move-OCIFleetsoftwareupdateFsuCycleCompartment', 'Move-OCIFleetsoftwareupdateFsuDiscoveryCompartment', 'New-OCIFleetsoftwareupdateFsuAction', 'New-OCIFleetsoftwareupdateFsuCollection', 'New-OCIFleetsoftwareupdateFsuCycle', 'New-OCIFleetsoftwareupdateFsuDiscovery', 'Remove-OCIFleetsoftwareupdateFsuAction', 'Remove-OCIFleetsoftwareupdateFsuCollection', 'Remove-OCIFleetsoftwareupdateFsuCollectionTargets', 'Remove-OCIFleetsoftwareupdateFsuCycle', 'Remove-OCIFleetsoftwareupdateFsuDiscovery', 'Remove-OCIFleetsoftwareupdateFsuJob', 'Stop-OCIFleetsoftwareupdateFsuAction', 'Stop-OCIFleetsoftwareupdateFsuDiscovery', 'Update-OCIFleetsoftwareupdateFsuAction', 'Update-OCIFleetsoftwareupdateFsuCollection', 'Update-OCIFleetsoftwareupdateFsuCycle', 'Update-OCIFleetsoftwareupdateFsuDiscovery', 'Update-OCIFleetsoftwareupdateFsuJob' # 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','Fleetsoftwareupdate' # 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/1497.ps1
1497.ps1
function Assert-Error { [CmdletBinding(DefaultParameterSetName='Default')] param( [Parameter(Mandatory=$true,ParameterSetName='CheckLastError')] [Switch] $Last, [Parameter(Mandatory=$true,ParameterSetName='CheckFirstError')] [Switch] $First, [Parameter(Mandatory=$true,Position=0,ParameterSetName='CheckSpecificError')] [int] $Index, [int] $Count, [Parameter(Mandatory=$true,Position=0,ParameterSetName='CheckLastError')] [Parameter(Mandatory=$true,Position=0,ParameterSetName='CheckFirstError')] [Parameter(Mandatory=$true,Position=1,ParameterSetName='CheckSpecificError')] [Regex] $Regex, [Parameter(Position=0,ParameterSetName='Default')] [Parameter(Position=1,ParameterSetName='CheckLastError')] [Parameter(Position=1,ParameterSetName='CheckFirstError')] [Parameter(Position=2,ParameterSetName='CheckSpecificError')] [string] $Message ) Set-StrictMode -Version 'Latest' Assert-GreaterThan $Global:Error.Count 0 'Expected there to be errors, but there aren''t any.' if( $PSBoundParameters.ContainsKey('Count') ) { Assert-Equal $Count $Global:Error.Count ('Expected ''{0}'' errors, but found ''{1}''' -f $Count,$Global:Error.Count) } if( $PSCmdlet.ParameterSetName -like 'Check*Error' ) { if( $PSCmdlet.ParameterSetName -eq 'CheckFirstError' ) { $Index = -1 } elseif( $PSCmdlet.ParameterSetName -eq 'CheckLastError' ) { $Index = 0 } Assert-True ($Index -lt $Global:Error.Count) ('Expected there to be at least {0} errors, but there are only {1}. {2}' -f ($Index + 1),$Global:Error.Count,$Message) Assert-Match -Haystack $Global:Error[$Index].Exception.Message -Regex $Regex -Message $Message } }
combined_dataset/train/non-malicious/3084.ps1
3084.ps1
function global:Test-Error { Write-Error "This is an error" -ErrorAction SilentlyContinue } Given "we mock Write-Error" { Mock Write-Error { } -Verifiable } When "we call a function that writes an error" { Test-Error } Then "we can verify the mock" { Assert-MockCalled Write-Error Assert-VerifiableMock } Then "we cannot verify the mock" { try { Assert-MockCalled Write-Error } catch { return } throw "Write-Error not called" }
combined_dataset/train/non-malicious/sample_33_56.ps1
sample_33_56.ps1
# # Module manifest for module 'OCI.PSModules.Announcementsservice' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Announcementsservice.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '4260cf9c-0dfb-4f1c-ac46-7d08fcbebbf2' # 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 Announcementsservice 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 = '75.1.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Announcementsservice.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-OCIAnnouncementsserviceAnnouncement', 'Get-OCIAnnouncementsserviceAnnouncementsList', 'Get-OCIAnnouncementsserviceAnnouncementsPreference', 'Get-OCIAnnouncementsserviceAnnouncementsPreferencesList', 'Get-OCIAnnouncementsserviceAnnouncementSubscription', 'Get-OCIAnnouncementsserviceAnnouncementSubscriptionsList', 'Get-OCIAnnouncementsserviceAnnouncementUserStatus', 'Move-OCIAnnouncementsserviceAnnouncementSubscriptionCompartment', 'New-OCIAnnouncementsserviceAnnouncementsPreference', 'New-OCIAnnouncementsserviceAnnouncementSubscription', 'New-OCIAnnouncementsserviceFilterGroup', 'Remove-OCIAnnouncementsserviceAnnouncementSubscription', 'Remove-OCIAnnouncementsserviceFilterGroup', 'Update-OCIAnnouncementsserviceAnnouncementsPreference', 'Update-OCIAnnouncementsserviceAnnouncementSubscription', 'Update-OCIAnnouncementsserviceAnnouncementUserStatus', 'Update-OCIAnnouncementsserviceFilterGroup' # 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','Announcementsservice' # 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/2290.ps1
2290.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$false, ParameterSetName="List", HelpMessage="List user accounts eligible for removal instead of being removed")] [ValidateNotNullOrEmpty()] [switch]$List, [parameter(Mandatory=$false, ParameterSetName="Purge", HelpMessage="Removed user accounts will be removed from the Recycle Bin")] [ValidateNotNullOrEmpty()] [switch]$Purge, [parameter(Mandatory=$false, ParameterSetName="List", HelpMessage="Show a progressbar displaying the current operation")] [parameter(Mandatory=$false, ParameterSetName="Purge")] [ValidateNotNullOrEmpty()] [switch]$ShowProgress ) Begin { try { Import-Module -Name MSOnline -ErrorAction Stop -Verbose:$false } catch [System.Exception] { Write-Warning -Message $_.Exception.Message ; break } if (($Credentials = Get-Credential -Message "Enter the username and password for a Microsoft Online Service") -eq $null) { Write-Warning -Message "Please specify a Global Administrator account and password" ; break } try { Connect-MsolService -Credential $Credentials -ErrorAction Stop -Verbose:$false } catch [System.Exception] { Write-Warning -Message $_.Exception.Message ; break } } Process { if ($PSBoundParameters["ShowProgress"]) { $UserCount = 0 } try { $SynchronizedUsers = Get-MsolUser -Synchronized -All -ErrorAction Stop $SyncedUserCount = ($SynchronizedUsers | Measure-Object).Count foreach ($User in $SynchronizedUsers) { if ($PSBoundParameters["ShowProgress"]) { $UserCount++ Write-Progress -Activity "Removing synchronized users from Azure Active Directory" -Status "$($UserCount) / $($SyncedUserCount)" -CurrentOperation "User: $($User.UserPrincipalName)" -PercentComplete (($UserCount / $SyncedUserCount) * 100) } if ($PSBoundParameters["List"] -eq $true) { $PSObject = [PSCustomObject]@{ UserPrincipalName = $User.UserPrincipalName DisplayName = $User.DisplayName } Write-Output -InputObject $PSObject } else { try { Write-Verbose -Message "Attempting to remove user account '$($User.UserPrincipalName)'" Remove-MsolUser -UserPrincipalName $User.UserPrincipalName -Force -ErrorAction Stop Write-Verbose -Message "Successfully removed user account '$($User.UserPrincipalName)'" } catch [System.Exception] { Write-Warning -Message "Unable to remove synchronized user account '$($User.UserPrincipalName)'" } try { if ($PSBoundParameters["Purge"]) { Write-Verbose -Message "Attempting to remove deleted user account '$($User.UserPrincipalName)'" Get-MsolUser -ReturnDeletedUsers | Where-Object { $_.UserPrincipalName -like $User.UserPrincipalName } | Remove-MsolUser -RemoveFromRecycleBin -Force -ErrorAction Stop Write-Verbose -Message "Successfully removed deleted user account '$($User.UserPrincipalName)'" } } catch [System.Exception] { Write-Warning -Message "There was a problem when attempting to remove deleted user account '$($User.UserPrincipalName)' from the recycle bin" } } Start-Sleep -Seconds 3 } } catch [System.Exception] { Write-Warning -Message $_.Exception.Message ; break } }
combined_dataset/train/non-malicious/Get Twitter RSS Feed_7.ps1
Get Twitter RSS Feed_7.ps1
param ([String] $ScreenName) $client = New-Object System.Net.WebClient $idUrl = "https://api.twitter.com/1/users/show.json?screen_name=$ScreenName" $data = $client.DownloadString($idUrl) $start = 0 $findStr = '"id":' do { $start = $data.IndexOf($findStr, $start + 1) if ($start -gt 0) { $start += $findStr.Length $end = $data.IndexOf(',', $start) $userId = $data.SubString($start, $end-$start) } } while ($start -le $data.Length -and $start -gt 0) $feed = "http://twitter.com/statuses/user_timeline/$userId.rss" $feed
combined_dataset/train/non-malicious/4154.ps1
4154.ps1
param ( [Parameter(Mandatory = $true)][string]$BIOSPassword ) Function BitLockerSAK { [cmdletBinding()] Param ( [Switch]$IsTPMActivated, [Switch]$IsTPMEnabled, [Switch]$IsTPMOwnerShipAllowed, [Switch]$ResumeEncryption, [Switch]$GetEncryptionState, [Switch]$GetProtectionStatus, [switch]$Encrypt, [Parameter(ParameterSetName = 'OwnerShip')][switch]$TakeTPMOwnerShip, [Parameter(ParameterSetName = 'OwnerShip')][int]$pin, [switch]$IsTPMOwned, [Switch]$GetKeyProtectorIds, [switch]$GetEncryptionMethod, [ValidateScript({ if ($_ -match '^[A-Z]{1}[:]') { return $true } else { Write-Warning 'The drive letter parameter has to respect the following case: DriverLetter+Colomn EG: --> C: --> D: --> E: ' return $false } })][string]$DriveLetter = 'C:', [switch]$GetKeyProtectorTypeAndID, [switch]$DeleteKeyProtectors, [String[]]$ProtectorIDs, [switch]$DeleteKeyProtector, [switch]$PauseEncryption, [switch]$PauseDecryption, [switch]$Decrytp, [Parameter(ParameterSetName = 'NumericalPassword')][Switch]$GetKeyProtectorNumericalPassword, [Parameter(ParameterSetName = 'NumericalPassword', Mandatory = $true)][String]$VolumeKeyProtectorID ) Begin { try { $Tpm = Get-WmiObject -Namespace ROOT\CIMV2\Security\MicrosoftTpm -Class Win32_Tpm -ErrorAction Stop } catch [System.Management.ManagementException]{ write-warning 'Could not access the WMI methods. Verify that you run the script with elevated rights and try again.' continue } } Process { switch ($PSBoundParameters.keys) { 'IsTPMActivated'{ $return = if ($Tpm) { $tpm.IsActivated().isactivated }; break } 'IsTPMEnabled'{ $return = if ($Tpm) { $tpm.IsEnabled().isenabled }; break } 'IsTPMOwnerShipAllowed'{ $return = if ($Tpm) { $tpm.IsOwnerShipAllowed().IsOwnerShipAllowed }; break } 'IsTPMOwned'{ $return = if ($Tpm) { $Tpm.isowned().isowned }; break } 'GetEncryptionState'{ write-verbose "Getting the encryptionstate of drive $($driveletter)" $EncryptionData = Get-WmiObject -Namespace ROOT\CIMV2\Security\Microsoftvolumeencryption -Class Win32_encryptablevolume -Filter "DriveLetter = '$DriveLetter'" $protectionState = $EncryptionData.GetConversionStatus() $CurrentEncryptionProgress = $protectionState.EncryptionPercentage switch ($ProtectionState.Conversionstatus) { '0' { $Properties = @{ 'EncryptionState' = 'FullyDecrypted'; 'CurrentEncryptionProgress' = $CurrentEncryptionProgress } $Return = New-Object psobject -Property $Properties } '1' { $Properties = @{ 'EncryptionState' = 'FullyEncrypted'; 'CurrentEncryptionProgress' = $CurrentEncryptionProgress } $Return = New-Object psobject -Property $Properties } '2' { $Properties = @{ 'EncryptionState' = 'EncryptionInProgress'; 'CurrentEncryptionProgress' = $CurrentEncryptionProgress } $Return = New-Object psobject -Property $Properties } '3' { $Properties = @{ 'EncryptionState' = 'DecryptionInProgress'; 'CurrentEncryptionProgress' = $CurrentEncryptionProgress } $Return = New-Object psobject -Property $Properties } '4' { $Properties = @{ 'EncryptionState' = 'EncryptionPaused'; 'CurrentEncryptionProgress' = $CurrentEncryptionProgress } $Return = New-Object psobject -Property $Properties } '5' { $Properties = @{ 'EncryptionState' = 'DecryptionPaused'; 'CurrentEncryptionProgress' = $CurrentEncryptionProgress } $Return = New-Object psobject -Property $Properties } default { write-verbose "Couldn't retrieve an encryption state." $Properties = @{ 'EncryptionState' = $false; 'CurrentEncryptionProgress' = $false } $Return = New-Object psobject -Property $Properties } } } 'ResumeEncryption'{ write-verbose 'Resuming encryption' $ProtectionState = Get-WmiObject -Namespace ROOT\CIMV2\Security\Microsoftvolumeencryption -Class Win32_encryptablevolume -Filter "DriveLetter = '$DriveLetter'" $Ret = $protectionState.ResumeConversion() $ReturnCode = $ret.ReturnValue switch ($ReturnCode) { ('0') { $Message = 'The Method Resume Conversion was called succesfully.' } ('2150694912') { $message = 'The volume is locked' } default { $message = 'The resume operation failed with an uknowned return code.' } } $Properties = @{ 'ReturnCode' = $ReturnCode; 'ErrorMessage' = $message } $Return = New-Object psobject -Property $Properties } 'GetProtectionStatus'{ $ProtectionState = Get-WmiObject -Namespace ROOT\CIMV2\Security\Microsoftvolumeencryption -Class Win32_encryptablevolume -Filter "DriveLetter = '$DriveLetter'" write-verbose 'Gathering BitLocker protection status infos.' switch ($ProtectionState.GetProtectionStatus().protectionStatus) { ('0') { $return = 'Unprotected' } ('1') { $return = 'Protected' } ('2') { $return = 'Uknowned' } default { $return = 'NoReturn' } } } 'Encrypt'{ $ProtectionState = Get-WmiObject -Namespace ROOT\CIMV2\Security\Microsoftvolumeencryption -Class Win32_encryptablevolume -Filter "DriveLetter = '$DriveLetter'" write-verbose 'Launching drive encryption.' $ProtectorKey = $protectionState.ProtectKeyWithTPMAndPIN('ProtectKeyWithTPMAndPin', '', $pin) Start-Sleep -Seconds 3 $NumericalPasswordReturn = $protectionState.ProtectKeyWithNumericalPassword() $Return = $protectionState.Encrypt() $returnCode = $return.returnvalue switch ($ReturnCode) { ('0') { $message = 'Operation successfully started.' } ('2147942487') { $message = 'The EncryptionMethod parameter is provided but is not within the known range or does not match the current Group Policy setting.' } ('2150694958') { $message = 'No encryption key exists for the volume' } ('2150694957') { $message = 'The provided encryption method does not match that of the partially or fully encrypted volume.' } ('2150694942') { $message = 'The volume cannot be encrypted because this computer is configured to be part of a server cluster.' } ('2150694956') { $message = 'No key protectors of the type Numerical Password are specified. The Group Policy requires a backup of recovery information to Active Directory Domain Services' } default { $message = 'An unknown status was returned by the Encryption action.' } } $Properties = @{ 'ReturnCode' = $ReturnCode; 'ErrorMessage' = $message } $Return = New-Object psobject -Property $Properties } 'GetKeyProtectorIds'{ $BitLocker = Get-WmiObject -Namespace 'Root\cimv2\Security\MicrosoftVolumeEncryption' -Class 'Win32_EncryptableVolume' -Filter "DriveLetter = '$DriveLetter'" $return = $BitLocker.GetKeyProtectors('0').VolumeKeyProtectorID } 'GetEncryptionMethod'{ $BitLocker = Get-WmiObject -Namespace 'Root\cimv2\Security\MicrosoftVolumeEncryption' -Class 'Win32_EncryptableVolume' -Filter "DriveLetter = '$DriveLetter'" $EncryptMethod = $BitLocker.GetEncryptionMethod().encryptionmethod switch ($EncryptMethod) { '0'{ $Return = 'None'; break } '1'{ $Return = 'AES_128_WITH_DIFFUSER'; break } '2'{ $Return = 'AES_256_WITH_DIFFUSER'; break } '3'{ $Return = 'AES_128'; break } '4'{ $Return = 'AES_256'; break } '5'{ $Return = 'HARDWARE_ENCRYPTION'; break } default { $Return = 'UNKNOWN'; break } } } 'GetKeyProtectorTypeAndID'{ $BitLocker = Get-WmiObject -Namespace 'Root\cimv2\Security\MicrosoftVolumeEncryption' -Class 'Win32_EncryptableVolume' -Filter "DriveLetter = '$DriveLetter'" $ProtectorIds = $BitLocker.GetKeyProtectors('0').volumekeyprotectorID $return = @() foreach ($ProtectorID in $ProtectorIds) { $KeyProtectorType = $BitLocker.GetKeyProtectorType($ProtectorID).KeyProtectorType $keyType = '' switch ($KeyProtectorType) { '0'{ $Keytype = 'Unknown or other protector type'; break } '1'{ $Keytype = 'Trusted Platform Module (TPM)'; break } '2'{ $Keytype = 'External key'; break } '3'{ $Keytype = 'Numerical password'; break } '4'{ $Keytype = 'TPM And PIN'; break } '5'{ $Keytype = 'TPM And Startup Key'; break } '6'{ $Keytype = 'TPM And PIN And Startup Key'; break } '7'{ $Keytype = 'Public Key'; break } '8'{ $Keytype = 'Passphrase'; break } '9'{ $Keytype = 'TPM Certificate'; break } '10'{ $Keytype = 'CryptoAPI Next Generation (CNG) Protector'; break } } $Properties = @{ 'KeyProtectorID' = $ProtectorID; 'KeyProtectorType' = $Keytype } $Return += New-Object -TypeName psobject -Property $Properties } } 'DeleteKeyProtectors'{ $BitLocker = Get-WmiObject -Namespace 'Root\cimv2\Security\MicrosoftVolumeEncryption' -Class 'Win32_EncryptableVolume' -Filter "DriveLetter = '$DriveLetter'" $Return = $BitLocker.DeleteKeyProtectors() } 'TakeTPMOwnerShip'{ $Tpm.takeOwnership() } 'DeleteKeyProtector'{ if ($PSBoundParameters.ContainsKey('ProtectorIDs')) { $Return = @() $BitLocker = Get-WmiObject -Namespace 'Root\cimv2\Security\MicrosoftVolumeEncryption' -Class 'Win32_EncryptableVolume' -Filter "DriveLetter = '$DriveLetter'" foreach ($ProtID in $ProtectorIDs) { $Return += $BitLocker.DeleteKeyProtector($ProtID) } } else { write-warning 'Could not delete the key protector. Missing ProtectorID parameter.' $Return = 'Could not delete the key protector. Missing ProtectorID parameter.' } } 'PauseEncryption'{ $BitLocker = Get-WmiObject -Namespace 'Root\cimv2\Security\MicrosoftVolumeEncryption' -Class 'Win32_EncryptableVolume' -Filter "DriveLetter = '$DriveLetter'" $ReturnCode = $BitLocker.PauseConversion() switch ($ReturnCode.ReturnValue) { '0'{ $Return = 'Paused sucessfully.'; break } '2150694912'{ $Return = 'The volume is locked.'; Break } default { $Return = 'Uknown return code.'; break } } } 'PauseDecryption'{ $BitLocker = Get-WmiObject -Namespace 'Root\cimv2\Security\MicrosoftVolumeEncryption' -Class 'Win32_EncryptableVolume' -Filter "DriveLetter = '$DriveLetter'" $ReturnCode = $BitLocker.PauseConversion() switch ($ReturnCode.ReturnValue) { '0'{ $Return = 'Paused sucessfully.'; break } '2150694912'{ $Return = 'The volume is locked.'; Break } default { $Return = 'Uknown return code.'; break } } } 'Decrytp'{ $BitLocker = Get-WmiObject -Namespace 'Root\cimv2\Security\MicrosoftVolumeEncryption' -Class 'Win32_EncryptableVolume' -Filter "DriveLetter = '$DriveLetter'" $ReturnCode = $BitLocker.Decrypt() switch ($ReturnCode.ReturnValue) { '0'{ $Return = 'Uncryption started successfully.'; break } '2150694912'{ $Return = 'The volume is locked.'; Break } '2150694953' { $Return = 'This volume cannot be decrypted because keys used to automatically unlock data volumes are available.'; Break } default { $Return = 'Uknown return code.'; break } } } 'GetKeyProtectorNumericalPassword'{ $BitLocker = Get-WmiObject -Namespace 'Root\cimv2\Security\MicrosoftVolumeEncryption' -Class 'Win32_EncryptableVolume' -Filter "DriveLetter = '$DriveLetter'" $Return = @() $KeyProtectorReturn = $BitLocker.GetKeyProtectorNumericalPassword($VolumeKeyProtectorID) switch ($KeyProtectorReturn.ReturnValue) { '0' { $msg = 'The method was successful.' } '2150694912' { $msg = 'The volume is locked.'; Break } '2147942487' { $msg = "The VolumeKeyProtectorID parameter does not refer to a key protector of the type 'Numerical Password'."; Break } '2150694920' { $msg = 'BitLocker is not enabled on the volume. Add a key protector to enable BitLocker.'; Break } default { $msg = "Unknown return value: $($KeyProtectorReturn.ReturnValue)" } } $Properties = @{ 'KeyProtectorNumericalPassword' = $KeyProtectorReturn.NumericalPassword; 'VolumeKeyProtectorID' = $VolumeKeyProtectorID; 'Message' = $msg } $Return += New-Object -TypeName psobject -Property $Properties } } if ($PSBoundParameters.Keys.Count -eq 0) { write-verbose 'Returning bitlocker main status' $Tpm = Get-WmiObject -Namespace ROOT\CIMV2\Security\MicrosoftTpm -Class Win32_Tpm $BitLocker = Get-WmiObject -Namespace 'Root\cimv2\Security\MicrosoftVolumeEncryption' -Class 'Win32_EncryptableVolume' -Filter "DriveLetter = '$DriveLetter'" if ($tpm) { $TpmActivated = $tpm.IsActivated().isactivated $TPMEnabled = $tpm.IsEnabled().isenabled $TPMOwnerShipAllowed = $Tpm.IsOwnershipAllowed().IsOwnerShipAllowed $TPMOwned = $Tpm.isowned().isowned } $ProtectorIds = $BitLocker.GetKeyProtectors('0').volumekeyprotectorID $CurrentEncryptionState = BitLockerSAK -GetEncryptionState $EncryptionMethod = BitLockerSAK -GetEncryptionMethod $KeyProtectorTypeAndID = BitLockerSAK -GetKeyProtectorTypeAndID $properties = @{ 'IsTPMActivated' = $TpmActivated;` 'IsTPMEnabled' = $TPMEnabled;` 'IsTPMOwnerShipAllowed' = $TPMOwnerShipAllowed;` 'IsTPMOwned' = $TPMOwned;` 'CurrentEncryptionPercentage' = $CurrentEncryptionState.CurrentEncryptionProgress;` 'EncryptionState' = $CurrentEncryptionState.encryptionState; ` 'EncryptionMethod' = $EncryptionMethod;` 'KeyProtectorTypesAndIDs' = $KeyProtectorTypeAndID } $Return = New-Object psobject -Property $Properties } } End { return $return } } Function Get-Architecture { Set-Variable -Name Architecture -Scope Local -Force $Architecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture $Architecture = $Architecture.OSArchitecture Return $Architecture Remove-Variable -Name Architecture -Scope Local -Force } function Get-BiosStatus { param ([String]$Option) Set-Variable -Name Architecture -Scope Local -Force Set-Variable -Name Argument -Scope Local -Force Set-Variable -Name CCTK -Scope Local -Force Set-Variable -Name Output -Scope Local -Force $Architecture = Get-Architecture If ($Architecture -eq "32-bit") { $CCTK = $env:ProgramFiles + "\Dell\Command Configure\X86\cctk.exe" } else { $CCTK = ${env:ProgramFiles(x86)} + "\Dell\Command Configure\X86_64\cctk.exe" } $Argument = "--" + $Option $Output = [string] (& $CCTK $Argument) $Output = $Output.Split('=') Return $Output[1] Remove-Variable -Name Architecture -Scope Local -Force Remove-Variable -Name Argument -Scope Local -Force Remove-Variable -Name CCTK -Scope Local -Force Remove-Variable -Name Output -Scope Local -Force } Function Install-EXE { Param ([String]$DisplayName, [String]$Executable, [String]$Switches) Set-Variable -Name ErrCode -Scope Local -Force Write-Host "Install"$DisplayName"....." -NoNewline If ((Test-Path $Executable) -eq $true) { $ErrCode = (Start-Process -FilePath $Executable -ArgumentList $Switches -Wait -Passthru).ExitCode } else { $ErrCode = 1 } If (($ErrCode -eq 0) -or ($ErrCode -eq 3010)) { Write-Host "Success" -ForegroundColor Yellow } else { Write-Host "Failed with error code "$ErrCode -ForegroundColor Red } Remove-Variable -Name ErrCode -Scope Local -Force } Function Get-BitLockerRecoveryKeyId { [cmdletBinding()] Param ( [Parameter(Mandatory = $false, ValueFromPipeLine = $false)][ValidateSet("Alltypes", "TPM", "ExternalKey", "NumericPassword", "TPMAndPin", "TPMAndStartUpdKey", "TPMAndPinAndStartUpKey", "PublicKey", "PassPhrase", "TpmCertificate", "SID")]$KeyProtectorType ) $BitLocker = Get-WmiObject -Namespace "Root\cimv2\Security\MicrosoftVolumeEncryption" -Class "Win32_EncryptableVolume" switch ($KeyProtectorType) { ("Alltypes") { $Value = "0" } ("TPM") { $Value = "1" } ("ExternalKey") { $Value = "2" } ("NumericPassword") { $Value = "3" } ("TPMAndPin") { $Value = "4" } ("TPMAndStartUpdKey") { $Value = "5" } ("TPMAndPinAndStartUpKey") { $Value = "6" } ("PublicKey") { $Value = "7" } ("PassPhrase") { $Value = "8" } ("TpmCertificate") { $Value = "9" } ("SID") { $Value = "10" } default { $Value = "0" } } $Ids = $BitLocker.GetKeyProtectors($Value).volumekeyprotectorID return $ids } Function Remove-RegistryKey { Param ([String]$RegistryKey, [Boolean]$Recurse) Set-Variable -Name i -Scope Local -Force Set-Variable -Name RegKey -Scope Local -Force Set-Variable -Name RegistryKey1 -Scope Local -Force Set-Variable -Name tempdrive -Scope Local -Force $tempdrive = New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT $RegistryKey1 = $RegistryKey.split("\") switch ($RegistryKey1[0]) { "HKEY_CLASSES_ROOT" { $RegistryKey1[0] = "HKCR" } "HKEY_CURRENT_USER" { $RegistryKey1[0] = "HKCU" } "HKEY_LOCAL_MACHINE" { $RegistryKey1[0] = "HKLM" } "HKEY_USERS" { $RegistryKey1[0] = "HKU" } "HKEY_CURRENT_CONFIG" { $RegistryKey1[0] = "HKCC" } } For ($i = 0; $i -lt $RegistryKey1.Count; $i++) { $RegKey = $RegKey + $RegistryKey1[$i] If ($i -eq 0) { $RegKey = $RegKey + ":\" } elseif ($i -ne $RegistryKey1.Count - 1) { $RegKey = $RegKey + "\" } else { $RegKey = $RegKey } } Write-Host "Delete"$RegKey"....." -NoNewline If (Test-Path $RegKey) { If (($Recurse -eq $false) -or ($Recurse -eq $null)) { Remove-Item -Path $RegKey -Force } elseIf ($Recurse -eq $true) { Remove-Item -Path $RegKey -Recurse -Force } if ((Test-Path $RegKey) -eq $false) { Write-Host "Success" -ForegroundColor Yellow } else { Write-Host "Failed" -ForegroundColor Yellow } } else { Write-Host "Not Present" -ForegroundColor Green } Remove-Variable -Name i -Scope Local -Force Remove-Variable -Name RegKey -Scope Local -Force Remove-Variable -Name RegistryKey1 -Scope Local -Force Remove-Variable -Name tempdrive -Scope Local -Force } Set-Variable -Name BitlockerID -Scope Local -Force Set-Variable -Name ManageBDE -Value $env:windir"\System32\manage-bde.exe" -Scope Local -Force Set-Variable -Name Switches -Scope Local -Force Set-Variable -Name TPMActivated -Scope Local -Force Set-Variable -Name TPMEnabled -Scope Local -Force Set-Variable -Name TPMOwnershipAllowed -Scope Local -Force cls $TPMEnabled = Get-BiosStatus -Option "tpm" Write-Host "TPM Enabled:"$TPMEnabled $TPMActivated = Get-BiosStatus -Option "tpmactivation" Write-Host "TPM Activated:"$TPMActivated $TPMOwnershipAllowed = BitLockerSAK -IsTPMOwnerShipAllowed Write-Host "TPM Ownership Allowed:"$TPMOwnershipAllowed $TPMOwned = BitLockerSAK -IsTPMOwned Write-Host "TPM Owned:"$TPMOwned If (($TPMEnabled -eq "on") -and ($TPMActivated -eq "activate") -and ($TPMOwnershipAllowed -eq $true) -and ($TPMOwned -eq $false)) { Remove-RegistryKey -RegistryKey "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\FVE" -Recurse $true Remove-RegistryKey -RegistryKey "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\TPM" -Recurse $true $Switches = "-tpm -takeownership" + [char]32 + $BIOSPassword Install-EXE -DisplayName "Take TPM Ownership" -Executable $ManageBDE -Switches $Switches $Switches = "-on" + [char]32 + $env:HOMEDRIVE + [char]32 + "-recoverypassword" Install-EXE -DisplayName "Enable Bitlocker" -Executable $ManageBDE -Switches $Switches Install-EXE -DisplayName "GPUpdate" -Executable $env:windir"\System32\gpupdate.exe" -Switches " " $BitlockerID = Get-BitLockerRecoveryKeyId -KeyProtectorType NumericPassword $Switches = "-protectors -adbackup" + [char]32 + $env:HOMEDRIVE + [char]32 + "-id" + [char]32 + $BitlockerID Install-EXE -DisplayName "Backup Recovery Key to AD" -Executable $ManageBDE -Switches $Switches } Remove-Variable -Name BitlockerID -Scope Local -Force Remove-Variable -Name ManageBDE -Scope Local -Force Remove-Variable -Name Switches -Scope Local -Force Remove-Variable -Name TPMActivated -Scope Local -Force Remove-Variable -Name TPMEnabled -Scope Local -Force Remove-Variable -Name TPMOwnershipAllowed -Scope Local -Force
combined_dataset/train/non-malicious/sample_38_21.ps1
sample_38_21.ps1
# # Module manifest for module 'OCI.PSModules.Nosql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Nosql.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '6350988d-a08e-4817-bfff-d79172f60809' # 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 Nosql 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.Nosql.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-OCINosqlIndex', 'Get-OCINosqlIndexesList', 'Get-OCINosqlRow', 'Get-OCINosqlTable', 'Get-OCINosqlTablesList', 'Get-OCINosqlTableUsageList', 'Get-OCINosqlWorkRequest', 'Get-OCINosqlWorkRequestErrorsList', 'Get-OCINosqlWorkRequestLogsList', 'Get-OCINosqlWorkRequestsList', 'Invoke-OCINosqlPrepareStatement', 'Invoke-OCINosqlQuery', 'Invoke-OCINosqlSummarizeStatement', 'Move-OCINosqlTableCompartment', 'New-OCINosqlIndex', 'New-OCINosqlReplica', 'New-OCINosqlTable', 'Remove-OCINosqlIndex', 'Remove-OCINosqlReplica', 'Remove-OCINosqlRow', 'Remove-OCINosqlTable', 'Remove-OCINosqlWorkRequest', 'Update-OCINosqlRow', 'Update-OCINosqlTable' # 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','Nosql' # 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/1268.ps1
1268.ps1
function Get-CIisVersion { [CmdletBinding()] param( ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $props = Get-ItemProperty hklm:\Software\Microsoft\InetStp return $props.MajorVersion.ToString() + "." + $props.MinorVersion.ToString() }
combined_dataset/train/non-malicious/2367.ps1
2367.ps1
$aOutput = @(); $aDisabledGpos = Get-GPO -All | Where-Object { $_.GpoStatus -eq 'AllSettingsDisabled' }; foreach ($oGpo in $aDisabledGpos) { $oOutput = New-Object System.Object; $oOutput | Add-Member -type NoteProperty -Name 'Status' -Value 'Disabled'; $oOutput | Add-Member -type NoteProperty -Name 'Name' -Value $oGpo.DisplayName; $aOutput += $oOutput; } $aAllGpos = Get-Gpo -All; $aUnlinkedGpos = @(); foreach ($oGpo in $aAllGpos) { [xml]$oGpoReport = Get-GPOReport -Guid $oGpo.ID -ReportType xml; if (!(Test-Member $oGpoReport.GPO LinksTo)) { $oOutput = New-Object System.Object; $oOutput | Add-Member -type NoteProperty -Name 'Status' -Value 'Unlinked'; $oOutput | Add-Member -type NoteProperty -Name 'Name' -Value $oGpo.DisplayName; $aOutput += $oOutput; } } $aOutput.Count $aOutput | Sort-Object Name | Format-Table -AutoSize
combined_dataset/train/non-malicious/2292.ps1
2292.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Specify the user principal name to amend the password expire policy on")] [ValidateNotNullOrEmpty()] [ValidatePattern("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$")] [string]$UserPrincipalName, [parameter(Mandatory=$true, HelpMessage="Specify whether the password expire policy should be true or false")] [ValidateNotNullOrEmpty()] [bool]$PasswordNeverExpires ) Begin { try { Import-Module -Name MSOnline -ErrorAction Stop -Verbose:$false } catch [System.Exception] { Write-Warning -Message $_.Exception.Message ; break } if (($Credentials = Get-Credential -Message "Enter the username and password for a Microsoft Online Service") -eq $null) { Write-Warning -Message "Please specify a Global Administrator account and password" ; break } try { Connect-MsolService -Credential $Credentials -ErrorAction Stop -Verbose:$false } catch [System.Exception] { Write-Warning -Message $_.Exception.Message ; break } } Process { $User = Get-MsolUser -UserPrincipalName $UserPrincipalName -ErrorAction Stop if ($User -ne $null) { try { Set-MsolUser -UserPrincipalName $UserPrincipalName -PasswordNeverExpires $PasswordNeverExpires -ErrorAction Stop } catch [System.Exception] { Write-Warning -Message "Unable to change the password expires policy for user '$($UserPrincipalName)'" ; break } $UserPasswordNeverExpires = Get-MsolUser -UserPrincipalName $UserPrincipalName -ErrorAction Stop | Select-Object -Property PasswordNeverExpires $PSObject = [PSCustomObject]@{ UserPrincipalName = $UserPrincipalName DisplayName = $User.DisplayName PasswordNeverExpires = $UserPasswordNeverExpires.PasswordNeverExpires } Write-Output -InputObject $PSObject } else { Write-Warning -Message "Specified user principal name was not found" ; break } }
combined_dataset/train/non-malicious/Import-Certificate_2.ps1
Import-Certificate_2.ps1
#requires -Version 2.0 function Import-Certificate { param ( [IO.FileInfo] $CertFile = $(throw "Paramerter -CertFile [System.IO.FileInfo] is required."), [string[]] $StoreNames = $(throw "Paramerter -StoreNames [System.String] is required."), [switch] $LocalMachine, [switch] $CurrentUser, [string] $CertPassword, [switch] $Verbose ) begin { [void][System.Reflection.Assembly]::LoadWithPartialName("System.Security") } process { if ($Verbose) { $VerbosePreference = 'Continue' } if (-not $LocalMachine -and -not $CurrentUser) { Write-Warning "One or both of the following parameters are required: '-LocalMachine' '-CurrentUser'. Skipping certificate '$CertFile'." } try { if ($_) { $certfile = $_ } $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $certfile,$CertPassword } catch { Write-Error ("Error importing '$certfile': $_ .") -ErrorAction:Continue } if ($cert -and $LocalMachine) { $StoreScope = "LocalMachine" $StoreNames | ForEach-Object { $StoreName = $_ if (Test-Path "cert:\\$StoreScope\\$StoreName") { try { $store = New-Object System.Security.Cryptography.X509Certificates.X509Store $StoreName, $StoreScope $store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite) $store.Add($cert) $store.Close() Write-Verbose "Successfully added '$certfile' to 'cert:\\$StoreScope\\$StoreName'." } catch { Write-Error ("Error adding '$certfile' to 'cert:\\$StoreScope\\$StoreName': $_ .") -ErrorAction:Continue } } else { Write-Warning "Certificate store '$StoreName' does not exist. Skipping..." } } } if ($cert -and $CurrentUser) { $StoreScope = "CurrentUser" $StoreNames | ForEach-Object { $StoreName = $_ if (Test-Path "cert:\\$StoreScope\\$StoreName") { try { $store = New-Object System.Security.Cryptography.X509Certificates.X509Store $StoreName, $StoreScope $store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite) $store.Add($cert) $store.Close() Write-Verbose "Successfully added '$certfile' to 'cert:\\$StoreScope\\$StoreName'." } catch { Write-Error ("Error adding '$certfile' to 'cert:\\$StoreScope\\$StoreName': $_ .") -ErrorAction:Continue } } else { Write-Warning "Certificate store '$StoreName' does not exist. Skipping..." } } } } end { } }
combined_dataset/train/non-malicious/sample_41_37.ps1
sample_41_37.ps1
######################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # Localized PackageManagement.Resources.psd1 # ######################################################################################### ConvertFrom-StringData @' ###PSLOC OldPowerShellCoreVersion=PackageManagement no longer supports PowerShell Core '{0}'. Please install the latest version of PowerShell Core from 'https://aka.ms/i6t6o3' and try again. ###PSLOC '@ # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBAD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b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24x # JjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAAB3V1X # HZXUraobAAEAAAHdMCIEINHbl0BAqj+H7rfoXSb1PttUVeNTlIzZtE5BZwARnrOR # MA0GCSqGSIb3DQEBCwUABIICAKQGDB/9HpYd0CvKhoRoJwIHugBRO16QnKXP4LP/ # 0JXFytYxsNezYdS8NtIC0nbgaiGzCj1+BAfMk0JR89am0R/OenFzmtyxpPJEagYn # 8lMDfpxY+KFZUffuMS36fAXIZmTz/2s9338+Xg97kgMK/EBCmpHyQNX4lFNNkp7W # zYkkzxA/xmvl21qWJQblST7ZdwcoNTOp3lM9J8RkIBedAJboTIgararxkCUxZB35 # BTKdEQHj2Gk/Cg3GTvHjEhhrNBQId+iqHvDaIxmBnslPRj1ecUfjGaHBJaLxk3k1 # 2XsGdAPcw9Kti5pcegWWtCQHEWXD1LK34cjBddOVxblBNOuHcL4VYl9TrjR2iyZI # PKHHbP4+YGrmgiUqjAbOwVC9mkU86rKt/IxVEfwzk+HgkILurNvMxckTI5qE82vZ # xCBvK+d63Mr+gGUOtvwVEQFzO1xctfVsRxXBYYF/pBYCP6a2S5HVHpz5VOwnvZbT # txzI/anLyWz4mvfB/u61xce7ePg4BDXHMLXTm6MKHjO2Ese8ebRLleOPeKVh3M8h # zZegWi9sBjlbhh6jO/04Njve/zUUTi6cVo34K16i8YUG9yXzKlRv9afNE7K3YQw4 # nphGXnSFPi28f0wkYgagA7PRq+1KQHcGaW8n0F7S+9kbP/qWoZ7382Bv7gGr9Ygw # 18la # SIG # End signature block
combined_dataset/train/non-malicious/sample_16_5.ps1
sample_16_5.ps1
# # Module manifest for module 'OCI.PSModules.Ailanguage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ailanguage.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = 'f9edfadc-7cd9-4f7a-8258-fc0671fb808f' # 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 Ailanguage 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 = '75.1.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Ailanguage.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-OCIAilanguageEndpoint', 'Get-OCIAilanguageEndpointsList', 'Get-OCIAilanguageEvaluationResultsList', 'Get-OCIAilanguageModel', 'Get-OCIAilanguageModelsList', 'Get-OCIAilanguageModelType', 'Get-OCIAilanguageProject', 'Get-OCIAilanguageProjectsList', 'Get-OCIAilanguageWorkRequest', 'Get-OCIAilanguageWorkRequestErrorsList', 'Get-OCIAilanguageWorkRequestLogsList', 'Get-OCIAilanguageWorkRequestsList', 'Invoke-OCIAilanguageBatchDetectDominantLanguage', 'Invoke-OCIAilanguageBatchDetectLanguageEntities', 'Invoke-OCIAilanguageBatchDetectLanguageKeyPhrases', 'Invoke-OCIAilanguageBatchDetectLanguagePiiEntities', 'Invoke-OCIAilanguageBatchDetectLanguageSentiments', 'Invoke-OCIAilanguageBatchDetectLanguageTextClassification', 'Invoke-OCIAilanguageBatchLanguageTranslation', 'Invoke-OCIAilanguageDetectDominantLanguage', 'Invoke-OCIAilanguageDetectLanguageEntities', 'Invoke-OCIAilanguageDetectLanguageKeyPhrases', 'Invoke-OCIAilanguageDetectLanguageSentiments', 'Invoke-OCIAilanguageDetectLanguageTextClassification', 'Move-OCIAilanguageEndpointCompartment', 'Move-OCIAilanguageModelCompartment', 'Move-OCIAilanguageProjectCompartment', 'New-OCIAilanguageEndpoint', 'New-OCIAilanguageModel', 'New-OCIAilanguageProject', 'Remove-OCIAilanguageEndpoint', 'Remove-OCIAilanguageModel', 'Remove-OCIAilanguageProject', 'Update-OCIAilanguageEndpoint', 'Update-OCIAilanguageModel', 'Update-OCIAilanguageProject' # 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','Ailanguage' # 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/ISEFun.psm1.ps1
ISEFun.psm1.ps1
# Module version 0.1 # Author: Bartek Bielawski (@bielawb on twitter) # Purpose: Add functionality to PowerShell ISE # Description: Adds Add-ons menu 'ISEFun' with all functions included. # User can add any action there using Add-MyMenuItem function # One of functions (Copy item from history) was build using WPK - won't work if the latter is not loaded. # There is also pretty large code for Windows Forms form (change token colors using ColorDialog # Edit-Function will allow you modify any function in ISE editor # Expand-Alias will expand aliases in current file # Have ISE - Fun! ;) if (-not ($MyISEMenu = $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus | Where-Object { $_.DisplayName -eq 'ISEFun'} ) ) { $MyISEMenu = $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('ISEFun',$null,$null) } # Helper function to add menu items, exported cause it can be used also for other stuff. :> function Add-MyMenuItem { <# .Synopsis Adds items to ISEFun Add-Ons sub-menu .Description Function can be used to add menu items to ISEFun menu. All you need is command, name and hotkey - we will take care of the rest for you. ;) .Example Add-MyMenuItem 'Write-Host fooo' 'Fooo!' 'CTRL+9' Description ----------- This command will add item 'Fooo!' to ISEFun menu. This item will write 'fooo' to the host and can be launched using shortcut CTRL + 9 #> PARAM ( # Script that will be launched when menu item will be selected [Parameter(Mandatory = $true, HelpMessage = 'Command that you want to add to menu')] [string]$Command, # Title for the command in the menu [string]$DisplayName, # Hot key to use given item [string]$HotKey = $null ) if (!$DisplayName) { $DisplayName = $Command -replace '-',' ' } if ( -not ($MyISEMenu.Submenus | Where-Object { $_.DisplayName -eq $DisplayName} ) ) { try { [void]$Script:MyISEMenu.Submenus.Add($DisplayName,[scriptblock]::Create($Command),$HotKey) } catch { # Probably hotkey already use, adding item without it [void]$Script:MyISEMenu.Submenus.Add($DisplayName,[scriptblock]::Create($Command),$null) } } } Add-MyMenuItem Add-MyMenuItem 'Add items' # Next few lines are just garbage you get when you wanna be smart and create GUI in the script. # Forgive me for adding this stuff here, I could probably compile it in some dll and skip this but... # ... well - it gives impression that my module is bigger than it actually is. ;) # # Our form to change colours... :) $handler_bClose_Click= { $Main.Hide() } $handler_bColor_Click= { $Dialog = New-Object Windows.Forms.ColorDialog -Property @{ Color = [drawing.color]::FromArgb($psISE.Options.TokenColors.Item($Combo.SelectedItem).ToString()) FullOpen = $true } if ($Dialog.ShowDialog() -eq 'OK') { $psISE.Options.TokenColors.Item($Combo.SelectedItem) = [windows.media.color]::FromRgb($Dialog.Color.R, $Dialog.Color.G, $Dialog.Color.B) $Combo.ForeColor = $Dialog.Color } } $handler_selectedValue = { $Combo.ForeColor = [drawing.color]::FromArgb($psISE.Options.TokenColors.Item($Combo.SelectedItem).ToString()) $bColor.Focus() } $OnLoadForm_StateCorrection = { $Main.WindowState = $InitialFormWindowState } $Script:Main = New-Object Windows.Forms.Form -Property @{ Text = "Token colors selector" MaximizeBox = $False Name = "Main" HelpButton = $True MinimizeBox = $False ClientSize = New-Object System.Drawing.Size 426, 36 } $Main.DataBindings.DefaultDataSourceUpdateMode = 0 $Combo = New-Object Windows.Forms.ComboBox -Property @{ FormattingEnabled = $True Size = New-Object System.Drawing.Size 239, 23 Name = "Combo" Location = New-Object System.Drawing.Point 12, 7 Font = New-Object System.Drawing.Font("Lucida Console",11.25,0,3,238) TabIndex = 4 } $Combo.DataBindings.DefaultDataSourceUpdateMode = 0 $Combo.Items.AddRange($psISE.Options.TokenColors.Keys) $Combo.Add_SelectedValueChanged($handler_SelectedValue) $InitialFormWindowState = New-Object Windows.Forms.FormWindowState $bClose = New-Object Windows.Forms.Button -Property @{ TabIndex = 2 Name = "bClose" Size = New-Object System.Drawing.Size 75, 23 UseVisualStyleBackColor = $True Text = "Close" Location = New-Object System.Drawing.Point 338, 7 } $bClose.DataBindings.DefaultDataSourceUpdateMode = 0 $bClose.add_Click($handler_bClose_Click) $bColor = New-Object Windows.Forms.Button -Property @{ TabIndex = 1 Name = "bColor" Size = New-Object System.Drawing.Size 75, 23 UseVisualStyleBackColor = $True Text = "Color" Location = New-Object System.Drawing.Point 257, 7 } $bColor.DataBindings.DefaultDataSourceUpdateMode = 0 $bColor.add_Click($handler_bColor_Click) $Main.Controls.AddRange(@($bColor,$bClose,$Combo)) $InitialFormWindowState = $Main.WindowState $Main.add_Load($OnLoadForm_StateCorrection) $HelpMessage = @' This GUI will help you change you token colors. It's updating text color as you select tokens that you want to modify. Button 'Color' opens up color dialog. I won't describe actions performed by 'Close' button. I hope you are able to guess it... ;) '@ $Main.add_HelpButtonClicked( { [void][windows.forms.MessageBox]::Show($HelpMessage,'Help','OK','Information')}) function Set-TokenColor { <# .Synopsis GUI to add some Token Colors. .Description Really. It is just that. No more to it. Seriously! OK. GUI is pretty smart. You can select tokens that are available, color will change and match the one you currently have. See for yourself. ;) .Example Can show you click-click-click example :) #> $Script:Main.ShowDialog()| Out-Null } Add-MyMenuItem Set-TokenColor function Expand-Alias { <# .Synopsis Function to expand all command aliases in current script. .Description If you want to expand all aliases in a script/ module that you write in PowerShell ISE - this function will help you with that. It's using Tokenizer to find all commands, Get-Alias to find aliases and their definition, and simply replace alias with command hidden by it. .Example Expand-Alias #> # Read in current file if (!$psISE.CurrentFile) { throw 'No files opened!' } if ( -not ($Script = $psISE.CurrentFile.Editor.Text) ) { throw 'No code!' } $line = $psISE.CurrentFile.Editor.CaretLine $column = $psISE.CurrentFile.Editor.CaretColumn if ( -not ($commands = [System.Management.Automation.PsParser]::Tokenize($Script, [ref]$null) | Where-Object { $_.Type -eq 'Command' } | Sort-Object -Property Start -Descending) ) { return } foreach ($command in $commands) { if (Get-Alias $command.Content -ErrorAction SilentlyContinue) { # $command $psISE.CurrentFile.Editor.Select($command.StartLine, $command.StartColumn, $command.EndLine, $command.EndColumn) $psISE.CurrentFile.Editor.InsertText($(Get-Alias $command.Content | Select-Object -ExpandProperty Definition)) } } $psISE.CurrentFile.Editor.SetCaretPosition($line, $column) } Add-MyMenuItem Expand-Alias function Edit-Function { <# .Synopsis Simpe function to edit functions in ISE. .Description Need to edit function on-the-fly? Want to see how a given function looks like to change it a bit and rename it? Or maybe just preparing module and you want to change functions you define to make sure changes will work as expected? Well, with Edit-Function, which is very simple (thank you PowerShell team!) you can do it. :) .Example Edit-Function Edit-Function Description ----------- You can open any function that exists in your current session, including the function that you reading help to now. Be careful with that one though. If you change it in wrong direction you may not be able to open it again and fix it. At least not in the way you could originaly, with Edit-Function. :) #> [CmdletBinding()] param ( [Parameter(Mandatory=$true,HelpMessage='Function name is mandatory parameter.')] [ValidateScript({Get-Command -CommandType function $_})] [string] $Name ) if (!$psISE) { Throw 'Implemented for PowerShell ISE only!' } $file = $psISE.CurrentPowerShellTab.Files.Add() $file.Editor.InsertText("function $name {`n") $file.Editor.InsertText($(Get-Command -CommandType function $name | Select-Object -ExpandProperty definition)) $file.Editor.InsertText("}") } Add-MyMenuItem Edit-Function function Copy-HistoryItem { <# .Synopsis Function build using WPK to give you functionality similar to one you already have in PowerShell.exe .Description Display you command history and let you choose from it. Copies selected command to you commandPane. .Example Copy-HistoryItem GUI, so it's not easy to show examples... #> try { New-Window -Width 800 -Height 100 { New-ListBox -On_PreviewMouseDoubleClick { $psISE.CurrentPowerShellTab.CommandPane.InsertText($this.SelectedValue) $this.parent.close() } -Items $(Get-History | Select-Object -ExpandProperty CommandLine) } -Show } catch { throw 'Requires WPK to work, will be rewritten soon...' } } Add-MyMenuItem Copy-HistoryItem 'Copy item from History' F7 New-Alias -Name edfun -Value Edit-Function New-Alias -Name expa -Value Expand-Alias New-Alias -Name cphi -Value Copy-HistoryItem Export-ModuleMember -Function * -Alias * # Get rid off menu if module is going to be unloaded. $MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = { [void]$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Remove($MyISEMenu) }
combined_dataset/train/non-malicious/sample_14_85.ps1
sample_14_85.ps1
# # Module manifest for module 'OCI.PSModules.Database' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Database.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = 'e1b520e7-13c2-41a0-be48-3eacc401dff5' # 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 Database 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.Database.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-OCIDatabaseStorageCapacityCloudExadataInfrastructure', 'Add-OCIDatabaseStorageCapacityExadataInfrastructure', 'Add-OCIDatabaseVirtualMachineToCloudVmCluster', 'Add-OCIDatabaseVirtualMachineToVmCluster', 'Complete-OCIDatabaseExternalBackupJob', 'Confirm-OCIDatabaseVmClusterNetwork', 'Disable-OCIDatabaseAutonomousDatabaseManagement', 'Disable-OCIDatabaseAutonomousDatabaseOperationsInsights', 'Disable-OCIDatabaseExternalContainerDatabaseDatabaseManagement', 'Disable-OCIDatabaseExternalContainerDatabaseStackMonitoring', 'Disable-OCIDatabaseExternalNonContainerDatabaseDatabaseManagement', 'Disable-OCIDatabaseExternalNonContainerDatabaseOperationsInsights', 'Disable-OCIDatabaseExternalNonContainerDatabaseStackMonitoring', 'Disable-OCIDatabaseExternalPluggableDatabaseDatabaseManagement', 'Disable-OCIDatabaseExternalPluggableDatabaseOperationsInsights', 'Disable-OCIDatabaseExternalPluggableDatabaseStackMonitoring', 'Disable-OCIDatabaseManagement', 'Disable-OCIDatabasePluggableDatabaseManagement', 'Edit-OCIDatabaseManagement', 'Edit-OCIDatabasePluggableDatabaseManagement', 'Enable-OCIDatabaseAutonomousDatabaseManagement', 'Enable-OCIDatabaseAutonomousDatabaseOperationsInsights', 'Enable-OCIDatabaseExadataInfrastructure', 'Enable-OCIDatabaseExternalContainerDatabaseDatabaseManagement', 'Enable-OCIDatabaseExternalContainerDatabaseStackMonitoring', 'Enable-OCIDatabaseExternalNonContainerDatabaseDatabaseManagement', 'Enable-OCIDatabaseExternalNonContainerDatabaseOperationsInsights', 'Enable-OCIDatabaseExternalNonContainerDatabaseStackMonitoring', 'Enable-OCIDatabaseExternalPluggableDatabaseDatabaseManagement', 'Enable-OCIDatabaseExternalPluggableDatabaseOperationsInsights', 'Enable-OCIDatabaseExternalPluggableDatabaseStackMonitoring', 'Enable-OCIDatabaseManagement', 'Enable-OCIDatabasePluggableDatabaseManagement', 'Get-OCIDatabase', 'Get-OCIDatabaseApplicationVip', 'Get-OCIDatabaseApplicationVipsList', 'Get-OCIDatabaseAutonomousContainerDatabase', 'Get-OCIDatabaseAutonomousContainerDatabaseDataguardAssociation', 'Get-OCIDatabaseAutonomousContainerDatabaseDataguardAssociationsList', 'Get-OCIDatabaseAutonomousContainerDatabaseResourceUsage', 'Get-OCIDatabaseAutonomousContainerDatabasesList', 'Get-OCIDatabaseAutonomousContainerDatabaseVersionsList', 'Get-OCIDatabaseAutonomousDatabase', 'Get-OCIDatabaseAutonomousDatabaseBackup', 'Get-OCIDatabaseAutonomousDatabaseBackupsList', 'Get-OCIDatabaseAutonomousDatabaseCharacterSetsList', 'Get-OCIDatabaseAutonomousDatabaseClonesList', 'Get-OCIDatabaseAutonomousDatabaseDataguardAssociation', 'Get-OCIDatabaseAutonomousDatabaseDataguardAssociationsList', 'Get-OCIDatabaseAutonomousDatabaseRefreshableClonesList', 'Get-OCIDatabaseAutonomousDatabaseRegionalWallet', 'Get-OCIDatabaseAutonomousDatabasesList', 'Get-OCIDatabaseAutonomousDatabaseWallet', 'Get-OCIDatabaseAutonomousDbPreviewVersionsList', 'Get-OCIDatabaseAutonomousDbVersionsList', 'Get-OCIDatabaseAutonomousExadataInfrastructure', 'Get-OCIDatabaseAutonomousExadataInfrastructureShapesList', 'Get-OCIDatabaseAutonomousExadataInfrastructuresList', 'Get-OCIDatabaseAutonomousPatch', 'Get-OCIDatabaseAutonomousVirtualMachine', 'Get-OCIDatabaseAutonomousVirtualMachinesList', 'Get-OCIDatabaseAutonomousVmCluster', 'Get-OCIDatabaseAutonomousVmClusterAcdResourceUsageList', 'Get-OCIDatabaseAutonomousVmClusterResourceUsage', 'Get-OCIDatabaseAutonomousVmClustersList', 'Get-OCIDatabaseBackup', 'Get-OCIDatabaseBackupDestination', 'Get-OCIDatabaseBackupDestinationList', 'Get-OCIDatabaseBackupsList', 'Get-OCIDatabaseCloudAutonomousVmCluster', 'Get-OCIDatabaseCloudAutonomousVmClusterAcdResourceUsageList', 'Get-OCIDatabaseCloudAutonomousVmClusterResourceUsage', 'Get-OCIDatabaseCloudAutonomousVmClustersList', 'Get-OCIDatabaseCloudExadataInfrastructure', 'Get-OCIDatabaseCloudExadataInfrastructuresList', 'Get-OCIDatabaseCloudExadataInfrastructureUnallocatedResources', 'Get-OCIDatabaseCloudVmCluster', 'Get-OCIDatabaseCloudVmClusterIormConfig', 'Get-OCIDatabaseCloudVmClustersList', 'Get-OCIDatabaseCloudVmClusterUpdate', 'Get-OCIDatabaseCloudVmClusterUpdateHistoryEntriesList', 'Get-OCIDatabaseCloudVmClusterUpdateHistoryEntry', 'Get-OCIDatabaseCloudVmClusterUpdatesList', 'Get-OCIDatabaseConsoleConnection', 'Get-OCIDatabaseConsoleConnectionsList', 'Get-OCIDatabaseConsoleHistoriesList', 'Get-OCIDatabaseConsoleHistory', 'Get-OCIDatabaseConsoleHistoryContent', 'Get-OCIDatabaseContainerDatabasePatchesList', 'Get-OCIDatabaseDataGuardAssociation', 'Get-OCIDatabaseDataGuardAssociationsList', 'Get-OCIDatabaseDbHome', 'Get-OCIDatabaseDbHomePatch', 'Get-OCIDatabaseDbHomePatchesList', 'Get-OCIDatabaseDbHomePatchHistoryEntriesList', 'Get-OCIDatabaseDbHomePatchHistoryEntry', 'Get-OCIDatabaseDbHomesList', 'Get-OCIDatabaseDbNode', 'Get-OCIDatabaseDbNodesList', 'Get-OCIDatabaseDbServer', 'Get-OCIDatabaseDbServersList', 'Get-OCIDatabaseDbSystem', 'Get-OCIDatabaseDbSystemComputePerformancesList', 'Get-OCIDatabaseDbSystemPatch', 'Get-OCIDatabaseDbSystemPatchesList', 'Get-OCIDatabaseDbSystemPatchHistoryEntriesList', 'Get-OCIDatabaseDbSystemPatchHistoryEntry', 'Get-OCIDatabaseDbSystemShapesList', 'Get-OCIDatabaseDbSystemsList', 'Get-OCIDatabaseDbSystemStoragePerformancesList', 'Get-OCIDatabaseDbSystemUpgradeHistoryEntriesList', 'Get-OCIDatabaseDbSystemUpgradeHistoryEntry', 'Get-OCIDatabaseDbVersionsList', 'Get-OCIDatabaseExadataInfrastructure', 'Get-OCIDatabaseExadataInfrastructureOcpus', 'Get-OCIDatabaseExadataInfrastructuresList', 'Get-OCIDatabaseExadataInfrastructureUnAllocatedResources', 'Get-OCIDatabaseExadataIormConfig', 'Get-OCIDatabaseExternalBackupJob', 'Get-OCIDatabaseExternalContainerDatabase', 'Get-OCIDatabaseExternalContainerDatabasesList', 'Get-OCIDatabaseExternalDatabaseConnector', 'Get-OCIDatabaseExternalDatabaseConnectorsList', 'Get-OCIDatabaseExternalNonContainerDatabase', 'Get-OCIDatabaseExternalNonContainerDatabasesList', 'Get-OCIDatabaseExternalPluggableDatabase', 'Get-OCIDatabaseExternalPluggableDatabasesList', 'Get-OCIDatabaseFlexComponentsList', 'Get-OCIDatabaseGiVersionsList', 'Get-OCIDatabaseInfrastructureTargetVersions', 'Get-OCIDatabaseKeyStore', 'Get-OCIDatabaseKeyStoresList', 'Get-OCIDatabaseMaintenanceRun', 'Get-OCIDatabaseMaintenanceRunHistory', 'Get-OCIDatabaseMaintenanceRunHistoryList', 'Get-OCIDatabaseMaintenanceRunsList', 'Get-OCIDatabaseOneoffPatch', 'Get-OCIDatabaseOneoffPatchesList', 'Get-OCIDatabasePdbConversionHistoryEntriesList', 'Get-OCIDatabasePdbConversionHistoryEntry', 'Get-OCIDatabasePluggableDatabase', 'Get-OCIDatabasePluggableDatabasesList', 'Get-OCIDatabasesList', 'Get-OCIDatabaseSoftwareImage', 'Get-OCIDatabaseSoftwareImagesList', 'Get-OCIDatabaseSystemVersionsList', 'Get-OCIDatabaseUpgradeHistoryEntriesList', 'Get-OCIDatabaseUpgradeHistoryEntry', 'Get-OCIDatabaseVmCluster', 'Get-OCIDatabaseVmClusterNetwork', 'Get-OCIDatabaseVmClusterNetworksList', 'Get-OCIDatabaseVmClusterPatch', 'Get-OCIDatabaseVmClusterPatchesList', 'Get-OCIDatabaseVmClusterPatchHistoryEntriesList', 'Get-OCIDatabaseVmClusterPatchHistoryEntry', 'Get-OCIDatabaseVmClustersList', 'Get-OCIDatabaseVmClusterUpdate', 'Get-OCIDatabaseVmClusterUpdateHistoryEntriesList', 'Get-OCIDatabaseVmClusterUpdateHistoryEntry', 'Get-OCIDatabaseVmClusterUpdatesList', 'Invoke-OCIDatabaseAutonomousDatabaseManualRefresh', 'Invoke-OCIDatabaseCheckExternalDatabaseConnectorConnectionStatus', 'Invoke-OCIDatabaseConfigureAutonomousDatabaseVaultKey', 'Invoke-OCIDatabaseConfigureSaasAdminUser', 'Invoke-OCIDatabaseConvertToPdb', 'Invoke-OCIDatabaseConvertToRegularPluggableDatabase', 'Invoke-OCIDatabaseDbNodeAction', 'Invoke-OCIDatabaseDownloadExadataInfrastructureConfigFile', 'Invoke-OCIDatabaseDownloadOneoffPatch', 'Invoke-OCIDatabaseDownloadValidationReport', 'Invoke-OCIDatabaseDownloadVmClusterNetworkConfigFile', 'Invoke-OCIDatabaseFailoverAutonomousContainerDatabaseDataguardAssociation', 'Invoke-OCIDatabaseFailOverAutonomousDatabase', 'Invoke-OCIDatabaseFailoverDataGuardAssociation', 'Invoke-OCIDatabaseLaunchAutonomousExadataInfrastructure', 'Invoke-OCIDatabaseLocalClonePluggableDatabase', 'Invoke-OCIDatabaseMigrateExadataDbSystemResourceModel', 'Invoke-OCIDatabaseMigrateVaultKey', 'Invoke-OCIDatabaseRefreshPluggableDatabase', 'Invoke-OCIDatabaseReinstateAutonomousContainerDatabaseDataguardAssociation', 'Invoke-OCIDatabaseReinstateDataGuardAssociation', 'Invoke-OCIDatabaseRemoteClonePluggableDatabase', 'Invoke-OCIDatabaseResizeVmClusterNetwork', 'Invoke-OCIDatabaseResourcePoolShapes', 'Invoke-OCIDatabaseRotateAutonomousContainerDatabaseEncryptionKey', 'Invoke-OCIDatabaseRotateAutonomousDatabaseEncryptionKey', 'Invoke-OCIDatabaseRotateAutonomousVmClusterOrdsCerts', 'Invoke-OCIDatabaseRotateAutonomousVmClusterSslCerts', 'Invoke-OCIDatabaseRotateCloudAutonomousVmClusterOrdsCerts', 'Invoke-OCIDatabaseRotateCloudAutonomousVmClusterSslCerts', 'Invoke-OCIDatabaseRotateOrdsCerts', 'Invoke-OCIDatabaseRotatePluggableDatabaseEncryptionKey', 'Invoke-OCIDatabaseRotateSslCerts', 'Invoke-OCIDatabaseRotateVaultKey', 'Invoke-OCIDatabaseSaasAdminUserStatus', 'Invoke-OCIDatabaseScanExternalContainerDatabasePluggableDatabases', 'Invoke-OCIDatabaseShrinkAutonomousDatabase', 'Invoke-OCIDatabaseSwitchoverAutonomousContainerDatabaseDataguardAssociation', 'Invoke-OCIDatabaseSwitchoverAutonomousDatabase', 'Invoke-OCIDatabaseSwitchoverDataGuardAssociation', 'Invoke-OCIDatabaseTerminateAutonomousContainerDatabase', 'Invoke-OCIDatabaseTerminateAutonomousExadataInfrastructure', 'Invoke-OCIDatabaseTerminateDbSystem', 'Invoke-OCIDatabaseUpgradeDatabase', 'Invoke-OCIDatabaseUpgradeDbSystem', 'Move-OCIDatabaseAutonomousContainerDatabaseCompartment', 'Move-OCIDatabaseAutonomousDatabaseCompartment', 'Move-OCIDatabaseAutonomousExadataInfrastructureCompartment', 'Move-OCIDatabaseAutonomousVmClusterCompartment', 'Move-OCIDatabaseBackupDestinationCompartment', 'Move-OCIDatabaseCloudAutonomousVmClusterCompartment', 'Move-OCIDatabaseCloudExadataInfrastructureCompartment', 'Move-OCIDatabaseCloudVmClusterCompartment', 'Move-OCIDatabaseDataguardRole', 'Move-OCIDatabaseDbSystemCompartment', 'Move-OCIDatabaseDisasterRecoveryConfiguration', 'Move-OCIDatabaseExadataInfrastructureCompartment', 'Move-OCIDatabaseExternalContainerDatabaseCompartment', 'Move-OCIDatabaseExternalNonContainerDatabaseCompartment', 'Move-OCIDatabaseExternalPluggableDatabaseCompartment', 'Move-OCIDatabaseKeyStoreCompartment', 'Move-OCIDatabaseKeyStoreType', 'Move-OCIDatabaseOneoffPatchCompartment', 'Move-OCIDatabaseSoftwareImageCompartment', 'Move-OCIDatabaseVmClusterCompartment', 'New-OCIDatabase', 'New-OCIDatabaseApplicationVip', 'New-OCIDatabaseAutonomousContainerDatabase', 'New-OCIDatabaseAutonomousContainerDatabaseDataguardAssociation', 'New-OCIDatabaseAutonomousDatabase', 'New-OCIDatabaseAutonomousDatabaseBackup', 'New-OCIDatabaseAutonomousDatabaseWallet', 'New-OCIDatabaseAutonomousVmCluster', 'New-OCIDatabaseBackup', 'New-OCIDatabaseBackupDestination', 'New-OCIDatabaseCloudAutonomousVmCluster', 'New-OCIDatabaseCloudExadataInfrastructure', 'New-OCIDatabaseCloudVmCluster', 'New-OCIDatabaseConsoleConnection', 'New-OCIDatabaseConsoleHistory', 'New-OCIDatabaseDataGuardAssociation', 'New-OCIDatabaseDbHome', 'New-OCIDatabaseDbSystem', 'New-OCIDatabaseExadataInfrastructure', 'New-OCIDatabaseExternalBackupJob', 'New-OCIDatabaseExternalContainerDatabase', 'New-OCIDatabaseExternalDatabaseConnector', 'New-OCIDatabaseExternalNonContainerDatabase', 'New-OCIDatabaseExternalPluggableDatabase', 'New-OCIDatabaseKeyStore', 'New-OCIDatabaseMaintenanceRun', 'New-OCIDatabaseOneoffPatch', 'New-OCIDatabasePluggableDatabase', 'New-OCIDatabaseRecommendedVmClusterNetwork', 'New-OCIDatabaseSoftwareImage', 'New-OCIDatabaseVmCluster', 'New-OCIDatabaseVmClusterNetwork', 'Register-OCIDatabaseAutonomousDatabaseDataSafe', 'Remove-OCIDatabase', 'Remove-OCIDatabaseApplicationVip', 'Remove-OCIDatabaseAutonomousDatabase', 'Remove-OCIDatabaseAutonomousDatabaseBackup', 'Remove-OCIDatabaseAutonomousVmCluster', 'Remove-OCIDatabaseBackup', 'Remove-OCIDatabaseBackupDestination', 'Remove-OCIDatabaseCloudAutonomousVmCluster', 'Remove-OCIDatabaseCloudExadataInfrastructure', 'Remove-OCIDatabaseCloudVmCluster', 'Remove-OCIDatabaseConsoleConnection', 'Remove-OCIDatabaseConsoleHistory', 'Remove-OCIDatabaseDbHome', 'Remove-OCIDatabaseExadataInfrastructure', 'Remove-OCIDatabaseExternalContainerDatabase', 'Remove-OCIDatabaseExternalDatabaseConnector', 'Remove-OCIDatabaseExternalNonContainerDatabase', 'Remove-OCIDatabaseExternalPluggableDatabase', 'Remove-OCIDatabaseKeyStore', 'Remove-OCIDatabaseOneoffPatch', 'Remove-OCIDatabasePluggableDatabase', 'Remove-OCIDatabaseSoftwareImage', 'Remove-OCIDatabaseVirtualMachineFromCloudVmCluster', 'Remove-OCIDatabaseVirtualMachineFromVmCluster', 'Remove-OCIDatabaseVmCluster', 'Remove-OCIDatabaseVmClusterNetwork', 'Restart-OCIDatabaseAutonomousContainerDatabase', 'Restart-OCIDatabaseAutonomousDatabase', 'Restore-OCIDatabase', 'Restore-OCIDatabaseAutonomousDatabase', 'Start-OCIDatabaseAutonomousDatabase', 'Start-OCIDatabasePluggableDatabase', 'Stop-OCIDatabaseAutonomousDatabase', 'Stop-OCIDatabaseBackup', 'Stop-OCIDatabasePluggableDatabase', 'Unregister-OCIDatabaseAutonomousDatabaseDataSafe', 'Update-OCIDatabase', 'Update-OCIDatabaseAutonomousContainerDatabase', 'Update-OCIDatabaseAutonomousContainerDatabaseDataguardAssociation', 'Update-OCIDatabaseAutonomousDatabase', 'Update-OCIDatabaseAutonomousDatabaseBackup', 'Update-OCIDatabaseAutonomousDatabaseRegionalWallet', 'Update-OCIDatabaseAutonomousDatabaseWallet', 'Update-OCIDatabaseAutonomousExadataInfrastructure', 'Update-OCIDatabaseAutonomousVmCluster', 'Update-OCIDatabaseBackupDestination', 'Update-OCIDatabaseCloudAutonomousVmCluster', 'Update-OCIDatabaseCloudExadataInfrastructure', 'Update-OCIDatabaseCloudVmCluster', 'Update-OCIDatabaseCloudVmClusterIormConfig', 'Update-OCIDatabaseConsoleConnection', 'Update-OCIDatabaseConsoleHistory', 'Update-OCIDatabaseDataGuardAssociation', 'Update-OCIDatabaseDbHome', 'Update-OCIDatabaseDbNode', 'Update-OCIDatabaseDbSystem', 'Update-OCIDatabaseExadataInfrastructure', 'Update-OCIDatabaseExadataIormConfig', 'Update-OCIDatabaseExternalContainerDatabase', 'Update-OCIDatabaseExternalDatabaseConnector', 'Update-OCIDatabaseExternalNonContainerDatabase', 'Update-OCIDatabaseExternalPluggableDatabase', 'Update-OCIDatabaseKeyStore', 'Update-OCIDatabaseMaintenanceRun', 'Update-OCIDatabaseOneoffPatch', 'Update-OCIDatabasePluggableDatabase', 'Update-OCIDatabaseSoftwareImage', 'Update-OCIDatabaseVmCluster', 'Update-OCIDatabaseVmClusterNetwork' # 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','Database' # 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_34.ps1
sample_41_34.ps1
# ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- <# .Synopsis Create an in-memory object for MetricSettings. .Description Create an in-memory object for MetricSettings. .Outputs Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings .Link https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzDiagnosticSettingMetricSettingsObject #> function New-AzDiagnosticSettingMetricSettingsObject { [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings')] [CmdletBinding(PositionalBinding=$false)] Param( [Parameter(HelpMessage="Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings operation.")] [string] $Category, [Parameter(Mandatory, HelpMessage="a value indicating whether this category is enabled.")] [bool] $Enabled, [Parameter(HelpMessage="the number of days for the retention in days. A value of 0 will retain the events indefinitely.")] [int] $RetentionPolicyDay, [Parameter(HelpMessage="a value indicating whether the retention policy is enabled.")] [bool] $RetentionPolicyEnabled, [Parameter(HelpMessage="the timegrain of the metric in ISO8601 format.")] [System.TimeSpan] $TimeGrain ) process { $Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.DiagnosticSetting.Models.Api20210501Preview.MetricSettings]::New() if ($PSBoundParameters.ContainsKey('Category')) { $Object.Category = $Category } if ($PSBoundParameters.ContainsKey('Enabled')) { $Object.Enabled = $Enabled } if ($PSBoundParameters.ContainsKey('RetentionPolicyDay')) { $Object.RetentionPolicyDay = $RetentionPolicyDay } if ($PSBoundParameters.ContainsKey('RetentionPolicyEnabled')) { $Object.RetentionPolicyEnabled = $RetentionPolicyEnabled } if ($PSBoundParameters.ContainsKey('TimeGrain')) { $Object.TimeGrain = $TimeGrain } return $Object } } # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDg76HURQvzJgnY # gRtOfUG+ccGZ/WdbNJ5PzFMJNnyhhqCCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQ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zM4jiXeFJXH1C4F6XYXBIqgdm1tnOxaV3gYoeaiFmc6g9NfkLUmVd1FSyIvUY8 # /zhuA+ynIflfYC4ruqKW3fDRKIMxJecRG4Aw9ZJM8iv1elQEfdwNCx5KW+yP6Pn2 # LLII9DiBHLWOZmDdkdjJBXOoFMwgFN4mJo2apof5CnYZ//9wPYfkRnn0CW22Hllv # QeXlhtObgy/N54uDQ9JC7gDJdhIHmajfvfZsxWGftmrNKvvXoMdukpX+iJftZIm8 # VT2UXUHqI35+2199A99S3JvpGc7iHJAI3G/FMvxR7g06WpaihTbKwrDGOsKPhqOK # 9sfQ # SIG # End signature block
combined_dataset/train/non-malicious/sample_8_24.ps1
sample_8_24.ps1
ConvertFrom-StringData @' id_printdevmodes2countcheck_st=There are several printers listed under HKU\\.DEFAULT\\Printers\\DevModes2 '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCpI8RSzDRSa3og # oOHqv3EUpkgdAs7DOLRiMKuRSauNPaCCDXYwggX0MIID3KADAgECAhMzAAAEBGx0 # Bv9XKydyAAAAAAQEMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjQwOTEyMjAxMTE0WhcNMjUwOTExMjAxMTE0WjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm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TqaiMvnRZHjCdjOLVRxvuSDehj18gcp6O # YydLNInnr8MISWAQn3w6ZHLcRV/aJsWcl8RFyB2rcyl3VqRppky8KNoXQtkFrM4m # xLE6S5qHRUWNHu/qY45TSn4YGu0k5brIWiaKTGGy3uKwGqabYlC9gsD+5zoUgg1i # jxGo5tkNduxxnWXWWdVzO9lYy90+ECMKnSv5XVIf0+OqAqoeFKUgzAImex26N94K # HaWX0xT/JJGSnFojOrQdJGqXRqjBuW0kN7VQOodRbw0bvw/fE5Nt36jdyq/FpTl/ # sxOLP45I0+L/gdtWG8uUqqKxU7uZQL/45rNXGbbLl5FXhoVFQsM3SNyansAo5REX # fWzwPk5C5Vu7pq9lcRjPIiHw5YgVw20VkXP69/P3pLnsVW+M64vGaf1Df9CJGU3V # 8U5kNGIEEahWx6JR23xJxcYiTdqixAVcZz6p9y4E+zsg7ZMs6LGIF/49fSuQKGlK # fKjAQ77k6eEfi9bTNcwBiX38DxV2M8z3JcJRYIWfVcwGCFmm5U+bSpQ+4FUhyny9 # c/d965vjC9D0JkzLUCY= # SIG # End signature block
combined_dataset/train/non-malicious/3560.ps1
3560.ps1
$suffix="v2avm1" $JobQueryWaitTimeInSeconds = 0 $PrimaryFabricName = "V2A-W2K12-400" $PrimaryNetworkFriendlyName = "corp" $RecoveryNetworkFriendlyName = "corp" $NetworkMappingName = "corp96map" $RecoveryPlanName = "RPSwag96" + $suffix $policyName1 = "V2aTest" + $suffix $policyName2 = "V2aTest"+ $suffix+"-failback" $PrimaryProtectionContainerMapping = "pcmmapping" + $suffix $reverseMapping = "reverseMap" + $suffix $pcName = "V2A-W2K12-400" $rpiName = "V2ATest-rpi-" + $suffix $RecoveryAzureStorageAccountId = "/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/canaryexproute/providers/Microsoft.Storage/storageAccounts/ev2teststorage" $RecoveryResourceGroupId = "/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/canaryexproute" $AzureVmNetworkId = "/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/ERNetwork/providers/Microsoft.Network/virtualNetworks/ASRCanaryTestSub3-CORP-SEA-VNET-1" $rpiNameNew = "V2ATest-CentOS6U7-400-new" $vCenterIpOrHostName = "10.150.209.216" $vCenterName = "BCDR" $Subnet = "Subnet-1" $piName = "v2avm1" $vmIp = "10.150.208.125" $VmNameList = "v2avm1,win-4002,win-4003" function WaitForJobCompletion { param( [string] $JobId, [int] $JobQueryWaitTimeInSeconds =$JobQueryWaitTimeInSeconds ) $isJobLeftForProcessing = $true; do { $Job = Get-AzRecoveryServicesAsrJob -Name $JobId $Job if($Job.State -eq "InProgress" -or $Job.State -eq "NotStarted") { $isJobLeftForProcessing = $true } else { $isJobLeftForProcessing = $false } if($isJobLeftForProcessing) { [Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities]::Wait($JobQueryWaitTimeInSeconds * 1000) } }While($isJobLeftForProcessing) } Function WaitForIRCompletion { param( [PSObject] $TargetObjectId, [int] $JobQueryWaitTimeInSeconds = $JobQueryWaitTimeInSeconds ) $isProcessingLeft = $true $IRjobs = $null do { $IRjobs = Get-AzRecoveryServicesAsrJob -TargetObjectId $TargetObjectId | Sort-Object StartTime -Descending | select -First 1 | Where-Object{$_.JobType -eq "IrCompletion"} if($IRjobs -eq $null -or $IRjobs.Count -lt 1) { $isProcessingLeft = $true } else { $isProcessingLeft = $false } if($isProcessingLeft) { [Microsoft.Rest.ClientRuntime.Azure.TestFramework.TestUtilities]::Wait($JobQueryWaitTimeInSeconds * 1000) } }While($isProcessingLeft) $IRjobs WaitForJobCompletion -JobId $IRjobs[0].Name -JobQueryWaitTimeInSeconds $JobQueryWaitTimeInSeconds } function Test-vCenter { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName $job = New-ASRvCenter -Fabric $fabric -Name $vCenterName -IpOrHostName $vCenterIporHostName -Port 443 -Account $fabric.FabricSpecificDetails.RunAsAccounts[0] WaitForJobCompletion -JobId $job.name $fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName $vCenterList = Get-ASRvCenter -Fabric $fabric Assert-NotNull($vCenterList[0]) $vCenter = Get-ASRvCenter -Fabric $fabric -Name $vCenterName Assert-NotNull($vCenter) $updateJob = Update-AzRecoveryServicesAsrvCenter -InputObject $vCenter -Port 444 WaitForJobCompletion -JobId $updatejob.name $job = Remove-ASRvCenter -InputObject $vCenter WaitForJobCompletion -JobId $job.name } function Test-SiteRecoveryFabricTest { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabricList = Get-AsrFabric Assert-NotNull($fabricList) $fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName Assert-NotNull($fabric) Assert-NotNull($fabric.FriendlyName) Assert-NotNull($fabric.name) Assert-NotNull($fabric.ID) Assert-NotNull($fabric.FabricSpecificDetails) $fabricDetails = $fabric.FabricSpecificDetails Assert-NotNull($fabricDetails.HostName) Assert-NotNull($fabricDetails.IpAddress) Assert-NotNull($fabricDetails.AgentVersion) Assert-NotNull($fabricDetails.ProtectedServers) Assert-NotNull($fabricDetails.LastHeartbeat) Assert-NotNull($fabricDetails.ProcessServers) Assert-NotNull($fabricDetails.MasterTargetServers) Assert-NotNull($fabricDetails.RunAsAccounts) Assert-NotNull($fabricDetails.IpAddress) $ProcessServer = $fabricDetails.ProcessServers Assert-NotNull($ProcessServer.FriendlyName) Assert-NotNull($ProcessServer.Id) Assert-NotNull($ProcessServer.IpAddress) } function Test-PC { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName $ProtectionContainerList = Get-ASRProtectionContainer -Fabric $fabric Assert-NotNull($ProtectionContainerList) $ProtectionContainer = $ProtectionContainerList[0] Assert-NotNull($ProtectionContainer) Assert-NotNull($ProtectionContainer.id) Assert-AreEQUAL -actual $ProtectionContainer.FabricType -expected "VMware" $ProtectionContainer = Get-ASRProtectionContainer -FriendlyName $pcName -Fabric $fabric Assert-NotNull($ProtectionContainer) Assert-NotNull($ProtectionContainer.id) Assert-AreEQUAL -actual $ProtectionContainer.FabricType -expected "VMware" $ProtectionContainer = Get-ASRProtectionContainer -Name $ProtectionContainer.Name -Fabric $fabric Assert-NotNull($ProtectionContainer) Assert-NotNull($ProtectionContainer.id) Assert-AreEQUAL -actual $ProtectionContainer.FabricType -expected "VMware" } function Test-SiteRecoveryPolicy { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $Job = New-AzRecoveryServicesAsrPolicy -Name $policyName1 -VmwareToAzure -RecoveryPointRetentionInHours 40 -RPOWarningThresholdInMinutes 5 -ApplicationConsistentSnapshotFrequencyInHours 15 WaitForJobCompletion -JobId $Job.Name $Policy1 = Get-AzRecoveryServicesAsrPolicy -Name $PolicyName1 Assert-True { $Policy1.Count -gt 0 } Assert-NotNull($Policy1) $Job = New-AzRecoveryServicesAsrPolicy -Name $policyName2 -AzureToVmware -RecoveryPointRetentionInHours 40 -RPOWarningThresholdInMinutes 5 -ApplicationConsistentSnapshotFrequencyInHours 15 WaitForJobCompletion -JobId $Job.Name $Policy2 = Get-AzRecoveryServicesAsrPolicy -Name $PolicyName2 Assert-True { $Policy2.Count -gt 0 } Assert-NotNull($Policy2) $RemoveJob = Remove-ASRPolicy -InputObject $Policy1 $RemoveJob = Remove-ASRPolicy -InputObject $Policy2 } function Test-V2AAddPI { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName $pc = Get-ASRProtectionContainer -FriendlyName $pcName -Fabric $fabric $job = New-AzRecoveryServicesAsrProtectableItem -IPAddress $vmIp -FriendlyName $piName -OSType Windows -ProtectionContainer $pc waitForJobCompletion -JobId $job.name } function Test-PCM { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $pc = Get-ASRProtectionContainer -FriendlyName $pcName -Fabric $fabric $Job1 = New-AzRecoveryServicesAsrPolicy -Name $policyName1 -VmwaretoAzure -RecoveryPointRetentionInHours 40 -RPOWarningThresholdInMinutes 5 -ApplicationConsistentSnapshotFrequencyInHours 15 $Job2 = New-AzRecoveryServicesAsrPolicy -Name $policyName2 -AzureToVmware -RecoveryPointRetentionInHours 40 -RPOWarningThresholdInMinutes 5 -ApplicationConsistentSnapshotFrequencyInHours 15 waitForJobCompletion -JobId $job1.name waitForJobCompletion -JobId $job2.name $Policy1 = Get-AzRecoveryServicesAsrPolicy -Name $PolicyName1 $Policy2 = Get-AzRecoveryServicesAsrPolicy -Name $PolicyName2 $pcmjob = New-AzRecoveryServicesAsrProtectionContainerMapping -Name $PrimaryProtectionContainerMapping -policy $Policy1 -PrimaryProtectionContainer $pc WaitForJobCompletion -JobId $pcmjob.Name $pcm = Get-ASRProtectionContainerMapping -Name $PrimaryProtectionContainerMapping -ProtectionContainer $pc Assert-NotNull($pcm) $Removepcm = Remove-AzRecoveryServicesAsrProtectionContainerMapping -InputObject $pcm WaitForJobCompletion -JobId $Removepcm.Name } function V2ACreateRPI { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName $pc = Get-ASRProtectionContainer -FriendlyName $pcName -Fabric $fabric $Job1 = New-AzRecoveryServicesAsrPolicy -VmwareToAzure -Name $policyName1 -RecoveryPointRetentionInHours 40 -RPOWarningThresholdInMinutes 5 -ApplicationConsistentSnapshotFrequencyInHours 15 -MultiVmSyncStatus "Enable" $Job2 = New-AzRecoveryServicesAsrPolicy -AzureToVmware -Name $policyName2 -RecoveryPointRetentionInHours 40 -RPOWarningThresholdInMinutes 5 -ApplicationConsistentSnapshotFrequencyInHours 15 -MultiVmSyncStatus "Enable" WaitForJobCompletion -JobId $Job1.Name WaitForJobCompletion -JobId $Job2.Name $Policy1 = Get-AzRecoveryServicesAsrPolicy -Name $PolicyName1 $Policy2 = Get-AzRecoveryServicesAsrPolicy -Name $PolicyName2 $pcmjob = New-AzRecoveryServicesAsrProtectionContainerMapping -Name $PrimaryProtectionContainerMapping -policy $Policy1 -PrimaryProtectionContainer $pc WaitForJobCompletion -JobId $pcmjob.Name $pcm = Get-ASRProtectionContainerMapping -Name $PrimaryProtectionContainerMapping -ProtectionContainer $pc $pi = Get-ASRProtectableItem -ProtectionContainer $pc -FriendlyName $piName $EnableDRjob = New-AzRecoveryServicesAsrReplicationProtectedItem -vmwaretoazure -ProtectableItem $pi -Name $rpiName -ProtectionContainerMapping $pcm -RecoveryAzureStorageAccountId $RecoveryAzureStorageAccountId -RecoveryResourceGroupId $RecoveryResourceGroupId -ProcessServer $fabric.fabricSpecificDetails.ProcessServers[0] -Account $fabric.fabricSpecificDetails.RunAsAccounts[0] -RecoveryAzureNetworkId $AzureVmNetworkId -RecoveryAzureSubnetName $Subnet } function Test-RPJobReverse { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName $pc = Get-ASRProtectionContainer -FriendlyName $pcName -Fabric $fabric $rpi = get-AzRecoveryServicesAsrReplicationProtectedItem -ProtectionContainer $pc -Name $rpiName $Policy2 = Get-AzRecoveryServicesAsrPolicy -Name $PolicyName2 $pcmjob = New-AzRecoveryServicesAsrProtectionContainerMapping -Name $reverseMapping -policy $Policy2 -PrimaryProtectionContainer $pc -RecoveryProtectionContainer $pc WaitForJobCompletion -JobId $pcmjob.Name $pcm = Get-ASRProtectionContainerMapping -Name $reverseMapping -ProtectionContainer $pc $job = Update-AzRecoveryServicesAsrProtectionDirection -AzureToVMware` -Account $fabric.FabricSpecificDetails.RunAsAccounts[0] -DataStore $fabric.FabricSpecificDetails.MasterTargetServers[0].DataStores[3] ` -Direction RecoveryToPrimary -MasterTarget $fabric.FabricSpecificDetails.MasterTargetServers[0] ` -ProcessServer $fabric.FabricSpecificDetails.ProcessServers[0] -ProtectionContainerMapping $pcm ` -ReplicationProtectedItem $RPI -RetentionVolume $fabric.FabricSpecificDetails.MasterTargetServers[0].RetentionVolumes[0] WaitForJobCompletion -JobId $Job.Name $RP = Get-AzRecoveryServicesAsrRecoveryPlan -Name $RecoveryPlanName $foJob = Start-AzRecoveryServicesAsrUnPlannedFailoverJob -RecoveryPlan $RP -Direction RecoveryToPrimary WaitForJobCompletion -JobId $foJob.Name $commitJob = Start-AzRecoveryServicesAsrCommitFailoverJob -RecoveryPlan $RP WaitForJobCompletion -JobId $commitJob.Name } function V2ATestResync { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName $pc = Get-ASRProtectionContainer -FriendlyName $pcName -Fabric $fabric $rpi = get-AzRecoveryServicesAsrReplicationProtectedItem -ProtectionContainer $pc -Name $rpiName $job = Start-AzRecoveryServicesAsrResynchronizeReplicationJob -ReplicationProtectedItem $rpi WaitForJobCompletion -JobId $Job.Name } function V2AUpdateMobilityService { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName $pc = Get-ASRProtectionContainer -FriendlyName $pcName -Fabric $fabric $rpi = get-AzRecoveryServicesAsrReplicationProtectedItem -ProtectionContainer $pc -Name $rpiName $job = Update-AzRecoveryServicesAsrMobilityService -ReplicationProtectedItem $rpi -Account $fabric.fabricSpecificDetails.RunAsAccounts[0] WaitForJobCompletion -JobId $Job.Name } function V2AUpdateServiceProvider { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName $splist = Get-ASRServicesProvider -Fabric $fabric $job = Update-ASRServicesProvider -InputObject $splist[0] WaitForJobCompletion -JobId $Job.Name } function V2ASwitchProcessServer { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName $pc = Get-ASRProtectionContainer -FriendlyName $pcName -Fabric $fabric $RPIList = Get-AzRecoveryServicesAsrReplicationProtectedItem -ProtectionContainer $pc $job = Start-AzRecoveryServicesAsrSwitchProcessServerJob -Fabric $fabric -SourceProcessServer $fabric.FabricSpecificDetails.ProcessServers[0] -TargetProcessServer $fabric.FabricSpecificDetails.ProcessServers[1] -ReplicatedItem $RPIList WaitForJobCompletion -JobId $Job.Name $job = Start-AzRecoveryServicesAsrSwitchProcessServerJob -Fabric $fabric -SourceProcessServer $fabric.FabricSpecificDetails.ProcessServers[0] -TargetProcessServer $fabric.FabricSpecificDetails.ProcessServers[1] WaitForJobCompletion -JobId $Job.Name } function V2ATestFailoverJob { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName $pc = Get-ASRProtectionContainer -FriendlyName $pcName -Fabric $fabric $rpi = get-AzRecoveryServicesAsrReplicationProtectedItem -ProtectionContainer $pc -Name $rpiName do { $rPoints = Get-ASRRecoveryPoint -ReplicationProtectedItem $rpi if($rpoints -and $rpoints.count -eq 0) { } else { break } }while ($rpoints.count -lt 0) $tfoJob = Start-AzRecoveryServicesAsrTestFailoverJob -ReplicationProtectedItem $rpi -Direction PrimaryToRecovery -AzureVMNetworkId $AzureVMNetworkId -RecoveryPoint $rpoints[0] WaitForJobCompletion -JobId $tfoJob.Name $cleanupJob = Start-AzRecoveryServicesAsrTestFailoverCleanupJob -ReplicationProtectedItem $rpi -Comment "testing done" WaitForJobCompletion -JobId $cleanupJob.Name } function V2AFailoverJob { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -Name "9a72155b61d09325a02ba0311dea55df3a7135b65558b43c9ff540b9e7be084f" $pcName = "cloud_a5441e09-275c-4f15-a1b9-450a22c89d7b" $pc = Get-ASRProtectionContainer -Name $pcName -Fabric $fabric $rpiName = "win-4003" $rpi = get-AzRecoveryServicesAsrReplicationProtectedItem -ProtectionContainer $pc -FriendlyName $rpiName $foJob = Start-AzRecoveryServicesAsrUnPlannedFailoverJob -ReplicationProtectedItem $rpi -Direction PrimaryToRecovery WaitForJobCompletion -JobId $foJob.Name $commitJob = Start-AzRecoveryServicesAsrCommitFailoverJob -ReplicationProtectedItem $rpi WaitForJobCompletion -JobId $commitJob.Name } function V2ATestReprotect { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -Name "9a72155b61d09325a02ba0311dea55df3a7135b65558b43c9ff540b9e7be084f" $pcName = "cloud_a5441e09-275c-4f15-a1b9-450a22c89d7b" $pc = Get-ASRProtectionContainer -Name $pcName -Fabric $fabric $rpiName = "win-4003" $rpi = get-AzRecoveryServicesAsrReplicationProtectedItem -ProtectionContainer $pc -FriendlyName $rpiName $Policy2 = Get-AzRecoveryServicesAsrPolicy -Name $PolicyName2 $pcmjob = New-AzRecoveryServicesAsrProtectionContainerMapping -Name $reverseMapping -policy $Policy2 -PrimaryProtectionContainer $pc -RecoveryProtectionContainer $pc WaitForJobCompletion -JobId $pcmjob.Name $pcm = Get-ASRProtectionContainerMapping -Name $reverseMapping -ProtectionContainer $pc $job = Update-AzRecoveryServicesAsrProtectionDirection ` -AzureToVmware ` -Account $fabric.FabricSpecificDetails.RunAsAccounts[0] ` -DataStore $fabric.FabricSpecificDetails.MasterTargetServers[1].DataStores[3] ` -Direction RecoveryToPrimary -MasterTarget $fabric.FabricSpecificDetails.MasterTargetServers[1] ` -ProcessServer $fabric.FabricSpecificDetails.ProcessServers[1] ` -ProtectionContainerMapping $pcm ` -ReplicationProtectedItem $RPI ` -RetentionVolume $fabric.FabricSpecificDetails.MasterTargetServers[1].RetentionVolumes[0] } function v2aFailbackReprotect { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -Name "9a72155b61d09325a02ba0311dea55df3a7135b65558b43c9ff540b9e7be084f" $pcName = "cloud_a5441e09-275c-4f15-a1b9-450a22c89d7b" $pc = Get-ASRProtectionContainer -Name $pcName -Fabric $fabric $rpiName = "win-4002" $rpi = get-AzRecoveryServicesAsrReplicationProtectedItem -ProtectionContainer $pc -FriendlyName $rpiName $job = Start-AzRecoveryServicesAsrUnPlannedFailoverJob -ReplicationProtectedItem $rpi -Direction PrimaryToRecovery WaitForJobCompletion -JobId $Job.Name $job = Start-AzRecoveryServicesAsrCommitFailoverJob -ReplicationProtectedItem $rpi WaitForJobCompletion -JobId $Job.Name $pcm = Get-ASRProtectionContainerMapping -Name $PrimaryProtectionContainerMapping -ProtectionContainer $pc $job = Update-AzRecoveryServicesAsrProtectionDirection ` -VMwareToAzure` -Account $fabric.FabricSpecificDetails.RunAsAccounts[1]` -Direction RecoveryToPrimary` -ProcessServer $fabric.FabricSpecificDetails.ProcessServers[1]` -ProtectionContainerMapping $pcm ` -ReplicationProtectedItem $rpi } function v2aUpdatePolicy { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $po = get-asrpolicy -Name V2aTestPolicy2 Update-AzRecoveryServicesAsrPolicy -VMwareToAzure -ApplicationConsistentSnapshotFrequencyInHours 5 -InputObject $po -MultiVmSyncStatus "Enable" Update-AzRecoveryServicesAsrPolicy -VMwareToAzure -ApplicationConsistentSnapshotFrequencyInHours 5 -InputObject $po } function Test-SetRPI { param([string] $vaultSettingsFilePath) Import-AzRecoveryServicesAsrVaultSettingsFile -Path $vaultSettingsFilePath $fabric = Get-AsrFabric -FriendlyName $PrimaryFabricName $pc = Get-ASRProtectionContainer -FriendlyName $pcName -Fabric $fabric $rpi = get-AzRecoveryServicesAsrReplicationProtectedItem -ProtectionContainer $pc -Name "-RPI" Set-AzRecoveryServicesAsrReplicationProtectedItem -InputObject $rpi -Name "VSPS212" -PrimaryNic $rpi.nicDetailsList[0].nicId -RecoveryNetworkId ` $AzureVmNetworkId -RecoveryNicStaticIPAddress "10.151.128.205" -RecoveryNicSubnetName "Subnet-2" -UseManagedDisk "True" }
combined_dataset/train/non-malicious/LibraryMSCS_2.ps1
LibraryMSCS_2.ps1
# ------------------------------------------------------------------------ ### <Script> ### <Author> ### Chad Miller ### </Author> ### <Description> ### Defines functions for working with Microsoft Cluster Service (MSCS) ### </Description> ### <Usage> ### . ./LibraryMSCS.ps1 ### </Usage> ### </Script> # ------------------------------------------------------------------------ ####################### function Get-Cluster { param($cluster) gwmi -class "MSCluster_Cluster" -namespace "root\\mscluster" -computername $cluster } #Get-Cluster ####################### function Get-ClusterName { param($cluster) Get-Cluster $cluster | select -ExpandProperty name } #Get-ClusterName ####################### function Get-ClusterNode { param($cluster) gwmi -class MSCluster_Node -namespace "root\\mscluster" -computername $cluster | add-member -pass NoteProperty Cluster $cluster } #Get-ClusterNode ####################### function Get-ClusterSQLVirtual { param($cluster) gwmi -class "MSCluster_Resource" -namespace "root\\mscluster" -computername $cluster | where {$_.type -eq "SQL Server"} | Select @{n='Cluster';e={$cluster}}, Name, State, @{n='VirtualServerName';e={$_.PrivateProperties.VirtualServerName}}, @{n='InstanceName';e={$_.PrivateProperties.InstanceName}}, ` @{n='ServerInstance';e={("{0}\\{1}" -f $_.PrivateProperties.VirtualServerName,$_.PrivateProperties.InstanceName).TrimEnd('\\')}}, ` @{n='Node';e={$(gwmi -namespace "root\\mscluster" -computerName $cluster -query "ASSOCIATORS OF {MSCluster_Resource.Name='$($_.Name)'} WHERE AssocClass = MSCluster_NodeToActiveResource" | Select -ExpandProperty Name)}} } #Get-ClusterSQLVirtual ####################### function Get-ClusterNetworkName { param($cluster) gwmi -class "MSCluster_Resource" -namespace "root\\mscluster" -computername $cluster | where {$_.type -eq "Network Name"} | Select @{n='Cluster';e={$cluster}}, Name, State, @{n='NetworkName';e={$_.PrivateProperties.Name}}, ` @{n='Node';e={$(gwmi -namespace "root\\mscluster" -computerName $cluster -query "ASSOCIATORS OF {MSCluster_Resource.Name='$($_.Name)'} WHERE AssocClass = MSCluster_NodeToActiveResource" | Select -ExpandProperty Name)}} } #Get-ClusterNetworkName ####################### function Get-ClusterResource { param($cluster) gwmi -ComputerName $cluster -Namespace "root\\mscluster" -Class MSCluster_Resource | add-member -pass NoteProperty Cluster $cluster | add-member -pass ScriptProperty Node ` { gwmi -namespace "root\\mscluster" -computerName $cluster -query "ASSOCIATORS OF {MSCluster_Resource.Name='$($this.Name)'} WHERE AssocClass = MSCluster_NodeToActiveResource" | Select -ExpandProperty Name } | add-member -pass ScriptProperty Group ` { gwmi -ComputerName $cluster -Namespace "root\\mscluster" -query "ASSOCIATORS OF {MSCluster_Resource.Name='$($this.Name)'} WHERE AssocClass = MSCluster_ResourceGroupToResource" | Select -ExpandProperty Name } } #Get-ClusterResource ####################### function Get-ClusterGroup { param($cluster) gwmi -class MSCluster_ResourceGroup -namespace "root\\mscluster" -computername $cluster | add-member -pass NoteProperty Cluster $cluster | add-member -pass ScriptProperty Node ` { gwmi -namespace "root\\mscluster" -computerName $cluster -query "ASSOCIATORS OF {MSCluster_ResourceGroup.Name='$($this.Name)'} WHERE AssocClass = MSCluster_NodeToActiveGroup" | Select -ExpandProperty Name } | add-member -pass ScriptProperty PreferredNodes ` { @(,(gwmi -namespace "root\\mscluster" -computerName $cluster -query "ASSOCIATORS OF {MSCluster_ResourceGroup.Name='$($this.Name)'} WHERE AssocClass = MSCluster_ResourceGroupToPreferredNode" | Select -ExpandProperty Name)) } } #Get-ClusterGroup
combined_dataset/train/non-malicious/442.ps1
442.ps1
Register-PSFConfigValidation -Name "consolecolor" -ScriptBlock { Param ( $Value ) $Result = New-Object PSObject -Property @{ Success = $True Value = $null Message = "" } try { [System.ConsoleColor]$color = $Value } catch { $Result.Message = "Not a console color: $Value" $Result.Success = $False return $Result } $Result.Value = $color return $Result }
combined_dataset/train/non-malicious/sample_40_42.ps1
sample_40_42.ps1
# # Module manifest for module 'OCI.PSModules.Ocicontrolcenter' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ocicontrolcenter.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = 'fc85f17d-35f9-4106-a77a-ccaa291877f6' # 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 Ocicontrolcenter 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 = '82.0.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Ocicontrolcenter.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-OCIOcicontrolcenterMetricPropertiesList', 'Get-OCIOcicontrolcenterNamespacesList', 'Invoke-OCIOcicontrolcenterRequestSummarizedMetricData' # 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','Ocicontrolcenter' # 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/0ddea161-baf2-439c-b797-afb5c636692f.ps1
0ddea161-baf2-439c-b797-afb5c636692f.ps1
#Variables $Date = Get-Date $TempReport = $env:TEMP + "\\temp.csv" $FinalReport = $env:USERPROFILE + "\\" + $Date.Year + "_" + $Date.Month + "_" + $Date.Day + "_" + $Date.Hour + ":" + $Date.Minute + "_Scheduled_Task_Report.csv" $title = Write-Host "Scheduled Task Reporter" -ForegroundColor green $message = Write-Host "Which servers would you like to report on?" -ForegroundColor yellow $EXIT = New-Object System.Management.Automation.Host.ChoiceDescription "&Exit", ` "Exits the script. . . " $ALL = New-Object System.Management.Automation.Host.ChoiceDescription "&All Server Report", ` "Queries for all SERVERS in the domain and reports on their scheduled tasks." $SRV = New-Object System.Management.Automation.Host.ChoiceDescription "&Single Host Report", ` "Queries for the exact server or workstation name entered." $OTHR = New-Object System.Management.Automation.Host.ChoiceDescription "A&NR Report", ` "Peforms an ANR (Ambiguous Name Request) lookup. ANR allows you to do a report against one or more computers by typing part of the computer name." $options = [System.Management.Automation.Host.ChoiceDescription[]]($EXIT, $ALL, $SRV, $OTHR) $result = $host.ui.PromptForChoice($title, $message, $options, 0) switch ($result) { 0 {Write-Host "No selection made. Exiting script. . ."} 1 {Get-QADComputer -sizelimit 0| Where {$_.osname -like "*Server*"} | Sort | % {schtasks /query /s $_.name /FO CSV /V | where {$_.length -gt 0} > $TempReport }} 2 {$Computer = Read-Host -Prompt "Enter the server name" Get-QADComputer $Computer | Sort | % {schtasks /query /s $_.name /FO CSV /V | where {$_.length -gt 0} > $TempReport}} # | set-content 'export-csv $outputdestination'}} 3 {$Search = Read-Host -Prompt "Type all or part of the computer name" Get-QADComputer -ANR $Search | ForEach-Object {schtasks /query /s $_.name /FO CSV /V | where {$_.length -gt 0} > $TempReport}}
combined_dataset/train/non-malicious/sample_64_65.ps1
sample_64_65.ps1
# dot-source all function files Get-ChildItem -Path $PSScriptRoot | Unblock-File Get-ChildItem -Path $PSScriptRoot\*.ps1 -Exclude ServiceFabricSDK.ps1 | Foreach-Object{ . $_.FullName } # SIG # Begin signature block # MIInkwYJKoZIhvcNAQcCoIInhDCCJ4ACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCeVayTDbx/PyBx # baOMgUQwBzc+KceGUCG0TFLzjeudsqCCDXYwggX0MIID3KADAgECAhMzAAADTrU8 # esGEb+srAAAAAANOMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMwMzE2MTg0MzI5WhcNMjQwMzE0MTg0MzI5WjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQDdCKiNI6IBFWuvJUmf6WdOJqZmIwYs5G7AJD5UbcL6tsC+EBPDbr36pFGo1bsU # p53nRyFYnncoMg8FK0d8jLlw0lgexDDr7gicf2zOBFWqfv/nSLwzJFNP5W03DF/1 # 1oZ12rSFqGlm+O46cRjTDFBpMRCZZGddZlRBjivby0eI1VgTD1TvAdfBYQe82fhm # WQkYR/lWmAK+vW/1+bO7jHaxXTNCxLIBW07F8PBjUcwFxxyfbe2mHB4h1L4U0Ofa # +HX/aREQ7SqYZz59sXM2ySOfvYyIjnqSO80NGBaz5DvzIG88J0+BNhOu2jl6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B5zCB5DCBvQQgCrkg6tgYHeSgIsN3opR2z7EExWA0YkirkvVY # STBgdtQwgZgwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3Rv # bjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0 # aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAA # AcE+oIOc4AmvxQABAAABwTAiBCD63vRfvzO9mZRBN93AhOi8UtC0RwZaMQTxosCv # w4ZH2zANBgkqhkiG9w0BAQsFAASCAgAN5bmE+77qR6VvOMIfpOqfGz1iFgPeq6Ym # 64BEYyaKMhsbgGc0oHiIdeoXtEC0kKIVNp0ZmSJX5O5M8fxbMH3YqDI1Va1wtAwv # iwB/vkkuEsMAEFkJCrc2mFzQ+4Vs3xRzCm1XUPvGj+HB5T/pj6GFTI3+DXA2rKKg # El9pA9tD1cRDYgCRGnLlv1Y/AHctrGeJoVUtKNk79gvB8gK6a8wrzzeBEj2t9lHT # LEg76PQKi06tiRCmzagvIbj0kYhap/IxNWUF8fEk0fSFdlcLOPvySqOk9axAqXIO # ctd5+dymfXlnuPpy4abPieFnjyDBLSi1GFmpVLk9/qvwn4mNS0bIu6Xz6CtYxhXp # Acyka4DNRv14Np4O9c77k9PpcGV33DHjShMFk044PFsfIk+lDOtTvxulBa9WaQ96 # Xfrnlr+4L096FtKBLSz7F9chqVOp3cZtO0pMuJlji5lO2TeF6CojDfMUs+pqut5t # D8GxH1pVGx2yKwFfDd0KnG1wmPmIJrUIn+nkFv5WJhLA669X6wxZLVWkgg+ss9Md # imTdQXC4pydSdYgkHKr5axvbu/MkBZr+pfMudihNy7ckB7v0n+GrFZxlW/1qh22x # lia4HsX4UffjeXNIYQn2Y24dXhd0s0YlT1eCt6creUtLqJsDIsgu5oTyzUcEFrY1 # DaYgakhELg== # SIG # End signature block
combined_dataset/train/non-malicious/1649.ps1
1649.ps1
|: | |: | $a = "<style>" $a = $a + "BODY{background-color:Lavender ;}" $a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}" $a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}" $a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:PaleGoldenrod}" $a = $a + "</style>" $vUserName = (Get-Item env:\username).Value $vComputerName = (Get-Item env:\Computername).Value $filepath = (Get-ChildItem env:\userprofile).value ConvertTo-Html -Title "System Information for $vComputerName" -Body "<h1> Computer Name : $vComputerName </h1>" > "$filepath\$vComputerName.html" ConvertTo-Html -Body "<H1>HARDWARE INFORMATION </H1>" >> "$filepath\$vComputerName.html" Get-WmiObject win32_bios -ComputerName $vComputerName | select Status,Version,PrimaryBIOS,Manufacturer,ReleaseDate,SerialNumber ` | ConvertTo-html -Body "<H2> BIOS Information</H2>" >> "$filepath\$vComputerName.html" Get-WmiObject win32_DiskDrive -ComputerName $vComputerName | Select Model,SerialNumber,Description,MediaType,FirmwareRevision |ConvertTo-html -Body "<H2> Physical DISK Drives </H2>" >> "$filepath\$vComputerName.html" get-WmiObject win32_networkadapter -ComputerName $vComputerName | Select Name,Manufacturer,Description ,AdapterType,Speed,MACAddress,NetConnectionID ` | ConvertTo-html -Body "<H2> Network Adapters</H2>" >> "$filepath\$vComputerName.html" ConvertTo-Html -Body "<H1>OS INFORMATION </H1>" >> "$filepath\$name.html" get-WmiObject win32_operatingsystem -ComputerName $vComputerName | select Caption,Organization,InstallDate,OSArchitecture,Version,SerialNumber,BootDevice,WindowsDirectory,CountryCode ` | ConvertTo-html -Body "<H2> Operating System Information</H2>" >> "$filepath\$vComputerName.html" Get-WmiObject win32_logicalDisk -ComputerName $vComputerName | select DeviceID,VolumeName,@{Expression={$_.Size /1Gb -as [int]};Label="Total Size(GB)"},@{Expression={$_.Freespace / 1Gb -as [int]};Label="Free Size (GB)"} ` | ConvertTo-html -Body "<H2> Logical DISK Drives </H2>" >> "$filepath\$vComputerName.html" Get-WmiObject Win32_NetworkAdapterConfiguration -ComputerName $vComputerName | Select-Object Description, DHCPServer, @{Name='IpAddress';Expression={$_.IpAddress -join '; '}}, @{Name='IpSubnet';Expression={$_.IpSubnet -join '; '}}, @{Name='DefaultIPgateway';Expression={$_.DefaultIPgateway -join '; '}}, @{Name='DNSServerSearchOrder';Expression={$_.DNSServerSearchOrder -join '; '}}, WinsPrimaryServer, WINSSecondaryServer| ConvertTo-html -Body "<H2>IP Address </H2>" >> "$filepath\$vComputerName.html" ConvertTo-Html -Body "<H1>SOFTWARE INFORMATION </H1>" >> "$filepath\$vComputerName.html" Get-WmiObject win32_startupCommand -ComputerName $vComputerName | select Name,Location,Command,User,caption ` | ConvertTo-html -Body "<H2>Startup Softwares</H2>" >> "$filepath\$vComputerName.html" Get-WmiObject win32_process -ComputerName $vComputerName | select Caption,ProcessId,@{Expression={$_.Vm /1mb -as [Int]};Label="VM (MB)"},@{Expression={$_.Ws /1Mb -as [Int]};Label="WS (MB)"} |sort "Vm (MB)" -Descending ` | ConvertTo-html -Head $a -Body "<H2> Running Processes</H2>" >> "$filepath\$vComputerName.html" Get-WmiObject win32_Service | where {$_.StartMode -eq "Auto" -and $_.State -eq "stopped"} | Select Name,StartMode,State | ConvertTo-html -Head $a -Body "<H2> Services </H2>" >> "$filepath\$vComputerName.html" $Report = "The Report is generated On $(get-date) by $((Get-Item env:\username).Value) on computer $((Get-Item env:\Computername).Value)" $Report >> "$filepath\$vComputerName.html" invoke-Expression "$filepath\$vComputerName.html"
combined_dataset/train/non-malicious/4341.ps1
4341.ps1
function Set-PSGalleryRepository { [CmdletBinding()] param( [Parameter()] [switch] $Trusted, [Parameter()] $Proxy, [Parameter()] $ProxyCredential ) $psgalleryLocation = Resolve-Location -Location $Script:PSGallerySourceUri ` -LocationParameterName 'SourceLocation' ` -Proxy $Proxy ` -ProxyCredential $ProxyCredential ` -ErrorAction SilentlyContinue ` -WarningAction SilentlyContinue $scriptSourceLocation = Resolve-Location -Location $Script:PSGalleryScriptSourceUri ` -LocationParameterName 'ScriptSourceLocation' ` -Proxy $Proxy ` -ProxyCredential $ProxyCredential ` -ErrorAction SilentlyContinue ` -WarningAction SilentlyContinue if($psgalleryLocation) { $result = Ping-Endpoint -Endpoint $Script:PSGalleryPublishUri -AllowAutoRedirect:$false -Proxy $Proxy -ProxyCredential $ProxyCredential if ($result.ContainsKey($Script:ResponseUri) -and $result[$Script:ResponseUri]) { $script:PSGalleryPublishUri = $result[$Script:ResponseUri] } $repository = Microsoft.PowerShell.Utility\New-Object PSCustomObject -Property ([ordered]@{ Name = $Script:PSGalleryModuleSource SourceLocation = $psgalleryLocation PublishLocation = $Script:PSGalleryPublishUri ScriptSourceLocation = $scriptSourceLocation ScriptPublishLocation = $Script:PSGalleryPublishUri Trusted=$Trusted Registered=$true InstallationPolicy = if($Trusted) {'Trusted'} else {'Untrusted'} PackageManagementProvider=$script:NuGetProviderName ProviderOptions = @{} }) $repository.PSTypeNames.Insert(0, "Microsoft.PowerShell.Commands.PSRepository") $script:PSGetModuleSources[$Script:PSGalleryModuleSource] = $repository Save-ModuleSources return $repository } }
combined_dataset/train/non-malicious/1439.ps1
1439.ps1
function Get-CCertificate { [CmdletBinding(DefaultParameterSetName='ByFriendlyName')] [OutputType([Security.Cryptography.X509Certificates.X509Certificate2])] param( [Parameter(Mandatory=$true,ParameterSetName='ByPath')] [string] $Path, [Parameter(ParameterSetName='ByPath')] $Password, [Parameter(ParameterSetName='ByPath')] [Security.Cryptography.X509Certificates.X509KeyStorageFlags] $KeyStorageFlags, [Parameter(Mandatory=$true,ParameterSetName='ByThumbprint')] [Parameter(Mandatory=$true,ParameterSetName='ByThumbprintCustomStoreName')] [string] $Thumbprint, [Parameter(Mandatory=$true,ParameterSetName='ByFriendlyName')] [Parameter(Mandatory=$true,ParameterSetName='ByFriendlyNameCustomStoreName')] [string] $FriendlyName, [Parameter(Mandatory=$true,ParameterSetName='ByFriendlyName')] [Parameter(Mandatory=$true,ParameterSetName='ByFriendlyNameCustomStoreName')] [Parameter(Mandatory=$true,ParameterSetName='ByThumbprint')] [Parameter(Mandatory=$true,ParameterSetName='ByThumbprintCustomStoreName')] [Security.Cryptography.X509Certificates.StoreLocation] $StoreLocation, [Parameter(Mandatory=$true,ParameterSetName='ByFriendlyName')] [Parameter(Mandatory=$true,ParameterSetName='ByThumbprint')] [Security.Cryptography.X509Certificates.StoreName] $StoreName, [Parameter(Mandatory=$true,ParameterSetName='ByFriendlyNameCustomStoreName')] [Parameter(Mandatory=$true,ParameterSetName='ByThumbprintCustomStoreName')] [string] $CustomStoreName ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState function Add-PathMember { param( [Parameter(Mandatory,VAlueFromPipeline=$true)] [Security.Cryptography.X509Certificates.X509Certificate2] $Certificate, [Parameter(Mandatory)] [string] $Path ) process { $Certificate | Add-Member -MemberType NoteProperty -Name 'Path' -Value $Path -PassThru } } function Resolve-CertificateProviderFriendlyPath { param( [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [string] $PSPath, [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [Management.Automation.PSDriveInfo] $PSDrive ) process { $qualifier = '{0}:' -f $PSDrive.Name $path = $PSPath | Split-Path -NoQualifier Join-Path -Path $qualifier -ChildPath $path } } if( $PSCmdlet.ParameterSetName -eq 'ByPath' ) { if( -not (Test-Path -Path $Path -PathType Leaf) ) { Write-Error ('Certificate ''{0}'' not found.' -f $Path) return } Get-Item -Path $Path | ForEach-Object { $item = $_ if( $item -is [Security.Cryptography.X509Certificates.X509Certificate2] ) { $certFriendlyPath = $item | Resolve-CertificateProviderFriendlyPath return $item | Add-PathMember -Path $certFriendlyPath } elseif( $item -is [IO.FileInfo] ) { try { $ctorParams = @( $item.FullName, $Password ) if( $KeyStorageFlags ) { $ctorParams += $KeyStorageFlags } return New-Object 'Security.Cryptography.X509Certificates.X509Certificate2' $ctorParams | Add-PathMember -Path $item.FullName } catch { $ex = $_.Exception while( $ex.InnerException ) { $ex = $ex.InnerException } Write-Error -Message ('Failed to create X509Certificate2 object from file ''{0}'': {1}' -f $item.FullName,$ex.Message) } } } } else { $storeLocationPath = '*' if( $StoreLocation ) { $storeLocationPath = $StoreLocation } $storeNamePath = '*' if( $PSCmdlet.ParameterSetName -like '*CustomStoreName' ) { $storeNamePath = $CustomStoreName } else { $storeNamePath = $StoreName if( $StoreName -eq [Security.Cryptography.X509Certificates.StoreName]::CertificateAuthority ) { $storeNamePath = 'CA' } } if( $pscmdlet.ParameterSetName -like 'ByThumbprint*' ) { $certPath = 'cert:\{0}\{1}\{2}' -f $storeLocationPath,$storeNamePath,$Thumbprint if( (Test-Path -Path $certPath) ) { foreach( $certPathItem in (Get-ChildItem -Path $certPath) ) { $path = $certPathItem | Resolve-CertificateProviderFriendlyPath $certPathItem | Add-PathMember -Path $path } } return } elseif( $PSCmdlet.ParameterSetName -like 'ByFriendlyName*' ) { $certPath = Join-Path -Path 'cert:' -ChildPath $storeLocationPath $certPath = Join-Path -Path $certPath -ChildPath $storeNamePath $certPath = Join-Path -Path $certPath -ChildPath '*' return Get-ChildItem -Path $certPath | Where-Object { $_.FriendlyName -eq $FriendlyName } | ForEach-Object { $friendlyPath = $_ | Resolve-CertificateProviderFriendlyPath $_ | Add-PathMember -Path $friendlyPath } } Write-Error "Unknown parameter set '$($pscmdlet.ParameterSetName)'." } }
combined_dataset/train/non-malicious/sample_3_53.ps1
sample_3_53.ps1
# Load Common Library #_#$debug = $false Write-Host "____ Loading utils_cts, Utils_Shared.ps1" #| WriteTo-StdOut -ShortFormat . ./utils_cts.ps1 . ./Utils_Shared.ps1 Import-LocalizedData -BindingVariable MainStrings -FileName TS_Main_SUVP -UICulture en-us #_# TraceOut "Start Main Script" <# . ./utils_cts.ps1 #_#. ./utils_Remote.ps1 #_# #_#. ./TS_RemoteSetup.ps1 #_# #> trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" } $FirstTimeExecution = FirstTimeExecution if ($FirstTimeExecution) { write-host " FirstTimeExecution" -ForegroundColor cyan #Event Logs - System & Application logs $sectionDescription = "Event Logs (System and Application)" $EventLogNames = "System", "Application" #_# Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription $sectionDescription # Auto Added Commands [AutoAdded] .\TS_AutoAddCommands_Repro.ps1 #-# NetView Info if ($Global:skipNetview -ne $true) { Write-Host -BackgroundColor Gray -ForegroundColor Black -Object "--- $(Get-Date -Format 'HH:mm:ss') ...Start of Get-NetView (to skip this step, use skipNetview)" & "$global:ToolsPath`\GetNetView.ps1" -OutputDirectory $global:savePathTmp Write-Host -BackgroundColor Gray -ForegroundColor Black -Object "--- $(Get-Date -Format 'HH:mm:ss') ... End of Get-NetView" } EndDataCollection } else{ write-host " no FirstTimeExecution" -ForegroundColor cyan Collect-DiscoveryFiles #2nd execution. Delete the temporary flag file then exit EndDataCollection -DeleteFlagFile $True } # SIG # Begin signature block # MIIoOAYJKoZIhvcNAQcCoIIoKTCCKCUCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBG10pbRwZrMTHl # IW763a+VZphxxGZqLaaDgQjMHMhLkqCCDYUwggYDMIID66ADAgECAhMzAAAEA73V # lV0POxitAAAAAAQDMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2Rl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MXqyN/47VUq3eZk/lJ3x6SMrDRtDANBgkqhkiG9w0BAQsFAASCAgCDhoax # NTqnG5xwN0Su8NaGvC99j/zLK3SOeexPMFczVDF7TiF+EsKI7QLG4GM3cntRwzAV # daHy6dtAenlRdMSFIkiL0mY3yxXcAYVpxJyuuZ6ETheqZQAMLgUHTVqCzQOA1v6S # kIUzdWvHrtXTF43PvOEsqzS0QyhvSCrOLoE50nWCTbXk31sFVOpYsrR+QPXOWZK/ # yh779P+v6R/ZIfyF7J7KylGOxIVfiEXhp5UAN3gYQ+jpqD50lnoB9tFL2eXwevGR # lzwH2bFT0915E+L9+L6qokBQHt2mRV7cdD+9MULYyPWAEgX5TddYmw8WDLf7gGwh # RRjY1UDRBvtIOzcS2pjFLuXFj4odVhnBqLqBLG2W3z1So3CM/8UXOm1lBTPCdvoD # 1xf8slC5HTx1dtrhJqX2WS90cZZiqkMRPQXakJJ3u/0F3LC0aLQt2A6a5C6KjbQL # 2OKAVX6xlde0Pv6HebDwXu81jbmGBIrFlL2iidG9DniWW5yp2mRua8fOQn6E2PvP # ydTyaVMhjYLbs9rUAHJss1c5kYUhl3VhW7msp7dEjNrenysY+NXahqPw/iEOnKsR # lhsGTd3xPw0Fe+fwEw/z0Y9S4h7wEzHleFLOq5pwQp7B9khZsnQE6WqAeDz1hhGn # zz+cKLglTsTyQniuWuHDkGF2vcjl3CRrFWlQbg== # SIG # End signature block
combined_dataset/train/non-malicious/sample_30_0.ps1
sample_30_0.ps1
data LocalizedData { # culture="en-US" ConvertFrom-StringData @' PathNotFoundError=The path '{0}' either does not exist or is not a valid file system path. ExpandArchiveInValidDestinationPath=The path '{0}' is not a valid file system directory path. InvalidZipFileExtensionError={0} is not a supported archive file format. {1} is the only supported archive file format. ArchiveFileIsReadOnly=The attributes of the archive file {0} is set to 'ReadOnly' hence it cannot be updated. If you intend to update the existing archive file, remove the 'ReadOnly' attribute on the archive file else use -Force parameter to override and create a new archive file. ZipFileExistError=The archive file {0} already exists. Use the -Update parameter to update the existing archive file or use the -Force parameter to overwrite the existing archive file. DuplicatePathFoundError=The input to {0} parameter contains a duplicate path '{1}'. Provide a unique set of paths as input to {2} parameter. ArchiveFileIsEmpty=The archive file {0} is empty. CompressProgressBarText=The archive file '{0}' creation is in progress... ExpandProgressBarText=The archive file '{0}' expansion is in progress... AppendArchiveFileExtensionMessage=The archive file path '{0}' supplied to the DestinationPath parameter does not include .zip extension. Hence .zip is appended to the supplied DestinationPath path and the archive file would be created at '{1}'. AddItemtoArchiveFile=Adding '{0}'. BadArchiveEntry=Can not process invalid archive entry '{0}'. CreateFileAtExpandedPath=Created '{0}'. InvalidArchiveFilePathError=The archive file path '{0}' specified as input to the {1} parameter is resolving to multiple file system paths. Provide a unique path to the {2} parameter where the archive file has to be created. InvalidExpandedDirPathError=The directory path '{0}' specified as input to the DestinationPath parameter is resolving to multiple file system paths. Provide a unique path to the Destination parameter where the archive file contents have to be expanded. FileExistsError=Failed to create file '{0}' while expanding the archive file '{1}' contents as the file '{2}' already exists. Use the -Force parameter if you want to overwrite the existing directory '{3}' contents when expanding the archive file. DeleteArchiveFile=The partially created archive file '{0}' is deleted as it is not usable. InvalidDestinationPath=The destination path '{0}' does not contain a valid archive file name. PreparingToCompressVerboseMessage=Preparing to compress... PreparingToExpandVerboseMessage=Preparing to expand... ItemDoesNotAppearToBeAValidZipArchive=File '{0}' does not appear to be a valid zip archive. '@ } Import-LocalizedData LocalizedData -filename ArchiveResources -ErrorAction Ignore $zipFileExtension = ".zip" <############################################################################################ # The Compress-Archive cmdlet can be used to zip/compress one or more files/directories. ############################################################################################> function Compress-Archive { [CmdletBinding( DefaultParameterSetName="Path", SupportsShouldProcess=$true, HelpUri="https://go.microsoft.com/fwlink/?linkid=2096473")] [OutputType([System.IO.File])] param ( [parameter (mandatory=$true, Position=0, ParameterSetName="Path", ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [parameter (mandatory=$true, Position=0, ParameterSetName="PathWithForce", ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [parameter (mandatory=$true, Position=0, ParameterSetName="PathWithUpdate", ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [string[]] $Path, [parameter (mandatory=$true, ParameterSetName="LiteralPath", ValueFromPipeline=$false, ValueFromPipelineByPropertyName=$true)] [parameter (mandatory=$true, ParameterSetName="LiteralPathWithForce", ValueFromPipeline=$false, ValueFromPipelineByPropertyName=$true)] [parameter (mandatory=$true, ParameterSetName="LiteralPathWithUpdate", ValueFromPipeline=$false, ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [Alias("PSPath")] [string[]] $LiteralPath, [parameter (mandatory=$true, Position=1, ValueFromPipeline=$false, ValueFromPipelineByPropertyName=$false)] [ValidateNotNullOrEmpty()] [string] $DestinationPath, [parameter ( mandatory=$false, ValueFromPipeline=$false, ValueFromPipelineByPropertyName=$false)] [ValidateSet("Optimal","NoCompression","Fastest")] [string] $CompressionLevel = "Optimal", [parameter(mandatory=$true, ParameterSetName="PathWithUpdate", ValueFromPipeline=$false, ValueFromPipelineByPropertyName=$false)] [parameter(mandatory=$true, ParameterSetName="LiteralPathWithUpdate", ValueFromPipeline=$false, ValueFromPipelineByPropertyName=$false)] [switch] $Update = $false, [parameter(mandatory=$true, ParameterSetName="PathWithForce", ValueFromPipeline=$false, ValueFromPipelineByPropertyName=$false)] [parameter(mandatory=$true, ParameterSetName="LiteralPathWithForce", ValueFromPipeline=$false, ValueFromPipelineByPropertyName=$false)] [switch] $Force = $false, [switch] $PassThru = $false ) BEGIN { # Ensure the destination path is in a non-PS-specific format $DestinationPath = $PSCmdlet.GetUnresolvedProviderPathFromPSPath($DestinationPath) $inputPaths = @() $destinationParentDir = [system.IO.Path]::GetDirectoryName($DestinationPath) if($null -eq $destinationParentDir) { $errorMessage = ($LocalizedData.InvalidDestinationPath -f $DestinationPath) ThrowTerminatingErrorHelper "InvalidArchiveFilePath" $errorMessage ([System.Management.Automation.ErrorCategory]::InvalidArgument) $DestinationPath } if($destinationParentDir -eq [string]::Empty) { $destinationParentDir = '.' } $archiveFileName = [system.IO.Path]::GetFileName($DestinationPath) $destinationParentDir = GetResolvedPathHelper $destinationParentDir $false $PSCmdlet if($destinationParentDir.Count -gt 1) { $errorMessage = ($LocalizedData.InvalidArchiveFilePathError -f $DestinationPath, "DestinationPath", "DestinationPath") ThrowTerminatingErrorHelper "InvalidArchiveFilePath" $errorMessage ([System.Management.Automation.ErrorCategory]::InvalidArgument) $DestinationPath } IsValidFileSystemPath $destinationParentDir | Out-Null $DestinationPath = Join-Path -Path $destinationParentDir -ChildPath $archiveFileName # GetExtension API does not validate for the actual existence of the path. $extension = [system.IO.Path]::GetExtension($DestinationPath) # If user does not specify an extension, we append the .zip extension automatically. If($extension -eq [string]::Empty) { $DestinationPathWithOutExtension = $DestinationPath $DestinationPath = $DestinationPathWithOutExtension + $zipFileExtension $appendArchiveFileExtensionMessage = ($LocalizedData.AppendArchiveFileExtensionMessage -f $DestinationPathWithOutExtension, $DestinationPath) Write-Verbose $appendArchiveFileExtensionMessage } $archiveFileExist = Test-Path -LiteralPath $DestinationPath -PathType Leaf if($archiveFileExist -and ($Update -eq $false -and $Force -eq $false)) { $errorMessage = ($LocalizedData.ZipFileExistError -f $DestinationPath) ThrowTerminatingErrorHelper "ArchiveFileExists" $errorMessage ([System.Management.Automation.ErrorCategory]::InvalidArgument) $DestinationPath } # If archive file already exists and if -Update is specified, then we check to see # if we have write access permission to update the existing archive file. if($archiveFileExist -and $Update -eq $true) { $item = Get-Item -Path $DestinationPath if($item.Attributes.ToString().Contains("ReadOnly")) { $errorMessage = ($LocalizedData.ArchiveFileIsReadOnly -f $DestinationPath) ThrowTerminatingErrorHelper "ArchiveFileIsReadOnly" $errorMessage ([System.Management.Automation.ErrorCategory]::InvalidOperation) $DestinationPath } } $isWhatIf = $psboundparameters.ContainsKey("WhatIf") if(!$isWhatIf) { $preparingToCompressVerboseMessage = ($LocalizedData.PreparingToCompressVerboseMessage) Write-Verbose $preparingToCompressVerboseMessage $progressBarStatus = ($LocalizedData.CompressProgressBarText -f $DestinationPath) ProgressBarHelper "Compress-Archive" $progressBarStatus 0 100 100 1 } } PROCESS { if($PsCmdlet.ParameterSetName -eq "Path" -or $PsCmdlet.ParameterSetName -eq "PathWithForce" -or $PsCmdlet.ParameterSetName -eq "PathWithUpdate") { $inputPaths += $Path } if($PsCmdlet.ParameterSetName -eq "LiteralPath" -or $PsCmdlet.ParameterSetName -eq "LiteralPathWithForce" -or $PsCmdlet.ParameterSetName -eq "LiteralPathWithUpdate") { $inputPaths += $LiteralPath } } END { # If archive file already exists and if -Force is specified, we delete the # existing archive file and create a brand new one. if(($PsCmdlet.ParameterSetName -eq "PathWithForce" -or $PsCmdlet.ParameterSetName -eq "LiteralPathWithForce") -and $archiveFileExist) { Remove-Item -Path $DestinationPath -Force -ErrorAction Stop } # Validate Source Path depending on parameter set being used. # The specified source path contains one or more files or directories that needs # to be compressed. $isLiteralPathUsed = $false if($PsCmdlet.ParameterSetName -eq "LiteralPath" -or $PsCmdlet.ParameterSetName -eq "LiteralPathWithForce" -or $PsCmdlet.ParameterSetName -eq "LiteralPathWithUpdate") { $isLiteralPathUsed = $true } ValidateDuplicateFileSystemPath $PsCmdlet.ParameterSetName $inputPaths $resolvedPaths = GetResolvedPathHelper $inputPaths $isLiteralPathUsed $PSCmdlet IsValidFileSystemPath $resolvedPaths | Out-Null $sourcePath = $resolvedPaths; # CSVHelper: This is a helper function used to append comma after each path specified by # the $sourcePath array. The comma separated paths are displayed in the -WhatIf message. $sourcePathInCsvFormat = CSVHelper $sourcePath if($pscmdlet.ShouldProcess($sourcePathInCsvFormat)) { try { # StopProcessing is not available in Script cmdlets. However the pipeline execution # is terminated when ever 'CTRL + C' is entered by user to terminate the cmdlet execution. # The finally block is executed whenever pipeline is terminated. # $isArchiveFileProcessingComplete variable is used to track if 'CTRL + C' is entered by the # user. $isArchiveFileProcessingComplete = $false $numberOfItemsArchived = CompressArchiveHelper $sourcePath $DestinationPath $CompressionLevel $Update $isArchiveFileProcessingComplete = $true } finally { # The $isArchiveFileProcessingComplete would be set to $false if user has typed 'CTRL + C' to # terminate the cmdlet execution or if an unhandled exception is thrown. # $numberOfItemsArchived contains the count of number of files or directories add to the archive file. # If the newly created archive file is empty then we delete it as it's not usable. if(($isArchiveFileProcessingComplete -eq $false) -or ($numberOfItemsArchived -eq 0)) { $DeleteArchiveFileMessage = ($LocalizedData.DeleteArchiveFile -f $DestinationPath) Write-Verbose $DeleteArchiveFileMessage # delete the partial archive file created. if (Test-Path $DestinationPath) { Remove-Item -LiteralPath $DestinationPath -Force -Recurse -ErrorAction SilentlyContinue } } elseif ($PassThru) { Get-Item -LiteralPath $DestinationPath } } } } } <############################################################################################ # The Expand-Archive cmdlet can be used to expand/extract an zip file. ############################################################################################> function Expand-Archive { [CmdletBinding( DefaultParameterSetName="Path", SupportsShouldProcess=$true, HelpUri="https://go.microsoft.com/fwlink/?linkid=2096769")] [OutputType([System.IO.FileSystemInfo])] param ( [parameter ( mandatory=$true, Position=0, ParameterSetName="Path", ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [string] $Path, [parameter ( mandatory=$true, ParameterSetName="LiteralPath", ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [Alias("PSPath")] [string] $LiteralPath, [parameter (mandatory=$false, Position=1, ValueFromPipeline=$false, ValueFromPipelineByPropertyName=$false)] [ValidateNotNullOrEmpty()] [string] $DestinationPath, [parameter (mandatory=$false, ValueFromPipeline=$false, ValueFromPipelineByPropertyName=$false)] [switch] $Force, [switch] $PassThru = $false ) BEGIN { $isVerbose = $psboundparameters.ContainsKey("Verbose") $isConfirm = $psboundparameters.ContainsKey("Confirm") $isDestinationPathProvided = $true if($DestinationPath -eq [string]::Empty) { $resolvedDestinationPath = (Get-Location).ProviderPath $isDestinationPathProvided = $false } else { $destinationPathExists = Test-Path -Path $DestinationPath -PathType Container if($destinationPathExists) { $resolvedDestinationPath = GetResolvedPathHelper $DestinationPath $false $PSCmdlet if($resolvedDestinationPath.Count -gt 1) { $errorMessage = ($LocalizedData.InvalidExpandedDirPathError -f $DestinationPath) ThrowTerminatingErrorHelper "InvalidDestinationPath" $errorMessage ([System.Management.Automation.ErrorCategory]::InvalidArgument) $DestinationPath } # At this point we are sure that the provided path resolves to a valid single path. # Calling Resolve-Path again to get the underlying provider name. $suppliedDestinationPath = Resolve-Path -Path $DestinationPath if($suppliedDestinationPath.Provider.Name-ne "FileSystem") { $errorMessage = ($LocalizedData.ExpandArchiveInValidDestinationPath -f $DestinationPath) ThrowTerminatingErrorHelper "InvalidDirectoryPath" $errorMessage ([System.Management.Automation.ErrorCategory]::InvalidArgument) $DestinationPath } } else { $createdItem = New-Item -Path $DestinationPath -ItemType Directory -Confirm:$isConfirm -Verbose:$isVerbose -ErrorAction Stop if($createdItem -ne $null -and $createdItem.PSProvider.Name -ne "FileSystem") { Remove-Item "$DestinationPath" -Force -Recurse -ErrorAction SilentlyContinue $errorMessage = ($LocalizedData.ExpandArchiveInValidDestinationPath -f $DestinationPath) ThrowTerminatingErrorHelper "InvalidDirectoryPath" $errorMessage ([System.Management.Automation.ErrorCategory]::InvalidArgument) $DestinationPath } $resolvedDestinationPath = GetResolvedPathHelper $DestinationPath $true $PSCmdlet } } $isWhatIf = $psboundparameters.ContainsKey("WhatIf") if(!$isWhatIf) { $preparingToExpandVerboseMessage = ($LocalizedData.PreparingToExpandVerboseMessage) Write-Verbose $preparingToExpandVerboseMessage $progressBarStatus = ($LocalizedData.ExpandProgressBarText -f $DestinationPath) ProgressBarHelper "Expand-Archive" $progressBarStatus 0 100 100 1 } } PROCESS { switch($PsCmdlet.ParameterSetName) { "Path" { $resolvedSourcePaths = GetResolvedPathHelper $Path $false $PSCmdlet if($resolvedSourcePaths.Count -gt 1) { $errorMessage = ($LocalizedData.InvalidArchiveFilePathError -f $Path, $PsCmdlet.ParameterSetName, $PsCmdlet.ParameterSetName) ThrowTerminatingErrorHelper "InvalidArchiveFilePath" $errorMessage ([System.Management.Automation.ErrorCategory]::InvalidArgument) $Path } } "LiteralPath" { $resolvedSourcePaths = GetResolvedPathHelper $LiteralPath $true $PSCmdlet if($resolvedSourcePaths.Count -gt 1) { $errorMessage = ($LocalizedData.InvalidArchiveFilePathError -f $LiteralPath, $PsCmdlet.ParameterSetName, $PsCmdlet.ParameterSetName) ThrowTerminatingErrorHelper "InvalidArchiveFilePath" $errorMessage ([System.Management.Automation.ErrorCategory]::InvalidArgument) $LiteralPath } } } ValidateArchivePathHelper $resolvedSourcePaths if($pscmdlet.ShouldProcess($resolvedSourcePaths)) { $expandedItems = @() try { # StopProcessing is not available in Script cmdlets. However the pipeline execution # is terminated when ever 'CTRL + C' is entered by user to terminate the cmdlet execution. # The finally block is executed whenever pipeline is terminated. # $isArchiveFileProcessingComplete variable is used to track if 'CTRL + C' is entered by the # user. $isArchiveFileProcessingComplete = $false # The User has not provided a destination path, hence we use '$pwd\ArchiveFileName' as the directory where the # archive file contents would be expanded. If the path '$pwd\ArchiveFileName' already exists then we use the # Windows default mechanism of appending a counter value at the end of the directory name where the contents # would be expanded. if(!$isDestinationPathProvided) { $archiveFile = New-Object System.IO.FileInfo $resolvedSourcePaths $resolvedDestinationPath = Join-Path -Path $resolvedDestinationPath -ChildPath $archiveFile.BaseName $destinationPathExists = Test-Path -LiteralPath $resolvedDestinationPath -PathType Container if(!$destinationPathExists) { New-Item -Path $resolvedDestinationPath -ItemType Directory -Confirm:$isConfirm -Verbose:$isVerbose -ErrorAction Stop | Out-Null } } ExpandArchiveHelper $resolvedSourcePaths $resolvedDestinationPath ([ref]$expandedItems) $Force $isVerbose $isConfirm $isArchiveFileProcessingComplete = $true } finally { # The $isArchiveFileProcessingComplete would be set to $false if user has typed 'CTRL + C' to # terminate the cmdlet execution or if an unhandled exception is thrown. if($isArchiveFileProcessingComplete -eq $false) { if($expandedItems.Count -gt 0) { # delete the expanded file/directory as the archive # file was not completely expanded. $expandedItems | % { Remove-Item "$_" -Force -Recurse } } } elseif ($PassThru -and $expandedItems.Count -gt 0) { # Return the expanded items, being careful to remove trailing directory separators from # any folder paths for consistency $trailingDirSeparators = '\' + [System.IO.Path]::DirectorySeparatorChar + '+$' Get-Item -LiteralPath ($expandedItems -replace $trailingDirSeparators) } } } } } <############################################################################################ # GetResolvedPathHelper: This is a helper function used to resolve the user specified Path. # The path can either be absolute or relative path. ############################################################################################> function GetResolvedPathHelper { param ( [string[]] $path, [boolean] $isLiteralPath, [System.Management.Automation.PSCmdlet] $callerPSCmdlet ) $resolvedPaths =@() # null and empty check are are already done on Path parameter at the cmdlet layer. foreach($currentPath in $path) { try { if($isLiteralPath) { $currentResolvedPaths = Resolve-Path -LiteralPath $currentPath -ErrorAction Stop } else { $currentResolvedPaths = Resolve-Path -Path $currentPath -ErrorAction Stop } } catch { $errorMessage = ($LocalizedData.PathNotFoundError -f $currentPath) $exception = New-Object System.InvalidOperationException $errorMessage, $_.Exception $errorRecord = CreateErrorRecordHelper "ArchiveCmdletPathNotFound" $null ([System.Management.Automation.ErrorCategory]::InvalidArgument) $exception $currentPath $callerPSCmdlet.ThrowTerminatingError($errorRecord) } foreach($currentResolvedPath in $currentResolvedPaths) { $resolvedPaths += $currentResolvedPath.ProviderPath } } $resolvedPaths } function Add-CompressionAssemblies { Add-Type -AssemblyName System.IO.Compression if ($psedition -eq "Core") { Add-Type -AssemblyName System.IO.Compression.ZipFile } else { Add-Type -AssemblyName System.IO.Compression.FileSystem } } function IsValidFileSystemPath { param ( [string[]] $path ) $result = $true; # null and empty check are are already done on Path parameter at the cmdlet layer. foreach($currentPath in $path) { if(!([System.IO.File]::Exists($currentPath) -or [System.IO.Directory]::Exists($currentPath))) { $errorMessage = ($LocalizedData.PathNotFoundError -f $currentPath) ThrowTerminatingErrorHelper "PathNotFound" $errorMessage ([System.Management.Automation.ErrorCategory]::InvalidArgument) $currentPath } } return $result; } function ValidateDuplicateFileSystemPath { param ( [string] $inputParameter, [string[]] $path ) $uniqueInputPaths = @() # null and empty check are are already done on Path parameter at the cmdlet layer. foreach($currentPath in $path) { $currentInputPath = $currentPath.ToUpper() if($uniqueInputPaths.Contains($currentInputPath)) { $errorMessage = ($LocalizedData.DuplicatePathFoundError -f $inputParameter, $currentPath, $inputParameter) ThrowTerminatingErrorHelper "DuplicatePathFound" $errorMessage ([System.Management.Automation.ErrorCategory]::InvalidArgument) $currentPath } else { $uniqueInputPaths += $currentInputPath } } } function CompressionLevelMapper { param ( [string] $compressionLevel ) $compressionLevelFormat = [System.IO.Compression.CompressionLevel]::Optimal # CompressionLevel format is already validated at the cmdlet layer. switch($compressionLevel.ToString()) { "Fastest" { $compressionLevelFormat = [System.IO.Compression.CompressionLevel]::Fastest } "NoCompression" { $compressionLevelFormat = [System.IO.Compression.CompressionLevel]::NoCompression } } return $compressionLevelFormat } function CompressArchiveHelper { param ( [string[]] $sourcePath, [string] $destinationPath, [string] $compressionLevel, [bool] $isUpdateMode ) $numberOfItemsArchived = 0 $sourceFilePaths = @() $sourceDirPaths = @() foreach($currentPath in $sourcePath) { $result = Test-Path -LiteralPath $currentPath -Type Leaf if($result -eq $true) { $sourceFilePaths += $currentPath } else { $sourceDirPaths += $currentPath } } # The Source Path contains one or more directory (this directory can have files under it) and no files to be compressed. if($sourceFilePaths.Count -eq 0 -and $sourceDirPaths.Count -gt 0) { $currentSegmentWeight = 100/[double]$sourceDirPaths.Count $previousSegmentWeight = 0 foreach($currentSourceDirPath in $sourceDirPaths) { $count = CompressSingleDirHelper $currentSourceDirPath $destinationPath $compressionLevel $true $isUpdateMode $previousSegmentWeight $currentSegmentWeight $numberOfItemsArchived += $count $previousSegmentWeight += $currentSegmentWeight } } # The Source Path contains only files to be compressed. elseIf($sourceFilePaths.Count -gt 0 -and $sourceDirPaths.Count -eq 0) { # $previousSegmentWeight is equal to 0 as there are no prior segments. # $currentSegmentWeight is set to 100 as all files have equal weightage. $previousSegmentWeight = 0 $currentSegmentWeight = 100 $numberOfItemsArchived = CompressFilesHelper $sourceFilePaths $destinationPath $compressionLevel $isUpdateMode $previousSegmentWeight $currentSegmentWeight } # The Source Path contains one or more files and one or more directories (this directory can have files under it) to be compressed. elseif($sourceFilePaths.Count -gt 0 -and $sourceDirPaths.Count -gt 0) { # each directory is considered as an individual segments & all the individual files are clubed in to a separate segment. $currentSegmentWeight = 100/[double]($sourceDirPaths.Count +1) $previousSegmentWeight = 0 foreach($currentSourceDirPath in $sourceDirPaths) { $count = CompressSingleDirHelper $currentSourceDirPath $destinationPath $compressionLevel $true $isUpdateMode $previousSegmentWeight $currentSegmentWeight $numberOfItemsArchived += $count $previousSegmentWeight += $currentSegmentWeight } $count = CompressFilesHelper $sourceFilePaths $destinationPath $compressionLevel $isUpdateMode $previousSegmentWeight $currentSegmentWeight $numberOfItemsArchived += $count } return $numberOfItemsArchived } function CompressFilesHelper { param ( [string[]] $sourceFilePaths, [string] $destinationPath, [string] $compressionLevel, [bool] $isUpdateMode, [double] $previousSegmentWeight, [double] $currentSegmentWeight ) $numberOfItemsArchived = ZipArchiveHelper $sourceFilePaths $destinationPath $compressionLevel $isUpdateMode $null $previousSegmentWeight $currentSegmentWeight return $numberOfItemsArchived } function CompressSingleDirHelper { param ( [string] $sourceDirPath, [string] $destinationPath, [string] $compressionLevel, [bool] $useParentDirAsRoot, [bool] $isUpdateMode, [double] $previousSegmentWeight, [double] $currentSegmentWeight ) [System.Collections.Generic.List[System.String]]$subDirFiles = @() if($useParentDirAsRoot) { $sourceDirInfo = New-Object -TypeName System.IO.DirectoryInfo -ArgumentList $sourceDirPath $sourceDirFullName = $sourceDirInfo.Parent.FullName # If the directory is present at the drive level the DirectoryInfo.Parent include directory separator. example: C:\ # On the other hand if the directory exists at a deper level then DirectoryInfo.Parent # has just the path (without an ending directory separator). example C:\source if($sourceDirFullName.Length -eq 3) { $modifiedSourceDirFullName = $sourceDirFullName } else { $modifiedSourceDirFullName = $sourceDirFullName + [System.IO.Path]::DirectorySeparatorChar } } else { $sourceDirFullName = $sourceDirPath $modifiedSourceDirFullName = $sourceDirFullName + [System.IO.Path]::DirectorySeparatorChar } $dirContents = Get-ChildItem -LiteralPath $sourceDirPath -Recurse foreach($currentContent in $dirContents) { $isContainer = $currentContent -is [System.IO.DirectoryInfo] if(!$isContainer) { $subDirFiles.Add($currentContent.FullName) } else { # The currentContent points to a directory. # We need to check if the directory is an empty directory, if so such a # directory has to be explicitly added to the archive file. # if there are no files in the directory the GetFiles() API returns an empty array. $files = $currentContent.GetFiles() if($files.Count -eq 0) { $subDirFiles.Add($currentContent.FullName + [System.IO.Path]::DirectorySeparatorChar) } } } $numberOfItemsArchived = ZipArchiveHelper $subDirFiles.ToArray() $destinationPath $compressionLevel $isUpdateMode $modifiedSourceDirFullName $previousSegmentWeight $currentSegmentWeight return $numberOfItemsArchived } function ZipArchiveHelper { param ( [System.Collections.Generic.List[System.String]] $sourcePaths, [string] $destinationPath, [string] $compressionLevel, [bool] $isUpdateMode, [string] $modifiedSourceDirFullName, [double] $previousSegmentWeight, [double] $currentSegmentWeight ) $numberOfItemsArchived = 0 $fileMode = [System.IO.FileMode]::Create $result = Test-Path -LiteralPath $DestinationPath -Type Leaf if($result -eq $true) { $fileMode = [System.IO.FileMode]::Open } Add-CompressionAssemblies try { # At this point we are sure that the archive file has write access. $archiveFileStreamArgs = @($destinationPath, $fileMode) $archiveFileStream = New-Object -TypeName System.IO.FileStream -ArgumentList $archiveFileStreamArgs $zipArchiveArgs = @($archiveFileStream, [System.IO.Compression.ZipArchiveMode]::Update, $false) $zipArchive = New-Object -TypeName System.IO.Compression.ZipArchive -ArgumentList $zipArchiveArgs $currentEntryCount = 0 $progressBarStatus = ($LocalizedData.CompressProgressBarText -f $destinationPath) $bufferSize = 4kb $buffer = New-Object Byte[] $bufferSize foreach($currentFilePath in $sourcePaths) { if($modifiedSourceDirFullName -ne $null -and $modifiedSourceDirFullName.Length -gt 0) { $index = $currentFilePath.IndexOf($modifiedSourceDirFullName, [System.StringComparison]::OrdinalIgnoreCase) $currentFilePathSubString = $currentFilePath.Substring($index, $modifiedSourceDirFullName.Length) $relativeFilePath = $currentFilePath.Replace($currentFilePathSubString, "").Trim() } else { $relativeFilePath = [System.IO.Path]::GetFileName($currentFilePath) } # Update mode is selected. # Check to see if archive file already contains one or more zip files in it. if($isUpdateMode -eq $true -and $zipArchive.Entries.Count -gt 0) { $entryToBeUpdated = $null # Check if the file already exists in the archive file. # If so replace it with new file from the input source. # If the file does not exist in the archive file then default to # create mode and create the entry in the archive file. foreach($currentArchiveEntry in $zipArchive.Entries) { if(ArchivePathCompareHelper $currentArchiveEntry.FullName $relativeFilePath) { $entryToBeUpdated = $currentArchiveEntry break } } if($entryToBeUpdated -ne $null) { $addItemtoArchiveFileMessage = ($LocalizedData.AddItemtoArchiveFile -f $currentFilePath) $entryToBeUpdated.Delete() } } $compression = CompressionLevelMapper $compressionLevel # If a directory needs to be added to an archive file, # by convention the .Net API's expect the path of the directory # to end with directory separator to detect the path as an directory. if(!$relativeFilePath.EndsWith([System.IO.Path]::DirectorySeparatorChar, [StringComparison]::OrdinalIgnoreCase)) { try { try { $currentFileStream = [System.IO.File]::Open($currentFilePath, [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::Read) } catch { # Failed to access the file. Write a non terminating error to the pipeline # and move on with the remaining files. $exception = $_.Exception if($null -ne $_.Exception -and $null -ne $_.Exception.InnerException) { $exception = $_.Exception.InnerException } $errorRecord = CreateErrorRecordHelper "CompressArchiveUnauthorizedAccessError" $null ([System.Management.Automation.ErrorCategory]::PermissionDenied) $exception $currentFilePath Write-Error -ErrorRecord $errorRecord } if($null -ne $currentFileStream) { $srcStream = New-Object System.IO.BinaryReader $currentFileStream $entryPath = DirectorySeparatorNormalizeHelper $relativeFilePath $currentArchiveEntry = $zipArchive.CreateEntry($entryPath, $compression) # Updating the File Creation time so that the same timestamp would be retained after expanding the compressed file. # At this point we are sure that Get-ChildItem would succeed. $lastWriteTime = (Get-Item -LiteralPath $currentFilePath).LastWriteTime if ($lastWriteTime.Year -lt 1980) { Write-Warning "'$currentFilePath' has LastWriteTime earlier than 1980. Compress-Archive will store any files with LastWriteTime values earlier than 1980 as 1/1/1980 00:00." $lastWriteTime = [DateTime]::Parse('1980-01-01T00:00:00') } $currentArchiveEntry.LastWriteTime = $lastWriteTime $destStream = New-Object System.IO.BinaryWriter $currentArchiveEntry.Open() while($numberOfBytesRead = $srcStream.Read($buffer, 0, $bufferSize)) { $destStream.Write($buffer, 0, $numberOfBytesRead) $destStream.Flush() } $numberOfItemsArchived += 1 $addItemtoArchiveFileMessage = ($LocalizedData.AddItemtoArchiveFile -f $currentFilePath) } } finally { If($null -ne $currentFileStream) { $currentFileStream.Dispose() } If($null -ne $srcStream) { $srcStream.Dispose() } If($null -ne $destStream) { $destStream.Dispose() } } } else { $entryPath = DirectorySeparatorNormalizeHelper $relativeFilePath $currentArchiveEntry = $zipArchive.CreateEntry($entryPath, $compression) $numberOfItemsArchived += 1 $addItemtoArchiveFileMessage = ($LocalizedData.AddItemtoArchiveFile -f $currentFilePath) } if($null -ne $addItemtoArchiveFileMessage) { Write-Verbose $addItemtoArchiveFileMessage } $currentEntryCount += 1 ProgressBarHelper "Compress-Archive" $progressBarStatus $previousSegmentWeight $currentSegmentWeight $sourcePaths.Count $currentEntryCount } } finally { If($null -ne $zipArchive) { $zipArchive.Dispose() } If($null -ne $archiveFileStream) { $archiveFileStream.Dispose() } # Complete writing progress. Write-Progress -Activity "Compress-Archive" -Completed } return $numberOfItemsArchived } <############################################################################################ # ValidateArchivePathHelper: This is a helper function used to validate the archive file # path & its file format. The only supported archive file format is .zip ############################################################################################> function ValidateArchivePathHelper { param ( [string] $archiveFile ) if(-not [System.IO.File]::Exists($archiveFile)) { $errorMessage = ($LocalizedData.PathNotFoundError -f $archiveFile) ThrowTerminatingErrorHelper "PathNotFound" $errorMessage ([System.Management.Automation.ErrorCategory]::InvalidArgument) $archiveFile } } <############################################################################################ # ExpandArchiveHelper: This is a helper function used to expand the archive file contents # to the specified directory. ############################################################################################> function ExpandArchiveHelper { param ( [string] $archiveFile, [string] $expandedDir, [ref] $expandedItems, [boolean] $force, [boolean] $isVerbose, [boolean] $isConfirm ) Add-CompressionAssemblies try { # The existence of archive file has already been validated by ValidateArchivePathHelper # before calling this helper function. $archiveFileStreamArgs = @($archiveFile, [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read) $archiveFileStream = New-Object -TypeName System.IO.FileStream -ArgumentList $archiveFileStreamArgs $zipArchiveArgs = @($archiveFileStream, [System.IO.Compression.ZipArchiveMode]::Read, $false) try { $zipArchive = New-Object -TypeName System.IO.Compression.ZipArchive -ArgumentList $zipArchiveArgs } catch [System.IO.InvalidDataException] { # Failed to open the file for reading as a zip archive. Wrap the exception # and re-throw it indicating it does not appear to be a valid zip file. $exception = $_.Exception if($null -ne $_.Exception -and $null -ne $_.Exception.InnerException) { $exception = $_.Exception.InnerException } # Load the WindowsBase.dll assembly to get access to the System.IO.FileFormatException class [System.Reflection.Assembly]::Load('WindowsBase,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35') $invalidFileFormatException = New-Object -TypeName System.IO.FileFormatException -ArgumentList @( ($LocalizedData.ItemDoesNotAppearToBeAValidZipArchive -f $archiveFile) $exception ) throw $invalidFileFormatException } if($zipArchive.Entries.Count -eq 0) { $archiveFileIsEmpty = ($LocalizedData.ArchiveFileIsEmpty -f $archiveFile) Write-Verbose $archiveFileIsEmpty return } $currentEntryCount = 0 $progressBarStatus = ($LocalizedData.ExpandProgressBarText -f $archiveFile) # Ensures that the last character on the extraction path is the directory separator char. # Without this, a bad zip file could try to traverse outside of the expected extraction path. # At this point $expandedDir is a fully qualified path without any relative segments. if (-not $expandedDir.EndsWith([System.IO.Path]::DirectorySeparatorChar)) { $expandedDir += [System.IO.Path]::DirectorySeparatorChar } # The archive entries can either be empty directories or files. foreach($currentArchiveEntry in $zipArchive.Entries) { # Windows filesystem provider will internally convert from `/` to `\` $currentArchiveEntryPath = Join-Path -Path $expandedDir -ChildPath $currentArchiveEntry.FullName # Remove possible relative segments from target # This is similar to [System.IO.Path]::GetFullPath($currentArchiveEntryPath) but uses PS current dir instead of process-wide current dir $currentArchiveEntryPath = $PSCmdlet.SessionState.Path.GetUnresolvedProviderPathFromPSPath($currentArchiveEntryPath) # Check that expanded relative paths and absolute paths from the archive are Not going outside of target directory # Ordinal match is safest, case-sensitive volumes can be mounted within volumes that are case-insensitive. if (-not ($currentArchiveEntryPath.StartsWith($expandedDir, [System.StringComparison]::Ordinal))) { $BadArchiveEntryMessage = ($LocalizedData.BadArchiveEntry -f $currentArchiveEntry.FullName) # notify user of bad archive entry Write-Error $BadArchiveEntryMessage # move on to the next entry in the archive continue } $extension = [system.IO.Path]::GetExtension($currentArchiveEntryPath) # The current archive entry is an empty directory # The FullName of the Archive Entry representing a directory would end with a trailing directory separator. if($extension -eq [string]::Empty -and $currentArchiveEntryPath.EndsWith([System.IO.Path]::DirectorySeparatorChar, [StringComparison]::OrdinalIgnoreCase)) { $pathExists = Test-Path -LiteralPath $currentArchiveEntryPath # The current archive entry expects an empty directory. # Check if the existing directory is empty. If it's not empty # then it means that user has added this directory by other means. if($pathExists -eq $false) { New-Item $currentArchiveEntryPath -Type Directory -Confirm:$isConfirm | Out-Null if(Test-Path -LiteralPath $currentArchiveEntryPath -PathType Container) { $addEmptyDirectorytoExpandedPathMessage = ($LocalizedData.AddItemtoArchiveFile -f $currentArchiveEntryPath) Write-Verbose $addEmptyDirectorytoExpandedPathMessage $expandedItems.Value += $currentArchiveEntryPath } } } else { try { $currentArchiveEntryFileInfo = New-Object -TypeName System.IO.FileInfo -ArgumentList $currentArchiveEntryPath $parentDirExists = Test-Path -LiteralPath $currentArchiveEntryFileInfo.DirectoryName -PathType Container # If the Parent directory of the current entry in the archive file does not exist, then create it. if($parentDirExists -eq $false) { # note that if any ancestor of this directory doesn't exist, we don't recursively create each one as New-Item # takes care of this already, so only one DirectoryInfo is returned instead of one for each parent directory # that only contains directories New-Item $currentArchiveEntryFileInfo.DirectoryName -Type Directory -Confirm:$isConfirm | Out-Null if(!(Test-Path -LiteralPath $currentArchiveEntryFileInfo.DirectoryName -PathType Container)) { # The directory referred by $currentArchiveEntryFileInfo.DirectoryName was not successfully created. # This could be because the user has specified -Confirm parameter when Expand-Archive was invoked # and authorization was not provided when confirmation was prompted. In such a scenario, # we skip the current file in the archive and continue with the remaining archive file contents. Continue } $expandedItems.Value += $currentArchiveEntryFileInfo.DirectoryName } $hasNonTerminatingError = $false # Check if the file in to which the current archive entry contents # would be expanded already exists. if($currentArchiveEntryFileInfo.Exists) { if($force) { Remove-Item -LiteralPath $currentArchiveEntryFileInfo.FullName -Force -ErrorVariable ev -Verbose:$isVerbose -Confirm:$isConfirm if($ev -ne $null) { $hasNonTerminatingError = $true } if(Test-Path -LiteralPath $currentArchiveEntryFileInfo.FullName -PathType Leaf) { # The file referred by $currentArchiveEntryFileInfo.FullName was not successfully removed. # This could be because the user has specified -Confirm parameter when Expand-Archive was invoked # and authorization was not provided when confirmation was prompted. In such a scenario, # we skip the current file in the archive and continue with the remaining archive file contents. Continue } } else { # Write non-terminating error to the pipeline. $errorMessage = ($LocalizedData.FileExistsError -f $currentArchiveEntryFileInfo.FullName, $archiveFile, $currentArchiveEntryFileInfo.FullName, $currentArchiveEntryFileInfo.FullName) $errorRecord = CreateErrorRecordHelper "ExpandArchiveFileExists" $errorMessage ([System.Management.Automation.ErrorCategory]::InvalidOperation) $null $currentArchiveEntryFileInfo.FullName Write-Error -ErrorRecord $errorRecord $hasNonTerminatingError = $true } } if(!$hasNonTerminatingError) { # The ExtractToFile() method doesn't handle whitespace correctly, strip whitespace which is consistent with how Explorer handles archives # There is an edge case where an archive contains files whose only difference is whitespace, but this is uncommon and likely not legitimate [string[]] $parts = $currentArchiveEntryPath.Split([System.IO.Path]::DirectorySeparatorChar) | % { $_.Trim() } $currentArchiveEntryPath = [string]::Join([System.IO.Path]::DirectorySeparatorChar, $parts) [System.IO.Compression.ZipFileExtensions]::ExtractToFile($currentArchiveEntry, $currentArchiveEntryPath, $false) # Add the expanded file path to the $expandedItems array, # to keep track of all the expanded files created while expanding the archive file. # If user enters CTRL + C then at that point of time, all these expanded files # would be deleted as part of the clean up process. $expandedItems.Value += $currentArchiveEntryPath $addFiletoExpandedPathMessage = ($LocalizedData.CreateFileAtExpandedPath -f $currentArchiveEntryPath) Write-Verbose $addFiletoExpandedPathMessage } } finally { If($null -ne $destStream) { $destStream.Dispose() } If($null -ne $srcStream) { $srcStream.Dispose() } } } $currentEntryCount += 1 # $currentSegmentWeight is Set to 100 giving equal weightage to each file that is getting expanded. # $previousSegmentWeight is set to 0 as there are no prior segments. $previousSegmentWeight = 0 $currentSegmentWeight = 100 ProgressBarHelper "Expand-Archive" $progressBarStatus $previousSegmentWeight $currentSegmentWeight $zipArchive.Entries.Count $currentEntryCount } } finally { If($null -ne $zipArchive) { $zipArchive.Dispose() } If($null -ne $archiveFileStream) { $archiveFileStream.Dispose() } # Complete writing progress. Write-Progress -Activity "Expand-Archive" -Completed } } <############################################################################################ # ProgressBarHelper: This is a helper function used to display progress message. # This function is used by both Compress-Archive & Expand-Archive to display archive file # creation/expansion progress. ############################################################################################> function ProgressBarHelper { param ( [string] $cmdletName, [string] $status, [double] $previousSegmentWeight, [double] $currentSegmentWeight, [int] $totalNumberofEntries, [int] $currentEntryCount ) if($currentEntryCount -gt 0 -and $totalNumberofEntries -gt 0 -and $previousSegmentWeight -ge 0 -and $currentSegmentWeight -gt 0) { $entryDefaultWeight = $currentSegmentWeight/[double]$totalNumberofEntries $percentComplete = $previousSegmentWeight + ($entryDefaultWeight * $currentEntryCount) Write-Progress -Activity $cmdletName -Status $status -PercentComplete $percentComplete } } <############################################################################################ # CSVHelper: This is a helper function used to append comma after each path specified by # the SourcePath array. This helper function is used to display all the user supplied paths # in the WhatIf message. ############################################################################################> function CSVHelper { param ( [string[]] $sourcePath ) # SourcePath has already been validated by the calling function. if($sourcePath.Count -gt 1) { $sourcePathInCsvFormat = "`n" for($currentIndex=0; $currentIndex -lt $sourcePath.Count; $currentIndex++) { if($currentIndex -eq $sourcePath.Count - 1) { $sourcePathInCsvFormat += $sourcePath[$currentIndex] } else { $sourcePathInCsvFormat += $sourcePath[$currentIndex] + "`n" } } } else { $sourcePathInCsvFormat = $sourcePath } return $sourcePathInCsvFormat } <############################################################################################ # ThrowTerminatingErrorHelper: This is a helper function used to throw terminating error. ############################################################################################> function ThrowTerminatingErrorHelper { param ( [string] $errorId, [string] $errorMessage, [System.Management.Automation.ErrorCategory] $errorCategory, [object] $targetObject, [Exception] $innerException ) if($innerException -eq $null) { $exception = New-object System.IO.IOException $errorMessage } else { $exception = New-Object System.IO.IOException $errorMessage, $innerException } $exception = New-Object System.IO.IOException $errorMessage $errorRecord = New-Object System.Management.Automation.ErrorRecord $exception, $errorId, $errorCategory, $targetObject $PSCmdlet.ThrowTerminatingError($errorRecord) } <############################################################################################ # CreateErrorRecordHelper: This is a helper function used to create an ErrorRecord ############################################################################################> function CreateErrorRecordHelper { param ( [string] $errorId, [string] $errorMessage, [System.Management.Automation.ErrorCategory] $errorCategory, [Exception] $exception, [object] $targetObject ) if($null -eq $exception) { $exception = New-Object System.IO.IOException $errorMessage } $errorRecord = New-Object System.Management.Automation.ErrorRecord $exception, $errorId, $errorCategory, $targetObject return $errorRecord } <############################################################################################ # DirectorySeparatorNormalizeHelper: This is a helper function used to normalize separators # when compressing archives, creating cross platform archives. # # The approach taken is leveraging the fact that .net on Windows all the way back to # Framework 1.1 specifies `\` as DirectoryPathSeparatorChar and `/` as # AltDirectoryPathSeparatorChar, while other platforms in .net Core use `/` for # DirectoryPathSeparatorChar and AltDirectoryPathSeparatorChar. When using a *nix platform, # the replacements will be no-ops, while Windows will convert all `\` to `/` for the # purposes of the ZipEntry FullName. ############################################################################################> function DirectorySeparatorNormalizeHelper { param ( [string] $archivePath ) if($null -eq $archivePath) { return $archivePath } return $archivePath.replace([System.IO.Path]::DirectorySeparatorChar, [System.IO.Path]::AltDirectorySeparatorChar) } <############################################################################################ # ArchivePathCompareHelper: This is a helper function used to compare with normalized # separators. ############################################################################################> function ArchivePathCompareHelper { param ( [string] $pathArgA, [string] $pathArgB ) $normalizedPathArgA = DirectorySeparatorNormalizeHelper $pathArgA $normalizedPathArgB = DirectorySeparatorNormalizeHelper $pathArgB return $normalizedPathArgA -eq $normalizedPathArgB } # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCxWUVaNUPabUNe # T6XgWNeKW3CfCVc/X+PBlTJ8w9y52qCCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQDOS8s1ra6f0YGtg0OhEaQa/t3Q+q1MEHhWJhqQVuO5amYXQpy8MDPNoJYk+FWA # hePP5LxwcSge5aen+f5Q6WNPd6EDxGzotvVpNi5ve0H97S3F7C/axDfKxyNh21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L0U5HnKMUvCe/b1zPO/jhTGFggVc9DIXLItC/w3ppp33AAqKb0629mrsJQuROvJ # Z+uPBL7RE4m65JaIyVevFp87gWkXP7gihVFDIP6cxudEd4KP4B7HkLljHGaCIc2o # ziYzu+WHTEF9YhTw0mvgsI32RnUlILj5YtOzE4TZ7rgYrZ7Pxa+uSp3UP110m2ez # 7Pmq1cBbi7LdmLE7RyhoTYvBBatcn0QxxzOUlJ2QLN3R8fSnjBapWXbbcdL7Fw4u # AuiHkTYh5NxYmcPckm6HX6sBeRdFL662hlQpJeIaSiMPCgrNgNtOyxy1nTEunU1J # rBDk74ToARSALxLWOw02khw= # SIG # End signature block
combined_dataset/train/non-malicious/Move-Mailbox 2010.ps1
Move-Mailbox 2010.ps1
$DistGroup = XC2010Move $MB2Move = Get-DistributionGroup XC2010Move | Get-DistributionGroupMember | Get-Mailbox | Where {($_.RecipientTypeDetails -eq "LegacyMailbox") -and ($_.MailboxMoveStatus -eq ‘None’)} | Get-Random -Count 20 $batch = "MoveMB_{0:ddMMM_yyyy}" -f (Get-Date) ForEach ($SingleMailbox in $MB2Move) {New-MoveRequest –Identity $SingleMailbox -BadItemLimit 100 -AcceptLargeDataLoss -Batchname $batch} $MB2RemoveFromDG = Get-DistributionGroup XC2010Move | Get-DistributionGroupMember | Get-Mailbox | Where {($_.RecipientTypeDetails -eq "UserMailbox") -and ($_.MailboxMoveStatus -eq ‘Completed’)} ForEach ($member in $MB2RemoveFromDG){Remove-DistributionGroupMember -Identity XC2010Move -Member $member -Confirm:$False} ForEach ($member in $MB2RemoveFromDG){Remove-MoveRequest -Identity $member -Confirm:$False}
combined_dataset/train/non-malicious/1854.ps1
1854.ps1
function New-ModuleSpecification { param( $ModuleName, $ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = @{} if ($ModuleName) { $modSpec.ModuleName = $ModuleName } if ($ModuleVersion) { $modSpec.ModuleVersion = $ModuleVersion } if ($MaximumVersion) { $modSpec.MaximumVersion = $MaximumVersion } if ($RequiredVersion) { $modSpec.RequiredVersion = $RequiredVersion } if ($Guid) { $modSpec.Guid = $Guid } return $modSpec } function Invoke-ImportModule { param( $Module, $MinimumVersion, $MaximumVersion, $RequiredVersion, [switch]$PassThru, [switch]$AsCustomObject) $cmdArgs = @{ Name = $Module ErrorAction = 'Stop' } if ($MinimumVersion) { $cmdArgs.MinimumVersion = $MinimumVersion } if ($MaximumVersion) { $cmdArgs.MaximumVersion = $MaximumVersion } if ($RequiredVersion) { $cmdArgs.RequiredVersion = $RequiredVersion } if ($PassThru) { $cmdArgs.PassThru = $true } if ($AsCustomObject) { $cmdArgs.AsCustomObject = $true } return Import-Module @cmdArgs } function Assert-ModuleIsCorrect { param( $Module, [string]$Name = $moduleName, [guid]$Guid = $actualGuid, [version]$Version = $actualVersion, [version]$MinVersion, [version]$MaxVersion, [version]$RequiredVersion ) $Module | Should -Not -Be $null $Module.Name | Should -Be $ModuleName $Module.Guid | Should -Be $Guid if ($Version) { $Module.Version | Should -Be $Version } if ($ModuleVersion) { $Module.Version | Should -BeGreaterOrEqual $ModuleVersion } if ($MaximumVersion) { $Module.Version | Should -BeLessOrEqual $MaximumVersion } if ($RequiredVersion) { $Module.Version | Should -Be $RequiredVersion } } $actualVersion = '2.3' $actualGuid = [guid]'9b945229-65fd-4629-ae99-88e2618377ff' $successCases = @( @{ ModuleVersion = '2.0' MaximumVersion = $null RequiredVersion = $null }, @{ ModuleVersion = '1.0' MaximumVersion = '3.0' RequiredVersion = $null }, @{ ModuleVersion = $null MaximumVersion = '3.0' RequiredVersion = $null }, @{ ModuleVersion = $null MaximumVersion = $null RequiredVersion = $actualVersion } ) $failCases = @( @{ ModuleVersion = '2.5' MaximumVersion = $null RequiredVersion = $null }, @{ ModuleVersion = '2.0' MaximumVersion = '2.2' RequiredVersion = $null }, @{ ModuleVersion = '3.0' MaximumVersion = '3.1' RequiredVersion = $null }, @{ ModuleVersion = '3.0' MaximumVersion = '2.0' RequiredVersion = $null }, @{ ModuleVersion = $null MaximumVersion = '1.7' RequiredVersion = $null }, @{ ModuleVersion = $null MaximumVersion = $null RequiredVersion = '2.2' } ) $guidSuccessCases = [System.Collections.ArrayList]::new() foreach ($case in $successCases) { [void]$guidSuccessCases.Add($case + @{ Guid = $null }) [void]$guidSuccessCases.Add(($case + @{ Guid = $actualGuid })) } $guidFailCases = [System.Collections.ArrayList]::new() foreach ($case in $failCases) { [void]$guidFailCases.Add($case + @{ Guid = $null }) [void]$guidFailCases.Add($case + @{ Guid = $actualGuid }) [void]$guidFailCases.Add($case + @{ Guid = [guid]::NewGuid() }) } Describe "Module loading with version constraints" -Tags "Feature" { BeforeAll { $moduleName = 'TestModule' $modulePath = Join-Path $TestDrive $moduleName New-Item -Path $modulePath -ItemType Directory $manifestPath = Join-Path $modulePath "$moduleName.psd1" New-ModuleManifest -Path $manifestPath -ModuleVersion $actualVersion -Guid $actualGuid $oldPSModulePath = $env:PSModulePath $env:PSModulePath += [System.IO.Path]::PathSeparator + $TestDrive } AfterAll { $env:PSModulePath = $oldPSModulePath } AfterEach { Get-Module $moduleName | Remove-Module } It "Loads the module by FullyQualifiedName from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module by FullyQualifiedName from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module by FullyQualifiedName from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $manifestPath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Does not get the module when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Get-Module -FullyQualifiedName $modSpec $mod | Should -Be $null } It "Does not load the module with FullyQualifiedName from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with FullyQualifiedName from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with FullyQualifiedName from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $manifestPath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } } Describe "Versioned directory loading with module constraints" -Tags "Feature" { BeforeAll { $moduleName = 'TestModule' $modulePath = Join-Path $TestDrive $moduleName New-Item -Path $modulePath -ItemType Directory $versionPath = Join-Path $modulePath $actualVersion New-Item -Path $versionPath -ItemType Directory $manifestPath = Join-Path $versionPath "$moduleName.psd1" New-ModuleManifest -Path $manifestPath -ModuleVersion $actualVersion -Guid $actualGuid $oldPSModulePath = $env:PSModulePath $env:PSModulePath += [System.IO.Path]::PathSeparator + $TestDrive } AfterAll { $env:PSModulePath = $oldPSModulePath } AfterEach { Get-Module $moduleName | Remove-Module } It "Loads the module by FullyQualifiedName from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module by FullyQualifiedName from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module by FullyQualifiedName from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $manifestPath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Does not get the module when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Get-Module -FullyQualifiedName $modSpec $mod | Should -Be $null } It "Does not load the module with FullyQualifiedName from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with FullyQualifiedName from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with FullyQualifiedName from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $manifestPath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } } Describe "Rooted module loading with module constraints" -Tags "Feature" { BeforeAll { $moduleName = 'TestModule' $modulePath = Join-Path $TestDrive $moduleName New-Item -Path $modulePath -ItemType Directory $rootModuleName = 'RootModule.psm1' $rootModulePath = Join-Path $modulePath $rootModuleName New-Item -Path $rootModulePath -ItemType File -Value 'function Test-RootModule { 178 }' $manifestPath = Join-Path $modulePath "$moduleName.psd1" New-ModuleManifest -Path $manifestPath -ModuleVersion $actualVersion -Guid $actualGuid -RootModule $rootModuleName $oldPSModulePath = $env:PSModulePath $env:PSModulePath += [System.IO.Path]::PathSeparator + $TestDrive } AfterAll { $env:PSModulePath = $oldPSModulePath } AfterEach { Get-Module $moduleName | Remove-Module } It "Loads the module by FullyQualifiedName from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module by FullyQualifiedName from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module by FullyQualifiedName from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $manifestPath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Does not get the module when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Get-Module -FullyQualifiedName $modSpec $mod | Should -Be $null } It "Does not load the module with FullyQualifiedName from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with FullyQualifiedName from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with FullyQualifiedName from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $manifestPath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } } Describe "Preloaded module specification checking" -Tags "Feature" { BeforeAll { $moduleName = 'TestModule' $modulePath = Join-Path $TestDrive $moduleName New-Item -Path $modulePath -ItemType Directory $manifestPath = Join-Path $modulePath "$moduleName.psd1" New-ModuleManifest -Path $manifestPath -ModuleVersion $actualVersion -Guid $actualGuid $oldPSModulePath = $env:PSModulePath $env:PSModulePath += [System.IO.Path]::PathSeparator + $TestDrive Import-Module $modulePath $relativePathCases = @( @{ Location = $TestDrive; ModPath = (Join-Path "." $moduleName) } @{ Location = $TestDrive; ModPath = (Join-Path "." $moduleName "$moduleName.psd1") } @{ Location = (Join-Path $TestDrive $moduleName); ModPath = (Join-Path "." "$moduleName.psd1") } @{ Location = (Join-Path $TestDrive $moduleName); ModPath = (Join-Path ".." $moduleName) } ) } AfterAll { $env:PSModulePath = $oldPSModulePath Get-Module $moduleName | Remove-Module } It "Gets the module when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Get-Module -FullyQualifiedName $modSpec Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Gets the module when a relative path is used in a module specification: <ModPath>" -TestCases $relativePathCases -Pending { param([string]$Location, [string]$ModPath) Push-Location $Location try { $modSpec = New-ModuleSpecification -ModuleName $ModPath -ModuleVersion $actualVersion $mod = Get-Module -FullyQualifiedName $modSpec Assert-ModuleIsCorrect ` -Module $mod ` -Name $moduleName -Guid $actualGuid -RequiredVersion $actualVersion } finally { Pop-Location } } It "Loads the module by FullyQualifiedName from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module by FullyQualifiedName from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module by FullyQualifiedName from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $manifestPath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Does not get the module when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Get-Module -FullyQualifiedName $modSpec $mod | Should -Be $null } It "Does not load the module with FullyQualifiedName from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with FullyQualifiedName from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with FullyQualifiedName from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $manifestPath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } Context "Required modules" { BeforeAll { $reqModName = 'ReqMod' $reqModPath = Join-Path $TestDrive "$reqModName.psd1" } AfterEach { Get-Module $reqModName | Remove-Module } It "Successfully loads a module when the required module has ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion New-ModuleManifest -Path $reqModPath -RequiredModules $modSpec $reqMod = Import-Module $reqModPath -PassThru $reqMod | Should -Not -Be $null $reqMod.Name | Should -Be $reqModName } It "Does not load a module when the required module has ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion New-ModuleManifest -Path $reqModPath -RequiredModules $modSpec { Import-Module $reqModPath -ErrorAction Stop } | Should -Throw -ErrorId "Modules_InvalidManifest,Microsoft.PowerShell.Commands.ImportModuleCommand" } } } Describe "Preloaded modules with versioned directory version checking" -Tag "Feature" { BeforeAll { $moduleName = 'TestModule' $modulePath = Join-Path $TestDrive $moduleName New-Item -Path $modulePath -ItemType Directory $versionPath = Join-Path $modulePath $actualVersion New-Item -Path $versionPath -ItemType Directory $manifestPath = Join-Path $versionPath "$moduleName.psd1" New-ModuleManifest -Path $manifestPath -ModuleVersion $actualVersion -Guid $actualGuid $oldPSModulePath = $env:PSModulePath $env:PSModulePath += [System.IO.Path]::PathSeparator + $TestDrive Import-Module $modulePath } AfterAll { $env:PSModulePath = $oldPSModulePath Get-Module $moduleName | Remove-Module } It "Gets the module when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Get-Module -FullyQualifiedName $modSpec Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module by FullyQualifiedName from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module by FullyQualifiedName from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module by FullyQualifiedName from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $manifestPath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Does not get the module when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Get-Module -FullyQualifiedName $modSpec $mod | Should -Be $null } It "Does not load the module with FullyQualifiedName from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with FullyQualifiedName from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with FullyQualifiedName from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $manifestPath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } Context "Required modules" { BeforeAll { $reqModName = 'ReqMod' $reqModPath = Join-Path $TestDrive "$reqModName.psd1" } AfterEach { Get-Module $reqModName | Remove-Module } It "Successfully loads a module when the required module has ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion New-ModuleManifest -Path $reqModPath -RequiredModules $modSpec $reqMod = Import-Module $reqModPath -PassThru $reqMod | Should -Not -Be $null $reqMod.Name | Should -Be $reqModName } It "Does not load a module when the required module has ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion New-ModuleManifest -Path $reqModPath -RequiredModules $modSpec { Import-Module $reqModPath -ErrorAction Stop } | Should -Throw -ErrorId "Modules_InvalidManifest,Microsoft.PowerShell.Commands.ImportModuleCommand" } } } Describe "Preloaded rooted module specification checking" -Tags "Feature" { BeforeAll { $moduleName = 'TestModule' $modulePath = Join-Path $TestDrive $moduleName New-Item -Path $modulePath -ItemType Directory $rootModuleName = 'RootModule.psm1' $rootModulePath = Join-Path $modulePath $rootModuleName New-Item -Path $rootModulePath -ItemType File -Value 'function Test-RootModule { 43 }' $manifestPath = Join-Path $modulePath "$moduleName.psd1" New-ModuleManifest -Path $manifestPath -ModuleVersion $actualVersion -Guid $actualGuid -RootModule $rootModuleName $oldPSModulePath = $env:PSModulePath $env:PSModulePath += [System.IO.Path]::PathSeparator + $TestDrive Import-Module $modulePath } AfterAll { $env:PSModulePath = $oldPSModulePath Get-Module $moduleName | Remove-Module } It "Gets the module when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Get-Module -FullyQualifiedName $modSpec Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module by FullyQualifiedName from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module by FullyQualifiedName from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module by FullyQualifiedName from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidSuccessCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $manifestPath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Import-Module -FullyQualifiedName $modSpec -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Loads the module with version constraints from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $mod = Invoke-ImportModule -Module $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid -PassThru Assert-ModuleIsCorrect ` -Module $mod ` -MinVersion $ModuleVersion ` -MaxVersion $MaximumVersion ` -RequiredVersion $RequiredVersion } It "Does not get the module when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid $mod = Get-Module -FullyQualifiedName $modSpec $mod | Should -Be $null } It "Does not load the module with FullyQualifiedName from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $modulePath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with FullyQualifiedName from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with FullyQualifiedName from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $guidFailCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $modSpec = New-ModuleSpecification -ModuleName $manifestPath -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion -Guid $Guid { Import-Module -FullyQualifiedName $modSpec -ErrorAction Stop } | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from absolute path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from the module path when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } It "Does not load the module with version constraints from the manifest when ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>, Guid=<Guid>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion, $Guid) $sb = { Invoke-ImportModule -Module $modulePath -MinimumVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion } if ($ModuleVersion -and $MaximumVersion -and ($ModuleVersion -ge $MaximumVersion)) { $sb | Should -Throw -ErrorId 'ArgumentOutOfRange,Microsoft.PowerShell.Commands.ImportModuleCommand' return } $sb | Should -Throw -ErrorId 'Modules_ModuleWithVersionNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand' } Context "Required modules" { BeforeAll { $reqModName = 'ReqMod' $reqModPath = Join-Path $TestDrive "$reqModName.psd1" } AfterEach { Get-Module $reqModName | Remove-Module } It "Successfully loads a module when the required module has ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>" -TestCases $successCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion New-ModuleManifest -Path $reqModPath -RequiredModules $modSpec $reqMod = Import-Module $reqModPath -PassThru $reqMod | Should -Not -Be $null $reqMod.Name | Should -Be $reqModName } It "Does not load a module when the required module has ModuleVersion=<ModuleVersion>, MaximumVersion=<MaximumVersion>, RequiredVersion=<RequiredVersion>" -TestCases $failCases { param($ModuleVersion, $MaximumVersion, $RequiredVersion) $modSpec = New-ModuleSpecification -ModuleName $moduleName -ModuleVersion $ModuleVersion -MaximumVersion $MaximumVersion -RequiredVersion $RequiredVersion New-ModuleManifest -Path $reqModPath -RequiredModules $modSpec { Import-Module $reqModPath -ErrorAction Stop } | Should -Throw -ErrorId "Modules_InvalidManifest,Microsoft.PowerShell.Commands.ImportModuleCommand" } } }
combined_dataset/train/non-malicious/Set-UserCannotChangePass.ps1
Set-UserCannotChangePass.ps1
#########1#########2#########3#########4#########5#########6#########7#########8#########9#########1 #########0#########0#########0#########0#########0#########0#########0#########0#########0#########0 # # Author: Erik McCarty # # Description: Set the "user Cannot Change Password" property on an active # directory user object # # Remarks: There is poor documentation on the internet that would lead you # to believe the $user.userAccountControl property value bit 0x000040 can # be set to turn on the "user Cannot Change Password" account property. # However you cannot assign this permission by directly modifying the # userAccountControl attribute. # # History: # 20080107 EWM Initial Creation # # reference: # http://msdn2.microsoft.com/en-us/library/aa746398.aspx # http://mow001.blogspot.com/2006/08/powershell-and-active-directory-part-8.html # http://ewmccarty.spaces.live.com/blog/cns!CE2AE9EFF99E6598!132.entry # Example: # # Set-UserCannotChangePassword "BMcClellan" # #########1#########2#########3#########4#########5#########6#########7#########8#########9#########1 #########0#########0#########0#########0#########0#########0#########0#########0#########0#########0 # function set-UserCannotChangePassword( [string] $sAMAccountName ){ # set variables $everyOne = [System.Security.Principal.SecurityIdentifier]'S-1-1-0' $self = [System.Security.Principal.SecurityIdentifier]'S-1-5-10' $SelfDeny = new-object System.DirectoryServices.ActiveDirectoryAccessRule ( $self,'ExtendedRight','Deny','ab721a53-1e2f-11d0-9819-00aa0040529b') $SelfAllow = new-object System.DirectoryServices.ActiveDirectoryAccessRule ( $self,'ExtendedRight','Allow','ab721a53-1e2f-11d0-9819-00aa0040529b') $EveryoneDeny = new-object System.DirectoryServices.ActiveDirectoryAccessRule ( $Everyone,'ExtendedRight','Deny','ab721a53-1e2f-11d0-9819-00aa0040529b') $EveryOneAllow = new-object System.DirectoryServices.ActiveDirectoryAccessRule ( $Everyone,'ExtendedRight','Allow','ab721a53-1e2f-11d0-9819-00aa0040529b') # find the user object in the default domain $searcher = New-Object DirectoryServices.DirectorySearcher $searcher.filter = "(&(samaccountname=$sAMAccountName))" $results = $searcher.findone() $user = $results.getdirectoryentry() # set "user cannot change password" $user.psbase.get_ObjectSecurity().AddAccessRule($selfDeny) $user.psbase.get_ObjectSecurity().AddAccessRule($EveryoneDeny) $user.psbase.CommitChanges() }
combined_dataset/train/non-malicious/sample_41_99.ps1
sample_41_99.ps1
@{ GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @('MSFT_MpPerformanceRecording.psm1') FormatsToProcess = @('MSFT_MpPerformanceReport.Format.ps1xml') CompatiblePSEditions = @('Desktop', 'Core') FunctionsToExport = @( 'New-MpPerformanceRecording', 'Get-MpPerformanceReport' ) HelpInfoUri="https://aka.ms/winsvr-2022-pshelp" PowerShellVersion = '5.1' } # SIG # Begin signature block # MIImAQYJKoZIhvcNAQcCoIIl8jCCJe4CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCALMtnQG5KhaVi8 # /j7ONkfb/EMugE0iBrx7n8hqD9uLdaCCC1MwggTgMIIDyKADAgECAhMzAAAK7CQL # sju2bxocAAAAAArsMA0GCSqGSIb3DQEBCwUAMHkxCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xIzAhBgNVBAMTGk1pY3Jvc29mdCBXaW5kb3dzIFBD # QSAyMDEwMB4XDTIzMTAxOTE5MTgwM1oXDTI0MTAxNjE5MTgwM1owcDELMAkGA1UE # BhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAc # BgNVBAoTFU1pY3Jvc29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1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNy # b3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAdj8SzOlHdiFFQABAAAB2DAi # BCCT4Z0OeFirR33EJOpbOx4eMCYbwcOwMRh5zZuizyVjJzANBgkqhkiG9w0BAQsF # AASCAgAhF6GDLuIx4P+UR1Jt07QgkezCAyUgklFGN6PzzWf45xDvpgkSQCsLBjKA # FRk2BlOo1/HZbwLNi7zL6Z27rhuq7GVnuighBH7yJLirj9e9UDePLQ1udVq/4hc3 # LlS7e88qUtAfkU27Ct9qaGQbXAza/FzHE2+LRNhJyT1sOBsxJcHeyzu/UCvyVwif # tvkz0eRs3bKffs9GYev/UINToYJ8tTit0OlZoJcOzPJ/jLeg+S3xKnJXJs9IMu6G # Z8pK1rmV/KjS4C+QNYuff9qropFLjWEAiKw+DgDY7o0CvW4Ft0FoWUUe1IlPcEXa # X3VnAnGq4ivgFnGwrMowTt5m8D7nNxVm1MMcyr0tUMAehpPI0DqhcwuQqY1gXAq0 # 83rg/lFyjIDEqVuf1edDy2uMyH/nZIrRumNqhdz/fbR6NOgP0Btw5o85G6yzRxiR # yx8QtVF13yPEDLTK7oH6hxufvVmVzok+Z27bxrXyhVgQFPt9/vuODTSsb9sHrpQC # 5DL7A/7E58NvXykqlFxlc3+csgu4kKQxemLPNZgpBcY9Z/kx+oqbmTxajRO16E3Q # ZtqQjy6s08Q9+a3QwsbCLfTo6SF4r2CIvr/f2EZiUwb/AWPvfHMtmi7tU121odrY # iEldLdH9tqjiZ0/+G7ZeW9O+ohCcur0b+2thRz0w/m4dDotI6Q== # SIG # End signature block
combined_dataset/train/non-malicious/2656.ps1
2656.ps1
[CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [ValidateSet('Install','Uninstall')] [string]$DeploymentType = 'Install', [Parameter(Mandatory=$false)] [ValidateSet('Interactive','Silent','NonInteractive')] [string]$DeployMode = 'Interactive', [Parameter(Mandatory=$false)] [switch]$AllowRebootPassThru = $false, [Parameter(Mandatory=$false)] [switch]$TerminalServerMode = $false ) Try { Try { Set-ExecutionPolicy -ExecutionPolicy 'ByPass' -Scope 'Process' -Force -ErrorAction 'Stop' } Catch {} [scriptblock]$Variables_Application = { [string]$appVendor = 'PSAppDeployToolkit' [string]$appName = 'Test Script' [string]$appVersion = '1.0' [string]$appArch = '' [string]$appLang = 'EN' [string]$appRevision = '01' [string]$appScriptVersion = '3.5.0' [string]$appScriptDate = '11/03/2014' [string]$appScriptAuthor = 'Dan Cunningham' } .$Variables_Application [scriptblock]$Variables_AllScriptParams = { [string]$DeploymentType = $DeploymentType [string]$DeployMode = $DeployMode [switch]$AllowRebootPassThru = $AllowRebootPassThru [switch]$TerminalServerMode = $TerminalServerMode } [int32]$mainExitCode = 0 $script:mainPSBoundParams = $PSBoundParameters [scriptblock]$Variables_Script = { [string]$deployAppScriptFriendlyName = 'Deploy Application' [version]$deployAppScriptVersion = [version]'4.0.0' [string]$deployAppScriptDate = '11/12/2014' [hashtable]$deployAppScriptParameters = $script:mainPSBoundParams } .$Variables_Script Try { [string]$scriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent [string]$moduleAppDeployToolkitMain = "$scriptDirectory\AppDeployToolkit\AppDeployToolkitMain.ps1" If (-not (Test-Path -Path $moduleAppDeployToolkitMain -PathType Leaf)) { Throw "Module does not exist at the specified location [$moduleAppDeployToolkitMain]." } . $moduleAppDeployToolkitMain } Catch { [int32]$mainExitCode = 1 Write-Error -Message "Module [$moduleAppDeployToolkitMain] failed to load: `n$($_.Exception.Message)`n `n$($_.InvocationInfo.PositionMessage)" -ErrorAction 'Continue' Exit $mainExitCode } If ($deploymentType -ine 'Uninstall') { [scriptblock]$Variables_InstallPhase = { [string]$installPhase = 'Pre-Installation' }; .$Variables_InstallPhase Show-InstallationWelcome -AllowDefer -DeferTimes 100 Show-InstallationWelcome -CloseApps 'iexplore' -CloseAppsCountdown 60 -CheckDiskSpace -PersistPrompt -BlockExecution [scriptblock]$Variables_InstallPhase = { [string]$installPhase = 'Installation' }; .$Variables_InstallPhase Show-InstallationProgress -StatusMessage 'BlockExecution Test: Open Internet Explorer or an Office application within 10 seconds...' Start-Sleep -Seconds 10 Show-InstallationProgress -StatusMessage 'MSI Installation And Removal Test...' Execute-MSI -Action Install -Path 'PSAppDeployToolkit_TestInstallation_1.0.0_EN_01.msi' Remove-MSIApplications -Name 'Test Installation (Testing) [Testing]' Show-InstallationProgress -StatusMessage 'x86 File Manipulation And DLL Registration Test...' Copy-File -Path "$dirSupportFiles\AutoItX3.dll" -Destination "$envWinDir\SysWOW64\AutoItx3.dll" Register-DLL -FilePath "$envWinDir\SysWOW64\AutoItx3.dll" Unregister-DLL -FilePath "$envWinDir\SysWOW64\AutoItx3.dll" Remove-File -Path "$envWinDir\SysWOW64\AutoItx3.dll" Show-InstallationProgress -StatusMessage 'x64 File Manipulation And DLL Registration Test...' Copy-File -Path "$dirSupportFiles\AutoItX3_x64.dll" -Destination "$envWinDir\System32\AutoItx3.dll" Register-DLL -FilePath "$envWinDir\System32\AutoItx3.dll" Unregister-DLL -FilePath "$envWinDir\System32\AutoItx3.dll" Remove-File -Path "$envWinDir\System32\AutoItx3.dll" Show-InstallationProgress -StatusMessage 'Shortcut Creation Test...' New-Shortcut -Path "$envProgramData\Microsoft\Windows\Start Menu\My Shortcut.lnk" -TargetPath "$envWinDir\system32\notepad.exe" -IconLocation "$envWinDir\system32\notepad.exe" -Description 'Notepad' -WorkingDirectory "$envHomeDrive\$envHomePath" Show-InstallationProgress -StatusMessage 'Pinned Application Test...' Set-PinnedApplication -Action 'PintoStartMenu' -FilePath "$envWinDir\Notepad.exe" Set-PinnedApplication -Action 'PintoTaskBar' -FilePath "$envWinDir\Notepad.exe" [scriptblock]$Variables_InstallPhase = { [string]$installPhase = 'Post-Installation' }; .$Variables_InstallPhase Show-InstallationProgress -StatusMessage 'Execute Process Test: Close Notepad to proceed...' If (-not $IsProcessUserInteractive) { Invoke-PSCommandAsUser -Command { Execute-Process -FilePath 'Notepad' } } Else { Execute-Process -FilePath 'Notepad' } Show-InstallationPrompt -Message 'Asynchronous Installation Prompt Test: The installation should complete in the background. Click OK to dismiss...' -ButtonRightText 'OK' -Icon 'Information' -NoWait Start-Sleep -Seconds 10 Remove-File -Path "$envProgramData\Microsoft\Windows\Start Menu\My Shortcut.lnk" Set-PinnedApplication -Action 'UnPinFromStartMenu' -FilePath "$envWinDir\Notepad.exe" Set-PinnedApplication -Action 'UnPinFromTaskBar' -FilePath "$envWinDir\Notepad.exe" } ElseIf ($deploymentType -ieq 'Uninstall') { [scriptblock]$Variables_InstallPhase = { [string]$installPhase = 'Post-Uninstallation' }; .$Variables_InstallPhase Show-InstallationWelcome -CloseApps 'iexplore' -CloseAppsCountdown 60 [scriptblock]$Variables_InstallPhase = { [string]$installPhase = 'Uninstallation' }; .$Variables_InstallPhase Show-InstallationProgress -StatusMessage 'MSI Uninstallation Test...' Execute-MSI -Action Uninstall -Path 'PSAppDeployToolkit_TestInstallation_1.0.0_EN_01.msi' [scriptblock]$Variables_InstallPhase = { [string]$installPhase = 'Post-Uninstallation' }; .$Variables_InstallPhase } Exit-Script -ExitCode $mainExitCode } Catch { [int32]$mainExitCode = 1 [string]$mainErrorMessage = "$(Resolve-Error)" Write-Log -Message $mainErrorMessage -Severity 3 -Source $deployAppScriptFriendlyName Show-DialogBox -Text $mainErrorMessage -Icon 'Stop' | Out-Null Exit-Script -ExitCode $mainExitCode }
combined_dataset/train/non-malicious/sample_19_63.ps1
sample_19_63.ps1
# # Module manifest for module 'OCI.PSModules.Streaming' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Streaming.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = 'ff4a80d2-3354-4a6a-a142-89663068a2ac' # 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 Streaming 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.Streaming.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-OCIStreamingConnectHarness', 'Get-OCIStreamingConnectHarnessesList', 'Get-OCIStreamingGroup', 'Get-OCIStreamingMessages', 'Get-OCIStreamingStream', 'Get-OCIStreamingStreamPool', 'Get-OCIStreamingStreamPoolsList', 'Get-OCIStreamingStreamsList', 'Invoke-OCIStreamingConsumerCommit', 'Invoke-OCIStreamingConsumerHeartbeat', 'Move-OCIStreamingConnectHarnessCompartment', 'Move-OCIStreamingStreamCompartment', 'Move-OCIStreamingStreamPoolCompartment', 'New-OCIStreamingConnectHarness', 'New-OCIStreamingCursor', 'New-OCIStreamingGroupCursor', 'New-OCIStreamingStream', 'New-OCIStreamingStreamPool', 'Remove-OCIStreamingConnectHarness', 'Remove-OCIStreamingStream', 'Remove-OCIStreamingStreamPool', 'Update-OCIStreamingConnectHarness', 'Update-OCIStreamingGroup', 'Update-OCIStreamingStream', 'Update-OCIStreamingStreamPool', 'Write-OCIStreamingMessages' # 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','Streaming' # 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_15_85.ps1
sample_15_85.ps1
ConvertFrom-StringData @' id_roiscan=Robust Office Inventory Scan id_roiscanobtaining=Collecting Robust Office Inventory Scan '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCAXZ66qMymInu0 # tQOmUkSWn1q3vDeQ0aZAnUtiJAjhyaCCDYUwggYDMIID66ADAgECAhMzAAAEA73V # lV0POxitAAAAAAQDMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjQwOTEyMjAxMTEzWhcNMjUwOTExMjAxMTEzWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQCfdGddwIOnbRYUyg03O3iz19XXZPmuhEmW/5uyEN+8mgxl+HJGeLGBR8YButGV # LVK38RxcVcPYyFGQXcKcxgih4w4y4zJi3GvawLYHlsNExQwz+v0jgY/aejBS2EJY # oUhLVE+UzRihV8ooxoftsmKLb2xb7BoFS6UAo3Zz4afnOdqI7FGoi7g4vx/0MIdi # kwTn5N56TdIv3mwfkZCFmrsKpN0zR8HD8WYsvH3xKkG7u/xdqmhPPqMmnI2jOFw/ # /n2aL8W7i1Pasja8PnRXH/QaVH0M1nanL+LI9TsMb/enWfXOW65Gne5cqMN9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yi7JPJJrdxnoGLT9O0dPFz6rCofQGoq # UFkqibUgZdyWckj1MHhFFRW2mhgQTyhJgz7KL/SFY0pSLnhaL+urUiAyZEUbHs8G # DODreWXXgwL02v1JWKLWrg5IFrEq723FXKyRdbvR3m6L1Fz8+Ck+wDPz0SsCkcle # LHnbsNg+ # SIG # End signature block
combined_dataset/train/non-malicious/sample_30_83.ps1
sample_30_83.ps1
#------------------------------------------------------------------------------ # Rules :- # # o Lines starting with # are ignored # o Blank lines are ignored # o Whitespace between commas is removed #------------------------------------------------------------------------------ # Supported data types # # o INTEGER # o DATETIME, # o STRING # o BOOLEAN # o NUMERIC, decimals #------------------------------------------------------------------------------ # Field Name must be unique across all fields. # Set 'Field Name' to '*' to use the 'XML Path Name' #------------------------------------------------------------------------------ # Xml Path Name Type Field Name # ---------------------------------------- -------- ------------------------- Event_Version, INTEGER, Version Event_SerialNumber, STRING, SerialNumber Event_DateTimeParent, DATETIME, DateTimeParent Event_DateTime, DATETIME, DateTime Event_Milliseconds, INTEGER, Milliseconds Event_EventSerialNumber, STRING, EventSerialNumber Event_DriverVersion, STRING, DriverVersion Event_FirmWareVersion, STRING, FirmWareVersion Event_MagicardGuid, STRING, MagicardGuid Event_MachineGuid, STRING, MachineGuid Event_DyeName, STRING, DyeName Event_DyeSerialNumber, STRING, DyeSerialNumber Event_DyeRibbonManufacturer, STRING, DyeRibbonManufacturer Event_EventCodeText, STRING, EventCodeText Event_EventCode, INTEGER, EventCode Event_Message, STRING, Message Event_HandFeed, BOOLEAN, HandFeed Event_DyeTagDsfid, INTEGER, DyeTagDsfid #------------------------------------------------------------------------------- # Time Zone information # --------------------- # TimeZoneName is actually TimeZoneKeyName which is in English, TimeZoneName # is localised. #------------------------------------------------------------------------------- Event_TimeZoneBias, INTEGER, TimeZoneBias Event_TimeZoneName, STRING, TimeZoneName
combined_dataset/train/non-malicious/Pomodoro Module.ps1
Pomodoro Module.ps1
#PomoDoro Module (make sure its a PS1) #12-3-2011 Karl Prosser #example #import-module C:\\amodule\\Pomodoro.psm1 -force #Start-Pomodoro -ShowPercent -Work "coding" -UsePowerShellPrompt #future todos # -limit , a number (by default 0 meaning forever) that will only run the pomodoro that many times # -Confirm (after one is finished it will ask questions like whether you want to do another and whether you were successful) # -StartSound - path to it - with the current ones as default # -BreakSound -path to it -with current ones as default # possibly some custom sounds and the module gets distributed as a zip. # document all the functions fully with standard powershell help techniques. # -useprompt - create a prompt instead and update that each time instead.. # Pomo 4:21> (means we are in the pomodoro with that many minutes left.. if work is specified like "watchlogs" then it could be # watchlogs 4:21> # and when its a break then Break 4:21> # support reason for stopping # when no progress is shown, do a write-host to state changes. $script:DefaultLength = 25; $script:DefaultBreak = 5; $script:timer = $null $script:showprogress = $true function Stop-Pomodoro { [CmdletBinding()] param( [parameter()] $reason ) Unregister-Event "Pomodoro" -ErrorAction silentlycontinue $script:timer = $null } function Set-PomodoroPrompt { [CmdletBinding()] param () $script:promptbackup = $function:prompt $function:prompt = { Get-PomodoroStatus -ForPrompt} } function Restore-PomodoroPrompt { [CmdletBinding()] param () $function:prompt = $script:promptbackup } function Show-PomodoroProgress { [cmdletbinding()]param() $script:showprogress = $true } function Hide-PomodoroProgress { [cmdletbinding()]param() $script:showprogress = $false } function Get-PomodoroStatus { [CmdletBinding(DefaultParameterSetName="summary")] param( [Parameter(ParameterSetName="remaining",Position=0)] [switch]$remaining , [Parameter(ParameterSetName="From",Position=0)] [switch]$From , [Parameter(ParameterSetName="Until",Position=0)] [switch]$Until , [Parameter(ParameterSetName="Length",Position=0)] [switch]$Length , [Parameter(ParameterSetName="forPrompt",Position=0)] [switch]$ForPrompt ) if($script:timer) { if($script:pomoorbreak) { $prefix = "Pomodoro - $script:currentwork" $pomotime = new-object system.TimeSpan 0,0,$script:currentlength,0 } else { $prefix = "Having a Break from work - $script:currentwork" $pomotime = new-object system.TimeSpan 0,0,$script:currentbreak,0 } $diff = (get-Date) - $script:starttime $timeleft = $pomotime - $diff $endtime = $starttime + $pomotime } switch ($PsCmdlet.ParameterSetName) { "summary" { "{5} for {4} minutes from {0:hh:mm} to {1:hh:mm} - {2}:{3:00} minutes left." -f $starttime,$endtime ,$timeleft.minutes, $timeleft.seconds ,$pomotime.minutes,$prefix} "remaining" { $timeleft} "From" {$script:starttime} "Until" { $endtime } "Length" {$pomotime} "ForPrompt" { if($script:timer) { if ($script:pomoorbreak) { if($script:currentwork -and ($script:currentwork.trim() -ne [string]::Empty)) { "{0} {1}:{2:00}>" -f $(if($script:currentwork.length -gt 8) { $script:currentwork.substring(0,8)} else {$script:currentwork} ), $timeleft.minutes, $timeleft.seconds } else { "{0} {1}:{2:00}>" -f "Pomo",$timeleft.minutes, $timeleft.seconds } } else { "{0} {1}:{2:00}>" -f "Break",$timeleft.minutes, $timeleft.seconds } } else { "No Pomo>" } } } } function Start-Pomodoro { [CmdletBinding()] param ( [Parameter()] [int]$Length = $script:DefaultLength , [Parameter()] [int]$Break = $script:DefaultBreak , [Parameter()] [string]$Work , [Parameter()] [switch]$ShowPercent , [Parameter()] [switch]$HideProgress , [Parameter()] [switch]$UsePowerShellPrompt ) $script:currentlength = $length $script:currentbreak = $break; $script:currentshowpercent = [bool]$showpercent; $script:currentwork = $work if($HideProgress) { $script:showprogress = $false } else { $script:showprogress = $true } #if pomoDoro Already running then stop it Unregister-Event "Pomodoro" -ErrorAction silentlycontinue $script:timer = $null $script:pomoorbreak = $true $script:starttime = get-Date $script:timer = New-Object System.Timers.Timer $script:timer.Interval = 1000 $script:timer.Enabled = $true $null = Register-ObjectEvent $timer "Elapsed" -SourceIdentifier "Pomodoro" -Action { $breakmode = & (get-Module Pomodoro) { $script:PomoOrBreak } $starttime = & (get-Module Pomodoro) { $script:starttime } $break = & (get-Module Pomodoro) {$script:currentbreak} $length = & (get-Module Pomodoro) { $script:currentlength } $work= & (get-Module Pomodoro) { $script:currentwork } if($breakmode) { $prefix = "Pomodoro - $work " $pomotime = new-object system.TimeSpan 0,0,$length,0 } else { $prefix = "Having a Break from work - $work" $pomotime = new-object system.TimeSpan 0,0,$break,0 } $diff = (get-Date) - $starttime $timeleft = $pomotime - $diff $endtime = $starttime + $pomotime $timeleftdisplay = "for {4} minutes from {0:hh:mm} to {1:hh:mm} - {2}:{3:00} minutes left." -f $starttime,$endtime ,$timeleft.minutes, $timeleft.seconds ,$pomotime.minutes if (($pomotime - $diff) -le 0) { write-Progress -Activity " " -Status "done"; $sound = new-Object System.Media.SoundPlayer; if ($breakmode) { $sound.SoundLocation="$env:systemroot\\Media\\tada.wav"; } else { $sound.SoundLocation="$env:systemroot\\Media\\notify.wav"; } $sound.Play(); sleep 1 $sound.Play(); sleep 1 $sound.Play(); iex "& (get-module pomodoro) {`$script:starttime = get-Date; `$script:pomoorbreak = ! `$$breakmode } " } else { if ( & (get-Module Pomodoro) { $script:showprogress } ) { if (& (get-Module Pomodoro) { $script:currentshowpercent} ) { $perc =100 - ( [int] ([double]$timeleft.totalseconds * 100 / [double]$pomotime.totalseconds)) write-Progress -Activity $prefix -Status "$timeleftdisplay" -PercentComplete $perc } else { write-Progress -Activity $prefix -Status "$timeleftdisplay" } } } } if($UsePowerShellPrompt) { Set-PomodoroPrompt } } export-ModuleMember -Function "*" $myInvocation.MyCommand.ScriptBlock.Module.OnRemove = { if ($script:promptbackup) { $function:prompt = $script:promptbackup } }
combined_dataset/train/non-malicious/1704.ps1
1704.ps1
[cmdletbinding()] param ( $Task = 'Default', [ValidateSet('Build','Minor','Major')] $StepVersionBy = 'Build' ) Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null $Modules = @("Psake", "PSDeploy","BuildHelpers","PSScriptAnalyzer", "Pester") ForEach ($Module in $Modules) { If (-not (Get-Module -Name $Module -ListAvailable)) { Switch ($Module) { Pester {Install-Module $Module -Force -SkipPublisherCheck} Default {Install-Module $Module -Force} } } Import-Module $Module } $Path = (Resolve-Path $PSScriptRoot\..).Path Set-BuildEnvironment -Path $Path -Force $invokepsakeSplat = @{ buildFile = "$PSScriptRoot\psake.ps1" taskList = $Task properties = @{'StepVersionBy' = $StepVersionBy} nologo = $true } Invoke-psake @invokepsakeSplat exit ([int](-not $psake.build_success))
combined_dataset/train/non-malicious/DekiWiki Module 1.5.ps1
DekiWiki Module 1.5.ps1
## DekiWiki Module 1.5 #require -version 2.0 ## Depends on the HttpRest script-module: ## http :// huddledmasses.org/using-rest-apis-from-powershell-with-the-dream-sdk/ #################################################################################################### ## The first of many script cmdlets for working with DekiWiki, based on the HttpREST module ## ## For documentation of the DekiWiki REST API: ## http :// wiki.developer.mindtouch.com/MindTouch_Deki/API_Reference #################################################################################################### ## USAGE: ## Add-Module DekiWiki ## Set-DekiUrl http`://powershell.wik.is ## ... ## ## For usage of each cmdlet, see the comments above each individual function ## ## ## ## ## ## ## #################################################################################################### ## History: ## v 1.5 Rewrite with the "Dream" specific code extracted to the HttpRest module ## v 1.2 Remove-DekiFile ## v 1.0 Set-DekiCredential, Get-DekiContent, Set-DekiContent, New-DekiContent, Set-DekiFile ## $hr = Add-Module HttpRest -Passthru Add-Module "$PSScriptRoot\\Utilities.ps1" $url = "http://powershell.wik.is" $api = "$url/@api/deki" #New-Alias Set-DekiCredential Set-HttpCredential -EA "SilentlyContinue" #New-Alias Set-DekiUrl Set-HttpDefaultUrl -EA "SilentlyContinue" FUNCTION Set-DekiUrl { PARAM ([uri]$baseUri=$(Read-Host "Please enter the base Uri for your RESTful web-service")) Set-HttpDefaultUrl $baseUri } FUNCTION Set-DekiCredential { PARAM($Credential=$(Get-Credential -Title "Http Authentication Request - $($global:url.Host)" ` -Message "Your login for $($global:url.Host)" ` -Domain $global:url.Host )) Set-HttpCredential $Credential } New-Alias e2 Encode-Twice -EA "SilentlyContinue" Add-Type ' public class ModuleInfo { public string Name; public string[] Author; public string CompanyName; public string[] Copyright; public string[] Description; public System.Version ModuleVersion; public string[] RequiredAssemblies; public string[] Dependencies; public System.Guid GUID = System.Guid.NewGuid(); public string[] PowerShellVersion; public string[] ModulesToProcess; public System.Version CLRVersion; public string[] FormatsToProcess; public string[] TypesToProcess; public string[] OtherItems; public string ModuleFile; } ' -EA "SilentlyContinue" # Retrieve a sitemap of all the pages in a wiki, # OR Retrieve all the subpages of a page as a sitemap # Added by Mark E. Schill CMDLET Get-DekiSiteMap { PARAM( [Parameter(Position=0, Mandatory=$false)] [string] $StartPage , [Parameter(Position=1, Mandatory=$false)] [ValidateSet("xml","html","google")] [string] $Format = "xml" ) if($StartPage) { Invoke-Http GET "pages/=$(e2 $StartPage)/tree" @{"format"=$format} | Receive-Http -Out Xml } else { Invoke-Http GET "pages" @{"format"=$format} | Receive-Http -Out Xml } } # Get the contents of a page from a DekiWiki # Note that by default you retrieve the "view" (rendered) markup # If you want to see it before the extensions run, you should specify at least -mode viewnoexecute # If you want to see the source so you can make changes, be sure to specify -mode edit CMDLET Get-DekiContent { PARAM( [Parameter(Position=0, Mandatory=$true)] [string] $pageName , [Parameter(Position=1, Mandatory=$false)] [int] $section , [Parameter(Position=5, Mandatory=$false)] [ValidateSet("edit", "raw", "view", "viewnoexecute")] [string] $mode="view" ) Invoke-Http "GET" "pages/=$(e2 $pageName)/contents" @{mode=$mode;section=$section} | Receive-Http -Out Xml } # Get-DekiFile will LIST all files if called with just a PageName # Otherwise, fileName can be a single fileName, or wildcards # To download all the attachments on a page, try: # Get-DekiFile PageName | Get-DekiFile CMDLET Get-DekiFile { PARAM( [Parameter(Position=0, Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [string] $pageName , [Parameter(Position=1, Mandatory=$false, ValueFromPipelineByPropertyName=$true)] [string] $fileName , [Parameter(Position=2, Mandatory=$false)] [string] $destination ) PROCESS { ## Remember, we can get both on the pipeline, so ... $files = Invoke-Http "GET" "pages/=$(e2 $pageName)/files" | Receive-Http Xml //file Write-Verbose "Fetching $($fileName) from the $($files.Count) in $pageName" if(!$fileName) { ## Add a PageName property, because then you can pipe the output back to Get-DekiFile after filtering... write-output $files | Add-Member NoteProperty PageName $pageName -passthru } else { ## Using -like means $fileName allows globbing foreach($file in $($files | where { $_.filename -like $fileName } )) { Invoke-Http "GET" "pages/=$(e2 $pageName)/files/=$(e2 $file.filename)" | Receive-Http File $(Get-FileName $file.filename $destination) } } } } # Set the contents of a DekiWiki page # Note that you can pass the content as an XML document, plain text, or a filename... CMDLET Set-DekiContent { PARAM( [Parameter(Position=0, Mandatory=$true)] [string] $pageName , [Parameter(Position=1, Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [Alias("FullName")] [string] $content , [Parameter(Position=2, Mandatory=$false)] $section , [switch]$new , [switch]$append ) $with = @{"edittime"=$(Get-UtcTime "yyyyMMddhhmmss")} if($new) { $with.abort = "exists" } if($append) { $with.section = "0" } elseif($section) { $with.section = $section } $result = Invoke-Http POST "pages/=$(e2 $pageName)/contents" -With $with -Content $content -Auth $true -Wait if($result.IsSuccessful) { return "$url/$($result | Receive-Http Text //edit/page/path)" } else { return $result } } # Same as Set-DekiContent, except this one crashes if the page already exists. # This is technically the only safe way to create new pages without fear of conflicts... CMDLET New-DekiContent { PARAM( [Parameter(Position=0, Mandatory=$true)] [string]$pageName , [Parameter(Position=1, Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [Alias("FullName")] [string] $content ) PROCESS { Set-DekiContent $pageName $content -new } } # Add a new attachment (or a new version of an existing attachment) # You can use wildcards, and specify arrays. But you could also include descriptions # USAGE: ## Set-DekiFile Path/PageName *.ps1,*.psm1 ## Set-DekiFile Path/PageName @{"Neat.jpg"="A really cool screenshot";"Source.zip"="The source code"} ## Set-DekiFile Path/PageName Something.png ## ls *.png | Set-DekiFile Path/PageName CMDLET Set-DekiFile { param( [Parameter(Position=0, Mandatory=$true)] [string]$pageName , [Parameter(Position=1, Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [Alias("FullName")] $Files ) # Two ways to specify files: 1) hashtable: file = "description" 1) array: file, file, file $hasDescriptions = $false; if($files -is [Hashtable]) { $hasDescriptions = $true; $fileNames = $files.Keys } else { $fileNames = $files } foreach($fileName in $fileNames) { foreach($file in (gci $fileName)) { $with = @{} if($hasDescriptions) { $With.description = $files[$fileName] } $result = Http-Invoke PUT "pages/=$(e2 $pageName)/files/=$($file.Name)" $With $file.FullName -Wait if($result.IsSuccessful) { return ($result | Receive-Http Text //file/href) } else { return $result.Response } } } } ## Move a page from one place to another (leaving an "alias" placeholder) CMDLET Move-DekiContent { PARAM( [Parameter(Position=0, Mandatory=$true)] [string] $pageName , [Parameter(Position=1, Mandatory=$true)] [string] $newPageName ) $with = @{"to"="$newPageName"} $result = Invoke-Http POST "pages/=$(e2 $pageName)/move" -With $with -Auth $true -Wait if($result.IsSuccessful) { return "$url/$($result | Receive-Http Text '//page[1]/path' )" } else { return $result } } CMDLET New-DekiAlias { PARAM( [Parameter(Position=0, Mandatory=$true)] [string] $pageName , [Parameter(Position=1, Mandatory=$true)] [string] $Alias ) $result = Invoke-Http POST "pages/=$(e2 $pageName)/move" @{"to"="$Alias"} -Auth $true -Wait if($result.IsSuccessful) { $aliasPage = "$url/$($result | Receive-Http Text '//page[1]/path' )" $result = Invoke-Http POST "pages/=$(e2 $Alias)/move" @{"to"="$pageName"} -Auth $true -Wait if($result.IsSuccessful) { return $aliasPage } else { return $result } } else { return $result } } # Delete a page from a dekiwiki, with an option to RECURSIVELY delete all child pages. # NOTE: if you delete a page that has children, and don't recurse, the contents are removed # and then replaced with template text, because they can't go away completely # NOTE: if you delete a page, it is actually put in the archive # TODO: add a -Force parameter to allow them to be permanently deleted from the archive CMDLET Remove-DekiContent { PARAM( [Parameter(Position=0, Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$pageName , [Parameter(Position=2, Mandatory=$false)][switch]$recurse ) Http-Invoke DELETE "pages/=$(e2 $pageName)" @{recursive=$($recurse.ToBool())} if($result.IsSuccessful) { return "DELETED $url/$PageName" } else { return $result.Response } } # Delete a file attachment from a dekiwiki page # You can use wildcards, and specify arrays: ## USAGE: ## Remove-DekiFile Path/PageName *.ps1,*.psm1 ## Remove-DekiFile Path/PageName Something.png ## ls *.png | Remove-DekiFile Path/PageName CMDLET Remove-DekiFile { PARAM( [Parameter(Position=0, Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$pageName , [Parameter(Position=1, Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [Alias("Name")] $fileNames ) $files = Invoke-Http GET "pages/=$(e2 $pageName)/files" | Receive-Http Text //file/filename foreach($fileName in $fileNames) { foreach($file in $($files -like $fileName)) { $path = "pages/=$(e2 $pageName)/files/=$(e2 $file)" Write-Host $path -fore cyan $result = Invoke-Http DELETE $path -Auth $true -Wait if($result.IsSuccessful) { "DELETED: $api/$path" } else { $result.Response } } } } Export-ModuleMember Set-DekiCredential, Set-DekiUrl, Get-HtmlHelp, Get-DekiFile, Get-DekiSiteMap, Get-DekiContent, Set-DekiContent, New-DekiContent, Move-DekiContent, New-DekiAlias, Remove-DekiContent, Remove-DekiFile, Set-DekiFile
combined_dataset/train/non-malicious/sample_55_65.ps1
sample_55_65.ps1
# # Module manifest for module 'OCI.PSModules.Dataflow' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dataflow.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '60441277-1663-4d77-af11-39ab99c7ac41' # 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 Dataflow 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.Dataflow.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-OCIDataflowApplication', 'Get-OCIDataflowApplicationsList', 'Get-OCIDataflowPool', 'Get-OCIDataflowPoolsList', 'Get-OCIDataflowPrivateEndpoint', 'Get-OCIDataflowPrivateEndpointsList', 'Get-OCIDataflowRun', 'Get-OCIDataflowRunLog', 'Get-OCIDataflowRunLogsList', 'Get-OCIDataflowRunsList', 'Get-OCIDataflowSqlEndpoint', 'Get-OCIDataflowSqlEndpointsList', 'Get-OCIDataflowStatement', 'Get-OCIDataflowStatementsList', 'Get-OCIDataflowWorkRequest', 'Get-OCIDataflowWorkRequestErrorsList', 'Get-OCIDataflowWorkRequestLogsList', 'Get-OCIDataflowWorkRequestsList', 'Move-OCIDataflowApplicationCompartment', 'Move-OCIDataflowPoolCompartment', 'Move-OCIDataflowPrivateEndpointCompartment', 'Move-OCIDataflowRunCompartment', 'Move-OCIDataflowSqlEndpointCompartment', 'New-OCIDataflowApplication', 'New-OCIDataflowPool', 'New-OCIDataflowPrivateEndpoint', 'New-OCIDataflowRun', 'New-OCIDataflowSqlEndpoint', 'New-OCIDataflowStatement', 'Remove-OCIDataflowApplication', 'Remove-OCIDataflowPool', 'Remove-OCIDataflowPrivateEndpoint', 'Remove-OCIDataflowRun', 'Remove-OCIDataflowSqlEndpoint', 'Remove-OCIDataflowStatement', 'Start-OCIDataflowPool', 'Stop-OCIDataflowPool', 'Update-OCIDataflowApplication', 'Update-OCIDataflowPool', 'Update-OCIDataflowPrivateEndpoint', 'Update-OCIDataflowRun', 'Update-OCIDataflowSqlEndpoint' # 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','Dataflow' # A URL to the license for this module. LicenseUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/LICENSE.txt' # A URL to the main website for this project. ProjectUri = 'https://github.com/oracle/oci-powershell-modules/' # A URL to an icon representing this module. IconUri = 'https://github.com/oracle/oci-powershell-modules/blob/master/icon.png' # ReleaseNotes of this module ReleaseNotes = 'https://github.com/oracle/oci-powershell-modules/blob/master/CHANGELOG.md' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update/save # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' }
combined_dataset/train/non-malicious/sample_26_36.ps1
sample_26_36.ps1
# # Module manifest for module 'OCI.PSModules.Lockbox' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Lockbox.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = '24788d7a-8305-474c-a1c0-add3a2ca16a0' # 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 Lockbox 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.Lockbox.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 = 'Export-OCILockboxAccessRequests', 'Get-OCILockbox', 'Get-OCILockboxAccessMaterials', 'Get-OCILockboxAccessRequest', 'Get-OCILockboxAccessRequestInternal', 'Get-OCILockboxAccessRequestsList', 'Get-OCILockboxApprovalTemplate', 'Get-OCILockboxApprovalTemplatesList', 'Get-OCILockboxesList', 'Get-OCILockboxWorkRequest', 'Get-OCILockboxWorkRequestErrorsList', 'Get-OCILockboxWorkRequestLogsList', 'Get-OCILockboxWorkRequestsList', 'Invoke-OCILockboxHandleAccessRequest', 'Move-OCILockboxApprovalTemplateCompartment', 'Move-OCILockboxCompartment', 'New-OCILockbox', 'New-OCILockboxAccessRequest', 'New-OCILockboxApprovalTemplate', 'Remove-OCILockbox', 'Remove-OCILockboxApprovalTemplate', 'Stop-OCILockboxWorkRequest', 'Update-OCILockbox', 'Update-OCILockboxApprovalTemplate' # 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','Lockbox' # 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_57_83.ps1
sample_57_83.ps1
# # Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker' # # Generated by: Microsoft Corporation # # Generated on: 19/01/2022 # @{ # Script module or binary module file associated with this manifest. RootModule = '' # Version number of this module. ModuleVersion = '1.2100.2671.410' # Supported PSEditions # CompatiblePSEditions = '' # ID used to uniquely identify this module GUID = '0a20dacd-fb41-47d9-a934-0f5457d793ec' # Author of this module Author = 'Microsoft Corporation' # Company or vendor of this module CompanyName = 'Microsoft Corporation' # Copyright statement for this module Copyright = '(c) 2022 Microsoft Corporation. All rights reserved.' # Description of the functionality provided by this module Description = 'Microsoft AzStackHci Readiness Checker' # Minimum version of the Windows PowerShell engine required by this module PowerShellVersion = '5.1' # 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 = @( 'AzStackHci.StandaloneObservability.psm1' 'AzStackHci.StandaloneObservability.Helpers.psm1' ) # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = @('Send-AzStackHciDiagnosticData') # 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 = 'Microsoft','AzStackHci' # 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 = '' # Prerelease string of this module # Prerelease = '' # Flag to indicate whether the module requires explicit user acceptance for install/update # RequireLicenseAcceptance = $false # External dependent modules of this module # ExternalModuleDependencies = @() } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' } # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCACa0/vqAEx0jV/ # Fww/6DYfH4A4bWYdPf2D/1Y3mcHuFaCCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE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Q8G5j63VQw # BMBaF6toKtS56cNPjyUgpRrJrsBhX6/uiv9Pdr1sUwh0SIIvpUN/+f2KQUJDnAxH # uQx2ExlTC+9g6a0U9XCHUDUBALokcNbySianrQmv6jaEvH3JZtn8Qr3klvvZiLO0 # TKOAQMBPm8hIwtYMpy7j43ZtsVAs8T9JKBB737gWNlxCoBq/6UKJgUrBIoS4jyuw # yO+s7h+8obJdZoHGLt5CCwjgc48WCxOxbPj0MGDGDUgLUL6GAOx68lwZd7iPIYqV # CNVWGNSlK3ffWayk/PQQcauv3nil+M2DyQ6EdPBni5lShmXJY3NE0pQrDKpnGObJ # cjGHsw2iLUkXoN/H4FLZLsqyH+DpSCHqAR1kHS0Rlk6PyB/PQ+po5YVmwgEq1WCp # Uxs6gUWxOH0GAxfM31dAIjPS58hZWwOBsXsdQRGHiLQ2vmOUOpeVgEJabciU4E/p # vVxEWnskGfysAE7h3CAm6zfOXnVtuK++LmJGtalW6JD4mHautihGwwF9D1Mec9R0 # dQlZ # SIG # End signature block
combined_dataset/train/non-malicious/sample_27_30.ps1
sample_27_30.ps1
# # Copyright (c) Microsoft Corporation. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # # This PS DSC resource enables installing a package. The resource uses Install-Package cmdlet # to install the package from various providers/sources. Import-LocalizedData -BindingVariable LocalizedData -filename MSFT_PackageManagement.strings.psd1 Import-Module -Name "$PSScriptRoot\..\PackageManagementDscUtilities.psm1" function Get-TargetResource { <# .SYNOPSIS This DSC resource provides a mechanism to download and install packages on a computer. Get-TargetResource returns the current state of the resource. .PARAMETER Name Specifies the name of the Package to be installed or uninstalled. .PARAMETER Source Specifies the name of the package source where the package can be found. This can either be a URI or a source registered with Register-PackageSource cmdlet. The DSC resource MSFT_PackageManagementSource can also register a package source. .PARAMETER RequiredVersion Specifies the exact version of the package that you want to install. If you do not specify this parameter, this DSC resource installs the newest available version of the package that also satisfies any maximum version specified by the MaximumVersion parameter. .PARAMETER MaximumVersion Specifies the maximum allowed version of the package that you want to install. If you do not specify this parameter, this DSC resource installs the highest-numbered available version of the package. .PARAMETER MinimumVersion Specifies the minimum allowed version of the package that you want to install. If you do not add this parameter, this DSC resource intalls the highest available version of the package that also satisfies any maximum specified version specified by the MaximumVersion parameter. .PARAMETER SourceCredential Specifies a user account that has rights to install a package for a specified package provider or source. .PARAMETER ProviderName Specifies a package provider name to which to scope your package search. You can get package provider names by running the Get-PackageProvider cmdlet. .PARAMETER AdditionalParameters Provider specific parameters that are passed as an Hashtable. For example, for NuGet provider you can pass additional parameters like DestinationPath. #> [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [Parameter(Mandatory = $true)] [System.String] $Name, [Parameter()] [System.String] $RequiredVersion, [Parameter()] [System.String] $MinimumVersion, [Parameter()] [System.String] $MaximumVersion, [Parameter()] [System.String] $Source, [Parameter()] [PSCredential] $SourceCredential, [Parameter()] [System.String] $ProviderName, [Parameter()] [Microsoft.Management.Infrastructure.CimInstance[]]$AdditionalParameters ) $ensure = "Absent" $null = $PSBoundParameters.Remove("Source") $null = $PSBoundParameters.Remove("SourceCredential") if ($AdditionalParameters) { foreach($instance in $AdditionalParameters) { Write-Verbose ('AdditionalParameter: {0}, AdditionalParameterValue: {1}' -f $instance.Key, $instance.Value) $null = $PSBoundParameters.Add($instance.Key, $instance.Value) } } $null = $PSBoundParameters.Remove("AdditionalParameters") $verboseMessage =$localizedData.StartGetPackage -f (GetMessageFromParameterDictionary $PSBoundParameters),$env:PSModulePath Write-Verbose -Message $verboseMessage $result = PackageManagement\Get-Package @PSBoundParameters -ErrorAction SilentlyContinue -WarningAction SilentlyContinue if ($result.count -eq 1) { Write-Verbose -Message ($localizedData.PackageFound -f $Name) $ensure = "Present" } elseif ($result.count -gt 1) { Write-Verbose -Message ($localizedData.MultiplePackagesFound -f $Name) $ensure = "Present" } else { Write-Verbose -Message ($localizedData.PackageNotFound -f $($Name)) } Write-Debug -Message "Source $($Name) is $($ensure)" if ($ensure -eq 'Absent') { return @{ Ensure = $ensure Name = $Name ProviderName = $ProviderName RequiredVersion = $RequiredVersion MinimumVersion = $MinimumVersion MaximumVersion = $MaximumVersion } } else { if ($result.Count -gt 1) { $result = $result[0] } return @{ Ensure = $ensure Name = $result.Name ProviderName = $result.ProviderName Source = $result.source RequiredVersion = $result.Version } } } function Test-TargetResource { <# .SYNOPSIS This DSC resource provides a mechanism to download and install packages on a computer. Test-TargetResource returns a boolean which determines whether the resource is in desired state or not. .PARAMETER Name Specifies the name of the Package to be installed or uninstalled. .PARAMETER Source Specifies the name of the package source where the package can be found. This can either be a URI or a source registered with Register-PackageSource cmdlet. The DSC resource MSFT_PackageManagementSource can also register a package source. .PARAMETER RequiredVersion Specifies the exact version of the package that you want to install. If you do not specify this parameter, this DSC resource installs the newest available version of the package that also satisfies any maximum version specified by the MaximumVersion parameter. .PARAMETER MaximumVersion Specifies the maximum allowed version of the package that you want to install. If you do not specify this parameter, this DSC resource installs the highest-numbered available version of the package. .PARAMETER MinimumVersion Specifies the minimum allowed version of the package that you want to install. If you do not add this parameter, this DSC resource intalls the highest available version of the package that also satisfies any maximum specified version specified by the MaximumVersion parameter. .PARAMETER SourceCredential Specifies a user account that has rights to install a package for a specified package provider or source. .PARAMETER ProviderName Specifies a package provider name to which to scope your package search. You can get package provider names by running the Get-PackageProvider cmdlet. .PARAMETER AdditionalParameters Provider specific parameters that are passed as an Hashtable. For example, for NuGet provider you can pass additional parameters like DestinationPath. #> [CmdletBinding()] [OutputType([bool])] param ( [Parameter(Mandatory = $true)] [System.String] $Name, [Parameter()] [System.String] $RequiredVersion, [Parameter()] [System.String] $MinimumVersion, [Parameter()] [System.String] $MaximumVersion, [Parameter()] [System.String] $Source, [Parameter()] [PSCredential] $SourceCredential, [ValidateSet("Present","Absent")] [System.String] $Ensure="Present", [Parameter()] [System.String] $ProviderName, [Parameter()] [Microsoft.Management.Infrastructure.CimInstance[]]$AdditionalParameters ) Write-Verbose -Message ($localizedData.StartTestPackage -f (GetMessageFromParameterDictionary $PSBoundParameters)) $null = $PSBoundParameters.Remove("Ensure") $temp = Get-TargetResource @PSBoundParameters if ($temp.Ensure -eq $ensure) { Write-Verbose -Message ($localizedData.InDesiredState -f $Name, $Ensure, $temp.Ensure) return $True } else { Write-Verbose -Message ($localizedData.NotInDesiredState -f $Name,$ensure,$temp.ensure) return [bool] $False } } function Set-TargetResource { <# .SYNOPSIS This DSC resource provides a mechanism to download and install packages on a computer. Set-TargetResource either intalls or uninstall a package as defined by the vaule of Ensure parameter. .PARAMETER Name Specifies the name of the Package to be installed or uninstalled. .PARAMETER Source Specifies the name of the package source where the package can be found. This can either be a URI or a source registered with Register-PackageSource cmdlet. The DSC resource MSFT_PackageManagementSource can also register a package source. .PARAMETER RequiredVersion Specifies the exact version of the package that you want to install. If you do not specify this parameter, this DSC resource installs the newest available version of the package that also satisfies any maximum version specified by the MaximumVersion parameter. .PARAMETER MaximumVersion Specifies the maximum allowed version of the package that you want to install. If you do not specify this parameter, this DSC resource installs the highest-numbered available version of the package. .PARAMETER MinimumVersion Specifies the minimum allowed version of the package that you want to install. If you do not add this parameter, this DSC resource intalls the highest available version of the package that also satisfies any maximum specified version specified by the MaximumVersion parameter. .PARAMETER SourceCredential Specifies a user account that has rights to install a package for a specified package provider or source. .PARAMETER ProviderName Specifies a package provider name to which to scope your package search. You can get package provider names by running the Get-PackageProvider cmdlet. .PARAMETER AdditionalParameters Provider specific parameters that are passed as an Hashtable. For example, for NuGet provider you can pass additional parameters like DestinationPath. #> [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [System.String] $Name, [Parameter()] [System.String] $RequiredVersion, [Parameter()] [System.String] $MinimumVersion, [Parameter()] [System.String] $MaximumVersion, [Parameter()] [System.String] $Source, [Parameter()] [PSCredential] $SourceCredential, [ValidateSet("Present","Absent")] [System.String] $Ensure="Present", [Parameter()] [System.String] $ProviderName, [Parameter()] [Microsoft.Management.Infrastructure.CimInstance[]]$AdditionalParameters ) Write-Verbose -Message ($localizedData.StartSetPackage -f (GetMessageFromParameterDictionary $PSBoundParameters)) $null = $PSBoundParameters.Remove("Ensure") if ($PSBoundParameters.ContainsKey("SourceCredential")) { $PSBoundParameters.Add("Credential", $SourceCredential) $null = $PSBoundParameters.Remove("SourceCredential") } if ($AdditionalParameters) { foreach($instance in $AdditionalParameters) { Write-Verbose ('AdditionalParameter: {0}, AdditionalParameterValue: {1}' -f $instance.Key, $instance.Value) $null = $PSBoundParameters.Add($instance.Key, $instance.Value) } } $PSBoundParameters.Remove("AdditionalParameters") # We do not want others to control the behavior of ErrorAction # while calling Install-Package/Uninstall-Package. $PSBoundParameters.Remove("ErrorAction") if ($Ensure -eq "Present") { PackageManagement\Install-Package @PSBoundParameters -ErrorAction Stop } else { # we dont source location for uninstalling an already # installed package $PSBoundParameters.Remove("Source") # Ensure is Absent PackageManagement\Uninstall-Package @PSBoundParameters -ErrorAction Stop } } function GetMessageFromParameterDictionary { <# Returns a strng of form "ParameterName:ParameterValue" Used with Write-Verbose message. The input is mostly $PSBoundParameters #> param([System.Collections.IDictionary] $paramDictionary) $returnValue = "" $paramDictionary.Keys | ForEach-Object { $returnValue += "-{0} {1} " -f $_,$paramDictionary[$_] } return $returnValue } Export-ModuleMember -function Get-TargetResource, Set-TargetResource, Test-TargetResource # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3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gNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAw # DgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24x # JjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAAB4NT8 # HxMVH35dAAEAAAHgMCIEIPokA7jEYMcKLyr8MC0LdMM2hjE55wuYZR4jOpJchD/u # MA0GCSqGSIb3DQEBCwUABIICAFhMrd/tefGqi1RYvUIUCI721aAFk/OlLf7SqYBD # Slylox54alkNNfjyr8ZV9eeRd9Z/U+527fe00r1ahVcG9Wta900DF8nkldILTE2k # YgaNZRFSM4TRs71s3v0KSbjGDhapIP31n8HZVc5t4bxNit44YqUF1qW1KZ5BZWA7 # G9op/zeaqHSs3fUNBuU5GBBChZdmNzz52G+FxRHpzj2xgxmWZETjIC8U4qd+q3Vs # WOC1k/rB+49Bob86MRoSIsruUXKAn1hTeYSnGzS99A6A2kpzrVVpux1o/F7lVdvb # RpTIZ0pf+BdcSNP1DnpC0yMc4gkL6CLFo3iFlUrFhj7snOTPl8j9fQSbEGrGQ0xj # o4JGP3ZnsJVm8AycDMv4tTpDPxG/uahQ9HTGQxnmt2o3D/taA0XfXn9xaU4CdMXv # et6BPi00uQobJZ0BDZmk/Xek2Ot4RgdgB351CWTWbLgqsi9iDYQz6z/6rvpI4kfp # x/zt2316eRL1azUdwcbCWi8SDfUoJBJD3Hf6U3h6EzHXt2oerYRorDFGGuA/Hg+w # +qvB3Bw2ZZtMq7zwc+BRf9GGRt3c41MyFlNgZRJHBcPeiq/VzcSjhwI3UL+iyzxn # etldhaWKFU0h6tx5A6F5JZ5G6E/12waAkOoGOeA434uK96KODUYAfBuyedVSo0W+ # 40vB # SIG # End signature block
combined_dataset/train/non-malicious/158.ps1
158.ps1
function Get-SCSMWorkItemAffectedCI { PARAM ( [parameter()] [Alias()] $GUID ) PROCESS { $WorkItemObject = Get-SCSMObject -id $GUID Get-SCSMRelationshipObject -BySource $WorkItemObject | Where-Object { $_.relationshipid -eq 'b73a6094-c64c-b0ff-9706-1822df5c2e82' } } }
combined_dataset/train/non-malicious/sample_65_35.ps1
sample_65_35.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ param ( [Parameter(Mandatory=$true)] [ValidateSet('install','uninstall')] [string] $Operation ) function Ensure-ServiceState($targetState) { Write-Host "Waiting for the service state to become $targetState" $svc = Get-WmiObject -Class Win32_Service -Filter "Name='ServiceFabricUpdateService'" while (($svc -eq $null) -or ($svc -ne $null -and $svc.State -ne $targetState)) { Start-Sleep -Seconds 3 $svc = Get-WmiObject -Class Win32_Service -Filter "Name='ServiceFabricUpdateService'" } Write-Host "The service state is $targetState as expected" } function Remove-Data($svcDirPath) { $dataDirPath = Join-Path $svcDirPath -ChildPath "Data" if (Test-Path $dataDirPath) { Write-Host "Cleaning up service data" Remove-Item -Path $dataDirPath -Recurse -Force } } $lastExitCode = 0 $Identity = [System.Security.Principal.WindowsIdentity]::GetCurrent() $Principal = New-Object System.Security.Principal.WindowsPrincipal($Identity) $IsAdmin = $Principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator) if(!$IsAdmin) { Write-host "Please run the script with administrative privileges." -ForegroundColor "Red" exit 1 } $service = Get-WmiObject -Class Win32_Service -Filter "Name='ServiceFabricUpdateService'" if ($Operation -eq 'install' -and $service -ne $null) { Write-host "The service is already installed." -ForegroundColor "Red" exit 1 } elseif ($Operation -eq 'uninstall' -and $service -eq $null) { Write-host "The service has not been installed." -ForegroundColor "Red" exit 1 } $svcDirPath = $(Split-Path -parent $MyInvocation.MyCommand.Definition) $svcExePath = Join-Path $svcDirPath -ChildPath "ServiceFabricUpdateService.exe" if(!(Test-Path $svcExePath)) { Write-host "Please keep the script right beside ServiceFabricUpdateService.exe." -ForegroundColor "Red" exit 1 } Write-host "Operation starts: $Operation" if ($Operation -eq 'install') { Remove-Data($svcDirPath) Start-Process -FilePath $svcExePath -ArgumentList "-install" -Wait Ensure-ServiceState('Stopped') Start-Service -Name "ServiceFabricUpdateService" Ensure-ServiceState('Running') } else { if ($service.State -ne 'Stopped') { $service.StopService() > $null Ensure-ServiceState('Stopped') } $service.Delete() > $null Remove-Data($svcDirPath) } if($lastExitCode -ne 0) { Write-host "The operation fails. Error code: $lastExitCode." -ForegroundColor "Red" exit 1 } else { Write-host "The operation succeeds." exit 0 } # SIG # Begin signature block # MIIn0QYJKoZIhvcNAQcCoIInwjCCJ74CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBFkMpvnyMXs0A0 # dvTm02jkBo6GMKArX/RU4krX8iGqGKCCDYUwggYDMIID66ADAgECAhMzAAADri01 # UchTj1UdAAAAAAOuMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwODU5WhcNMjQxMTE0MTkwODU5WjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQD0IPymNjfDEKg+YyE6SjDvJwKW1+pieqTjAY0CnOHZ1Nj5irGjNZPMlQ4HfxXG # yAV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C+sBfFKNb2D5ToUuOiCue40rv2iUWc7MLgC/ # YcAihcMO9fz3gc8EQ3SAc7YtVKQxRnjMVaBYmzBVTPghlZhZ3crlO86j6Uig/BwX # 4VbnLCsvPdrI+M/Doyot7zfFGRf9OI+RyCx52yj7aRiVs6blmD7z8dFacT7tiWwi # aSDSFKryMd/Pi5P8mdBR5h/cyaE5A+yQQOzVCYYwEyEgG5JfL4FBzIGzAgcsi1dk # adclKLI8o+l9kokeghMsYSCjY6za # SIG # End signature block
combined_dataset/train/non-malicious/sample_36_44.ps1
sample_36_44.ps1
# # Module manifest for module 'OCI.PSModules.Datalabelingservicedataplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datalabelingservicedataplane.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = 'c7f9095b-be8f-42bb-88ca-422eca4176a1' # 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 Datalabelingservicedataplane 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.Datalabelingservicedataplane.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-OCIDatalabelingservicedataplaneAnnotation', 'Get-OCIDatalabelingservicedataplaneAnnotationsList', 'Get-OCIDatalabelingservicedataplaneDataset', 'Get-OCIDatalabelingservicedataplaneRecord', 'Get-OCIDatalabelingservicedataplaneRecordContent', 'Get-OCIDatalabelingservicedataplaneRecordPreviewContent', 'Get-OCIDatalabelingservicedataplaneRecordsList', 'Invoke-OCIDatalabelingservicedataplaneSummarizeAnnotationAnalytics', 'Invoke-OCIDatalabelingservicedataplaneSummarizeRecordAnalytics', 'New-OCIDatalabelingservicedataplaneAnnotation', 'New-OCIDatalabelingservicedataplaneRecord', 'Remove-OCIDatalabelingservicedataplaneAnnotation', 'Remove-OCIDatalabelingservicedataplaneRecord', 'Update-OCIDatalabelingservicedataplaneAnnotation', 'Update-OCIDatalabelingservicedataplaneRecord' # 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','Datalabelingservicedataplane' # 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_63_2.ps1
sample_63_2.ps1
ConvertFrom-StringData @' ###PSLOC DeployRole = Deploy '{0:RoleName}' role on '{1:MachineName}' machine. DeployRoleFailed = Deployment of '{0:RoleName}' role failed on '{1:MachineName}' machine with Error: {2:ErrorMessage}. CheckLogs = Check logs at '{0:FilePath}' on '{1:MachineName}' machine. ConfigureRole = Configure '{0:RoleName}' role on '{1:MachineName}' machine. ConfigureRoleFailed = Configuration of '{0:RoleName}' role failed on '{1:MachineName}' machine with Error: {2:ErrorMessage}. WaitingForScheduleTask = Waiting for the scheduled tasks to finish. ServiceDidNotStartup = Service {0:ServiceName} did not start on {1:ComputerName} computer after {2:ValueInSeconds} seconds. ValidationTestStarting = Starting validation test for Role '{0:ServerRoleName}' on machine '{1:ComputerName}' ValidationTestFailed = One or more validation test failed for Role '{0:ServerRoleName}' on machine '{1:ComputerName}' ValidationTestNotAvailable = Validation test result is empty for Role '{0:ServerRoleName}' on machine '{1:ComputerName}'. Investigate whether test cases were not run. ValidationTestFinished = Validation test for Role '{0:ServerRoleName}' finished on machine '{1:ComputerName}' TestConnection = Test Connection on machine '{0:ComputerName}' KeyValueNotProvided = The parameter '{0:ParameterName}' does not contain a value for the key '{1:KeyName}' TestResultsLocation = For detailed test results look at file '{0:FullFilePath}' TestParameterShouldBeProvided = Test parameter '{0:TestParameterName}' should not be null or empty. CouldNotConnectToServerWarning = Could not connect to server '{0:ServerName}' using Test-WSMAN. Server may already be shutdown. GettingCluster = Getting cluster '{0:ClusterName}'. StoppingCluster = Stopping the cluster '{0:ClusterName}'. CheckingClusterResources = Checking cluster: '{0:ClusterName}' resources: '{1:ResourceNames}' for online state. ClusterStartedSuccessfully = Successfully started cluster: '{0:ClusterName}'. ClusterNotReadyRestartingService = Cluster: '{0:ClusterName}' is not yet ready. Restarting the service on servers: '{1:ServerNames}'. VerifyingCluster = Verifying cluster: '{0:ClusterName}' and its resources: '{1:ResourceNames}' are online. ClusterAlreadyStarted = Cluster: '{0:ClusterName}' is already started and ready to receive requests. SetClusterServiceToAutomatic = Setting Cluster: '{0:ClusterName}' service to automatic on servers: '{1:ServerNames}'. UnableToGetCluster = Unable to get the sql cluster: '{0:ClusterName}'. Cluster may already be shutdown. ClusterResourcesTimeout = The following cluster resources: '{0:ClusterResourceNames}' did not come online before timeout of '{1:ClusterTimeoutTime}' seconds. UnableToGetClusterTimeout = Unable to get cluster: '{0:ClusterName}' before timeout of '{1:ClusterTimeoutTime}' seconds. ParameterCannotBeEmptyOrNull = Parameter '{0:ParameterName}' cannot be empty or null. TimeoutOccurred = A timeout has occurred after {0:NumberOfMinutes} minutes. NodeToUpdateNotProvided = A machine name has not been provided to run update. Verify that the running action plan has a RoleName defined in the ExecutionContext node in the CustomerConfig.xml file. ServiceShouldBeRunningOnMachine = Service '{0:ServiceName}' should be running on machine '{1:MachineName}'. QueryingScalableNode = Querying Nodelist in '{0:machineRole}' for any node in '{1:ProvisioningStatus}' state and from '{2:Role}' role. FoundNoScalableNode = No nodes in '{0:ProvisioningStatus}' state from '{1:Role}' role found in {2:machineRole} Nodelist." FoundSomeScalableNodes = Found {0} Nodes in '{1:ProvisioningStatus}' state from '{2:Role}' role found in {3:machineRole} Nodelist." '@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TNP2n4F0z3bc # cNirC1i41CWcPOH2OuntGL3C2Xcrnsl6WwoJTpPlTges+glk4hKsw4oMt3zjRse5 # YCFcf62SKhAaul/Vo3Jh9eCzL/kalqGdDDWvj4Ts6YxuxQcLGc7TWxW+CFM150bb # NuotedDa7TBCdPrNdw== # SIG # End signature block
combined_dataset/train/non-malicious/Audit File Share Perms.ps1
Audit File Share Perms.ps1
Function Get-SharePermissions($ShareName){ $Share = Get-WmiObject win32_LogicalShareSecuritySetting -Filter "name='$ShareName'" if($Share){ $obj = @() $ACLS = $Share.GetSecurityDescriptor().Descriptor.DACL foreach($ACL in $ACLS){ $User = $ACL.Trustee.Name if(!($user)){$user = $ACL.Trustee.SID} $Domain = $ACL.Trustee.Domain switch($ACL.AccessMask) { 2032127 {$Perm = "Full Control"} 1245631 {$Perm = "Change"} 1179817 {$Perm = "Read"} } $obj = $obj + "$Domain\\$user $Perm<br>" } } if(!($Share)){$obj = " ERROR: cannot enumerate share permissions. "} Return $obj } # End Get-SharePermissions Function Function Get-NTFSOwner($Path){ $ACL = Get-Acl -Path $Path $a = $ACL.Owner.ToString() Return $a } # End Get-NTFSOwner Function Function Get-NTFSPerms($Path){ $ACL = Get-Acl -Path $Path $obj = @() foreach($a in $ACL.Access){ $aA = $a.FileSystemRights $aB = $a.AccessControlType $aC = $a.IdentityReference $aD = $a.IsInherited $aE = $a.InheritanceFlags $aF = $a.PropagationFlags $obj = $obj + "$aC | $aB | $aA | $aD | $aE | $aF <br>" } Return $obj } # End Get-NTFSPerms Function Function Get-AllShares{ $a = Get-WmiObject win32_share -Filter "type=0" Return $a } # End Get-AllShares Function # Create Webpage Header $z = "<!DOCTYPE html PUBLIC `"-//W3C//DTD XHTML 1.0 Strict//EN`" `"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd`">" $z = $z + "<html xmlns=`"http://www.w3.org/1999/xhtml`">" $z = "<head><style>" $z = $z + "TABLE{border-width: 2px;border-style: solid;border-color: black;border-collapse: collapse;}" $z = $z + "TH{border-width: 2px;padding: 4px;border-style: solid;border-color: black;background-color:lightblue;text-align:left;font-size:14px}" $z = $z + "TD{border-width: 1px;padding: 4px;border-style: solid;border-color: black;font-size:12px}" $z = $z + "</style></head><body>" $z = $z + "<H4>File Share Report for $env:COMPUTERNAME</H4>" $z = $z + "<table><colgroup><col/><col/><col/><col/><col/><col/></colgroup>" $z = $z + "<tr><th>ShareName</th><th>Location</th><th>NTFSPermissions<br>IdentityReference|AccessControlType|FileSystemRights|IsInherited|InheritanceFlags|PropagationFlags</th><th>NTFSOwner</th><th>SharePermissions</th><th>ShareDescription</th></tr>" $MainShares = Get-AllShares Foreach($MainShare in $MainShares){ $MainShareName = $MainShare.Name $MainLocation = $MainShare.Path $MainNTFSPermissions = Get-NTFSPerms -Path $MainLocation $MainNTFSOwner = Get-NTFSOwner -Path $MainLocation $MainSharePermissions = Get-SharePermissions -ShareName $MainShareName $MainShareDescription = $MainShare.Description $z = $z + "<tr><td>$MainShareName</td><td>$MainLocation</td><td>$MainNTFSPermissions</td><td>$MainNTFSOwner</td><td>$MainSharePermissions</td><td>$MainShareDescription</td></tr>" } $z = $z + "</table></body></html>" $OutFileName = $env:COMPUTERNAME + "ShareReport.html" Out-File -FilePath .\\$OutFileName -InputObject $z -Encoding ASCII $OutFileItem = Get-Item -Path .\\$OutFileName Write-Host " Report available here: $OutFileItem" -Foregroundcolor Yellow Exit
combined_dataset/train/non-malicious/692.ps1
692.ps1
function Get-ItemType { param ( [string]$FileExtension ) switch ($FileExtension) { '.rdl' { return 'Report' } '.rsds' { return 'DataSource' } '.rds' { return 'DataSource' } '.rsd' { return 'DataSet' } '.rsmobile' { return 'MobileReport' } '.pbix' { return 'PowerBIReport' } '.xls' { return 'ExcelWorkbook' } '.xlsx' { return 'ExcelWorkbook' } '.kpi' { return 'Kpi' } default { return 'Resource' } } }
combined_dataset/train/non-malicious/1556.ps1
1556.ps1
function Get-MrLeapYear2 { [CmdletBinding()] param ( [Parameter(ValueFromPipeline)] [ValidateRange(1582,9999)] [int[]]$Year = (Get-Date).Year ) PROCESS { foreach ($y in $Year) { try { if (Get-Date -Date 2/29/$y) { Write-Output "$y is a leap year" } } catch { Write-Output "$y is not a leap year" } } } }
combined_dataset/train/non-malicious/3437.ps1
3437.ps1
. "$PSScriptRoot\TestExplorer.ps1" function Create-TestContent([string] $path, [string] $tag = 'SmokeTest') { $testFiles = Filter-TestFiles $path if ($testFiles.Count -eq 0) { ' '$testFile = @()' return } $variableList = New-Object System.Collections.ArrayList $sessionFunctions = Get-ChildItem function: foreach ($testFile in $testFiles) { . "$testFile" $scriptFunctions = Get-ChildItem function: | Where-Object { $sessionFunctions -inotcontains $_ } $testFunctions = $scriptFunctions | Where-Object { $desc = (Get-Help $_).Description $_.Name -ilike 'Test*' -and $desc -ne $null -and $desc[0].Text -contains $tag } $scriptFunctions | ForEach-Object { Remove-Item function:\$_ } if ($testFunctions.Count -eq 0) { " continue } $null = $variableList.Add($testFile.BaseName) " "`$$($testFile.BaseName) = @(" for ($i = 0; $i -lt $testFunctions.Count; $i++) { $testSuffix = if($i -eq $testFunctions.Count - 1) { ' )' } else { ',' } "`t'$($testFunctions[$i])'$testSuffix" } } $testListSuffix = if($variableList.Count -eq 0) { ' @()' } else { '' } "`$testList =$testListSuffix" for ($i = 0; $i -lt $variableList.Count; $i++) { $varSuffix = if($i -eq $variableList.Count - 1) { '' } else { ' +' } "`t`$$($variableList[$i])$varSuffix" } } function Create-Runbooks ( [hashtable] $template, [string] $srcPath, [string[]] $projectList, [string] $outputPath) { if (-not (Test-Path $outputPath)) { $null = New-Item -ItemType directory -Path $outputPath -ErrorAction Stop } else { Write-Verbose "Cleaning up the $outputPath folder..." Remove-Item "$outputPath\*" -ErrorAction Stop } Write-Verbose "Collecting .ps1 test files..." foreach($folder in Get-TestFolders $srcPath $projectList) { $bookName = "Live$($folder.Name)Tests" $bookPath = "$outputPath\$bookName.ps1" $null = New-Item $bookPath -type file -Force $loginParamsTemplate = '%LOGIN-PARAMS%' $testListTemplate = '%TEST-LIST%' Get-Content $template.Path | ForEach-Object { $content = switch -wildcard ($_) { "*$loginParamsTemplate" { $_ -replace $loginParamsTemplate, "'$($template.AutomationConnectionName)' '$($template.SubscriptionName)'" } $testListTemplate { Create-TestContent $folder.Path | Out-String } default { $_ } } $content | Add-Content $bookPath } Write-Verbose "$bookPath generated." } } function Start-Runbooks ([hashtable] $automation, [string] $runbooksPath) { foreach ($runbook in Get-ChildItem $runbooksPath) { $bookName = $runbook.BaseName Write-Verbose "Uploading '$bookName' runbook..." $null = Import-AzAutomationRunbook -Path $runbook.FullName -Name $bookName -type PowerShell -AutomationAccountName $automation.AccountName -ResourceGroupName $automation.ResourceGroupName -LogVerbose $true -Force -ErrorAction Stop Write-Verbose "Publishing '$bookName' runbook..." $null = Publish-AzAutomationRunbook -Name $bookName -AutomationAccountName $automation.AccountName -ResourceGroupName $automation.ResourceGroupName -ErrorAction Stop Start-Job -Name $bookName -ArgumentList (Get-AzContext),$bookName,$automation -ScriptBlock { param ($context,$bookName,$automation) Start-AzAutomationRunbook -DefaultProfile $context -Name $bookName -AutomationAccountName $automation.AccountName -ResourceGroupName $automation.ResourceGroupName -ErrorAction Stop -Wait -MaxWaitSeconds 3600 } Write-Verbose "$bookName started." } } function Wait-RunbookResults ([hashtable] $automation, $jobs) { Write-Verbose 'Waiting for runbooks to complete...' $failedJobs = $jobs | Wait-Job | ForEach-Object { $name = $_.Name $state = $_.State $output = $_ | Receive-Job -Keep $jobId = @($output | Where-Object { $_ -like 'JobId:*' } | Select-Object -First 1) -replace 'JobId:','' | Out-String $failureCount = @($output | Where-Object { $_ -like '!!!*' } | Measure-Object -Line).Lines New-Object PSObject -Property @{Name = $name; State = $state; JobId = $jobId; FailureCount = $failureCount} } | Where-Object { $_.FailureCount -ge 1 -or $_.State -eq 'Failed' } $success = ($failedJobs | Measure-Object).Count -eq 0 if($success){ Write-Verbose 'All tests succeeded!' return $success } else { Write-Verbose "Failed test suites: $(($failedJobs | ForEach-Object {$_.Name}) -join ',')" } $resultsPath = "$PSScriptRoot\..\Results" if (-not (Test-Path $resultsPath)) { $null = New-Item -ItemType Directory -Path $resultsPath -ErrorAction Stop } else { Write-Verbose "Cleaning up the $resultsPath folder..." Remove-Item "$resultsPath\*" -Recurse -Force -ErrorAction Stop } foreach($failedJob in $failedJobs) { if($failedJob.State -eq 'Failed') { Write-Verbose "$($failedJob.Name) failed to complete the Runbook job. No results can be created." continue } Write-Verbose "Gathering $($failedJob.Name) suite logs..." $streams = Get-AzAutomationJobOutput ` -id $failedJob.JobId ` -ResourceGroupName $automation.ResourceGroupName ` -AutomationAccountName $automation.AccountName ` -Stream Any ` | Where-Object {$_.Summary.Length -gt 0} ` | Get-AzAutomationJobOutputRecord $suitePath = Join-Path $resultsPath $failedJob.Name if (-not (Test-Path $suitePath)) { $null = New-Item -ItemType Directory -Path $suitePath -ErrorAction Stop } foreach($stream in $streams) { $content = switch ($stream.Type) { 'Output' { $stream.Value.value } 'Error' { $stream.Value.Exception $stream.Value.ScriptStackTrace } 'Warning' { $stream.Value.Message $stream.Value.InvocationInfo } default { $stream.Value.Message } } $filePath = Join-Path $suitePath "$($stream.Type).txt" if (-not (Test-Path $filePath)) { $null = New-Item -type File -Path $filePath -Force -ErrorAction Stop } $content | Add-Content -Path $filePath } Write-Verbose "$($failedJob.Name) logs created." } $success }
combined_dataset/train/non-malicious/Scan Remote Event Logs.ps1
Scan Remote Event Logs.ps1
#requires -version 2.0 function Scan-EventLogs { <# .SYNOPSIS Scan event logs on specified computer(s) and return a sorted collection events to review. .Description Uses PowerShell Remoting with Invoke-Command and Get-EventLog to fetch a list of enabled event logs from one or more computers and sort output. .PARAMETER ComputerName Specifies one or more computers to scan and report event logs info from. The default is the local computer. .PARAMETER Sort Specifies a property to sort by. The default is MachineName, but any property of EventLogConfiguration class could be used, including "IsClassicLog" and "FileSize". .PARAMETER Descending Indicates whether to be descending or ascending sort order. Default is descending = true. .PARAMETER Exclude An array of psobjects created by the New-EventId cmdlet which will be excluded from the output. .PARAMETER Credential The network credential to use when connecting to a remote compiuter. .EXAMPLE PS > $Exclusions = (New-EventId -Source "W32Time" -EventId 29), (New-EventId -Source "Netlogon" -EventId 5719) PS > Get-EnabledEvtLogs -CN "ANY-SERVER", "Localhost" -Sort "Source" -Descending $true #> # Parameters Param ( [parameter(Mandatory=$false)] [alias("CN")] [String[]] $ComputerName = $ENV:COMPUTERNAME, [parameter(Mandatory=$false)] [String] $Sort = "MachineName", [parameter(Mandatory=$false)] [Boolean] $Descending = $true, [parameter(Mandatory=$false)] [psobject[]] $Exclude, [parameter(Mandatory=$false)] [PSobject] $Credential ) Process { # Help enforcing coding rules... Set-StrictMode -Version Latest # The logs we want to scan... $LogNames = "Security", "System"; $EntryTypes = "FailureAudit", "Error"; $list = $null; foreach($cn in $ComputerName) { foreach($logName in $LogNames) { # Determine dates for last month $LastMonth = (get-date).AddMonths(-1); $LastMonthFirst = get-date -year $LastMonth.Year -month $LastMonth.Month -day 1 $ThisMonthFirst = get-date -year (get-date).Year -month (get-date).Month -day 1 $EventLogArgs = @{ ComputerName = $cn LogName = $logName After = $LastMonthFirst Before = $ThisMonthFirst EntryType = $EntryTypes AsBaseObject = $true } # Build args struct $remoteScript = { param($elArgs) & get-eventlog @elArgs } # get events... $events = Invoke-Command -ScriptBlock $remoteScript -ComputerName $cn -Credential $Credential -ArgumentList $EventLogArgs; # Build the filter algorithm for the where object... $filterScript = { # Loop through the exclusions... $bInc = $true; foreach($ex in $Exclude) { # first check to make sure the incoming object has a Source property.. $hasSource = get-member -name "Source" -InputObject $_ # if not has Source if($hasSource -eq $null) { $bInc = $false; } # in our exlucde list, then not include. else { if($_.Source -eq $ex.Source -and $_.EventID -eq $ex.EventID) { $bInc = $false; } } } $bInc; }; # Do the actual filtering... [psobject[]]$filtered = $null; foreach($evt in $events) { $filtered += where -FilterScript $filterScript -InputObject $evt; } # prepare final list... $list += ($filtered | select MachineName, EntryType, TimeGenerated, Source, EventId, Message, UserName); } } # Sort the collection according to callers wishes and format for output... $list | sort -property @{Expression=$Sort;Descending=$Descending} } } function New-EventId { Param ( [ValidateNotNullOrEmpty()] [string] $Source, [ValidateNotNullOrEmpty()] [int] $EventId ) process { $EventIdItem = new-object psobject; $EventIdItem | add-member -membertype noteproperty -name Source -value $Source; $EventIdItem | add-member -membertype noteproperty -Name EventID -value $EventId; $EventIdItem; } }
combined_dataset/train/non-malicious/sample_58_31.ps1
sample_58_31.ps1
# Localized 05/01/2024 11:12 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=Д&а PromptNoString=&Нет BundleFound=Найденный набор: {0} PackageFound=Обнаружен пакет: {0} EncryptedBundleFound=Найден зашифрованный набор: {0} EncryptedPackageFound=Найден зашифрованный пакет: {0} CertificateFound=Обнаружен сертификат: {0} DependenciesFound=Обнаружены пакеты зависимостей: GettingDeveloperLicense=Получение лицензии разработчика... InstallingCertificate=Установка сертификата... InstallingPackage=\nУстановка приложения... AcquireLicenseSuccessful=Лицензия разработчика успешно получена. InstallCertificateSuccessful=Сертификат успешно установлен. Success=\nУспех: приложение успешно установлено. WarningInstallCert=\nВы собираетесь установить цифровой сертификат в хранилище сертификатов "Доверенные лица" своего компьютера. Эта операция связана с серьезными рисками для безопасности и должна выполняться, только если вы доверяете источнику данного цифрового сертификата.\n\nПосле завершения использования приложения вы должны будете вручную удалить данный цифровой сертификат. Соответствующие инструкции можно найти по следующему адресу: http://go.microsoft.com/fwlink/?LinkId=243053\n\nПродолжить?\n\n ElevateActions=\nПеред установкой этого приложения необходимо выполнить следующие действия: ElevateActionDevLicense=\t- Получить лицензию разработчика ElevateActionCertificate=\t- Установить сертификат подписи ElevateActionsContinue=Для продолжения требуются учетные данные разработчика. Нажмите "ОК" в сообщении контроля учетных записей и укажите пароль администратора, если появится соответствующий запрос. ErrorForceElevate=Для продолжения необходимо указать учетные данные администратора. Запустите этот скрипт без параметра -Force или из окна PowerShell с повышенными правами. ErrorForceDeveloperLicense=Получение лицензии разработчика предполагает участие пользователя. Заново запустите этот скрипт без параметра -Force. ErrorLaunchAdminFailed=Ошибка: не удалось запустить новый процесс от имени администратора. ErrorNoScriptPath=Ошибка: необходимо запустить этот скрипт из файла. ErrorNoPackageFound=Ошибка: в каталоге скрипта не найден пакет или набор. Проверьте, что устанавливаемый пакет или набор находится в одном каталоге со скриптом. ErrorManyPackagesFound=Ошибка: в каталоге скрипта найдено несколько пакетов или наборов. Проверьте, что в каталоге со скриптом находится только устанавливаемый пакет или набор. ErrorPackageUnsigned=Ошибка: пакет или набор не подписан цифровой подписью, либо подпись повреждена. ErrorNoCertificateFound=Ошибка: в каталоге скрипта не найден сертификат. Проверьте, что в каталоге со скриптом находится сертификат, используемый для подписывания устанавливаемого пакета или набора. ErrorManyCertificatesFound=Ошибка: в каталоге скрипта найдено несколько сертификатов. Проверьте, что в каталоге со скриптом находится только сертификат, используемый для подписывания устанавливаемого пакета или набора. ErrorBadCertificate=Ошибка: файл "{0}" не является допустимым цифровым сертификатом. Программа CertUtil вернула код ошибки {1}. ErrorExpiredCertificate=Ошибка: срок действия сертификата разработчика {0} истек. Одной из возможных причин является неправильная настройка даты и времени в системных часах. Если системные параметры настроены правильно, обратитесь к владельцу приложения для повторного создания пакета или набора с действительным сертификатом. ErrorCertificateMismatch=Ошибка: сертификат не совпадает с сертификатом, с помощью которого был подписан пакет или набор. ErrorCertIsCA=Ошибка: сертификат не может быть центром сертификации. ErrorBannedKeyUsage=Ошибка: в сертификате не может быть следующего значения назначения ключа: {0}. Значение назначения ключа может быть не задано или равняться "DigitalSignature". ErrorBannedEKU=Ошибка: в сертификате не может быть следующего расширенного назначения ключа: {0}. Допускаются только расширенные назначения для подписывания кода и подписывания времени жизни. ErrorNoBasicConstraints=Ошибка: в сертификате отсутствует расширение базовых ограничений. ErrorNoCodeSigningEku=Ошибка: в сертификате отсутствует расширенное назначение ключа для подписывания кода. ErrorInstallCertificateCancelled=Ошибка: установка сертификата была отменена. ErrorCertUtilInstallFailed=Ошибка: не удалось установить сертификат. Программа CertUtil вернула код ошибки {0}. ErrorGetDeveloperLicenseFailed=Ошибка: не удалось получить лицензию разработчика. Дополнительные сведения см. по адресу http://go.microsoft.com/fwlink/?LinkID=252740. ErrorInstallCertificateFailed=Ошибка: не удалось установить сертификат. Состояние: {0}. Дополнительные сведения см. по адресу http://go.microsoft.com/fwlink/?LinkID=252740. ErrorAddPackageFailed=Ошибка: не удалось установить приложение. ErrorAddPackageFailedWithCert=Ошибка: не удалось установить приложение. Для обеспечения безопасности рекомендуется удалить сертификат подписи до времени установки приложения. Соответствующие инструкции можно найти по следующему адресу:\nhttp://go.microsoft.com/fwlink/?LinkId=243053 '@
combined_dataset/train/non-malicious/3928.ps1
3928.ps1
function Test-AzureIotDpsAccessPolicyLifeCycle { $Location = Get-Location "Microsoft.Devices" "Device Provisioning Service" $IotDpsName = getAssetName $ResourceGroupName = getAssetName $AccessPolicyDefaultKeyName = "provisioningserviceowner" $AccessPolicyDefaultRights = "ServiceConfig, DeviceConnect, EnrollmentWrite" $NewAccessPolicyKeyName = "Access1" $NewAccessPolicyRights = "ServiceConfig" $resourceGroup = New-AzResourceGroup -Name $ResourceGroupName -Location $Location $iotDps = New-AzIoTDps -ResourceGroupName $ResourceGroupName -Name $IotDpsName -Location $Location Assert-True { $iotDps.Name -eq $IotDpsName } $iotDpsAccessPolicy1 = Get-AzIoTDpsAccessPolicy -ResourceGroupName $ResourceGroupName -Name $IotDpsName Assert-True { $iotDpsAccessPolicy1.Count -eq 1 } Assert-True { $iotDpsAccessPolicy1.KeyName -eq $AccessPolicyDefaultKeyName } Assert-True { $iotDpsAccessPolicy1.Rights -eq $AccessPolicyDefaultRights } $iotDpsAccessPolicy2 = Add-AzIoTDpsAccessPolicy -ResourceGroupName $ResourceGroupName -Name $IotDpsName -KeyName $NewAccessPolicyKeyName -Permissions $NewAccessPolicyRights Assert-True { $iotDpsAccessPolicy2.Count -eq 2 } Assert-True { $iotDpsAccessPolicy2[1].KeyName -eq $NewAccessPolicyKeyName } Assert-True { $iotDpsAccessPolicy2[1].Rights -eq $NewAccessPolicyRights } $result = Remove-AzIoTDpsAccessPolicy -ResourceGroupName $ResourceGroupName -Name $IotDpsName -KeyName $NewAccessPolicyKeyName -PassThru Assert-True { $result } $iotDpsAccessPolicy3 = Update-AzIoTDpsAccessPolicy -ResourceGroupName $ResourceGroupName -Name $IotDpsName -KeyName $AccessPolicyDefaultKeyName -Permissions $NewAccessPolicyRights Assert-True { $iotDpsAccessPolicy3.Count -eq 1 } Assert-True { $iotDpsAccessPolicy3.KeyName -eq $AccessPolicyDefaultKeyName } Assert-True { $iotDpsAccessPolicy3.Rights -eq $NewAccessPolicyRights } $result = Remove-AzIoTDps -ResourceGroupName $ResourceGroupName -Name $IotDpsName -PassThru Assert-True { $result } Remove-AzResourceGroup -Name $ResourceGroupName -force }
combined_dataset/train/non-malicious/sample_23_74.ps1
sample_23_74.ps1
function Unlock-AzDataProtectionResourceGuardOperation { [OutputType('System.String')] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Unlocks the critical operation which is protected by the resource guard')] param( [Parameter(ParameterSetName="UnlockDelete", Mandatory=$false, HelpMessage='Subscription Id of the backup vault')] [System.String] ${SubscriptionId}, [Parameter(ParameterSetName="UnlockDelete", Mandatory, HelpMessage='Resource Group name of the backup vault')] [System.String] ${ResourceGroupName}, [Parameter(ParameterSetName="UnlockDelete", Mandatory, HelpMessage='Name of the backup vault')] [System.String] ${VaultName}, [Parameter(ParameterSetName="UnlockDelete", Mandatory=$false, HelpMessage='List of critical operations which are protected by the resourceGuard and need to be unlocked. Supported values are DeleteBackupInstance, DisableMUA')] [System.String[]] ${ResourceGuardOperationRequest}, [Parameter(ParameterSetName="UnlockDelete", Mandatory=$false, HelpMessage='ARM Id of the resource that need to be unlocked for performing critical operation')] [System.String] ${ResourceToBeDeleted}, [Parameter(ParameterSetName="UnlockDelete", Mandatory=$false, HelpMessage='Parameter to authorize operations protected by cross tenant resource guard. Use command (Get-AzAccessToken -TenantId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").Token to fetch authorization token for different tenant.')] [System.String] ${Token}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [System.Management.Automation.PSObject] # The credentials, account, tenant, and subscription used for communication with Azure. ${DefaultProfile}, [Parameter(DontShow)] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) process { $ResGuardProxy = $null if($SubscriptionId -ne $null){ $ResGuardProxy = Get-AzDataProtectionResourceGuardMapping -VaultName $VaultName -ResourceGroupName $ResourceGroupName -SubscriptionId $SubscriptionId } else { $ResGuardProxy = Get-AzDataProtectionResourceGuardMapping -VaultName $VaultName -ResourceGroupName $ResourceGroupName } $CriticalOperationsMap = @{ DisableMUA = "deleteResourceGuardProxyRequests"; DeleteBackupInstance = "deleteBackupInstanceRequests" } # modify Critical operation exclusion list $ResourceGuardOperationRequestInternal = [System.Collections.ArrayList]@() foreach($operation in $ResourceGuardOperationRequest) { if($CriticalOperationsMap.ContainsKey($operation)){ $arrayIndex = $ResourceGuardOperationRequestInternal.Add(($ResGuardProxy.ResourceGuardOperationDetail.DefaultResourceRequest | Where-Object { $_ -match $CriticalOperationsMap[$operation] } )) } else { $arrayIndex = $ResourceGuardOperationRequestInternal.Add($operation) } } if($PSBoundParameters.ContainsKey("ResourceGuardOperationRequest")) { $null = $PSBoundParameters.Remove("ResourceGuardOperationRequest") $null = $PSBoundParameters.Add("ResourceGuardOperationRequest", $ResourceGuardOperationRequestInternal) } if($PSBoundParameters.ContainsKey("Token")) { $null = $PSBoundParameters.Remove("Token") $null = $PSBoundParameters.Add("Token", "Bearer $Token") } Az.DataProtection.Internal\Unlock-AzDataProtectionDppResourceGuardProxyDelete @PSBoundParameters } } # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDmUm/LgA4QWLvm # l6lV2qw/r8oGGkLkzrCXbeUUYdR4kKCCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4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YtqjQrzjI2tG # +iKlq+UsizsdzfkC6ej+PG4iwxAhsk74Bx2rgfLBH87HKstU3vRKlnjniIM0vtGq # 64NKr299FYqmF31V23jo+Iq4IMLjO8xtHB8YikuWIuMZo71Pe7CyFCQNHIeqqgHz # JbKQJvnajk7sAtvY7h9o1UTP8yXvU2n3S65/tz8mYb4cP/tEtzZhvvTD5Vim0GXz # MpXWDH2L5YfnOEgbTatc0wTQN84joCbexoaT9hjadf2VukFtBUannXYJzLZBvD+E # 5mhsk3lpoam80cjerIowMYkledArj7pLV/0dJtXCTxo0LOq+Gbrk+AyXbVANKlyB # x6te # SIG # End signature block
combined_dataset/train/non-malicious/sample_61_97.ps1
sample_61_97.ps1
# # Module manifest for module 'OCI.PSModules.Healthchecks' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll' # Version number of this module. ModuleVersion = '89.0.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = 'ec09c1dc-6260-4794-9b17-b24077d3c55a' # 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 Healthchecks 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 = '89.0.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'assemblies/OCI.DotNetSDK.Healthchecks.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-OCIHealthchecksHttpMonitor', 'Get-OCIHealthchecksHttpMonitorsList', 'Get-OCIHealthchecksHttpProbeResultsList', 'Get-OCIHealthchecksPingMonitor', 'Get-OCIHealthchecksPingMonitorsList', 'Get-OCIHealthchecksPingProbeResultsList', 'Get-OCIHealthchecksVantagePointsList', 'Move-OCIHealthchecksHttpMonitorCompartment', 'Move-OCIHealthchecksPingMonitorCompartment', 'New-OCIHealthchecksHttpMonitor', 'New-OCIHealthchecksOnDemandHttpProbe', 'New-OCIHealthchecksOnDemandPingProbe', 'New-OCIHealthchecksPingMonitor', 'Remove-OCIHealthchecksHttpMonitor', 'Remove-OCIHealthchecksPingMonitor', 'Update-OCIHealthchecksHttpMonitor', 'Update-OCIHealthchecksPingMonitor' # 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','Healthchecks' # 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/2817.ps1
2817.ps1
if (Get-Command logparser.exe) { $lpquery = @" SELECT COUNT(To_Lowercase(CmdLine)) as ct, To_Lowercase(CmdLine) as CmdLineLC FROM *SvcFail.tsv GROUP BY CmdLineLC ORDER BY ct ASC "@ & logparser -stats:off -i:csv -fixedsep:on -dtlines:0 -rtp:-1 $lpquery } else { $ScriptName = [System.IO.Path]::GetFileName($MyInvocation.ScriptName) "${ScriptName} requires logparser.exe in the path." }
combined_dataset/train/non-malicious/1396.ps1
1396.ps1
function Test-CFileShare { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Name ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $share = Get-CFileShare -Name ('{0}*' -f $Name) | Where-Object { $_.Name -eq $Name } return ($share -ne $null) }
combined_dataset/train/non-malicious/3591.ps1
3591.ps1
function Test-UpdateAzureRmServiceFabricDurability { $nodeTypeName = Get-NewNodeTypeName $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $durabilityLevel = Get-DurabilityLevel $newNodeTypeName = Get-NewNodeTypeName WaitForClusterReadyStateIfRecord $clusterName $resourceGroupName $cluster = Update-AzServiceFabricDurability -Level $durabilityLevel -NodeType $nodeTypeName -ClusterName $clusterName -ResourceGroupName $resourceGroupName -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName Assert-AreEqual $clusters[0].NodeTypes.Where({$_.Name -eq $newNodeTypeName}).DurabilityLevel $durabilityLevel } function Test-UpdateAzureRmServiceFabricReliability { $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $reliabilityLevel = Get-ReliabilityLevel WaitForClusterReadyStateIfRecord $clusterName $resourceGroupName $cluster = Update-AzServiceFabricReliability -ReliabilityLevel $reliabilityLevel -ClusterName $clusterName -ResourceGroupName $resourceGroupName -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName Assert-AreEqual $clusters[0].ReliabilityLevel $reliabilityLevel } function Test-AddAzureRmServiceFabricClusterCertificate { $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $keyvaulturi = Get-SecretUrl WaitForClusterReadyStateIfRecord $clusterName $resourceGroupName $cluster = Add-AzServiceFabricClusterCertificate -ResourceGroupName $resourceGroupName -ClusterName $clusterName -SecretIdentifier $keyvaulturi -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName Assert-NotNull $clusters[0].Certificate.ThumbprintSecondary } function Test-AddAzureRmServiceFabricClusterCertificateCNNotAllowed { $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $keyvaulturi = Get-SecretUrl $commonName = Get-CACertCommonName $issuerThumbprint = Get-CACertIssuerThumbprint $exceptionThrown = $false Try { $cluster = Add-AzServiceFabricClusterCertificate -ResourceGroupName $resourceGroupName -ClusterName $clusterName -SecretIdentifier $keyvaulturi ` -CertificateCommonName $commonName -CertificateIssuerThumbprint $issuerThumbprint -Verbose -ErrorAction Stop } Catch [System.Management.Automation.PSInvalidOperationException] { Assert-AreEqual $true ($PSItem.Exception.Message -match 'Unable to mix certificates by common name and thumbprint') $exceptionThrown = $true } Assert-AreEqual $true $exceptionThrown "Expected Exception mix certs not thrown" } function Test-RemoveAzureRmServiceFabricClusterCertificate { $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $thumbprint = Get-Thumbprint WaitForClusterReadyStateIfRecord $clusterName $resourceGroupName $cluster = Remove-AzServiceFabricClusterCertificate -ClusterName $clusterName -ResourceGroupName $resourceGroupName -Thumbprint $thumbprint -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName Assert-Null $clusters[0].Certificate.ThumbprintSecondary } function Test-RemoveAzureRmServiceFabricClusterCertificateNotAllowed { $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $thumbprint = Get-Thumbprint $exceptionThrown = $false Try { $cluster = Remove-AzServiceFabricClusterCertificate -ClusterName $clusterName -ResourceGroupName $resourceGroupName -Thumbprint $thumbprint -Verbose -ErrorAction Stop } Catch [System.InvalidOperationException] { Assert-AreEqual $true ($PSItem.Exception.Message -match 'There is only one certificate in the cluster') $exceptionThrown = $true } Assert-AreEqual $true $exceptionThrown "Expected Exception only one cert not thrown" } function Test-AddAzureRmServiceFabricClientCertificate { $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $certName = Get-NewCertName $commonName = "cn=$certName" $thumbprint = Get-Thumbprint WaitForClusterReadyStateIfRecord $clusterName $resourceGroupName $cluster = Add-AzServiceFabricClientCertificate -ClusterName $clusterName -ResourceGroupName $resourceGroupName -CommonName $commonName -IssuerThumbprint $thumbprint -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName Assert-AreEqual $clusters[0].ClientCertificateCommonNames[0].CertificateCommonName $commonName } function Test-RemoveAzureRmServiceFabricClientCertificate { $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $certName = Get-NewCertName $commonName = "cn=$certName" $thumbprint = Get-Thumbprint WaitForClusterReadyStateIfRecord $clusterName $resourceGroupName $cluster = Remove-AzServiceFabricClientCertificate -ClusterName $clusterName -ResourceGroupName $resourceGroupName -CommonName $commonName -IssuerThumbprint $thumbprint -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName Assert-Null $clusters[0].ClientCertificateCommonNames[0] } function Test-NewAzureRmServiceFabricCluster { $clusterName = "azurermsfclustertptest" $resourceGroupName = "azurermsfrgTP" $keyvaulturi = Get-SecretUrl $vmPassword = Get-RandomPwd | ConvertTo-SecureString -Force -AsPlainText $cluster = New-AzServiceFabricCluster -ResourceGroupName $resourceGroupName -VmPassword $vmPassword ` -TemplateFile (Join-Path $pwd '\Resources\template.json') -ParameterFile (Join-Path $pwd '\Resources\parameters.json') -SecretIdentifier $keyvaulturi -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName $newClsuter = $clusters.Where({$_.Name -eq $clusterName}) Assert-NotNull $newClsuter Assert-NotNull $newClsuter.Certificate Assert-Null $newClsuter.CertificateCommonNames } function Test-NewAzureRmServiceFabricClusterCNCert { $clusterName = "azurermsfcntest" $resourceGroupName = "azurermsfrgCNTest" $keyvaulturi = Get-CACertSecretUrl $vmPassword = Get-RandomPwd | ConvertTo-SecureString -Force -AsPlainText $commonName = Get-CACertCommonName $issuerThumbprint = Get-CACertIssuerThumbprint $cluster = New-AzServiceFabricCluster -ResourceGroupName $resourceGroupName -VmPassword $vmPassword ` -TemplateFile (Join-Path $pwd '\Resources\templateCNCert.json') -ParameterFile (Join-Path $pwd '\Resources\parametersCNCert.json') ` -SecretIdentifier $keyvaulturi -CertCommonName $commonName -CertIssuerThumbprint $issuerThumbprint -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName $newClsuter = $clusters.Where({$_.Name -eq $clusterName}) Assert-NotNull $newClsuter Assert-Null $newClsuter.Certificate Assert-NotNull $newClsuter.CertificateCommonNames.CommonNames Assert-AreEqual $newClsuter.CertificateCommonNames.CommonNames[0].CertificateCommonName $commonName } function Test-AddAzureRmServiceFabricNodeType { $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $newNodeTypeName = Get-NewNodeTypeName WaitForClusterReadyStateIfRecord $clusterName $resourceGroupName $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName $vmPassword = Get-RandomPwd | ConvertTo-SecureString -Force -AsPlainText $cluster = Add-AzServiceFabricNodeType -Capacity 1 -VmUserName username -VmPassword $vmPassword -NodeType $newNodeTypeName -ClusterName $clusterName -ResourceGroupName $resourceGroupName -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName Assert-NotNull $clusters[0].NodeTypes.Where({$_.Name -eq $newNodeTypeName}) } function Test-RemoveAzureRmServiceFabricNodeType { $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $newNodeTypeName = Get-NewNodeTypeName WaitForClusterReadyStateIfRecord $clusterName $resourceGroupName $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName $cluster = Remove-AzServiceFabricNodeType -ResourceGroupName $resourceGroupName -ClusterName $clusterName -NodeType $newNodeTypeName -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName Assert-Null $clusters[0].NodeTypes.Where({$_.Name -eq $newNodeTypeName}) } function Test-AddAzureRmServiceFabricNode { $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $newNodeTypeName = Get-NewNodeTypeName $nodes = 5 WaitForClusterReadyStateIfRecord $clusterName $resourceGroupName $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName $count = $clusters[0].NodeTypes.Where({$_.Name -eq $newNodeTypeName}).VmInstanceCount $cluster = Add-AzServiceFabricNode -NodeType $newNodeTypeName -NumberOfNodesToAdd $nodes -ClusterName $clusterName -ResourceGroupName $resourceGroupName -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName Assert-AreEqual ($count + $nodes) $clusters[0].NodeTypes.Where({$_.Name -eq $newNodeTypeName}).VmInstanceCount } function Test-RemoveAzureRmServiceFabricNode { $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $newNodeTypeName = Get-NewNodeTypeName $nodes = 1 WaitForClusterReadyStateIfRecord $clusterName $resourceGroupName $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName $count = $clusters[0].NodeTypes.Where({$_.Name -eq $newNodeTypeName}).VmInstanceCount $cluster = Remove-AzServiceFabricNode -NodeType $newNodeTypeName -NumberOfNodesToRemove $nodes -ClusterName $clusterName -ResourceGroupName $resourceGroupName -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName Assert-AreEqual ($count - $nodes) $clusters[0].NodeTypes.Where({$_.Name -eq $newNodeTypeName}).VmInstanceCount } function Test-SetAzureRmServiceFabricSettings { $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $sectionName = Get-SectionName $parameterName = Get-ParameterName $valueName = Get-ValueName WaitForClusterReadyStateIfRecord $clusterName $resourceGroupName $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName $count = $clusters[0].FabricSettings.Count $cluster = Set-AzServiceFabricSetting -ResourceGroupName $resourceGroupName -ClusterName $clusterName -Section $sectionName -Parameter $parameterName -Value $valueName -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName $settingAdded = $false; foreach ($setting in $clusters[0].FabricSettings) { if ($setting.name -eq $sectionName) { $settingAdded = ($setting.parameters[0].name -eq $parameterName -and $setting.parameters[0].value -eq $valueName) } } Assert-True { $settingAdded } } function Test-RemoveAzureRmServiceFabricSettings { $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $sectionName = Get-SectionName $parameterName = Get-ParameterName WaitForClusterReadyStateIfRecord $clusterName $resourceGroupName $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName $preSettings = $clusters[0].FabricSettings $cluster = Remove-AzServiceFabricSetting -ResourceGroupName $resourceGroupName -ClusterName $clusterName -Section $sectionName -Parameter $parameterName -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName Assert-AreNotEqual $preSettings $clusters[0].FabricSettings } function Test-SetAzureRmServiceFabricUpgradeType { $clusterName = Get-ClusterName $resourceGroupName = Get-ResourceGroupName $cluster = Set-AzServiceFabricUpgradeType -ResourceGroupName $resourceGroupName -ClusterName $clusterName -UpgradeMode Manual -Verbose $clusters = Get-AzServiceFabricCluster -ClusterName $clusterName -ResourceGroupName $resourceGroupName Assert-AreEqual $clusters[0].UpgradeMode 'Manual' }
combined_dataset/train/non-malicious/Findup_26.ps1
Findup_26.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; using System.Text.RegularExpressions; namespace Findup { public class FileLengthComparer : IComparer<FileInfo> { public int Compare(FileInfo x, FileInfo y) { return (x.Length.CompareTo(y.Length)); } } class Findup { public static Dictionary<string, List<string>> optionspaths = new Dictionary<string, List<string>> { {"/x", new List<string>()},{"/i",new List<string>()},{"/xf",new List<string>()},{"/if",new List<string>()}, {"/xd",new List<string>()},{"/id",new List<string>()},{"/paths",new List<string>()} }; public static Dictionary<string, List<Regex>> optionsregex = new Dictionary<string, List<Regex>> { {"/xr", new List<Regex>()},{"/ir",new List<Regex>()},{"/xfr",new List<Regex>()},{"/ifr",new List<Regex>()}, {"/xdr",new List<Regex>()},{"/idr",new List<Regex>()} }; public static Dictionary<string, Boolean> optionsbools = new Dictionary<string, bool> { { "/recurse", false }, { "/noerr", false }, {"/delete",false}, {"/xj", false}}; public static long numOfDupes, dupeBytes, bytesrecovered, deletedfiles = 0; // number of duplicate files found, bytes in duplicates, bytes recovered from deleting dupes, number of deleted dupes. public static long errors = 0; public static string delconfirm; public static void Main(string[] args) { DateTime startTime = DateTime.Now; Console.WriteLine("Findup.exe v2.0 - By James Gentile - [email protected] - 2012."); Console.WriteLine("Findup.exe matches sizes, then SHA512 hashes to identify duplicate files."); Console.WriteLine(" "); string optionskey = "/paths"; List<FileInfo> files = new List<FileInfo>(); int i = 0; for (i = 0; i < args.Length; i++) { string argitem = args[i].ToLower(); if ((System.String.Compare(argitem, "/help", true) == 0) || (System.String.Compare(argitem, "/h", true) == 0)) { Console.WriteLine("Usage: findup.exe <file/directory #1..#N> [/recurse] [/noerr] [/x /i /xd /id /xf /if + [r]] <files/directories/regex> [/delete]"); Console.WriteLine(" "); Console.WriteLine("Options: /help - displays this help message."); Console.WriteLine(" /recurse - recurses through subdirectories when directories or file specifications (e.g. *.txt) are specified."); Console.WriteLine(" /noerr - discards error messages."); Console.WriteLine(" /delete - delete each duplicate file with confirmation."); Console.WriteLine(" /x - eXcludes if full file path starts with (or RegEx matches if -xr) one of the items following this switch until another switch is used."); Console.WriteLine(" /i - include if full file path starts with (or Regex matches if -ir) one of the items following this switch until another switch is used."); Console.WriteLine(" /xd - eXcludes all directories - minus drive/files - (using RegEx if /xdr) including subdirs following this switch until another switch is used."); Console.WriteLine(" /id - Include only directories - minus drive/files - (using RegEx if /idr) including subdirs following this switch until another switch is used."); Console.WriteLine(" /xf - eXcludes all files - minus drive/directories - (using RegEx if /xfr) following this switch until another switch is used."); Console.WriteLine(" /if - Include only files - minus drive/directories - (using RegEx if /ifr) following this switch until another switch is used."); Console.WriteLine(" [r] - Use regex for include/exclude by appending an 'r' to the option, e.g. -ir, -ifr, -idr, -xr, -xfr, -xdr."); Console.WriteLine(" /paths - not needed unless you want to specify files/dirs after an include/exclude without using another non-exclude/non-include option."); Console.WriteLine(" /xj - Exclude File and Directory Junctions."); Console.WriteLine(" "); Console.WriteLine("Examples: findup.exe c:\\\\finances /recurse /noerr /delete"); Console.WriteLine(" - Find dupes in c:\\\\finance."); Console.WriteLine(" - recurse all subdirs of c:\\\\finance."); Console.WriteLine(" - suppress error messages."); Console.WriteLine(" - deletes duplicates after consent is given."); Console.WriteLine(" findup.exe c:\\\\users\\\\alice\\\\plan.txt d:\\\\data /recurse /x d:\\\\data\\\\webpics"); Console.WriteLine(" - Find dupes in c:\\\\users\\\\alice\\\\plan.txt, d:\\\\data"); Console.WriteLine(" - recurse subdirs in d:\\\\data."); Console.WriteLine(" - exclude any files in d:\\\\data\\\\webpics and subdirs."); Console.WriteLine(" findup.exe c:\\\\data *.txt c:\\\\reports\\\\quarter.doc /xfr \\"(jim)\\""); Console.WriteLine(" - Find dupes in c:\\\\data, *.txt in current directory and c:\\\\reports\\\\quarter.doc"); Console.WriteLine(" - exclude any file with 'jim' in the name as specified by the Regex item \\"(jim)\\""); Console.WriteLine(" findup.exe c:\\\\data *.txt c:\\\\reports\\\\*quarter.doc /xr \\"[bf]\\" /ir \\"(smith)\\""); Console.WriteLine(" - Find dupes in c:\\\\data, *.txt in current directory and c:\\\\reports\\\\*quarter.doc"); Console.WriteLine(" - Include only files with 'smith' and exclude any file with letters b or f in the path name as specified by the Regex items \\"[bf]\\",\\"(smith)\\""); Console.WriteLine("Note: Exclude takes precedence over Include."); return; } if (optionsbools.ContainsKey(argitem)) { optionsbools[argitem] = true; optionskey = "/paths"; continue; } if (optionspaths.ContainsKey(argitem) || optionsregex.ContainsKey(argitem)) { optionskey = argitem; continue; } if (optionspaths.ContainsKey(optionskey)) optionspaths[optionskey].Add(args[i]); else { try { Regex rgx = new Regex(args[i], RegexOptions.Compiled); optionsregex[optionskey].Add(rgx); } catch (Exception e) {WriteErr("Regex compilation failed: " + e.Message);} } } if (optionspaths["/paths"].Count == 0) { WriteErr("No files, file specifications, or directories specified. Try findup.exe -help. Assuming current directory."); optionspaths["/paths"].Add("."); } Console.Write("Getting file info and sorting file list..."); getFiles(optionspaths["/paths"], "*.*", optionsbools["/recurse"], files); if (files.Count < 2) { WriteErr("\\nFindup.exe needs at least 2 files to compare. Try findup.exe -help"); Console.WriteLine("\\n"); return; } files.Sort(new FileLengthComparer()); Console.WriteLine("Completed!"); Console.Write("Building dictionary of file sizes, SHA512 hashes and full paths..."); var SizeHashFile = new Dictionary<long, Dictionary<string,List<FileInfo>>>(); long filesize = 0; for (i = 0; i < (files.Count - 1); i++) { if (files[i].Length != files[i + 1].Length) continue; var breakout = false; while (true) { filesize = (files[i].Length); try { var _SHA512 = SHA512.Create(); using (var fstream = File.OpenRead(files[i].FullName)) { _SHA512.ComputeHash(fstream); } string SHA512string = Hash2String(_SHA512.Hash); if (!SizeHashFile.ContainsKey(filesize)) SizeHashFile.Add(filesize, new Dictionary<string,List<FileInfo>>()); if (!SizeHashFile[filesize].ContainsKey(SHA512string)) { SizeHashFile[filesize][SHA512string] = new List<FileInfo>() {}; } SizeHashFile[filesize][SHA512string].Add(files[i]); } catch (Exception e) { WriteErr("Hash error: " + e.Message); } if (breakout == true) {break;} i++; if (i == (files.Count - 1)) { breakout = true; continue; } breakout = (files[i].Length != files[i + 1].Length); } if (SizeHashFile.ContainsKey(filesize)) { foreach (var HG in SizeHashFile[filesize]) { if (HG.Value.Count > 1) { Console.WriteLine("{0:N0} Duplicate files. {1:N0} Bytes each. {2:N0} Bytes total : ", HG.Value.Count, filesize, filesize * HG.Value.Count); foreach (var finfo in HG.Value) { Console.WriteLine(finfo.FullName); numOfDupes++; dupeBytes += finfo.Length; if (optionsbools["/delete"]) if (DeleteDupe(finfo)) { bytesrecovered += finfo.Length; deletedfiles++; } } } } } } Console.WriteLine("\\n "); Console.WriteLine("Files checked : {0:N0}", files.Count); // display statistics and return to OS. Console.WriteLine("Duplicate files : {0:N0}", numOfDupes); Console.WriteLine("Duplicate bytes : {0:N0}", dupeBytes); Console.WriteLine("Deleted duplicates : {0:N0}", deletedfiles); Console.WriteLine("Bytes recovered : {0:N0}", bytesrecovered); Console.WriteLine("Errors : {0:N0}", errors); Console.WriteLine("Execution time : " + (DateTime.Now - startTime)); } private static void WriteErr(string Str) { errors++; if (!optionsbools["/noerr"]) Console.WriteLine(Str); } private static string Hash2String(Byte[] hasharray) { string SHA512string = ""; foreach (var c in hasharray) { SHA512string += String.Format("{0:x2}", c); } return SHA512string; } private static Boolean DeleteDupe(FileInfo Filenfo) { Console.Write("Delete this file <y/N> <ENTER>?"); delconfirm = Console.ReadLine(); if ((delconfirm[0] == 'Y') || (delconfirm[0] == 'y')) { try { Filenfo.Delete(); Console.WriteLine("File Successfully deleted."); return true; } catch (Exception e) { Console.WriteLine("File could not be deleted: " + e.Message); } } return false; } private static Boolean CheckNames(string fullname) { var filePart = Path.GetFileName(fullname); // get file name only (e.g. "d:\\temp\\data.txt" -> "data.txt") var dirPart = Path.GetDirectoryName(fullname).Substring(fullname.IndexOf(Path.VolumeSeparatorChar)+2); // remove drive & file (e.g. "d:\\temp\\data.txt" -> "temp") if (CheckNamesWorker(fullname, "/x", "/xr", true)) return false; if (CheckNamesWorker(filePart, "/xf", "/xfr", true)) return false; if (CheckNamesWorker(dirPart, "/xd", "/xdr", true)) return false; if (CheckNamesWorker(fullname, "/i", "/ir", false)) return false; if (CheckNamesWorker(filePart, "/if", "/ifr", false)) return false; if (CheckNamesWorker(dirPart, "/id", "/idr", false)) return false; return true; } private static Boolean CheckNamesWorker(string filestr, string pathskey, string rgxkey, Boolean CheckType) { foreach (var filepath in optionspaths[pathskey]) { if (filestr.ToLower().StartsWith(filepath) == CheckType) return true; } foreach (var rgx in optionsregex[rgxkey]) { if (rgx.IsMatch(filestr) == CheckType) return true; } return false; } private static void getFiles(List<string> pathRec, string searchPattern, Boolean recursiveFlag, List<FileInfo> returnList) { foreach (string d in pathRec) { getFiles(d, searchPattern, recursiveFlag, returnList); } } private static void getFiles(string[] pathRec, string searchPattern, Boolean recursiveFlag, List<FileInfo> returnList) { foreach (string d in pathRec) { getFiles(d, searchPattern, recursiveFlag, returnList); } } private static void getFiles(string pathRec, string searchPattern, Boolean recursiveFlag, List<FileInfo> returnList) { string dirPart; string filePart; if (File.Exists(pathRec)) { try { FileInfo addf = (new FileInfo(pathRec)); if (((addf.Attributes & FileAttributes.ReparsePoint) == 0) || !optionsbools["/xj"]) if (CheckNames(addf.FullName)) returnList.Add(addf); } catch (Exception e) { WriteErr("Add file error: " + e.Message); } } else if (Directory.Exists(pathRec)) { try { DirectoryInfo Dir = new DirectoryInfo(pathRec); if (((Dir.Attributes & FileAttributes.ReparsePoint) == 0) || !optionsbools["/xj"]) foreach (FileInfo addf in (Dir.GetFiles(searchPattern))) { if (((addf.Attributes & FileAttributes.ReparsePoint) == 0) || !optionsbools["/xj"]) if (CheckNames(addf.FullName)) returnList.Add(addf); } } catch (Exception e) { WriteErr("Add files from Directory error: " + e.Message); } if (recursiveFlag) { try { getFiles((Directory.GetDirectories(pathRec)), searchPattern, recursiveFlag, returnList); } catch (Exception e) { WriteErr("Add Directory error: " + e.Message); } } } else { try { filePart = Path.GetFileName(pathRec); dirPart = Path.GetDirectoryName(pathRec); } catch (Exception e) { WriteErr("Parse error on: " + pathRec); WriteErr(@"Make sure you don't end a directory with a \\ when using quotes. The console arg parser doesn't accept that."); WriteErr("Exception: " + e.Message); return; } if (filePart.IndexOfAny(new char[] {'?','*'}) >= 0) { if ((dirPart == null) || (dirPart == "")) dirPart = Directory.GetCurrentDirectory(); if (Directory.Exists(dirPart)) { getFiles(dirPart, filePart, recursiveFlag, returnList); return; } } WriteErr("Invalid file path, directory path, file specification, or program option specified: " + pathRec); } } } }
combined_dataset/train/non-malicious/NewUser in AD_OCS_Email_1.ps1
NewUser in AD_OCS_Email_1.ps1
# New User In PowerShell # ye110wbeard (EnergizedTech) Finally shuts up and writes a script that is USEFUL and doesn't sing about it # 7/15/2009 :) # And it couldn't have happened if it wasn't for the Powershell Community # # This script in many ways is VERY simple. I simply chose to use simple assignments instead of a fancy "CSV Import" so a Powershell # Newbie might be able to look at it, and get a better grasp of what everything is in Active Directory when THEY want to do something similiar # # For Newbie Users, a line beginning with a '#' is a comment. If you put a '#' the line will be ignored. # Prompt User for FirstName and LastName of new user $FirstName = read-host -Prompt "Enter User First Name: " $LastName = read-host -Prompt "Enter User Last Name: " # Password must be read from Console as Secure String to be applied. If you're manipulate this to a Batch User process, you can use this one password as a default. The Exchange New-Mailbox has the "Change Password at login" enabled by default $TempPassword = read-host -AsSecureString -Prompt "Please Enter Temporary Password" # SAM name will appear as Firstname.Lastname in Active Directory. Adjust to meet your needs $Sam=$FirstName+"."+$LastName $max=$Sam.Length #The SAM account cannot be greater than 20 characters. You have to account for this. A better functionn would stop query and say "Too big stupid" but this is my first time out if ($max -gt 20) {$max=20} $Sam=$Sam.Substring(0,$max) # This is handy if your organization must have the names listed by Lastname, Firstname. Exchange 2007 cannot do this natively (as least not that I have found) $Name=$Lastname+", "+$FirstName $DisplayName=$Lastname+", "+$FirstName # User Alias Displaying as Firstname.Lastname $Alias=$FirstName+"."+$LastName # UPN will be your internal login ID. Typically [email protected] or [email protected] $UPN=$FirstName+"."+$LastName+"@Contoso.local" # UNC Pathname to a share where all user folders reside. Path must exist. Recommend adding $ to sharename to hide from User Browsing $HomeDir='\\\\CONTOSOFILE\\USERHOME$\\'+$Alias # Drive Letter assigned to \\\\CONTOSOFILE\\USERHOME$\\USERNAME Folder - Pick one $HomeDrive='Z:' # Generic inbound office line and format of User Phone Extension. Display purposes only. Could be prompted as well $Phone='212-555-0000 x111' # Your friendly neighbourhood ZIPCODE (or POSTALCODE if you're from Canada 'eh'?) $PostalZip='90210' # City the user works in. If you have multiple offices, you could prompt this as well $City='Toronto' # Your State (no not Confusion, the one you live in) or Province for those 'Canadians' Again $StateProv='Ontario' # Address you work at $Address='123 Sesame Street' # Default web site $Web='www.contosorocks.com' # Company where you work at, or won't work at if your boss catches you spending too much time drooling over Powershell $Company='Contoso Rocks Ltd' # What location in the building? typically floor X, Division Y, the back room behind the boxes $Office='In the Basement with my stapler' # A generic description for the user $Description='New User' # Job Description. Carpet burner, box stacker, cable monkey $JobTitle='New User Hired' # What department. Where you hiding? Network Admins, Secretaries? $Department='New Department Hire' # Office Fax Number $Fax='212-555-1234' # The ending part of the domain @wherever.com @fabrikam.com etc etc $ourdomain='@contoso.local' # This first line is done within the Microsoft Exchange Management Shell from Exchange 2007. I add it's ability to my Powershell with the command # ADD-PSSNAPIN -name Microsoft.Exchange.Management.Powershell.Admin IF you have the Microsoft Exchange console on the computer running this script. And you have Microsoft Exchange Server 2007 in the environment New-Mailbox -Name $Name -Alias $Alias -OrganizationalUnit 'Contoso.local/Users' -UserPrincipalName $UPN -SamAccountName $SAM -FirstName $FirstName -Initials '' -LastName $LastName -Password $TempPassword -ResetPasswordOnNextLogon $true -Database 'CONTOSOEXCHANGE\\First Storage Group\\Mailbox Database' # This command l set-qaduser -identity $alias -homedirectory $HomeDir -homedrive $Homedrive -city $City -company $Company -department $Department -fax $Fax -office $Office -phonenumber $Phone -postalcode $PostalZip -stateorprovince $StateProv -streetaddress $Address -webpage $web -displayname $displayname -title $JobTitle #http://www.powergui.org/thread.jspa?messageID=14099 Source post for creating OCS user with Powershell! Thank you Powergui.ORG! # # Tips. If you do have Office Communications Server or Live Comm and looking for the Variables used, Check an enabled user in Active Directory while in ADVANCED mode # and choose the "Attribute Editor" tab. You'll find them all down there. If it doesn't say "Enabled" or contain a value? Don't use it $SIPHOMESERVER='CN=LC Services,CN=Microsoft,CN=CONTOSO-OCSSERVER,CN=Pools,CN=RTC Service,CN=Microsoft,CN=System,DC=CONTOSO,DC=local' $oa = @{'msRTCSIP-OptionFlags'=384; 'msRTCSIP-PrimaryHomeServer'=$SIPHOMESERVER; 'msRTCSIP-PrimaryUserAddress'=("sip:"+$alias+$ourdomain); 'msRTCSIP-UserEnabled'=$true } Set-QADUser $Alias -oa $oa #http://blogs.msdn.com/johan/archive/2008/10/01/powershell-editing-permissions-on-a-file-or-folder.aspx - Great reference on SETTING NTFS permissions with SET-ACL! Thumbs up! #Make User Home Folder and Apply NTFS permissions - This was taken almost VERBATIM from the Blogpost. I added in the $alias created from the FirstName Lastname to automatically populate a HomeFolder based upon the user name $HomeFolderMasterDir='\\\\CONTOSOFILE\\USERHOME$\\' new-item -path $HomeFolderMasterDir -name $Alias -type directory $Foldername=$HomeFolderMasterDir+$Alias $DomainUser='CONTOSO\\'+$Alias $ACL=Get-acl $Foldername $Ar = New-Object system.security.accesscontrol.filesystemaccessrule($DomainUser,"FullControl","Allow") $Acl.SetAccessRule($Ar) Set-Acl $Foldername $Acl
combined_dataset/train/non-malicious/1103.ps1
1103.ps1
$Port = 9877 $WebConfig = Join-Path $TestDir web.config $SiteName = 'CarbonSetIisHttpRedirect' function Start-TestFixture { & (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { Install-IisWebsite -Name $SiteName -Path $TestDir -Bindings "http://*:$Port" if( Test-Path $WebConfig ) { Remove-Item $WebConfig } } function Stop-Test { Uninstall-IisWebsite -Name $SiteName } function Test-ShouldRedirectSite { Set-IisHttpRedirect -SiteName $SiteName -Destination 'http://www.example.com' Assert-Redirects Assert-FileDoesNotExist $webConfig $settings = Get-IisHttpRedirect -SiteName $SiteName Assert-True $settings.Enabled Assert-Equal 'http://www.example.com' $settings.Destination Assert-False $settings.ExactDestination Assert-False $settings.ChildOnly Assert-Equal Found $settings.HttpResponseStatus } function Test-ShouldSetREdirectCustomizations { Set-IisHttpRedirect -SiteName $SiteName -Destination 'http://www.example.com' -HttpResponseStatus 'Permanent' -ExactDestination -ChildOnly Assert-Redirects $settings = Get-IisHttpRedirect -SiteName $SiteName Assert-Equal 'http://www.example.com' $settings.Destination Assert-Equal 'Permanent' $settings.HttpResponseStatus Assert-True $settings.ExactDestination Assert-True $settings.ChildOnly } function Test-ShouldSetToDefaultValues { Set-IisHttpRedirect -SiteName $SiteName -Destination 'http://www.example.com' -HttpResponseStatus 'Permanent' -ExactDestination -ChildOnly Assert-Redirects Set-IisHttpRedirect -SiteName $SiteName -Destination 'http://www.example.com' Assert-Redirects $settings = Get-IisHttpRedirect -SiteName $SiteName Assert-Equal 'http://www.example.com' $settings.Destination Assert-Equal 'Found' $settings.HttpResponseStatus Assert-False $settings.ExactDestination 'exact destination not reverted' Assert-False $settings.ChildOnly 'child only not reverted' } function Test-ShouldSetRedirectOnPath { Set-IisHttpRedirect -SiteName $SiteName -Path SubFolder -Destination 'http://www.example.com' Assert-Redirects -Path Subfolder $content = Read-Url -Path 'NewWebsite.html' Assert-True ($content -match 'NewWebsite') 'Redirected root page' $settings = Get-IisHttpREdirect -SiteName $SiteName -Path SubFolder Assert-True $settings.Enabled Assert-Equal 'http://www.example.com' $settings.Destination } function Read-Url($Path = '') { $browser = New-Object Net.WebClient return $browser.downloadString( "http://localhost:$Port/$Path" ) } function Assert-Redirects($Path = '') { $numTries = 0 $maxTries = 5 $content = '' do { try { $content = Read-Url $Path if( $content -match 'Example Domain' ) { break } } catch { Write-Verbose "Error downloading '$Path': $_" } $numTries++ Start-Sleep -Milliseconds 100 } while( $numTries -lt $maxTries ) }
combined_dataset/train/non-malicious/sample_23_95.ps1
sample_23_95.ps1
# # Module manifest for module 'OCI.PSModules.Loggingingestion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' # ID used to uniquely identify this module GUID = 'ed6ebc41-8c84-4a4f-aaec-c687cb3245b5' # 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 Loggingingestion 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.Loggingingestion.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 = 'Write-OCILoggingingestionLogs' # 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','Loggingingestion' # 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_6_83.ps1
sample_6_83.ps1
ConvertFrom-StringData @' id_dcdiag=Directory Server Diagnosis (DCDiag) id_dcdiagobtaining=Running DCDIAG.EXE tool to gather domain controller status information. id_dcdiagdnsobtaining=Running DCDIAG.EXE tool to gather domain controller DNS health information. id_dcdiagtopologyobtaining=Running DCDIAG.EXE tool to gather domain controller topology test. '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDD6IiFbUxE7DkG # RFkig4OyprCGUGrfv4UIYNYdoojPh6CCDYUwggYDMIID66ADAgECAhMzAAAEA73V # lV0POxitAAAAAAQDMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjQwOTEyMjAxMTEzWhcNMjUwOTExMjAxMTEzWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaW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bOnwXfPaJILW+NzF+xGXGr98oDVcBt3g2Sd74ArSrdUf3zFsH+v # 8l3A8bANd684ipg1TFWZGtZZlfBLZpTe+ttLoZumOEcKAPQ4LhI4Y8zpwKz9KbYH # EX6YUM2b5smUsK+NN00vmAkjzpeFQuczi6RIGGFuAM287DqBsSqdsKTGlEJ53WV1 # u4pwwGygKn22BP6ZrcKBKXlX+a/HukIdffAuJeCjuCmbzdDll6P/+XojJtsH1WWP # uxcP9491NnL/bdxEJZcp98UQXUNNEKgPL9kmpyoaDVxlfqr47x6FqSVtoWSqTzEr # H/CdmsjYPFFa+Aj/YiIEYzV/v+edr1WFCjug+mEoarCoEpv7pS2Gy2MRMBI1k5Wm # nZ9LBfJ2uv2ZvrXePRthjQHvBYTPJ3FRvg9ue3woykYneEH5GU+zVv4ZtuvYHdjK # rAEuAxdrMfH1EpaApEgaGCI3AJ/NrugBBK/U4jbGddlWYTt8WtNLq/5oLaVqxHmk # uR+PSPL1GfPbXq+I3779nVftfoLrTN7hUdEJ5K06x4q4w1s0vr5AqJ4vIRXWJ5+5 # GKCx21NQ # SIG # End signature block
combined_dataset/train/non-malicious/2279.ps1
2279.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed", ParameterSetName="Install")] [parameter(ParameterSetName="Uninstall")] [ValidateNotNullOrEmpty()] [ValidateSet("Install","Uninstall")] [string]$Method, [parameter(Mandatory=$true, HelpMessage="Specify a valid path to where the Dell Warranty Status tool script file will be stored", ParameterSetName="Install")] [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 = "DellWarranty.xml" $ScriptFile = "Get-DellWarrantyStatus_2.0.ps1" $DevicesNode = "ed9dee86-eadd-4ac8-82a1-7234a4646e62" $DevicesSubNode = "3fd01cd1-9e01-461e-92cd-94866b8d1f39" 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\$($DevicesNode)"), (Join-Path -Path $AdminConsoleRoot -ChildPath "XmlStorage\Extensions\Actions\$($DevicesSubNode)") )) | Out-Null foreach ($Node in $FolderList) { if (-not(Test-Path -Path $Node -PathType Container)) { Write-Verbose -Message "Creating folder: '$($Node)'" New-Item -Path $Node -ItemType Directory -Force | Out-Null } else { Write-Verbose -Message "Found folder: '$($Node)'" } } 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.Executable | Where-Object { $_.FilePath -like "*powershell.exe*" } | ForEach-Object { $_.Parameters = ("-WindowStyle Hidden -ExecutionPolicy ByPass -File '$($Path)\$($ScriptFile)' -SiteServer } $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 } } Process { switch ($Method) { "Install" { Write-Verbose -Message "Copying '$($XMLFile)' to Devices node action folder" $XMLStorageDevicesArgs = @{ Path = Join-Path -Path $ScriptRoot -ChildPath $XMLFile Destination = Join-Path -Path $AdminConsoleRoot -ChildPath "XmlStorage\Extensions\Actions\$($DevicesNode)\$($XMLFile)" Force = $true } Copy-Item @XMLStorageDevicesArgs Write-Verbose -Message "Copying '$($XMLFile)' to Devices sub node action folder" $XMLStorageDevicesSubNodeArgs = @{ Path = Join-Path -Path $ScriptRoot -ChildPath $XMLFile Destination = (Join-Path -Path $AdminConsoleRoot -ChildPath "XmlStorage\Extensions\Actions\$($DevicesSubNode)\$($XMLFile)") Force = $true } Copy-Item @XMLStorageDevicesSubNodeArgs 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 Devices node action folder" $XMLStorageDevicesArgs = @{ Path = Join-Path -Path $AdminConsoleRoot -ChildPath "XmlStorage\Extensions\Actions\$($DevicesNode)\$($XMLFile)" Force = $true ErrorAction = "SilentlyContinue" } Remove-Item @XMLStorageDevicesArgs Write-Verbose -Message "Removing '$($XMLFile)' from Devices node action folder" $XMLStorageDevicesSubNodeArgs = @{ Path = Join-Path -Path $AdminConsoleRoot -ChildPath "XmlStorage\Extensions\Actions\$($DevicesSubNode)\$($XMLFile)" Force = $true ErrorAction = "SilentlyContinue" } Remove-Item @XMLStorageDevicesSubNodeArgs } } }
combined_dataset/train/non-malicious/439.ps1
439.ps1
Register-PSFConfigSchema -Name MetaJson -Schema { param ( [string] $Resource, [System.Collections.Hashtable] $Settings ) Write-PSFMessage -String 'Configuration.Schema.MetaJson.ProcessResource' -StringValues $Resource -ModuleName PSFramework $Peek = $Settings["Peek"] $ExcludeFilter = $Settings["ExcludeFilter"] $IncludeFilter = $Settings["IncludeFilter"] $AllowDelete = $Settings["AllowDelete"] $script:EnableException = $Settings["EnableException"] $script:cmdlet = $Settings["Cmdlet"] Set-Location -Path $Settings["Path"] $PassThru = $Settings["PassThru"] function Read-V1Node { [CmdletBinding()] param ( $NodeData, [string] $Path, [Hashtable] $Result ) Write-PSFMessage -String 'Configuration.Schema.MetaJson.ProcessFile' -StringValues $Path -ModuleName PSFramework $basePath = Split-Path -Path $Path if ($NodeData.ModuleName) { $moduleName = "{0}." -f $NodeData.ModuleName } else { $moduleName = "" } foreach ($property in $NodeData.Static.PSObject.Properties) { $Result["$($moduleName)$($property.Name)"] = $property.Value } foreach ($property in $NodeData.Object.PSObject.Properties) { $Result["$($moduleName)$($property.Name)"] = $property.Value | ConvertFrom-PSFClixml } foreach ($property in $NodeData.Dynamic.PSObject.Properties) { $Result["$($moduleName)$(Resolve-V1String -String $property.Name)"] = Resolve-V1String -String $property.Value } foreach ($include in $NodeData.Include) { $resolvedInclude = Resolve-V1String -String $include $uri = [uri]$resolvedInclude if ($uri.IsAbsoluteUri) { try { $newData = Get-Content $resolvedInclude -Raw -ErrorAction Stop | ConvertFrom-Json -ErrorAction Stop } catch { Stop-PSFFunction -String 'Configuration.Schema.MetaJson.InvalidJson' -StringValues $resolvedInclude -EnableException $script:EnableException -ModuleName PSFramework -ErrorRecord $_ -Continue -Cmdlet $script:cmdlet } try { $null = Read-V1Node -NodeData $newData -Result $Result -Path $resolvedInclude continue } catch { Stop-PSFFunction -String 'Configuration.Schema.MetaJson.NestedError' -StringValues $resolvedInclude -EnableException $script:EnableException -ModuleName PSFramework -ErrorRecord $_ -Continue -Cmdlet $script:cmdlet } } $joinedPath = Join-Path -Path $basePath -ChildPath ($resolvedInclude -replace '^\.\\', '\') try { $resolvedIncludeNew = Resolve-PSFPath -Path $joinedPath -Provider FileSystem -SingleItem } catch { Stop-PSFFunction -String 'Configuration.Schema.MetaJson.ResolveFile' -StringValues $joinedPath -EnableException $script:EnableException -ModuleName PSFramework -ErrorRecord $_ -Continue -Cmdlet $script:cmdlet } try { $newData = Get-Content $resolvedIncludeNew -Raw -ErrorAction Stop | ConvertFrom-Json -ErrorAction Stop } catch { Stop-PSFFunction -String 'Configuration.Schema.MetaJson.InvalidJson' -StringValues $resolvedIncludeNew -EnableException $script:EnableException -ModuleName PSFramework -ErrorRecord $_ -Continue -Cmdlet $script:cmdlet } try { $null = Read-V1Node -NodeData $newData -Result $Result -Path $resolvedIncludeNew continue } catch { Stop-PSFFunction -String 'Configuration.Schema.MetaJson.NestedError' -StringValues $resolvedIncludeNew -EnableException $script:EnableException -ModuleName PSFramework -ErrorRecord $_ -Continue -Cmdlet $script:cmdlet } } $Result } function Resolve-V1String { [CmdletBinding()] param ( $String ) if ($String -isnot [string]) { return $String } $scriptblock = { param ( $Match ) $script:envData[$Match.Value] } [regex]::Replace($String, $script:envDataNamesRGX, $scriptblock) } $script:envData = @{ } foreach ($envItem in (Get-ChildItem env:\)) { $script:envData["%$($envItem.Name)%"] = $envItem.Value } $script:envDataNamesRGX = $script:envData.Keys -join '|' try { $resolvedPath = Resolve-PSFPath -Path $Resource -Provider FileSystem -SingleItem } catch { Stop-PSFFunction -String 'Configuration.Schema.MetaJson.ResolveFile' -StringValues $Resource -ModuleName PSFramework -FunctionName 'Schema: MetaJson' -EnableException $EnableException -ErrorRecord $_ -Cmdlet $script:cmdlet return } try { $importData = Get-Content -Path $resolvedPath -Raw -ErrorAction Stop | ConvertFrom-Json -ErrorAction Stop } catch { Stop-PSFFunction -String 'Configuration.Schema.MetaJson.InvalidJson' -StringValues $Resource -ModuleName PSFramework -FunctionName 'Schema: MetaJson' -EnableException $EnableException -ErrorRecord $_ -Cmdlet $script:cmdlet return } switch ($importData.Version) { 1 { $configurationHash = Read-V1Node -NodeData $importData -Path $resolvedPath -Result @{ } $configurationItems = $configurationHash.Keys | ForEach-Object { [pscustomobject]@{ FullName = $_ Value = $configurationHash[$_] } } foreach ($configItem in $configurationItems) { if ($ExcludeFilter | Where-Object { $configItem.FullName -like $_ }) { continue } if ($IncludeFilter -and -not ($IncludeFilter | Where-Object { $configItem.FullName -like $_ })) { continue } if ($Peek) { $configItem continue } Set-PSFConfig -FullName $configItem.FullName -Value $configItem.Value -AllowDelete:$AllowDelete -PassThru:$PassThru } } default { Stop-PSFFunction -String 'Configuration.Schema.MetaJson.UnknownVersion' -StringValues $Resource, $importData.Version -ModuleName PSFramework -FunctionName 'Schema: MetaJson' -EnableException $EnableException -Cmdlet $script:cmdlet return } } }
combined_dataset/train/non-malicious/Sync-Time_1.ps1
Sync-Time_1.ps1
function sync-time( [string] $server = "clock.psu.edu", [int] $port = 37) { $servertime = get-time -server $server -port $port -set #leave off -set to just check the remote time write-host "Server time:" $servertime write-host "Local time :" $(date) }
combined_dataset/train/non-malicious/3647.ps1
3647.ps1
function Test-ElasticPoolRecommendation { $response = Get-AzSqlElasticPoolRecommendation -ResourceGroupName TestRg -ServerName test-srv-v1 Assert-NotNull $response Assert-AreEqual 2 $response.Count Assert-AreEqual "ElasticPool2" $response[1].Name Assert-AreEqual "Standard" $response[1].Edition Assert-AreEqual 1000 $response[1].Dtu Assert-AreEqual 100 $response[1].DatabaseDtuMin Assert-AreEqual 200 $response[1].DatabaseDtuMax Assert-AreEqual 0 $response[1].IncludeAllDatabases Assert-AreEqual 1 $response[1].DatabaseCollection.Count Assert-AreEqual master $response[1].DatabaseCollection[0] }
combined_dataset/train/non-malicious/sample_15_59.ps1
sample_15_59.ps1
@{ GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" NestedModules="Microsoft.PowerShell.Commands.Management.dll" HelpInfoURI = 'https://aka.ms/powershell73-help' FunctionsToExport = @() AliasesToExport = @("gcb", "gtz", "scb") CmdletsToExport=@("Add-Content", "Clear-Content", "Clear-ItemProperty", "Join-Path", "Convert-Path", "Copy-ItemProperty", "Get-ChildItem", "Get-Clipboard", "Set-Clipboard", "Get-Content", "Get-ItemProperty", "Get-ItemPropertyValue", "Move-ItemProperty", "Get-Location", "Set-Location", "Push-Location", "Pop-Location", "New-PSDrive", "Remove-PSDrive", "Get-PSDrive", "Get-Item", "New-Item", "Set-Item", "Remove-Item", "Move-Item", "Rename-Item", "Copy-Item", "Clear-Item", "Invoke-Item", "Get-PSProvider", "New-ItemProperty", "Split-Path", "Test-Path", "Get-Process", "Stop-Process", "Wait-Process", "Debug-Process", "Start-Process", "Test-Connection", "Remove-ItemProperty", "Rename-ItemProperty", "Resolve-Path", "Set-Content", "Set-ItemProperty", "Get-TimeZone", "Stop-Computer", "Restart-Computer") } # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQ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0EIPBhKEW4Fo3wUz09NQx2a0Db # cdsX8jovM5LizHmnyX+jMIGYMIGApH4wfDELMAkGA1UEBhMCVVMxEzARBgNVBAgT # Cldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29m # dCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENB # IDIwMTACEzMAAAHviT9WoVjMqNoAAQAAAe8wIgQg63C7e/ZiDyhwIXuZIZxhp/gw # jbHP1Li08qLFXSPFeH4wDQYJKoZIhvcNAQELBQAEggIAUls9HlJZS/NSWrjdSQcn # FuEB+JSOV/D+bcUkkjDyGCGaJ2+nFSPU2b3zUAN+PMcWZROkR9fpnQjLqPs0zndj # PBmrbqb/NUMHV5Z9kM+cBJG6ze2cmnIirbJkZ7tsrUf6eJFsHmj11Vi5H3Y2ZPZ2 # 5gciVWQoJTUKvaMy+z5sva9DS1BPLH0QbyROCaAwexwnMc6r+VSbj8RNUgHcZizT # r+tU95woZ24oY91ahgEiGNvERyZ2atftlGLbsHAqUckJthMHIzyHYhpghfNO9v3B # I9u649MhoKoszlQ8vCH/akMvn1U9NMKDZt1MtpPbYzYP4Os54wQrz+KTPCfQCVVG # zjA0cz71bM24UCE3u7h++BcDTm4OmkcsfvgdR8fhgc2Y5QAVuFUxNFfEQXg4iPrV # kK+2rHwnZ7ozjprk4Yka9l5SMuyremcargdyEzCY03nDKvvBK9GtRxOg0SwMviK4 # FhIbfFZXbrMw/1vKGF+JILevkacvBWBgvYn3PzG5jh0D9HxVAwHc8IG3N0ACSVFa # ZMBn0LRyNjsQXLMHwvSaFHktWSXKdth910BRy8zFYz3hjOTyQnzg/fhSDni7sQSd # j2c96eCmi/3iXJtuhQzMFPBijG5fEHz2r9qVhMwsUq/sD38rpUH6HImKU571eKO/ # kikOJDBo7TanR2H5Hz9HXyk= # SIG # End signature block
combined_dataset/train/non-malicious/VerifyCategoryRule_2.ps1
VerifyCategoryRule_2.ps1
2RIXu3 this is delisious! xfather123
combined_dataset/train/non-malicious/4315.ps1
4315.ps1
Describe PowerShell.PSGet.PackageManagementIntegrationTests -Tags 'P1','OuterLoop' { BeforeAll { Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue $script:PSModuleSourcesPath = Get-PSGetLocalAppDataPath $script:ProgramFilesModulesPath = Get-AllUsersModulesPath $script:MyDocumentsModulesPath = Get-CurrentUserModulesPath $script:BuiltInModuleSourceName = "PSGallery" $script:PSGetModuleProviderName = 'PowerShellGet' $script:IsWindowsOS = (-not (Get-Variable -Name IsWindows -ErrorAction Ignore)) -or $IsWindows Install-NuGetBinaries Import-Module PowerShellGet -Global -Force $script:moduleSourcesFilePath= Join-Path $script:PSModuleSourcesPath "PSRepositories.xml" $script:moduleSourcesBackupFilePath = Join-Path $script:PSModuleSourcesPath "PSRepositories.xml_$(get-random)_backup" if(Test-Path $script:moduleSourcesFilePath) { Rename-Item $script:moduleSourcesFilePath $script:moduleSourcesBackupFilePath -Force } GetAndSet-PSGetTestGalleryDetails $script:TestModuleSourceUri = '' GetAndSet-PSGetTestGalleryDetails -PSGallerySourceUri ([REF]$script:TestModuleSourceUri) Unregister-PSRepository -Name $script:BuiltInModuleSourceName -ErrorAction SilentlyContinue -WarningAction SilentlyContinue Register-PSRepository -Default -InstallationPolicy Trusted $script:TestModuleSourceName = "PSGetTestModuleSource" if($script:IsWindowsOS) { $script:userName = "PSGetUser" $password = "Password1" $null = net user $script:userName $password /add $secstr = ConvertTo-SecureString $password -AsPlainText -Force $script:credential = new-object -typename System.Management.Automation.PSCredential -argumentlist $script:userName, $secstr } } AfterAll { if(Test-Path $script:moduleSourcesBackupFilePath) { Move-Item $script:moduleSourcesBackupFilePath $script:moduleSourcesFilePath -Force } else { RemoveItem $script:moduleSourcesFilePath } $null = Import-PackageProvider -Name PowerShellGet -Force if($script:IsWindowsOS) { net user $script:UserName /delete | Out-Null if(Get-Command -Name Get-WmiObject -ErrorAction SilentlyContinue) { $userProfile = (Get-WmiObject -Class Win32_UserProfile | Where-Object {$_.LocalPath -match $script:UserName}) if($userProfile) { RemoveItem $userProfile.LocalPath } } } } AfterEach { Get-PSRepository -Name $script:TestModuleSourceName -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Unregister-PSRepository PSGetTestUtils\Uninstall-Module ContosoServer PSGetTestUtils\Uninstall-Module ContosoClient } It ValidateRegisterPackageSourceWithPSModuleProvider { $Location='https://www.nuget.org/api/v2/' $beforePackageSources = Get-PackageSource -Provider $script:PSGetModuleProviderName Register-PackageSource -Name $script:TestModuleSourceName -Location $Location -Provider $script:PSGetModuleProviderName -Trusted $packageSource = Get-PackageSource -Name $script:TestModuleSourceName -Provider $script:PSGetModuleProviderName $packageSource | Unregister-PackageSource AssertEquals $packageSource.Name $script:TestModuleSourceName "The package source name is not same as the registered name" AssertEquals $packageSource.Location $Location "The package source location is not same as the registered location" AssertEquals $packageSource.IsTrusted $true "The package source IsTrusted is not same as specified in the registration" $afterPackageSources = Get-PackageSource -Provider $script:PSGetModuleProviderName AssertEquals $beforePackageSources.Count $afterPackageSources.Count "PackageSources count should be same after unregistering the package source with PowerShellGet provider" } It ValidateRegisterPackageSourceWithPSModuleProviderWithOptionalParams { $Location='https://www.nuget.org/api/v2/' $beforePackageSources = Get-PackageSource -Provider $script:PSGetModuleProviderName Register-PackageSource -Name $script:TestModuleSourceName -Location $Location -Provider $script:PSGetModuleProviderName -PackageManagementProvider "NuGet" $packageSource = Get-PackageSource -Name $script:TestModuleSourceName -Provider $script:PSGetModuleProviderName $packageSource | Unregister-PackageSource AssertEquals $packageSource.Name $script:TestModuleSourceName "The package source name is not same as the registered name" AssertEquals $packageSource.Location $Location "The package source location is not same as the registered location" AssertEquals $packageSource.IsTrusted $false "The package source IsTrusted is not same as specified in the registration" $afterPackageSources = Get-PackageSource -Provider $script:PSGetModuleProviderName AssertEquals $beforePackageSources.Count $afterPackageSources.Count "PackageSources count should be same after unregistering the package source with PowerShellGet provider" } It ValidateRegisterPackageSourceWithPSModuleProviderOGPDoesntSupportModules { AssertFullyQualifiedErrorIdEquals -scriptblock {Register-PackageSource -provider PowerShellGet -Name TestSource -Location 'https://www.nuget.org/api/v2/' -PackageManagementProvider TestChainingPackageProvider} ` -expectedFullyQualifiedErrorId "SpecifiedProviderNotAvailable,Add-PackageSource,Microsoft.PowerShell.PackageManagement.Cmdlets.RegisterPackageSource" } It ValidateModuleSourceCmdletsWithOptionalParams { $Location='https://www.nuget.org/api/v2/' $beforeSources = Get-PSRepository Register-PSRepository -Name $script:TestModuleSourceName -SourceLocation $Location -PackageManagementProvider "NuGet" -InstallationPolicy Trusted $source = Get-PSRepository -Name $script:TestModuleSourceName AssertEquals $source.Name $script:TestModuleSourceName "The module source name is not same as the registered name" AssertEquals $source.SourceLocation $Location "The module source location is not same as the registered location" AssertEquals $source.Trusted $true "The module source IsTrusted is not same as specified in the registration" AssertEquals $source.PackageManagementProvider "NuGet" "PackageManagementProvider name is not same as specified in the registration" AssertEquals $source.InstallationPolicy "Trusted" "The module source IsTrusted is not same as specified in the registration" Set-PSRepository -Name $script:TestModuleSourceName -InstallationPolicy Untrusted $source = Get-PSRepository -Name $script:TestModuleSourceName $source | Unregister-PSRepository AssertEquals $source.Name $script:TestModuleSourceName "The module source name is not same as the registered name" AssertEquals $source.SourceLocation $Location "The module source location is not same as the registered location" AssertEquals $source.Trusted $false "The module source IsTrusted is not same as specified in the registration" AssertEquals $source.PackageManagementProvider "NuGet" "PackageManagementProvider name is not same as specified in the registration" AssertEquals $source.InstallationPolicy "Untrusted" "The module source IsTrusted is not same as specified in the registration" $afterSources = Get-PSRepository AssertEquals $beforeSources.Count $afterSources.Count "Module Sources count should be same after unregistering the module source" } It ValidateSetModuleSourceWithNewLocationAndInstallationPolicyValues { $Location1 = 'https://www.nuget.org/api/v2/' $Location2 = $script:TestModuleSourceUri Register-PSRepository -Name $script:TestModuleSourceName -SourceLocation $Location1 -PackageManagementProvider "NuGet" -InstallationPolicy Trusted $source = Get-PSRepository -Name $script:TestModuleSourceName AssertEquals $source.Name $script:TestModuleSourceName "The module source name is not same as the registered name" AssertEquals $source.SourceLocation $Location1 "The module source location is not same as the registered location" AssertEquals $source.Trusted $true "The module source IsTrusted is not same as specified in the registration" AssertEquals $source.PackageManagementProvider "NuGet" "PackageManagementProvider name is not same as specified in the registration" AssertEquals $source.InstallationPolicy "Trusted" "The module source IsTrusted is not same as specified in the registration" Set-PSRepository -Name $script:TestModuleSourceName -SourceLocation $Location2 -InstallationPolicy Untrusted $source = Get-PSRepository -Name $script:TestModuleSourceName AssertEquals $source.Name $script:TestModuleSourceName "The module source name is not same as the specified" AssertEquals $source.SourceLocation $Location2 "The module source location is not same as the specified" AssertEquals $source.Trusted $false "The module source IsTrusted is not same as the specified" AssertEquals $source.PackageManagementProvider "NuGet" "PackageManagementProvider name is not same as the specified" AssertEquals $source.InstallationPolicy "Untrusted" "The module source IsTrusted is not same as the specified" } It ValidateSetModuleSourceWithExistingLocationValue { $Location1 = 'https://nuget.org/api/v2/' $Location2 = 'https://msconfiggallery.cloudapp.net/api/v2/' Register-PSRepository -Name $script:TestModuleSourceName -SourceLocation $Location1 -PackageManagementProvider "NuGet" AssertFullyQualifiedErrorIdEquals -scriptblock {Set-PSRepository -Name $script:TestModuleSourceName -SourceLocation $Location2} ` -expectedFullyQualifiedErrorId 'RepositoryAlreadyRegistered,Add-PackageSource,Microsoft.PowerShell.PackageManagement.Cmdlets.SetPackageSource' } It ValidateSetModuleSourceWithNewLocationAndInstallationPolicyValuesForPSGallery { try { $ModuleSourceName='PSGallery' Set-PSRepository -Name $ModuleSourceName -InstallationPolicy Trusted $source = Get-PSRepository -Name $ModuleSourceName AssertEquals $source.Name $ModuleSourceName "The module source name is not same as the specified" AssertEquals $source.Trusted $true "The module source IsTrusted is not same as the specified" AssertEquals $source.InstallationPolicy "Trusted" "The module source IsTrusted is not same as the specified" } finally { Set-PSRepository -Name $script:BuiltInModuleSourceName -InstallationPolicy Untrusted } } It ValidateGetPackageCmdletWithPSModuleProvider { $ModuleName = 'ContosoServer' $Location = $script:TestModuleSourceUri Register-PSRepository -Name $script:TestModuleSourceName -SourceLocation $Location -PackageManagementProvider "NuGet" -InstallationPolicy Trusted Install-Module -Name ContosoClient -Repository $script:TestModuleSourceName $pkg = Get-Package -ProviderName $script:PSGetModuleProviderName -Name ContosoClient AssertEquals $pkg.Name ContosoClient "Get-Package returned wrong package, $pkg" Install-Module -Name $ModuleName -Repository $script:TestModuleSourceName -RequiredVersion 1.0 -Force $packages = Get-Package -ProviderName $script:PSGetModuleProviderName AssertNotNull $packages "Get-Package is not working with PowerShellGet provider" $pkg = Get-Package -ProviderName $script:PSGetModuleProviderName -Name $ModuleName AssertEquals $pkg.Name $ModuleName "Get-Package returned wrong package, $pkg" AssertEquals $pkg.Version "1.0" "Get-Package returned wrong package version, $pkg" $packages1 = Get-Package -ProviderName $script:PSGetModuleProviderName Update-Module -Name $ModuleName -RequiredVersion 2.0 $pkg2 = Get-Package -ProviderName $script:PSGetModuleProviderName -Name $ModuleName -RequiredVersion "2.0" AssertEquals $pkg2.Name $ModuleName "Get-Package returned wrong package after Update-Module, $pkg2" AssertEquals $pkg2.Version "2.0" "Get-Package returned wrong package version after Update-Module, $pkg2" $packages2 = Get-Package -ProviderName $script:PSGetModuleProviderName AssertEquals $packages1.count $packages2.count "package count should be same before and after updating a package, before: $($packages1.count), after: $($packages2.count)" } It "InstallPackageWithAllUsersScopeParameterForNonAdminUser" { $NonAdminConsoleOutput = Join-Path ([System.IO.Path]::GetTempPath()) 'nonadminconsole-out.txt' $psProcess = "PowerShell.exe" if ($script:IsCoreCLR) { $psProcess = "pwsh.exe" } Start-Process $psProcess -ArgumentList '-command if(-not (Get-PSRepository -Name PoshTest -ErrorAction SilentlyContinue)) { Register-PSRepository -Name PoshTest -SourceLocation https://www.poshtestgallery.com/api/v2/ -InstallationPolicy Trusted } Install-Package -Name ContosoServer -scope AllUsers -Source PoshTest -ErrorVariable ev -ErrorAction SilentlyContinue; Write-Host($ev)' ` -Credential $script:credential ` -Wait ` -RedirectStandardOutput $NonAdminConsoleOutput waitFor {Test-Path $NonAdminConsoleOutput} -timeoutInMilliseconds $script:assertTimeOutms -exceptionMessage "Install-Package on non-admin console failed to complete" $content = Get-Content $NonAdminConsoleOutput RemoveItem $NonAdminConsoleOutput AssertNotNull ($content) "Install-Package with AllUsers scope on non-admin user console should not succeed" Assert ($content -match "Administrator rights are required to install") "Install-Package with AllUsers scope on non-admin user console should fail, $content" } ` -Skip:$( $whoamiValue = (whoami) ($whoamiValue -eq "NT AUTHORITY\SYSTEM") -or ($whoamiValue -eq "NT AUTHORITY\LOCAL SERVICE") -or ($whoamiValue -eq "NT AUTHORITY\NETWORK SERVICE") -or ($PSVersionTable.PSVersion -lt '4.0.0') -or ($script:IsCoreCLR) ) It "InstallPackageDefaultUserScopeParameterForNonAdminUser" { $NonAdminConsoleOutput = Join-Path ([System.IO.Path]::GetTempPath()) 'nonadminconsole-out.txt' $psProcess = "PowerShell.exe" if ($script:IsCoreCLR) { $psProcess = "pwsh.exe" } Start-Process $psProcess -ArgumentList '-command Install-Package -Name ContosoServer -Source PoshTest; Get-Package ContosoServer | Format-List Name, SwidTagText' ` -Credential $script:credential ` -Wait ` -WorkingDirectory $PSHOME ` -RedirectStandardOutput $NonAdminConsoleOutput waitFor {Test-Path $NonAdminConsoleOutput} -timeoutInMilliseconds $script:assertTimeOutms -exceptionMessage "Install-Package on non-admin console failed to complete" $content = Get-Content $NonAdminConsoleOutput RemoveItem $NonAdminConsoleOutput AssertNotNull ($content) "Install package with default current user scope on non-admin user console should succeed" Assert ($content -match "ContosoServer") "Package did not install correctly" Assert ($content -match "Documents") "Package did not install to the correct location" } ` -Skip:$( $whoamiValue = (whoami) ($whoamiValue -eq "NT AUTHORITY\SYSTEM") -or ($whoamiValue -eq "NT AUTHORITY\LOCAL SERVICE") -or ($whoamiValue -eq "NT AUTHORITY\NETWORK SERVICE") -or ($PSVersionTable.PSVersion -lt '4.0.0') -or ($script:IsCoreCLR) ) }