full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/1242.ps1
1242.ps1
[CmdletBinding()] param( [Parameter(Mandatory=$true,Position=0)] [string] $Name, [Parameter(Mandatory=$true,Position=1)] [string] $Value ) Set-StrictMode -Version 'Latest' $Name = [Text.Encoding]::Unicode.GetString( [Convert]::FromBase64String($Name) ) $Value = [Text.Encoding]::U...
combined_dataset/train/non-malicious/sample_54_73.ps1
sample_54_73.ps1
# # Module manifest for module 'OCI.PSModules.Waf' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Waf.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/sample_33_35.ps1
sample_33_35.ps1
ConvertFrom-StringData @' ###PSLOC DnsFail = DNS resolution failed on {0}. Stopping tests. Dns output: \r\n{1} DnsDowngrade = Downgrading DNS resolution test on {0} from critical to warning, because user specified a proxy. PsSessionFail = Skipping. Unable to reconnect Ps Session ({0}). Error: {1} DiagnosticSystemF...
combined_dataset/train/non-malicious/sample_13_10.ps1
sample_13_10.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\tailwindcss@3.4.1\node_modules\tailwindcss\lib\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\t...
combined_dataset/train/non-malicious/NumLock Notifier.ps1
NumLock Notifier.ps1
<# .NOTES Name : NumLockNotifier.ps1 Author : Bryan Jaudon <bryan.jaudon@gmail.com> Version : 1.0 Date : 10/25/2012 .Description Adds a notification icon to show current NumLock status. Double clicking or by using the context menu, allows for toggling of the NumLo...
combined_dataset/train/non-malicious/3561.ps1
3561.ps1
function Test-NewA2ADiskReplicationConfiguration { $recoveryStorageAccountId ="/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/resourceGroups/a2a-rg/providers/Microsoft.Storage/storageAccounts/a2argdisks412" $logStorageAccountId = "/subscriptions/7c943c1b-5122-4097-90c8-861411bdd574/res...
combined_dataset/train/non-malicious/sample_2_90.ps1
sample_2_90.ps1
ConvertFrom-StringData @' id_sbsl_dhcprelaykb2459530_sd=This machine may experience a three to five second delay in obtaining an IP address through Dynamic Host Configuration Protocol (DHCP) at restart due missing hotfix 2459530. '@ # SIG # Begin signature block # MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZ...
combined_dataset/train/non-malicious/Get-CrawlHealth (MOSS)_1.ps1
Get-CrawlHealth (MOSS)_1.ps1
[reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint") | out-null [reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server") | out-null [reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server.Search") | out-null @@#NOTE: I've set strict crawl freshness/crawl duration/success rati...
combined_dataset/train/non-malicious/sample_55_38.ps1
sample_55_38.ps1
######################################################################################### # # Copyright (c) Microsoft Corporation. All rights reserved. # # Localized PackageManagement.Resources.psd1 # ######################################################################################### ConvertFrom-StringDa...
combined_dataset/train/non-malicious/sample_62_13.ps1
sample_62_13.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_19_45.ps1
sample_19_45.ps1
# # Module manifest for module 'OCI.PSModules.Keymanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Keymanagement.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/4180.ps1
4180.ps1
[CmdletBinding()] param ( [boolean]$ListFeatures = $false, [string]$Feature, [ValidateSet('enable', 'disable')][string]$Setting, [String]$FeaturesFile ) function Confirm-Feature { [CmdletBinding()][OutputType([boolean])] param ( [ValidateNotNull()][string]$FeatureName, [ValidateSet('Enable', 'Disa...
combined_dataset/train/non-malicious/2138.ps1
2138.ps1
Describe 'Argument transformation attribute on optional argument with explicit $null' -Tags "CI" { $tdefinition = @' using System; using System.Management.Automation; using System.Reflection; namespace MSFT_1407291 { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field,...
combined_dataset/train/non-malicious/sample_5_39.ps1
sample_5_39.ps1
# 2023-02-24 WalterE mod Trap #we# $startTime_AutoAdd = Get-Date trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" } Write-Host -Background...
combined_dataset/train/non-malicious/sample_34_92.ps1
sample_34_92.ps1
@{ GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" CmdletsToExport = @( 'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al...
combined_dataset/train/non-malicious/3536.ps1
3536.ps1
$location = "southeastasia" $resourceGroupName = "pstestFSRG1bca8f8e" $vaultName = "PSTestFSRSV1bca8f8e" $fileShareFriendlyName = "pstestfs1bca8f8e" $fileShareName = "AzureFileShare;pstestfs1bca8f8e" $saName = "pstestsa1bca8f8e" $skuName="Standard_LRS" $policyName = "AFSBackupPolicy" ...
combined_dataset/train/non-malicious/sample_7_56.ps1
sample_7_56.ps1
#************************************************ # TS_ClusterXsigoDriverNetworkCheck.ps1 # Version 1.0.1 # Date: 6/5/2012 # Author: v-kaw # Description: [Idea ID 2169] [Windows] Xsigo network host driver can cause Cluster disconnects # Rule number: 2169 # Rule URL: http://sharepoint/sites/rules/Rule Submissi...
combined_dataset/train/non-malicious/sample_30_44.ps1
sample_30_44.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/ping check using dotNet .ps1
ping check using dotNet .ps1
function check-ping { $erroractionpreference = "SilentlyContinue" $ping = new-object System.Net.NetworkInformation.Ping $rslt = $ping.send($args) if ($rslt.status.tostring() –eq “Success”) { write-host $args + “ ping worked” } else { write-host $args + “ ping failed” } $ping = $null }
combined_dataset/train/non-malicious/4469.ps1
4469.ps1
$script:helperModuleName = 'PowerShellGet.LocalizationHelper' Describe "$script:helperModuleName Unit Tests" { BeforeAll { $resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent $dscResourcesFolderFilePath = Join-Path -Path (Join-Path -Path $resourceModuleRoot -C...
combined_dataset/train/non-malicious/sample_18_92.ps1
sample_18_92.ps1
ConvertFrom-StringData @' id_sccm_checkservicestatus=Checking Status of Services id_sccm_checkservicestatusdesc=Checking the status of '@ # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQI...
combined_dataset/train/non-malicious/sample_55_48.ps1
sample_55_48.ps1
# # Module manifest for module 'OCI.PSModules.Certificatesmanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Certificatesmanagement.dll' # Version number of this module. ModuleVersion = '84.0.0' ...
combined_dataset/train/non-malicious/sample_39_53.ps1
sample_39_53.ps1
########################################################### # # 'ServiceHelper' module # ########################################################### $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest $global:GCServiceName = "GCService" $script:GCServiceBinaryName = "gc_service.exe" $script:GC...
combined_dataset/train/non-malicious/sample_54_5.ps1
sample_54_5.ps1
# # Module manifest for module 'OCI.PSModules.Email' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Email.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_48_73.ps1
sample_48_73.ps1
# # Module manifest for module 'OCI.PSModules.Opensearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opensearch.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/3016.ps1
3016.ps1
Set-StrictMode -Version Latest Describe 'Testing Context' { It "Context throws a missing name error" { { Context { it "runs a test" { } } }| should -Throw 'Test fixture name has multiple lines and no test fixture is provided. (Have you provided a name f...
combined_dataset/train/non-malicious/Import-Iis-Log_1.ps1
Import-Iis-Log_1.ps1
param ( [Parameter( Mandatory=$true, Position = 0, ValueFromPipeline=$true, HelpMessage="Specifies the path to the IIS *.log file to import. You can also pipe a path to Import-Iss-Log." )] [ValidateNotNullOrEmpty()] [string] $Path, [Parameter( Position = 1, HelpMessage="Specifies the d...
combined_dataset/train/non-malicious/sample_31_57.ps1
sample_31_57.ps1
# # Script module for module 'Az.ConfidentialLedger' that is executed when 'Az.ConfidentialLedger' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 04/23/2024 13:01:40 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { ...
combined_dataset/train/non-malicious/sample_66_37.ps1
sample_66_37.ps1
# # Module manifest for module 'Az.SqlVirtualMachine' # # Generated by: Microsoft Corporation # # Generated on: 7/4/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.SqlVirtualMachine.psm1' # Version number of this module. ModuleVersion = '2.3.0' # Suppo...
combined_dataset/train/non-malicious/LoadModuleConfig_3.ps1
LoadModuleConfig_3.ps1
################################################################################ ## Script Name: LoadModuleConfig ## Created On: 01/21/2010 ## Author: Thell Fowler ## File: LoadModuleConfig.ps1 ## Usage: Called from the NestedModules value from a module manifest. ## Version:...
combined_dataset/train/non-malicious/sample_65_59.ps1
sample_65_59.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_27.ps1
sample_8_27.ps1
# 2023-02-20 WalterE mod Trap #we# trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" } Import-LocalizedData -BindingVariable ScriptStrings ...
combined_dataset/train/non-malicious/SMS.psm1.ps1
SMS.psm1.ps1
# SystemsManagementServer.psm1 # written by Tojo2000 <tojo2000@tojo2000.com> # Last updated on 20080921 # # Functions for getting data from MS Systems Management Server. # Set default server and site name here. It should be the server with the SMS # Provider, not necessarily the site server. [string]$def...
combined_dataset/train/non-malicious/sample_10_32.ps1
sample_10_32.ps1
# # Module manifest for module 'OCI.PSModules.Redis' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Redis.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_66_8.ps1
sample_66_8.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 = '86.2.0' # S...
combined_dataset/train/non-malicious/Get-Parameter 1.2.ps1
Get-Parameter 1.2.ps1
function Get-Parameter { [OutputType('System.String')] [CmdletBinding()] param( [Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)] [ValidateNotNullOrEmpty()] [String]$Command, [Parameter(Position=1)] [String[]]$Name=@('*'), [Parameter()] [Validate...
combined_dataset/train/non-malicious/3281.ps1
3281.ps1
class TeamsConnectionConfig : ConnectionConfig { [string]$BotName [string]$TeamId [string]$ServiceBusNamespace [string]$QueueName [string]$AccessKeyName [securestring]$AccessKey }
combined_dataset/train/non-malicious/ESXiMgmt module sample 2.ps1
ESXiMgmt module sample 2.ps1
####################################################################################################################### # File: ESXiMgmt_machines_poweron_sample.ps1 # # Author: Alexander Petrovskiy ...
combined_dataset/train/non-malicious/sample_63_94.ps1
sample_63_94.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_14_32.ps1
sample_14_32.ps1
ConvertFrom-StringData @' IPAddressDisplayNameFormat=Adres IP: {0} NetworkNameDisplayNameFormat=Nazwa: {0} NetworkNameOfflineDisplayNameFormat=Adres IP: adres w sieci „{0}” CreateClusterProgressValidationStart=Weryfikowanie możliwości użycia serwerów w klastrze trybu failover. CreateClusterProgressValidationEnd=Za...
combined_dataset/train/non-malicious/sample_13_44.ps1
sample_13_44.ps1
# # Module manifest for module 'OCI.PSModules.Opensearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opensearch.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_8_46.ps1
sample_8_46.ps1
if (Test-Path "HKLM:\System\CurrentControlSet\Services\MSiSCSI") { $MSiSCSIService = Get-Service "MSiSCSI" if ($MSiSCSIService.Status.value__ -eq 4) { Import-LocalizedData -BindingVariable ISCSIInfoStrings Write-DiagProgress -Activity $ISCSIInfoStrings.ID_ISCSIInfo -Status $ISCSIInfoStrings.ID_...
combined_dataset/train/non-malicious/3324.ps1
3324.ps1
function Get-ScheduledCommand { [PoshBot.BotCommand( Aliases = ('getschedule', 'get-schedule'), Permissions = 'manage-schedules' )] [cmdletbinding()] param( [parameter(Mandatory)] $Bot, [string]$Id ) $fields = @( 'Id', @{l='Command'...
combined_dataset/train/non-malicious/sample_32_94.ps1
sample_32_94.ps1
# # Module manifest for module 'PowerShellEditorServices' # # Generated by: daviwil # # Generated on: 5/12/2016 # @{ # Script module or binary module file associated with this manifest. RootModule = 'PowerShellEditorServices.Commands.psm1' # Version number of this module. ModuleVersion = '0.2.0' # I...
combined_dataset/train/non-malicious/sample_35_86.ps1
sample_35_86.ps1
let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl(); let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/aspire.eventHandlers.js"]; let currentScriptElement = document.querySelector("script[src='Scripts/aspire.plugin.js']"); if (currentScriptElement !== null) { scrip...
combined_dataset/train/non-malicious/sample_12_19.ps1
sample_12_19.ps1
Import-LocalizedData -BindingVariable lblTxt -FileName AzStackHci.Bitlocker.Strings.psd1 class HealthModel { # Attributes for Azure Monitor schema [string]$Name #Name of the individual test/rule/alert that was executed. Unique, not exposed to the customer. [string]$Title #User-facing name; one or mor...
combined_dataset/train/non-malicious/77.ps1
77.ps1
function Get-AuthToken { [cmdletbinding()] param ( [Parameter(Mandatory=$true)] $User ) $userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User $tenant = $userUpn.Host Write-Host "Checking for AzureAD module..." $AadModule = Get-Module -Name "AzureAD" -ListAvailable if ($Aa...
combined_dataset/train/non-malicious/1561.ps1
1561.ps1
function Invoke-MrTDDWorkflow { [CmdletBinding()] param ( [ValidateScript({ If (Test-Path -Path $_ -PathType Container) { $true } else { Throw "'$_' is not a valid directory." } })] [string]$Path = (Get-Location), ...
combined_dataset/train/non-malicious/CertMgmt pack_2.ps1
CertMgmt pack_2.ps1
##################################################################### # CertMgmtPack.ps1 # Version 0.51 # # Digital certificate management pack # # Vadims Podans (c) 2009 # http://www.sysadmins.lv/ ##################################################################### #requires -Version 2.0 function Import-C...
combined_dataset/train/non-malicious/3018.ps1
3018.ps1
function New-MockObject { param ( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [type]$Type ) [System.Runtime.Serialization.Formatterservices]::GetUninitializedObject($Type) }
combined_dataset/train/non-malicious/3812.ps1
3812.ps1
function Test-VirtualMachineZone { $rgname = Get-ComputeTestResourceName try { [string]$loc = Get-ComputeVMLocation; $loc = $loc.Replace(' ', ''); New-AzResourceGroup -Name $rgname -Location $loc -Force; $vmsize = 'Standard_DS...
combined_dataset/train/non-malicious/sample_20_32.ps1
sample_20_32.ps1
#************************************************ # DC_DiskInfo.ps1 # Version 1.0 # Date: 09-05-2023 # Author: Edmund Spatariu # Updated: # Description: This script obtains Disk Info and associate a drive letter with corresponding LUN, saving output to a # file named $ComputerName_DC_DiskInfo.txt ...
combined_dataset/train/non-malicious/WriteFileName_3.ps1
WriteFileName_3.ps1
# functions to print overwriting multi-line messages. Test script will accept a file/filespec/dir and iterate through all files in all subdirs printing a test message + file name to demostrate. # e.g. PS>.\\writefilename.ps1 c:\\ # call WriteFileName [string] # after done writing series of overwriting messages, cal...
combined_dataset/train/non-malicious/sample_66_73.ps1
sample_66_73.ps1
# # Module manifest for module 'Microsoft.SME.RemoteDesktop' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.RemoteDesktop.psm1' # Version number of this module. ModuleVersion = '4.21.0' # Supported PSEditions # CompatiblePSEditions = @() # ID us...
combined_dataset/train/non-malicious/Searching Word.ps1
Searching Word.ps1
$word=New-Object -COM "Word.Application" $errorlog="c:\\missing.csv" Set-Content $errorlog "Chapter,Script" Get-ChildItem c:\\test\\*.doc | foreach { $file=$_.fullname Write-Host $file $doc=$word.Documents.Open($file) $style=$word.ActiveDocument.Styles | where {$_.namelocal -eq "c...
combined_dataset/train/non-malicious/sample_19_84.ps1
sample_19_84.ps1
#************************************************ # DC_Repadmin.ps1 # Version 1.0.1 # Date: 03-6-2013 # Authors : Andre Teixeira/ David Fisher (CSS)/ Craig Landis # Description: Run Repadmin utility to obtain Kerberos tickets and TGT #************************************************ if($debug -eq $true){[vo...
combined_dataset/train/non-malicious/A Compare-Object Bug.ps1
A Compare-Object Bug.ps1
# I want do demonstrate a Compare-object bug # Bernd Kriszio - http://pauerschell.blogspot.com/ 1, 2, 3, 4, 5 > .\\textfile_a.txt 1, 2, 4, 5, 6 > .\\textfile_b.txt cat .\\textfile_a.txt cat .\\textfile_b.txt compare-object (gc .\\textfile_a.txt) (gc .\\textfile_b.txt) -inc <#yields InputObject ...
combined_dataset/train/non-malicious/1851.ps1
1851.ps1
$script:oldModulePath = $env:PSModulePath function Add-ModulePath { param([string]$Path, [switch]$Prepend) $script:oldModulePath = $env:PSModulePath if ($Prepend) { $env:PSModulePAth = $Path + [System.IO.Path]::PathSeparator + $env:PSModulePath } else { $env:PSModulePat...
combined_dataset/train/non-malicious/sample_48_21.ps1
sample_48_21.ps1
# # Module manifest for module 'OCI.PSModules.Desktops' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Desktops.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/Get-Command (which).ps1
Get-Command (which).ps1
## This ought to be the same as Get-Command, except... ## it will output the commands in the actual order they would be used by the shell function which( [string]$command ) { $Script:ErrorActionPreference = "SilentlyContinue" Get-Command $command -commandType Alias Get-Command $command -commandType Funct...
combined_dataset/train/non-malicious/sample_33_38.ps1
sample_33_38.ps1
# # Module manifest for module 'OCI.PSModules.Budget' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Budget.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/sample_53_87.ps1
sample_53_87.ps1
function Get-AllFixedDependenciesToInstall { param( $tempFolder, $dependencies ) . ".\FileLibrary.ps1" . ".\DevOpsLibrary.ps1" . ".\AzureBlobLibrary.ps1" if (!$dependencies) { return } $dependencies | Foreach-Object { $entry = $_ swi...
combined_dataset/train/non-malicious/sample_47_99.ps1
sample_47_99.ps1
function Search-AzDataProtectionBackupInstanceInAzGraph { [OutputType('PSObject')] [CmdletBinding(PositionalBinding=$false)] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Searches for Backup instances in Azure Resource Graph and retrieves the expected entries')] param ( ...
combined_dataset/train/non-malicious/sample_26_45.ps1
sample_26_45.ps1
# # Module manifest for module 'OCI.PSModules.Apigateway' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apigateway.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/1750.ps1
1750.ps1
Import-Module $PSScriptRoot/CronTab/CronTab.psd1 Write-Host -Foreground Yellow "Get the existing cron jobs" Get-CronJob | Out-Host Write-Host -Foreground Yellow "New cron job to clean out tmp every day at 1am" New-CronJob -Command 'rm -rf /tmp/*; Write-Host -Foreground Yellow "Add some more jobs" New-CronJob -Co...
combined_dataset/train/non-malicious/Reverse filename sequenc.ps1
Reverse filename sequenc.ps1
# Reverse filename sequence v 0.9 # Author: Sean Wendt # # This script will rename a sequenced set of files in a directory. # For example, you have foobar01.jpg, foobar02.jpg, foobar03.jpg # -- it will reverse the order, so the last file is now 01, the second to last 02, etc.. # # Limitations: -You cannot us...
combined_dataset/train/non-malicious/2194.ps1
2194.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, ParameterSetName="Recurse", HelpMessage="Site server where the SMS Provider is installed")] [parameter(Mandatory=$true, ParameterSetName="CSV")] [parameter(Mandatory=$true, ParameterSetName="Static")] [ValidateNotNullOrEmpt...
combined_dataset/train/non-malicious/h20 - Hashtables to obje.ps1
h20 - Hashtables to obje.ps1
#hashtable to object function. #used to be able to make custom objects with math inside the pipeline #e.g. 1..10 | h20 { @{karl = $_;dude = $_+1} } # gps | h20 { @{name = $_.processname; mem = $_.workingset / 1MB} } function h20([scriptblock]$sb ) { begin {} process{ if ($sb -ne $null) { ...
combined_dataset/train/non-malicious/sample_2_68.ps1
sample_2_68.ps1
# # Module manifest for module 'OCI.PSModules.Waf' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Waf.dll' # Version number of this module. ModuleVersion = '92.1.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/Set-OCSUser.ps1
Set-OCSUser.ps1
###########################################################################" # # NAME: Set-OCSUser.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # # COMMENT: Requires Quest AD cmdlets. This oneliner sets Active Directory user attributes for Microsoft Office Communications Server 2007. # ...
combined_dataset/train/non-malicious/1908.ps1
1908.ps1
$assetsDir = Join-Path -Path $PSScriptRoot -ChildPath assets Describe "Import-LocalizedData" -Tags "CI" { BeforeAll { $script = "localized.ps1" $sunday = "Sunday" $sundayInGerman = $sunday + " (in German)" } It "Should be able to import string using default culture" { $culture = Get-Culture $cultu...
combined_dataset/train/non-malicious/sample_19_12.ps1
sample_19_12.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 = '77.0.0' # Supported...
combined_dataset/train/non-malicious/sample_58_50.ps1
sample_58_50.ps1
<div align="center"> <img style="width: 200px;height: 200px;" src="./logo.jpg" alt="icon"/> <h1 align="center">Pure GPT</h1> [English](./README.md) / 简体中文 </div> 与纯粹的 chatGPT 对话! 使用 `@pure_gpt` 与 chatGPT 开始对话。 ![Example](example.png) ## 设计初衷 Copilot 确实是一款革命性的 AI 生产力工具, 背靠 VSCode 团队几十年的 IDE 研发经验, 其无论是在功能的完善程度, 还是...
combined_dataset/train/non-malicious/sample_5_47.ps1
sample_5_47.ps1
#************************************************ # DC_GetSQLSetupLogs.ps1 # Version 1.0.0 # Date: 8-19-2011 # Author: Shon Hauck - Shonh@Microsoft.com # Description: Used to Get SQL Setup Logs (Bootstrap Directory for SQL 9, 10 , 10.5, 11) # # Date: 4-15-2020 # Modified By: João Polisel - JPolisel@Microsoft.co...
combined_dataset/train/non-malicious/sample_54_88.ps1
sample_54_88.ps1
# # Argument initialization # $nextarg = "none" $DebugPort = "unassigned" $targetcomputer = "." $VMName = "" $VMGuid = "" $AutoAssign = "false" $DebugOff = "false" function funHelp() { $helpText=@" DESCRIPTION: NAME: kdnetdebugvm.ps1 Displays (and optionally sets) the port used to network debug a V...
combined_dataset/train/non-malicious/sample_65_98.ps1
sample_65_98.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # # ModifyProxySettings.ps1 - To be used by the installer - Mo...
combined_dataset/train/non-malicious/sample_64_0.ps1
sample_64_0.ps1
# Import the helper functions Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [parameter(Mandatory = $true)] [System.String] $Category ) #Write-Verbose "Use this cmdlet t...
combined_dataset/train/non-malicious/sample_63_17.ps1
sample_63_17.ps1
#------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. #------------------------------------------------------------------------- #region Object Synchronization Diagnostic Options Set-Variable DiagnoseObjectSyncIssues ...
combined_dataset/train/non-malicious/sample_14_70.ps1
sample_14_70.ps1
#************************************************ # TS_InfoCacheLevelCheck.ps1 # Version 1.0 # Date: 1-2-2012 # Author: v-anecho # Description: If you are experiencing slow logons or slow enumeration of shares, the InfoCacheLevel registry value may resolve the issue. #*********************************************...
combined_dataset/train/non-malicious/3271.ps1
3271.ps1
class Trigger { [TriggerType]$Type [string]$Trigger [MessageType]$MessageType = [MessageType]::Message [MessageSubType]$MessageSubtype = [Messagesubtype]::None Trigger([TriggerType]$Type, [string]$Trigger) { $this.Type = $Type $this.Trigger = $Trigger } }
combined_dataset/train/non-malicious/sample_30_68.ps1
sample_30_68.ps1
# # Module manifest for module 'DscInstall' # # Generated by: Zia Jalali # # Generated on: 07/31/2017 # @{ # Script module or binary module file associated with this manifest. ModuleToProcess = 'Heartbeat.psm1' # Version number of this module. ModuleVersion = '1.1' # ID used to uniquely identify thi...
combined_dataset/train/non-malicious/1202.ps1
1202.ps1
$tempDir = $null function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { $tempDir = New-TempDirectory -Prefix $PSCommandPath } function Stop-Test { Remove-Item $tempDir.FullName -Recurse } configuration IAmBrok...
combined_dataset/train/non-malicious/sample_52_25.ps1
sample_52_25.ps1
# # Module manifest for module 'OCI.PSModules.Mysql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Mysql.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_25_48.ps1
sample_25_48.ps1
# # Module manifest for module 'OCI.PSModules.Artifacts' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Artifacts.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/Highlight-Syntax _2.0.ps1
Highlight-Syntax _2.0.ps1
#requires -version 2.0 # Highlight-Syntax.ps1 # version 2.0 # by Jeff Hillman # # this script uses the System.Management.Automation.PsParser class # to highlight PowerShell syntax with HTML. param( [string] $code, [switch] $LineNumbers ) if ( Test-Path $code -ErrorAction SilentlyContinue ) { $code =...
combined_dataset/train/non-malicious/sample_42_74.ps1
sample_42_74.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/sample_30_32.ps1
sample_30_32.ps1
# # Module manifest for module 'OCI.PSModules.Analytics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Analytics.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/Get-GroupMembership_1.ps1
Get-GroupMembership_1.ps1
## Get-DistinguishedName -- look up a DN from a user's (login) name function Get-DistinguishedName { Param($UserName) $ads = New-Object System.DirectoryServices.DirectorySearcher([ADSI]'') $ads.filter = "(&(objectClass=Person)(samAccountName=$UserName))" $s = $ads.FindOne() return $s.GetDirectoryEnt...
combined_dataset/train/non-malicious/sample_30_24.ps1
sample_30_24.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # 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.apa...
combined_dataset/train/non-malicious/Xml Module 4.3.ps1
Xml Module 4.3.ps1
#requires -version 2.0 # Improves over the built-in Select-XML by leveraging Remove-XmlNamespace http`://poshcode.org/1492 # to provide a -RemoveNamespace parameter -- if it's supplied, all of the namespace declarations # and prefixes are removed from all XML nodes (by an XSL transform) before searching. # IMP...
combined_dataset/train/non-malicious/Get-WebFile 3.7.1.ps1
Get-WebFile 3.7.1.ps1
## Get-WebFile (aka wget for PowerShell) ############################################################################################################## ## Downloads a file or page from the web ## History: ## v3.7.1 - Puts a try-catch statement around the $req.GetResponse() call to prevent further execution if ## ...
combined_dataset/train/non-malicious/Get-CInfo.ps1
Get-CInfo.ps1
function Get-CInfo { param($Comp) Function PC-Name{ param ($compname) $ADS = Get-ADComputer -Filter {name -eq $compname} -Properties * | Select-Object -Property name If($ads -eq $null) {$false} ELSE{$True} } $ping = PC-Name $COMP if ($ping -eq $true) { Write-Host -ForegroundColor G...
combined_dataset/train/non-malicious/3659.ps1
3659.ps1
function Test-ListStretchDatabaseRestorePoints { $location = Get-ProviderLocation "Microsoft.Sql/servers" $serverVersion = "12.0"; $rg = Create-ResourceGroupForTest $location try { $server = Create-ServerForTest $rg $location $databaseName = Get-DatabaseName $stretchdb = New-AzSqlDataba...
combined_dataset/train/non-malicious/Import-Certificate.ps1
Import-Certificate.ps1
function Import-Certificate { param ( [IO.FileInfo] $CertFile = $(throw "Paramerter -CertFile [System.IO.FileInfo] is required."), [string[]] $StoreNames = $(throw "Paramerter -StoreName [System.String] is required."), [switch] $LocalMachine, [switch] $CurrentUser, [string] $CertPassword, [switch...
combined_dataset/train/non-malicious/sample_46_63.ps1
sample_46_63.ps1
param( [parameter(Mandatory = $false)] $databaseName, [parameter(Mandatory = $false)] $databaseUserName, [parameter(Mandatory = $false)] $databaseUserPassword, [parameter(Mandatory = $true)] $databaseAdminUser, [parameter(Mandatory = $true)] $databaseAdminPasswo...
combined_dataset/train/non-malicious/112.ps1
112.ps1
function Get-AuthToken { [cmdletbinding()] param ( [Parameter(Mandatory=$true)] $User ) $userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User $tenant = $userUpn.Host Write-Host "Checking for AzureAD module..." $AadModule = Get-Module -Name "AzureAD" -ListAvailable if ($Aad...
combined_dataset/train/non-malicious/106.ps1
106.ps1
function Get-AuthToken { [cmdletbinding()] param ( [Parameter(Mandatory=$true)] $User ) $userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User $tenant = $userUpn.Host Write-Host "Checking for AzureAD module..." $AadModule = Get-Module -Name "AzureAD" -ListAvailable if ($Aa...
combined_dataset/train/non-malicious/sample_1_12.ps1
sample_1_12.ps1
[dynamic, provider("dcismprovider"), Association, Description ( "DCIM_BMElementCapabilities is a derivation of CIM_ElementCapabilities " "and represents an association between ManagedElements and their " "Capabilites." ) ] class DCIM_BMElementCapabilities : CIM_ElementCapabilities { ...
combined_dataset/train/non-malicious/3685.ps1
3685.ps1
function Test-AdlsGen2Crud { $resourceGroup = getAssetName try { $AccountName = getAssetName $ShareName = getAssetName $DataSetName = getAssetName $StorageAccountId = getAssetName $FileSystemName = getAssetName $createdFileSystemDataset = New-AzDataShareDataSet -ResourceGroupName $resourceGroup -A...
combined_dataset/train/non-malicious/sample_47_53.ps1
sample_47_53.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 # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI...