full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_17_2.ps1
sample_17_2.ps1
# # Module manifest for module 'OCI.PSModules.Waa' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Waa.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/3709.ps1
3709.ps1
function Clean-ResourceGroup($rgname) { if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) { Remove-AzResourceGroup -Name $rgname -Force } } function Retry-IfException { param([ScriptBlock] $script,...
combined_dataset/train/non-malicious/Boots Hierarchical Bind.ps1
Boots Hierarchical Bind.ps1
######## CSV DATA ############# # Save the following data to a csv. City,Team "Los Angeles","Lakers" "Los Angeles","Clippers" "New York","Knicks" "New York","Liberty" "Sacramento","Kings" ######## CODE ################# $teams = Import-Csv "C:\\testdata.csv" [array]$cities = $teams | %{$_.City} ...
combined_dataset/train/non-malicious/Get-NaNfsExport.ps1
Get-NaNfsExport.ps1
# Glenn Sizemore ~ www . Get-Admin . Com # Example Powershell function to get the NFS Exports from a NetApp Filer # First you'll need to download the OnTap SDK 3.5 : http://communities.netapp.com/docs/DOC-1365 # within the download your interested in .\\manage-ontap-sdk-3.5\\lib\\DotNet\\ManageOntap.dll # Next...
combined_dataset/train/non-malicious/sample_35_26.ps1
sample_35_26.ps1
/////////////////////////////////////////////////////////////////////////////// // Helper to set a designer prop /////////////////////////////////////////////////////////////////////////////// function setDesignerProp(tname, ttype, tvalue) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)...
combined_dataset/train/non-malicious/1573.ps1
1573.ps1
function Get-MrPipelineInput { [CmdletBinding()] param ( [Parameter(Mandatory)] [string]$Name, [System.Management.Automation.WhereOperatorSelectionMode]$Option = 'Default', [ValidateRange(1,2147483647)] [int]$Records = 2147483647 ) (Get-Command...
combined_dataset/train/non-malicious/3137.ps1
3137.ps1
[CmdletBinding(DefaultParameterSetName='Decrypt')] param ( [Parameter( Position=0, Mandatory=$true, HelpMessage='String which you want to encrypt or decrypt')] [String]$Text, [Parameter( Position=1, HelpMessage='Specify which rotation you want to use (D...
combined_dataset/train/non-malicious/3605.ps1
3605.ps1
function Get-PSResourceGroupName { return Get-DeviceResourceGroupName } function Get-PSDeviceName { return getAssetName } function Test-GetDeviceNonExistent { $rgname = Get-PSResourceGroupName $dfname = Get-PSDeviceName Assert-ThrowsContains { Get-AzDataBoxEdgeDevice $rgname $dfname } "not fo...
combined_dataset/train/non-malicious/1899.ps1
1899.ps1
Describe "Read-Host Test" -tag "CI" { BeforeAll { $th = New-TestHost $rs = [runspacefactory]::Createrunspace($th) $rs.open() $ps = [powershell]::Create() $ps.Runspace = $rs $ps.Commands.Clear() } AfterEach { $ps.Commands.Clear() } AfterAll ...
combined_dataset/train/non-malicious/sample_17_48.ps1
sample_17_48.ps1
# # Module manifest for module 'Microsoft.SME.ServerManager' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.ServerManager.psm1' # Version number of this module. ModuleVersion = '4.12.2' # Supported PSEditions # CompatiblePSEditions = @() # ID us...
combined_dataset/train/non-malicious/4096.ps1
4096.ps1
[CmdletBinding()] param () function Uninstall-MSIByName { [CmdletBinding()] param ( [ValidateNotNullOrEmpty()][String]$ApplicationName, [ValidateNotNullOrEmpty()][String]$Switches ) $Executable = $Env:windir + "\system32\msiexec.exe" $Uninstall = Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\Curre...
combined_dataset/train/non-malicious/sample_10_23.ps1
sample_10_23.ps1
@{ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Start-Transcript", "Stop-Transcript" AliasesTo...
combined_dataset/train/non-malicious/ConvertTo-Hex_9.ps1
ConvertTo-Hex_9.ps1
# Ported from C# technique found here: http://forums.asp.net/p/1298956/2529558.aspx param ( [string]$SidString ) # Create SID .NET object using SID string provided $sid = New-Object system.Security.Principal.SecurityIdentifier $sidstring # Create a byte array of the proper length $sidBytes = New-Object byte[] ...
combined_dataset/train/non-malicious/212.ps1
212.ps1
function Get-ADFSMORole { [CmdletBinding()] PARAM ( [Alias("RunAs")] [System.Management.Automation.Credential()] [pscredential] $Credential = [System.Management.Automation.PSCredential]::Empty ) TRY { IF (-not (Get-Module -Name ActiveDirectory)) { Im...
combined_dataset/train/non-malicious/HttpRest.ps1
HttpRest.ps1
## Http Rest #################################################################################################### ## The first implementation of the HttpRest module, as a bunch of script functions ## Based on the REST api from MindTouch's Dream SDK ## ## INSTALL: ## You need log4net.dll mindtouch.core.dll mindto...
combined_dataset/train/non-malicious/sample_49_77.ps1
sample_49_77.ps1
function Get-RoleArnPolicy { <# .SYNOPSIS Returns a customized Arn policy using the Sentinel Workspace Id .PARAMETER WorkspaceId Specifies the Azure Sentinel workspace id #> [OutputType([string])] [CmdletBinding()] param ( [Parameter(position=0)] [ValidateNotNullOrEmpty()] [string] $Works...
combined_dataset/train/non-malicious/3690.ps1
3690.ps1
function Test-SourceDataSetsCrud { $resourceGroup = getAssetName $AccountName = getAssetName $ShareSubscriptionName = getAssetName $SourceDataSets = Get-AzDataShareSourceDataSet -ResourceGroupName $resourceGroup -AccountName $AccountName -ShareSubscriptionName $ShareSubscriptionName Assert-NotNull ...
combined_dataset/train/non-malicious/sample_8_8.ps1
sample_8_8.ps1
#************************************************ # DC_RAS-Component.ps1 # Version 1.0 # Collects registry and netsh information. # Version 1.1 # Commented out "ras show activeservers". <- On Win7, this caused a Windows Firewall prompt to allow RAS server advertisements # Commented out "ras show user" <- Th...
combined_dataset/train/non-malicious/sample_17_34.ps1
sample_17_34.ps1
#************************************************ # DC_NgenCollect.ps1 # Version 1.0 # Date: 2009-2019 # Author: Walter Eder (waltere@microsoft.com) # Description: Collects .Net Framework nGen files # Called from: TS_AutoAddCommands_Apps.ps1 #******************************************************* Trap [Excep...
combined_dataset/train/non-malicious/ScheduleGPOBackups.ps1
ScheduleGPOBackups.ps1
Import-Module grouppolicy #region ConfigBlock # What domain are we going to backup GPOs for? $domain = "psd267.wednet.edu" # Where are we going to store the backups? $gpoBackupRootDir = "c:\\gpoBackups" # As I plan to do a new backup set each month I'll setup the directory names to reflect # the year and month i...
combined_dataset/train/non-malicious/sample_33_90.ps1
sample_33_90.ps1
<############################################################## # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # ##############################################################>...
combined_dataset/train/non-malicious/3844.ps1
3844.ps1
function Test-Media { $rgname = GetResourceGroupName $preferedlocation = "East US" $location = Get-AvailableLocation $preferedlocation Write-Output $location $resourceGroup = CreateResourceGroup $rgname $location $storageAccountName1 = "sto" + $rgname $storageAccount1 = CreateStorageAccou...
combined_dataset/train/non-malicious/sample_36_51.ps1
sample_36_51.ps1
@{ GUID="A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Get-Acl", "Set-Acl", "Get-PfxCertific...
combined_dataset/train/non-malicious/3268.ps1
3268.ps1
class ChannelRule { [string]$Channel [string[]]$IncludeCommands [string[]]$ExcludeCommands ChannelRule() { $this.Channel = '*' $this.IncludeCommands = @('*') $this.ExcludeCommands = @() } ChannelRule([string]$Channel, [string[]]$IncludeCommands, [string]$ExcludeCommand...
combined_dataset/train/non-malicious/653.ps1
653.ps1
$reportPortalUri = if ($env:PesterPortalUrl -eq $null) { 'http://localhost/reports' } else { $env:PesterPortalUrl } $reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl } function New-TestCredentials { param( [string] $Username, ...
combined_dataset/train/non-malicious/281.ps1
281.ps1
$groupID = " FILL ME IN " $datasetID = " FILL ME IN " $clientId = " FILL ME IN " function GetAuthToken { if(-not (Get-Module AzureRm.Profile)) { Import-Module AzureRm.Profile } $redirectUri = "urn:ietf:wg:oauth:2.0:oob" $resourceAppIdURI = "htt...
combined_dataset/train/non-malicious/sample_38_31.ps1
sample_38_31.ps1
# # Module manifest for module 'ExtensionService' # # Generated by: Microsoft # # Generated on: 04/09/2020 # @{ # Script module or binary module file associated with this manifest. ModuleToProcess = 'ExtensionService.psm1' # Version number of this module. ModuleVersion = '1.0' # ID used to uniquely ...
combined_dataset/train/non-malicious/1459.ps1
1459.ps1
function Set-CDotNetAppSetting { [CmdletBinding(SupportsShouldProcess=$true, DefaultParameterSetName='All')] param( [Parameter(Mandatory=$true)] [string] $Name, [Parameter(Mandatory=$true)] [string] $Value, [Switch] ...
combined_dataset/train/non-malicious/sample_33_68.ps1
sample_33_68.ps1
## Copyright (c) Microsoft Corporation. All rights reserved. <# .SYNOPSIS This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. .DESCRIPTION This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. These performance recordings contain Microsoft-Antimal...
combined_dataset/train/non-malicious/3955.ps1
3955.ps1
function Get-TestResourcesDeployment([string]$rgn) { $virtualMachineName = Get-NrpResourceName $storageAccountName = Get-NrpResourceName $routeTableName = Get-NrpResourceName $virtualNetworkName = Get-NrpResourceName $networkInterfaceName = Get-NrpResourceName $networkSecurityGro...
combined_dataset/train/non-malicious/Get-TopProcess.ps1
Get-TopProcess.ps1
## poll-process.ps1 ## Continuously display a process list, sorted ## by the desired criteria. ## ## usage: poll-process [sortCriteria] [pollInterval] ## ## sortCriteria must be one of "Id", "ProcessName", "MainWindowTitle", ## "Processor", "Disk", or "WorkingSet" ## pollIn...
combined_dataset/train/non-malicious/824.ps1
824.ps1
$cred = Get-Credential New-AzVmss ` -ResourceGroupName "myResourceGroup" ` -VMScaleSetName "myScaleSet" ` -Location "EastUS" ` -VirtualNetworkName "myVnet" ` -SubnetName "mySubnet" ` -PublicIpAddressName "myPublicIPAddress" ` -LoadBalancerName "myLoadBalancer" ` -Credential $cred
combined_dataset/train/non-malicious/sample_65_90.ps1
sample_65_90.ps1
@{ GUID="{Fb6cc51d-c096-4b38-b78d-0fed6277096a}" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" RootModule="Microsoft.Management.Infrastructure.CimCmdlets" RequiredAssembli...
combined_dataset/train/non-malicious/3917.ps1
3917.ps1
function Test-ListUsageDetails { $usageDetails = Get-AzConsumptionUsageDetail -Top 10 Assert-NotNull $usageDetails Assert-AreEqual 10 $usageDetails.Count Foreach($usage in $usageDetails) { Assert-NotNull $usage.AccountName Assert-Null $usage.AdditionalProperties Assert-NotNull $usage.Bil...
combined_dataset/train/non-malicious/1196.ps1
1196.ps1
$userDomain = $env:USERDNSDOMAIN $computerDomain = Get-WmiObject 'Win32_ComputerSystem' | Select-Object -ExpandProperty Domain if( (Get-Service -Name MSMQ -ErrorAction SilentlyContinue) -and $userDomain -eq $computerDomain ) { $publicQueueName = $null $privateQueueName = $null function Start-T...
combined_dataset/train/non-malicious/Easy Migration Tool v2.0.ps1
Easy Migration Tool v2.0.ps1
#Generated Form Function function GenerateForm { ######################################################################## # Code Generated By: Richard Yaw # Generated On: 09/12/2010 # # Easy Migration Script for VMware (Version 2.0) # - Added a "Reload Tasks" feature. # - Fixed issue with the Undo feature for S...
combined_dataset/train/non-malicious/3385.ps1
3385.ps1
function Assert-Throws { param([ScriptBlock] $script, [string] $message) try { &$script } catch { if ($message -ne "") { $actualMessage = $_.Exception.Message Write-Output ("Caught exception: '$actualMessage'") if ($actualMessage -eq $message) { ...
combined_dataset/train/non-malicious/sample_49_66.ps1
sample_49_66.ps1
parameters: artifactsPublishingAdditionalParameters: '' PromoteToChannelIds: '' BARBuildId: '' symbolPublishingAdditionalParameters: '' buildQuality: 'daily' useServicingBuildPools: false stages: - stage: publish displayName: Publishing jobs: - job: publish_assets displayName: Publish A...
combined_dataset/train/non-malicious/1567.ps1
1567.ps1
function Get-MrParameterAlias { [CmdletBinding()] param ( [Parameter(Mandatory)] [string]$Name ) (Get-Command -Name $Name).Parameters.Values | Where-Object Aliases | Select-Object -Property Name, Aliases }
combined_dataset/train/non-malicious/2281.ps1
2281.ps1
param( [parameter(Mandatory=$true)] [string]$RBOptionFirst, [parameter(Mandatory=$true)] [string]$RBOptionSecond, [parameter(Mandatory=$true)] [string]$DomainName, [parameter(Mandatory=$true)] [string]$DomainSuffix, [parameter(Mandatory=$true)] [string[]]$LocationList ) function Load-Form { $Form.Controls.AddRang...
combined_dataset/train/non-malicious/sample_3_2.ps1
sample_3_2.ps1
#************************************************ # DC_DhcpServer-Component.ps1 # Version x # Date: 2009-2014 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about DHCP Server. # Called from: Networking Diags #******************************************************* Trap [Exce...
combined_dataset/train/non-malicious/sample_61_43.ps1
sample_61_43.ps1
function Get-ValueFromLaunchJson { param ( [Parameter(Mandatory=$false)] [string]$LaunchJsonPath, [Parameter(Mandatory=$false)] $ConfigName, [Parameter(Mandatory=$true)] $KeyName, [Parameter(Mandatory=$false)] $LaunchConfig ) if (![String]::Is...
combined_dataset/train/non-malicious/Invoke-MoveRequest.ps1
Invoke-MoveRequest.ps1
########################################################################### # # NAME: Invoke-MoveRequest.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jer@powershell.no # # COMMENT: Script to use when migrating mailboxes to Microsoft Exchange Server 2010 Cross-Forest. Prepares user objects already # moved to...
combined_dataset/train/non-malicious/Google Chromium Download_2.ps1
Google Chromium Download_2.ps1
<# .Synopsis Download Google Chromium if there is a later build. .Description Download Google Chromium if there is a later build. http://poshcode.org/2422 #> Set-StrictMode -Version Latest Import-Module bitstransfer # comment out when not debugging $VerbosePreferenc...
combined_dataset/train/non-malicious/Remove diacritics.ps1
Remove diacritics.ps1
### Grťgory Schiro, 2009 ### <summary> ### Removes diacritics from string. ### </summary> ### <param name="String">String containing diacritics</param> function Remove-Diacritics([string]$String) { $objD = $String.Normalize([Text.NormalizationForm]::FormD) $sb = New-Object Text.StringBuilder fo...
combined_dataset/train/non-malicious/1532.ps1
1532.ps1
Set-StrictMode -Version latest $ErrorActionPreference = 'Stop' $root = (Resolve-Path $PSScriptRoot\..\..).Path $outFolder = "$root\out" $moduleFolder = "$outFolder\platyPS" Import-Module $moduleFolder -Force $MyIsLinux = Get-Variable -Name IsLinux -ValueOnly -ErrorAction SilentlyContinue $MyIsMacOS = Get-Variable -Na...
combined_dataset/train/non-malicious/Get-CryptoBytes_2.ps1
Get-CryptoBytes_2.ps1
function Get-CryptoBytes { #.Synopsis # Generate Cryptographically Random Bytes #.Description # Uses RNGCryptoServiceProvider to generate arrays of random bytes #.Parameter Count # How many bytes to generate #.Parameter AsString # Output hex-formatted strings instead of byte arrays param( [Parameter(Va...
combined_dataset/train/non-malicious/3352.ps1
3352.ps1
param ( [string] $configuration = 'Debug', [string] $pathDelimiter = ':' ) $tempModulePath = $env:PSModulePath $outputDir = "$PSScriptRoot/../artifacts/$configuration" Write-Warning "Running Test-ModuleManfiest on .psd1 files in $outputDir" $env:PSModul...
combined_dataset/train/non-malicious/sample_53_33.ps1
sample_53_33.ps1
# # Module manifest for module 'OCI.PSModules.Optimizer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Optimizer.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_51_48.ps1
sample_51_48.ps1
. "$PSScriptRoot/api.ps1" . "$PSScriptRoot/../php/api.ps1" $scheduledTasksFile = Get-Full-Path("Custom/scheduled-tasks/scheduled-tasks.json") $scheduledTasks = (Get-Content $scheduledTasksFile -Encoding UTF8 | Out-String | ConvertFrom-Json) while ($true) { Write-Host "Select your schedule :" $indexSch...
combined_dataset/train/non-malicious/3879.ps1
3879.ps1
function Test-StorageInsightCreateUpdateDelete { $wsname = Get-ResourceName $siname = Get-ResourceName $saname = Get-ResourceName $rgname = Get-ResourceGroupName $said = Get-StorageResourceId $rgname $saname $wslocation = Get-ProviderLocation New-AzResourceGroup -Name $rg...
combined_dataset/train/non-malicious/Get-NaNfsExport_1.ps1
Get-NaNfsExport_1.ps1
# Glenn Sizemore ~ www . Get-Admin . Com # Example Powershell function to get the NFS Exports from a NetApp Filer # First you'll need to download the OnTap SDK 3.5 : http://communities.netapp.com/docs/DOC-1365 # within the download your interested in .\\manage-ontap-sdk-3.5\\lib\\DotNet\\ManageOntap.dll # Next...
combined_dataset/train/non-malicious/930.ps1
930.ps1
$omsId = "<Replace with your OMS ID>" $omsKey = "<Replace with your OMS key>" $resourceGroup = "myResourceGroup" $location = "westeurope" $vmName = "myVM" $cred = Get-Credential -Message "Enter a username and password for the virtual machine." New-AzResourceGroup -Name $resourceGroup -Location $location New-Az...
combined_dataset/train/non-malicious/3937.ps1
3937.ps1
function Test-NetworkInterfaceExpandResource { $rgname = Get-ResourceGroupName $vnetName = Get-ResourceName $subnetName = Get-ResourceName $publicIpName = Get-ResourceName $nicName = Get-ResourceName $domainNameLabel = Get-ResourceName $rglocation = Get-ProviderLocation R...
combined_dataset/train/non-malicious/1654.ps1
1654.ps1
function Get-SNMPPrinterInfo { param ( [string[]]$printers ) begin { $snmp = New-Object -ComObject olePrn.OleSNMP $ping = New-Object System.Net.NetworkInformation.Ping } process { foreach ($printer in $printers) { try { $result ...
combined_dataset/train/non-malicious/sample_20_57.ps1
sample_20_57.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\mockjs@1.1.0\node_modules\mockjs\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\mockjs@1.1....
combined_dataset/train/non-malicious/sample_67_92.ps1
sample_67_92.ps1
########################################################################## # DELL PROPRIETARY INFORMATION # # This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this # software to you under the terms of a license agreement,nondisclosure agreement or both. # You may not copy, disclose, o...
combined_dataset/train/non-malicious/3938.ps1
3938.ps1
function Check-CmdletReturnType { param($cmdletName, $cmdletReturn) $cmdletData = Get-Command $cmdletName; Assert-NotNull $cmdletData; [array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") ...
combined_dataset/train/non-malicious/sample_40_85.ps1
sample_40_85.ps1
# # Module manifest for module 'OCI.PSModules.Identitydataplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Identitydataplane.dll' # Version number of this module. ModuleVersion = '81.0.0' # Support...
combined_dataset/train/non-malicious/226.ps1
226.ps1
function Get-AsciiReaction { [cmdletbinding()] Param ( [Parameter()] [ValidateSet( 'Shrug', 'Disapproval', 'TableFlip', 'TableBack', 'TableFlip2', 'TableBac...
combined_dataset/train/non-malicious/Hack ESX MOTD_1.ps1
Hack ESX MOTD_1.ps1
$screen = @" You see here a virtual switch. ------------ ------ #...........| |....| --------------- ###------------ |...(| |..%...........|########## ###-@...| ...
combined_dataset/train/non-malicious/1955.ps1
1955.ps1
Describe "Register-EngineEvent" -Tags "CI" { Context "Check return type of Register-EngineEvent" { It "Should return System.Management.Automation.PSEventJob as return type of Register-EngineEvent" { Register-EngineEvent -SourceIdentifier PesterTestRegister -Action {Write-Output registerengineevent} | Shoul...
combined_dataset/train/non-malicious/sample_56_54.ps1
sample_56_54.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ ## ## TODO: Refactor the cer...
combined_dataset/train/non-malicious/sample_46_97.ps1
sample_46_97.ps1
# # Module manifest for module 'OCI.PSModules.Tenantmanagercontrolplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Tenantmanagercontrolplane.dll' # Version number of this module. ModuleVersion = '83...
combined_dataset/train/non-malicious/DS L Order brneanew game.ps1
DS L Order brneanew game.ps1
# Version: 0.1 # Author: Stefan Stranger # Description: Retrieve Dell Order Status # Start Page Order Status USA: https://support.dell.com/support/order/status.aspx?c=us&cs=19&l=en&s=dhs&~ck=pn # Start Page Order Status EMEA(nl): http://support.euro.dell.com/support/index.aspx?c=nl&l=nl&s=gen&~ck=bt # Example Dell...
combined_dataset/train/non-malicious/Findup_9.ps1
Findup_9.ps1
using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using Microsoft.Win32; using System.IO; namespace Findup { public class FileInfoExt { public FileInfoExt(FileInfo fi) ...
combined_dataset/train/non-malicious/Asp.net-Using httpConext.ps1
Asp.net-Using httpConext.ps1
@@ Default.aspx @@---------------- Partial Class _Default Inherits System.Web.UI.Page Dim var1 As String Dim var2 As String Protected Sub lnk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnk.Click Context.Items("Nome") = var1 Context.Items("Email") = var2 Server.Transfer("pagina...
combined_dataset/train/non-malicious/Script logging_1.ps1
Script logging_1.ps1
#region Log File Management $ScriptName = $MyInvocation.mycommand.name $LocalAppDir = "$(gc env:LOCALAPPDATA)\\PS_Data" $LogName = $ScriptName.replace(".ps1", ".log") $MaxLogFileSizeMB = 5 # After a log file reaches this size it will archive the existing and create a new one trap [Exception] { sendl "er...
combined_dataset/train/non-malicious/sample_53_27.ps1
sample_53_27.ps1
@{ IncludeRules = @( 'PSPlaceOpenBrace', 'PSPlaceCloseBrace', 'PSUseConsistentWhitespace', 'PSUseConsistentIndentation', 'PSAlignAssignmentStatement', 'PSUseCorrectCasing' ) Rules = @{ PSPlaceOpenBrace = @{ Enable ...
combined_dataset/train/non-malicious/NPS Server Synchronize_1.ps1
NPS Server Synchronize_1.ps1
###Network Policy Server Synchronization Script #This script copies the configuration from the NPS Master Server and imports it on this server. #The Account that this script runs under must have Local Administrator rights to the NPS Master. #This was designed to be run as a scheduled task on the NPS Secondary Server...
combined_dataset/train/non-malicious/1155.ps1
1155.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldResolveBuiltinIdentity { $identity = Resolve-Identity -Name 'Administrators' Assert-Equal 'BUILTIN\Administrators' $identity.FullName Assert-Equal 'BUILTIN...
combined_dataset/train/non-malicious/sample_25_73.ps1
sample_25_73.ps1
# Copyright (c) 2020 Ansible Project # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) Function Get-AnsibleWindowsWebRequest { <# .SYNOPSIS Creates a System.Net.WebRequest object based on common URL module options in Ansible. .DESCRIPTION Wi...
combined_dataset/train/non-malicious/sample_62_55.ps1
sample_62_55.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. param( [ValidateSet('Hang', 'Fail')] $TestHook ) $waitTimeoutSeconds = 300 switch ($TestHook) { 'Hang' { $waitTimeoutSeconds = 10 $jobScript = { Start-Sleep -Seconds 600 } } 'Fail' { $jo...
combined_dataset/train/non-malicious/Ping Alert Script_2.ps1
Ping Alert Script_2.ps1
#Email Alert Parameters $to = "user@mydomain.com" $from = "unreachable@mydomain.com" $smtpserver = "my_exchange_server" #Array of computers to test $Computers = ("comp1" , "comp2" , "comp3" , "comp4") #Variable to hold INT value 0 $zero = 0 Foreach ($Computer in $Computers) { if...
combined_dataset/train/non-malicious/Windows Startup Script_4.ps1
Windows Startup Script_4.ps1
<#====================================================================================== File Name : Startup.ps1 Original Author : Kenneth C. Mazie : Description : This is a Windows start-up script with pop-up notification and checks to : assure things are n...
combined_dataset/train/non-malicious/sample_27_90.ps1
sample_27_90.ps1
# # Module manifest for module 'OCI.PSModules.Disasterrecovery' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Disasterrecovery.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported...
combined_dataset/train/non-malicious/sample_41_76.ps1
sample_41_76.ps1
##------------------------------------------------------------------ ## <copyright file="GMATenantJsonHelper.psm1" company="Microsoft"> ## Copyright (C) Microsoft. All rights reserved. ## </copyright> ##------------------------------------------------------------------ ## Import ObservabilityGMAEventSource ...
combined_dataset/train/non-malicious/966.ps1
966.ps1
$rgName='MyResourceGroup' $location='eastus' $cred = Get-Credential -Message 'Enter a username and password for the virtual machine.' New-AzResourceGroup -Name $rgName -Location $location $fesubnet = New-AzVirtualNetworkSubnetConfig -Name 'MySubnet-FrontEnd' -AddressPrefix 10.0.1.0/24 $besubnet = New-AzVirtualNe...
combined_dataset/train/non-malicious/LibraryInputComparison.p.ps1
LibraryInputComparison.p.ps1
## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n\nSet-StrictMode -Version Latest\n\n## Process each element in the pipeline, using a\n## foreach statement to visit each element in $input\nfunction Get-InputWithForeach($identifier)\n{\n Write-Host "Beginning InputWit...
combined_dataset/train/non-malicious/Invoke-Switch v0.9.ps1
Invoke-Switch v0.9.ps1
New-Variable castDictionaryEntries [System.Func[System.Collections.IEnumerable, System.Collections.Generic.IEnumerable[System.Collections.DictionaryEntry]]] ` $castDictionaryEntries = [System.Delegate]::CreateDelegate( [System.Func[System.Collections.IEnumerable, System.Collections.Generic.IEnumerable[Sy...
combined_dataset/train/non-malicious/Test-Server_1.ps1
Test-Server_1.ps1
Function Test-Server{ [cmdletBinding()] param( [parameter(Mandatory=$true,ValueFromPipeline=$true)] [string[]]$ComputerName, [parameter(Mandatory=$false)] [switch]$CredSSP, [Management.Automation.PSCredential] $Credential) begin{ $total = Get-Date $results = @() if($credssp){if(!($credential)){Wri...
combined_dataset/train/non-malicious/339.ps1
339.ps1
function Get-PSFConfig { [OutputType([PSFramework.Configuration.Config])] [CmdletBinding(DefaultParameterSetName = "FullName", HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFConfig')] Param ( [Parameter(ParameterSetName = "FullName", Position = 0)] [string] $FullName = "*", ...
combined_dataset/train/non-malicious/IniFile Functions 1.0.ps1
IniFile Functions 1.0.ps1
function Get-IniSection($inifile,$section) { $sections = select-string "^\\[.*\\]" $inifile if(!$section) { return $sections | %{$_.Line.Trim("[]")} } $start = 0 switch($sections){ {$_.Line.Trim() -eq "[$section]"}{ $start = $_.LineNumber -1 } defaul...
combined_dataset/train/non-malicious/Get-LeaderBoard.ps1
Get-LeaderBoard.ps1
<# .SYNOPSIS Pulls down the leaderboards for the 2011 Scripting Games .DESCRIPTION Quick and dirty script to pull down the leaderboards for the 2011 scripting games. Can choose either beginner or advanced via a command line switch. .PARAMETER Level The leaderboard to parse .EXAMPLE Get...
combined_dataset/train/non-malicious/265.ps1
265.ps1
function Get-LocalGroupMember { [CmdletBinding()] PARAM ( [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [System.String[]]$ComputerName = $env:COMPUTERNAME, [System.String]$GroupName = "Administrators" ) BEGIN { TRY { Add-Type -AssemblyName System.DirectoryServ...
combined_dataset/train/non-malicious/2144.ps1
2144.ps1
Describe "Redirection operator now supports encoding changes" -Tags "CI" { BeforeAll { $asciiString = "abc" if ( $IsWindows ) { $asciiCR = "`r`n" } else { $asciiCR = [string][char]10 } $SavedValue = $null $oldDefa...
combined_dataset/train/non-malicious/sample_18_1.ps1
sample_18_1.ps1
<ManagementPack SchemaVersion="2.0" ContentReadable="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Manifest> <Identity> <ID>Microsoft.SCOMMIAccelerator</ID> <Version>1.0.0.5</Version> </Identity> <Name>Microsoft.SCOMMIAccelerator</Name> <References> <Reference Alias="SC"> ...
combined_dataset/train/non-malicious/Get-IISLogLocation.ps1
Get-IISLogLocation.ps1
Function Get-IISLogLocation { <# .SYNOPSIS This function can be ran against a server or multiple servers to locate the log file location for each web site configured in IIS. .DESCRIPTION This function can be ran against a server or multiple servers to locate the log file location for each web...
combined_dataset/train/non-malicious/sample_59_69.ps1
sample_59_69.ps1
# # Module manifest for module 'OCI.PSModules.Functions' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Functions.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_9_76.ps1
sample_9_76.ps1
#************************************************ # TS_KernelAuthRPCCheck.ps1 # Version 1.0 # Date: 5-1-2012 # Author: davidcop # Description: Checks for kernel-mode authentication mismatch between server, web site, and /rpc virtual directory #************************************************ $varx = Get-Cim...
combined_dataset/train/non-malicious/3087.ps1
3087.ps1
function Verify-Throw { param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [ScriptBlock]$ScriptBlock ) $exceptionThrown = $false try { $null = & $ScriptBlock } catch { $exceptionThrown = $true $_ } if (-not $exceptionThrown) { ...
combined_dataset/train/non-malicious/sample_9_55.ps1
sample_9_55.ps1
#************************************************ # TS_HyperVKB2263829Check.ps1 #************************************************ Import-LocalizedData -BindingVariable RegKeyCheck Write-DiagProgress -Activity $RegKeyCheck.ID_HyperVKB2263829Check -Status $RegKeyCheck.ID_HyperVKB2263829CheckDesc $RootCauseDetect...
combined_dataset/train/non-malicious/3758.ps1
3758.ps1
function Test-StartLogicApp { $resourceGroup = TestSetup-CreateResourceGroup $resourceGroupName = $resourceGroup.ResourceGroupName $location = Get-Location "Microsoft.Logic" "workflows" "West US" $workflowName = getAssetname $definitionFilePath = Join-Path "Resources" "TestSimpleWorkflowTriggerDefi...
combined_dataset/train/non-malicious/sample_43_71.ps1
sample_43_71.ps1
# # Module manifest for module 'OCI.PSModules.Bastion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Bastion.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Compat...
combined_dataset/train/non-malicious/sample_29_40.ps1
sample_29_40.ps1
@{ GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" FunctionsToExport = @() CmdletsToExport = "Get-Credential", "Get-ExecutionP...
combined_dataset/train/non-malicious/Get-DellWarranty_4.ps1
Get-DellWarranty_4.ps1
function Get-DellWarranty { <# .Synopsis Provides warranty information for one or more Dell service tags. .Description Queries the Dell Website for a list of service tags and returns the warranty information as a custom object. If a service tag has multiple warranties, they are...
combined_dataset/train/non-malicious/2198.ps1
2198.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")] [ValidateNotNullOrEmpty()] [ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})] [string]$SiteServer, [parameter(Mandatory=$true, HelpMessag...
combined_dataset/train/non-malicious/sample_67_48.ps1
sample_67_48.ps1
\PrintAllTranslations प्रतिबंध का IgnoreTranslations प्रतिबंध के साथ उपयोग नहीं किया जा सकता.vआप परिकलित कालम '%{oii_column/}' को हाइब्रिड तालिका '%{oii_table/}' में नहीं जोड़ सकते. कृपया परिकलित कॉलम को निकालें.ˆआप हाइब्रिड तालिका '%{oii_table/}' में एकीकरण के लिए उपयोग किया गया 'alternateOf' कालम नहीं जोड़ सकते. कृप...
combined_dataset/train/non-malicious/sample_47_87.ps1
sample_47_87.ps1
# # Module manifest for module 'OCI.PSModules.Objectstorage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Objectstorage.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEdi...
combined_dataset/train/non-malicious/2223.ps1
2223.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")] [ValidateNotNullOrEmpty()] [string]$SiteServer, [parameter(Mandatory=$true, HelpMessage="Specify installation method")] [ValidateNotNullOrEmpty()] [Va...