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...
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 = $hashA...
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...
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[]]...
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 = ...
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 ...
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' # Sup...
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.Wind...
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 Comp...
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" F...
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 Dist...
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.Open...
combined_dataset/train/non-malicious/3626.ps1
3626.ps1
function Test-BasicDataClassificationOnSqlManagedDatabase { $testSuffix = getAssetName Create-ManagedDataClassificationTestEnvironment $testSuffix $params = Get-DataClassificationManagedTestEnvironmentParameters $testSuffix try { $recommendations = Get-AzSqlInstanceDatabaseSensitivityRecomme...
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 ...
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) = "Desc...
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 Comp...
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_FCC...
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 ## ...
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 PSE...
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...
combined_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 -Zo...
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] ...
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 incl...
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"} | Conne...
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 ...
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 "Vm...
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-Antimal...
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' # Sup...
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] ...
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-Verifiabl...
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' # S...
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="Remove...
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) { $s...
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, [...
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 Compatible...
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.Minor...
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 $oG...
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(Manda...
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...
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-StringDa...
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 ...
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...
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 Comp...
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 Licen...
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 # KX7zUQIBAA...
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+...
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> # --...
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...
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...
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...
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 # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI...
combined_dataset/train/non-malicious/1649.ps1
1649.ps1
|: | |: | $a = "<style>"...
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 ` ...
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(Param...
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...
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 su...
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) {Ne...
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 = ...
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 # director...
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 = @(...
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...
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 Co...
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 # KX7zUQIBAAIBAAIB...
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 # ...
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 # -Confi...
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-Mod...
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 cmd...
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 Comp...
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 Compat...
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.26...
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 ...
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(Manda...
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...
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 = Conf...
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 i...
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' } '.p...
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) { W...
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-...
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 log...
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} EncryptedPackageFoun...
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, D...
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')] pa...
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 PSEditi...
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...
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 $Na...
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 $resour...
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 : I...
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 i...
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"...
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...
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 g...
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, [...
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["Ex...
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[...
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...
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 = Ge...