full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_28_57.ps1 | sample_28_57.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ServiceBus.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Module]::Instance
# Export nothing to clear implicit expo... |
combined_dataset/train/non-malicious/sample_6_97.ps1 | sample_6_97.ps1 | ConvertFrom-StringData @'
id_surfacepro3detectconnectedstandbyhibernationconfig=Detect Surface Pro 3 Connected Standby Hibernation Configuration Issue
id_surfacepro3detectconnectedstandbyhibernationconfigdesc=Detected Surface Pro 3 Connected Standby Hibernation Configuration Issue.
'@
# SIG # Begin signature bloc... |
combined_dataset/train/non-malicious/1225.ps1 | 1225.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'Get-SslCertificateBinding.when getting all bindings' {
It 'should match netsh output' {
$output = netsh http show sslcert
$output |
ForEach-Object {
if(... |
combined_dataset/train/non-malicious/finddupe_2.ps1 | finddupe_2.ps1 | write-host "Usage: finddupe.ps1 <directory1> <directory2> ... <directoryN>"
function Get-MD5([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.MD5CryptoServiceProvider];
$hashAlgorithm = new-object $cr... |
combined_dataset/train/non-malicious/sample_0_10.ps1 | sample_0_10.ps1 | # diag_uex.psm1
# Created by tdimli
# March 2020
#
# Diagnostic functions for UEX area
# version
$UEX_version = "1.0.240717.0"
# Area and Area/Component arrays
$UEX = @("xray_uex_wmi", "xray_uex_eventlog")
#Component/Diagnostic Function arrays
$xray_uex_wmi = @("uex_wmi_KB2020286")
$xray_uex_eventlog =... |
combined_dataset/train/non-malicious/sample_49_41.ps1 | sample_49_41.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 = '77.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/37.ps1 | 37.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/1121.ps1 | 1121.ps1 |
$siteName = 'SslFlags'
$sitePort = 4389
$webConfigPath = Join-Path $TestDir web.config
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
Uninstall-IisWebsite $siteName
Install-IisWebsite -Name $siteName -Pa... |
combined_dataset/train/non-malicious/Check Modules path_1..ps1 | Check Modules path_1..ps1 | function Update-ModulePath {
<#
.Synopsis
Command insures that path and the name of psm1 file are alike.
.Description
This function should help to troubleshoot modules. It loooks up path that should contain modules.
For each .psm1 file found it checks if parent folder containing th... |
combined_dataset/train/non-malicious/2356.ps1 | 2356.ps1 | $samaccount_to_copy = 'abertram'
$new_samaccountname = 'aaaa'
$new_displayname = 'displayname'
$new_firstname = 'firstname'
$new_lastname = 'lastname'
$new_name = 'namehere'
$new_user_logon_name = 'logonname'
$new_password = 'password'
$new_description = 'description'
$new_ou_DN = ''
$enable_user_after_creation = $true... |
combined_dataset/train/non-malicious/sample_65_3.ps1 | sample_65_3.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 = '89.0.0'
# Supported... |
combined_dataset/train/non-malicious/1879.ps1 | 1879.ps1 |
Describe "Update-TypeData basic functionality" -Tags "CI" {
BeforeAll {
$testfilename = "testfile.ps1xml"
$testfile = Join-Path -Path $TestDrive -ChildPath $testfilename
$invalidFileExtensionFile = Join-Path -Path $TestDrive -ChildPath "notmshxml"
$xmlContent=@"
<Types>
... |
combined_dataset/train/non-malicious/2166.ps1 | 2166.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/3892.ps1 | 3892.ps1 |
function Test-PoolCrud
{
$resourceGroup = Get-ResourceGroupName
$accName = Get-ResourceName
$poolName1 = Get-ResourceName
$poolName2 = Get-ResourceName
$resourceLocation = Get-ProviderLocation "Microsoft.NetApp"
$poolSize = 4398046511104
$serviceLevel = "Premium"
tr... |
combined_dataset/train/non-malicious/4022.ps1 | 4022.ps1 |
function Test-MoveAzureResource
{
$sourceResourceGroupName = "testResourceGroup1"
$destinationResourceGroupName = "testResourceGroup2"
$testResourceName1 = "testResource1"
$testResourceName2 = "testResource2"
$location = "West US"
$apiversion = "2014-04-01"
$providerNamespace ... |
combined_dataset/train/non-malicious/sample_14_12.ps1 | sample_14_12.ps1 | # Copyright (C) 2020,2023 VMware, Inc. All rights reserved.
. ".\utils.ps1"
try {
# IIS 7 and above
$applicationHostConfigPath = Join-Path $env:windir "system32\inetsrv\config\applicationHost.config"
if (Test-Path $applicationHostConfigPath) {
$result = ((Get-Content $applicationHostCon... |
combined_dataset/train/non-malicious/Get-ScriptPerformancePro.ps1 | Get-ScriptPerformancePro.ps1 | #############################################################################\n##\n## Get-ScriptPerformanceProfile\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS... |
combined_dataset/train/non-malicious/231.ps1 | 231.ps1 | function Get-SCSMServiceRequestComment
{
PARAM
(
[Parameter(ParameterSetName = 'General',
Mandatory = $true)]
$DateTime = $((Get-Date).AddHours(-24)),
[Parameter(ParameterSetName = 'GUID')]
$GUID
)
IF ($PSBoundParameters['GUID'])
{
$Tickets = Get-SCSMObject -id $GUID
}
ELSE
{
if ($DateTim... |
combined_dataset/train/non-malicious/sample_40_4.ps1 | sample_40_4.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 = '83.1.0'
# Supported PSEditions
... |
combined_dataset/train/non-malicious/sample_16_15.ps1 | sample_16_15.ps1 | trap [Exception]
{
WriteTo-ErrorDebugReport -ErrorRecord $_
continue
}
If (!$Is_SiteServer) {
TraceOut "ConfigMgr Site Server not detected. This script gathers data only from a Site Server. Exiting."
exit 0
}
TraceOut "Started"
Import-LocalizedData -BindingVariable ScriptStrings
$sectiondescription... |
combined_dataset/train/non-malicious/PasswordNeverExpires.ps1 | PasswordNeverExpires.ps1 | # Synopsis:
# Windows Script to collect usernames and OU locations
# for User Account with Password Set to Never Expire
# and email .txt list to email address
# Author: VulcanX
# Date: 2011/10/11
# Version: 1.0
# Requirements:
# -Quest PSSnapin Installed Locally
# -SMTP Access to Relay/Exchange
# Import... |
combined_dataset/train/non-malicious/4098.ps1 | 4098.ps1 |
Set-Variable -Name Command -Scope Global -Force
Set-Variable -Name Computer -Scope Global -Force
Set-Variable -Name Computers -Scope Global -Force
Set-Variable -Name i -Scope Global -Value 1 -Force
Set-Variable -Name Output -Scope Global -Force
Set-Variable -Name RelativePath -Scope Global -Force
Set-Variable ... |
combined_dataset/train/non-malicious/Bytes.ps1 | Bytes.ps1 | #requires -version 2.0\nAdd-Type @"\npublic class Shift {\n public static int Right(int x, int count) { return x >> count; }\n public static uint Right(uint x, int count) { return x >> count; }\n public static long Right(long x, int count) { return x >> count; }\n public static ulong Right(ulong x, int ... |
combined_dataset/train/non-malicious/3935.ps1 | 3935.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/139.ps1 | 139.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_22_76.ps1 | sample_22_76.ps1 | <#
.SYNOPSIS
Adds an entry for the given IP address and hostname to a hosts file.
Does nothing if a matching entry already exists.
.PARAMETER IPAddress
IP address for the address/name pair which should be added to the hosts file.
.PARAMETER Hostname
Hostname for the address/name pair which sh... |
combined_dataset/train/non-malicious/Get-ExchangeDBSizes_2.ps1 | Get-ExchangeDBSizes_2.ps1 | <#
.SYNOPSIS
Get-ExchangeDBSizes - Gather data on Exchange 2007 / 2010 Mailbox Databases.
.DESCRIPTION
Gathers data from Exchange mailbox servers.
These data include:
Server\\StorageGroup\\Database (2007) or Database (2010),
Total Size (in GB) of the disk,
Size of the .edb file (in GB),
... |
combined_dataset/train/non-malicious/sample_59_78.ps1 | sample_59_78.ps1 | LMetoda se ne može izvršiti kada je onemogućena pohrana s više snimki stanja.oZahtjev je ograničen, previše zahtjeva za ažuriranje izvora podataka koje pokreće korisnik u kratkom razdoblju.pNema dovoljno dozvola za osvježavanje tablice u načinu rada Direct Lake, obratite se autoru ovog skupa podataka.Nije moguće zadrž... |
combined_dataset/train/non-malicious/2722.ps1 | 2722.ps1 |
if (Test-Path "$env:SystemRoot\clrver.exe") {
$counter = 0
& $env:SystemRoot\clrver.exe -all 2> $null | `
ConvertFrom-Csv -Delimiter `t -Header "PID","ProcessName","CLR Version" | `
ForEach-Object {
if ($counter -gt 1) {
$_
}
$counter += 1
... |
combined_dataset/train/non-malicious/Get-SPListItem.ps1 | Get-SPListItem.ps1 | #.Example
# Get-SPListItem "Scrum Team Assignments"
# Gets all the items in the list with the default columns on them
#.Example
# Get-SPListItem -Name "Scrum Team Assignments" -Property "Scrum Team","Team Role","Last","First"
# Gets all the items in the list with just the specified columns as properties
#.Ex... |
combined_dataset/train/non-malicious/Read-Choice.ps1 | Read-Choice.ps1 | function Read-Choice {
#.Synopsis
# Prompt the user for a choice, and return the (0-based) index of the selected item
#.Parameter Message
# The question to ask
#.Parameter Choices
# An array of strings representing the "menu" items, with optional ampersands (&) in them to mark (unique) characters to be used to... |
combined_dataset/train/non-malicious/1135.ps1 | 1135.ps1 |
$user = 'CarbonTestUser1'
$group1 = 'CarbonTestGroup1'
$password = 'a1z2b3y4!'
$containerPath = $null
$childPath = $null
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
Install-User -Username $user -Password ... |
combined_dataset/train/non-malicious/sample_12_74.ps1 | sample_12_74.ps1 | ConvertFrom-StringData @'
id_whoamioutput=Whoami Diagnostic Tool
id_whoamistatus=Running Whoami.exe to gather the user's SID, group memberships and privileges
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w... |
combined_dataset/train/non-malicious/sample_52_6.ps1 | sample_52_6.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#####################################################################################################
#
# Registers the WinRM endpoint for this instance of PowerShell.
#
# If the parameters '-PowerShellHome' were specified, it means that t... |
combined_dataset/train/non-malicious/Update-ISETabs.ps1 | Update-ISETabs.ps1 | foreach($tab in $psISE.PowerShellTabs) {
foreach($file in $tab.Files) {
$position = Select-Object -InputObject $file.Editor -Property CaretLine, CaretColumn
$content = Get-Content $file.FullPath -Raw
if($content -ne $file.Editor.Text) {
$file.Editor.Text = Get-Content $file.FullPath -... |
combined_dataset/train/non-malicious/Kill-Process_v2.ps1 | Kill-Process_v2.ps1 | function Kill-Process(){
param(
[string[]]$ComputerNames,
[string[]]$ProcessNames,
$User
)
if ($ProcessNames -eq $null){Write-Error 'The parametre "ProcessNames" cannot be empty';break}
if ($User -is [String]){$Connection = Get-Credential -Credential $User}
if ($Connection -eq $null){
foreach ($int1 ... |
combined_dataset/train/non-malicious/BridgeBot 1.2.ps1 | BridgeBot 1.2.ps1 | ## Depends on the PoshXmpp.dll from http://CodePlex.com/PoshXmpp
#requires -pssnapin PoshXmpp
##########################################################################################
# @Author: Joel Bennnett
# @Usage:
# Start-JabberMirror.ps1 User@JabberServer.com Password "groupchat@oneserver.com" "groupchat@an... |
combined_dataset/train/non-malicious/2612.ps1 | 2612.ps1 | $LabConfig = Get-Content C:\git-repositories\PowerShell\MSFVMLab\LabVMS.json | ConvertFrom-Json
$WorkingDirectory = $LabConfig.WorkingDirectory
$DomainCred = Import-Clixml "$WorkingDirectory\vmlab_domainadmin.xml"
$dc = ( $LabConfig.Servers | Where-Object {$_.Class -eq 'DomainController'}).Name
Copy-VMFile -VMName $dc... |
combined_dataset/train/non-malicious/2075.ps1 | 2075.ps1 |
Describe "Script with a class definition run path" -Tags "CI" {
$TestCases = @(
@{ FileName = 'MyTest.ps1'; Name = 'path without a comma' }
@{ FileName = 'My,Test.ps1'; Name = 'path with a comma' }
)
It "Script with a class definition can run from a <Name>" -TestCases $TestCases {
... |
combined_dataset/train/non-malicious/Users_Contacts from CSV_2.ps1 | Users_Contacts from CSV_2.ps1 | #=============================================================================#
#=============================================================================#
#=============================================================================#
#
# SCRIPT : CreateOrUpdateUsersOrContacts.ps1
# LAST UPDATE : 9/18/2009... |
combined_dataset/train/non-malicious/3948.ps1 | 3948.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/3763.ps1 | 3763.ps1 |
function Test-CreateIntegrationAccountMap
{
$xslt1FilePath = Join-Path (Join-Path $TestOutputRoot "Resources") "SampleXslt1Map.xslt"
$xslt2FilePath = Join-Path (Join-Path $TestOutputRoot "Resources") "SampleXslt2Map.xslt"
$xslt3FilePath = Join-Path (Join-Path $TestOutputRoot "Resources") "SampleXslt3M... |
combined_dataset/train/non-malicious/sample_49_7.ps1 | sample_49_7.ps1 | #
# Module manifest for module 'OCI.PSModules.Operatoraccesscontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Operatoraccesscontrol.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
#... |
combined_dataset/train/non-malicious/sample_12_85.ps1 | sample_12_85.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\resolve@1.22.8\node_modules\resolve\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\resolve@... |
combined_dataset/train/non-malicious/sample_55_87.ps1 | sample_55_87.ps1 | . "$PSScriptRoot/api.ps1"
. "$PSScriptRoot/../php/api.ps1"
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$project = Get-Project-Definition
$env:allegro_root = Resolve-Path -Path (Get-Project-Root)
$env:include_path = ".:" + $env:allegro_root + ":" + $env:allegro_root + "/External"
$env:php_ini_pa... |
combined_dataset/train/non-malicious/sample_67_9.ps1 | sample_67_9.ps1 | #
# Module manifest for module 'ClientContext'
#
# Generated by: JakubVanak
#
# Generated on: 01.05.2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'ClientContext.psm1'
# Version number of this module.
ModuleVersion = '0.0.1'
# Supported PSEditions
# Comp... |
combined_dataset/train/non-malicious/sample_50_1.ps1 | sample_50_1.ps1 | #
# Module manifest for module 'OCI.PSModules.Core'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Core.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/2200e57e-b53f-4e8d-96c9-43d4360ace3e.ps1 | 2200e57e-b53f-4e8d-96c9-43d4360ace3e.ps1 | # Environment proprties
[string]$QTDIR = "C:\\Qt\\4.8.3-msvc2008"
[string]$rootDir = "C:\\Build\\"
[string]$buildDir = "C:\\Build\\build_dir\\"
[string]$outputDir = "C:\\Build\\output_dir\\"
[string]$svnDir = "C:\\Build\\build_dir\\vacuum"
[string]$svnUrl = "http://vacuum-im.googlecode.com/svn/trunk/"
[string]... |
combined_dataset/train/non-malicious/2727.ps1 | 2727.ps1 |
Get-HotFix | Select-Object HotfixID, Caption, Description, InstalledBy |
combined_dataset/train/non-malicious/sample_63_44.ps1 | sample_63_44.ps1 | <#
.SYNOPSIS
UninstallSyncServiceIIS.ps1 script file
This is a place-holder file only fofr agent patch build purposes
#>
Write-Host "This file functionality is deprecated and is place-holder only"
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# ... |
combined_dataset/train/non-malicious/sample_56_51.ps1 | sample_56_51.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/565.ps1 | 565.ps1 |
function Add-SPODocumentLibrary
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$listTitle
)
Add-SPOList -listTitle $listTitle -templateType "DocumentLibrary"
}
|
combined_dataset/train/non-malicious/sample_40_9.ps1 | sample_40_9.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.LoadTesting.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.LoadTesting.Module]::Instance
# Export nothing to clear implicit ex... |
combined_dataset/train/non-malicious/sample_5_1.ps1 | sample_5_1.ps1 | // Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved.
// ==================================================================
// DCIM_OpaqueManagementData
// ==================================================================
[dynamic, provider("dcismprovider"),
Description(
"DCI... |
combined_dataset/train/non-malicious/sample_7_91.ps1 | sample_7_91.ps1 | ConvertFrom-StringData @'
id_sccm_activity_iisvdirinfo=Gathering IIS Virtual Directories Information
id_sccm_iisvdirinfo_vdir=Obtaining a list of IIS Virtual Directories
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYC... |
combined_dataset/train/non-malicious/1148.ps1 | 1148.ps1 |
$cert = $null
$ipAddress = '1.2.3.4'
$ipV6Address = '::1234'
$port = '8483'
$ipPort = '{0}:{1}' -f $ipAddress,$port
$ipv6Port = '[{0}]:{1}' -f $ipV6Address,$port
$appID = '454f19a6-3ea8-434c-874f-3a860778e4af'
$ipV6AppID = 'b01fa31e-d255-48df-983e-c5c6dd0ccd03'
function Start-TestFixture
{
& (Join-Path... |
combined_dataset/train/non-malicious/sample_61_83.ps1 | sample_61_83.ps1 | #
# Module manifest for module 'OCI.PSModules.Psql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Psql.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/1719.ps1 | 1719.ps1 | Function Get-ServiceNowAttachment {
[System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidUsingConvertToSecureStringWithPlainText','')]
[System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidGlobalVars','')]
[CmdletBinding(DefaultParameterSetName,SupportsShouldProcess=$true)]
Param(
... |
combined_dataset/train/non-malicious/sample_67_11.ps1 | sample_67_11.ps1 | #
# Module manifest for module 'Az.StorageSync'
#
# Generated by: Microsoft Corporation
#
# Generated on: 7/31/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.StorageSync.psm1'
# Version number of this module.
ModuleVersion = '2.3.0'
# Supported PSEdit... |
combined_dataset/train/non-malicious/sample_53_14.ps1 | sample_53_14.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Ya existe una variable de entorno con este nombre y tipo.
EnvironmentErrorDoesNotExists=No existe una variable de entorno con este nombre y tipo.
'@
# SIG # Begin signature block
# MIIoLgYJKoZIhvcNAQcCoIIoHzCCKBsCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3... |
combined_dataset/train/non-malicious/Set-IPConfigv4.ps1 | Set-IPConfigv4.ps1 | # script parameters
param(
[string[]] $Computers = $env:computername,
[switch] $ChangeSettings,
[switch] $EnableDHCP,
[switch] $IpRelease
)
# script variables
$nl = [Environment]::NewLine
$Domain = "domain.local"
$DNSSuffix = @("domain.local,domain.com")
$DNSServers = @("10.10.0.1", "10.10.0.2", "10.10.0.3... |
combined_dataset/train/non-malicious/Set-Encoding.ps1 | Set-Encoding.ps1 | function Set-Encoding{
<#
.Synopsis
Takes a Script file or any other text file into memory
and Re-Encodes it in the format specified.
.Parameter FilePath
The path to the file to be re-encoded.
.Parameter Unicode
Outputs the file in Unicode format.
.Parameter UTF7
Outputs the file in UTF7 format.... |
combined_dataset/train/non-malicious/3513.ps1 | 3513.ps1 |
function Get-DataLakeStoreAccountName
{
return getAssetName
}
function Get-DataLakeAnalyticsAccountName
{
return getAssetName
}
function Get-ResourceGroupName
{
return getAssetName
}
function Invoke-HandledCmdlet
{
param
(
[ScriptBlock] $Command,
[switch] $IgnoreFailures
)
try... |
combined_dataset/train/non-malicious/finddupe_15.ps1 | finddupe_15.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/3103.ps1 | 3103.ps1 | param(
[switch]$SkipCabs,
[switch]$ShowProgress
)
$global:ProgressPreference = 'SilentlyContinue'
if ($ShowProgress) { $ProgressPreference = 'Continue' }
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
$tempDir = [System.IO.Path... |
combined_dataset/train/non-malicious/Get-ProcedureCallTree.ps1 | Get-ProcedureCallTree.ps1 | #requires -version 2
#Uses SQLParser.ps1 script http://poshcode.org/1445 to return Stored Procedure Call Tree
#Chad Miller
#http://chadwickmiller.spaces.live.com/
param ($procedure, $server, $database, $schema='dbo')
add-type -AssemblyName Microsoft.SqlServer.Smo
#Only create the dynamic SQLParser type if... |
combined_dataset/train/non-malicious/sample_3_16.ps1 | sample_3_16.ps1 | var OfficeaicopilotStrings={ChatContainerKeepItActionButtonText:"Conservar",ChatContainerUndoActionButtonText:"Desfacer",ChatContainerInsertActionButtonText:"Inserir",ChatContainerFeedbackNudgeContent:"Axúdanos a aprender e a adestrar os modelos marcando os resultados que xeren os LLM cun polgar cara arriba ou cara aba... |
combined_dataset/train/non-malicious/sample_59_97.ps1 | sample_59_97.ps1 | <#
.SYNOPSIS
Common Reporting functions across all modules/scenarios
.DESCRIPTION
Logging, Reporting
.INPUTS
Inputs (if any)
.OUTPUTS
Output (if any)
.NOTES
General notes
#>
function Set-AzStackHciOutputPath
{
param ($Path, $Source='AzStackHciEnvironmentChecker/Diagnostic')
... |
combined_dataset/train/non-malicious/Get-NestedGroups v_2.ps1 | Get-NestedGroups v_2.ps1 | Function Global:Get-NestedGroups {
<#
.SYNOPSIS
Enumerate all AD group memberships of an account (including nested membership).
.DESCRIPTION
This script will return the AD group objects for each group the user is a member of.
.PARAMETER UserName
The username whose group memberships to find.
.E... |
combined_dataset/train/non-malicious/Test if file is writable.ps1 | Test if file is writable.ps1 | function get-IsWritable(){
<#
.Synopsis
Command tests if a file is present and writable.
.Description
Command to test if a file is writeable. Returns true if file can be opened for write access.
.Example
get-IsWritable -path $foo
Test if file $foo is accesible for write acc... |
combined_dataset/train/non-malicious/sample_67_25.ps1 | sample_67_25.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_93.ps1 | sample_30_93.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 = '79.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_27_75.ps1 | sample_27_75.ps1 | #
# Module manifest for module 'OCI.PSModules.Governancerulescontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Governancerulescontrolplane.dll'
# Version number of this module.
ModuleVersion =... |
combined_dataset/train/non-malicious/sample_0_25.ps1 | sample_0_25.ps1 | ConvertFrom-StringData @'
id_ctsgrouppolicyclient=GroupPolicy Client
id_ctsgrouppolicyclientdescription=Collects information about GroupPolicy Client.
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE6... |
combined_dataset/train/non-malicious/sample_37_88.ps1 | sample_37_88.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.SYNOPSIS
Starts the language and debug services from the PowerShellEditorServices module.
.DESCRIPTION
PowerShell Editor Services Bootstrapper Script
----------------------------------------------
This script contains... |
combined_dataset/train/non-malicious/2508.ps1 | 2508.ps1 |
param(
$SQLServer = 'PSQLRPT2',
[string]$ScriptDir = 'C:\Users\MMessano\Desktop\DMartInterum',
$Beta = 0,
[String[]] $DatabaseList,
$FilePrefix = 'Log',
[switch]$Log
)
$DQuery = "SELECT CDCReportDB FROM ClientConnectionCDC WHERE Beta = " + $Beta + " ORDER BY 1"
$Databases = Invoke-Sqlcmd -ServerInstance $SQL... |
combined_dataset/train/non-malicious/sample_48_46.ps1 | sample_48_46.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/1610.ps1 | 1610.ps1 |
$a1 = New-Object System.Collections.ArrayList
$a2 = New-Object System.Collections.ArrayList
$a3 = New-Object System.Collections.ArrayList
1..10 | % {
[void]$a1.add((Measure-Command {
@(dir C:\temp -Recurse).where{$_.basename}
}).ticks)
[void]$a2.add((Measure-Command {
dir C:\temp -Re... |
combined_dataset/train/non-malicious/sample_40_78.ps1 | sample_40_78.ps1 | # Localized 05/08/2024 05:10 AM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Sí
PromptNoString=&No
BundleFound=Agrupación encontrada: {0}
PackageFound=Paquete encontrado: {0}
EncryptedBundleFound=Se ha encontrado un conjunto cifrado: {0}
En... |
combined_dataset/train/non-malicious/sample_22_12.ps1 | sample_22_12.ps1 | function Get-WACMOCounters {
<#
.SYNOPSIS
Gets all the Counters for a particular Object for Performance Monitor tool.
.DESCRIPTION
Gets all the Counters for a particular Object for Performance Monitor tool.
.ROLE
Readers
#>
param(
[Parameter(Mandatory = $true)]
[String]
$ObjectName
)
... |
combined_dataset/train/non-malicious/sample_29_7.ps1 | sample_29_7.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmtraces'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmtraces.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_42_46.ps1 | sample_42_46.ps1 |
function Stop-AzDataProtectionBackupInstanceProtection
{
[OutputType('System.Boolean')]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('This operation will stop protection of a backup instance an... |
combined_dataset/train/non-malicious/3479.ps1 | 3479.ps1 |
function Test-CreateSqlVirtualMachineGroup
{
$location = Get-LocationForTest
$rg = Create-ResourceGroupForTest $location
$groupName = Get-SqlVirtualMachineGroupName
$previousErrorActionPreferenceValue = $ErrorActionPreference
$ErrorActionPreference = "SilentlyContinue"
try
{
$group = Crea... |
combined_dataset/train/non-malicious/1134.ps1 | 1134.ps1 |
$tempDir = $null
$identity = $null
$dirPath = $null
$filePath = $null
$tempKeyPath = $null
$keyPath = $null
$childKeyPath = $null
$privateKeyPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Cryptography\CarbonTestPrivateKey.pfx' -Resolve
function Start-TestFixture
{
& (Join-Path -Path $TestDir -Chil... |
combined_dataset/train/non-malicious/Get-UserLogonLogoffScrip.ps1 | Get-UserLogonLogoffScrip.ps1 | ##############################################################################\n##\n## Get-UserLogonLogoffScript\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n... |
combined_dataset/train/non-malicious/sample_25_15.ps1 | sample_25_15.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\semver@7.5.4\node_modules\semver\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\semver@7.5.... |
combined_dataset/train/non-malicious/sample_11_87.ps1 | sample_11_87.ps1 | #
# Module manifest for module 'OCI.PSModules.Jmsjavadownloads'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jmsjavadownloads.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported... |
combined_dataset/train/non-malicious/1601.ps1 | 1601.ps1 |
function Get-SNMPData {
param (
[string]$ip
)
begin {
$ping = New-Object System.Net.NetworkInformation.Ping
$snmp = New-Object -ComObject olePrn.OleSNMP
}
process {
$info = [pscustomobject]@{
IP = $ip
Name = ''
Description = ''... |
combined_dataset/train/non-malicious/1384.ps1 | 1384.ps1 |
function Uninstall-CCertificate
{
[CmdletBinding(SupportsShouldProcess=$true,DefaultParameterSetName='ByThumbprint')]
param(
[Parameter(Mandatory=$true,ParameterSetName='ByThumbprint',ValueFromPipelineByPropertyName=$true,ValueFromPipeline=$true)]
[Parameter(Mandatory=$true,ParameterSetNam... |
combined_dataset/train/non-malicious/sample_0_38.ps1 | sample_0_38.ps1 |
if($debug -eq $true){[void]$shell.popup("Run DC_FCInfo.ps1")}
if ($OSArchitecture -eq 'ARM')
{
'Skipping running {fcinfo.exe} since it is not supported in ' + $OSArchitecture + ' architecture.' | WriteTo-StdOut
return
}
Import-LocalizedData -BindingVariable FCInfoStrings
Write-DiagProgress -Activity $FCIn... |
combined_dataset/train/non-malicious/986.ps1 | 986.ps1 | Param(
[parameter(Mandatory=$true)]
$CsvFilePath
)
$ErrorActionPreference = "Stop"
$scriptsPath = $PSScriptRoot
if ($PSScriptRoot -eq "") {
$scriptsPath = "."
}
. "$scriptsPath\asr_logger.ps1"
. "$scriptsPath\asr_common.ps1"
. "$scriptsPath\asr_csv_processor.ps1"
Function ProcessItemImpl($processor, $cs... |
combined_dataset/train/non-malicious/sample_49_56.ps1 | sample_49_56.ps1 | #
# Module manifest for module 'OCI.PSModules.Emaildataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Emaildataplane.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSE... |
combined_dataset/train/non-malicious/1070.ps1 | 1070.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ResolveRelativePathWithExplicitPath
{
$fileDir = New-TempDir
$to = Join-Path $fileDir 'myfile.txt'
$from = [System.IO.Path]::GetTempPath()
$relativ... |
combined_dataset/train/non-malicious/sample_22_8.ps1 | sample_22_8.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ArcResourceBridge.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ArcResourceBridge.internal.psm1'
if(Test-Path $internalMod... |
combined_dataset/train/non-malicious/1390.ps1 | 1390.ps1 |
function Enable-CIisSsl
{
[CmdletBinding(SupportsShouldProcess=$true,DefaultParameterSetName='IgnoreClientCertificates')]
param(
[Parameter(Mandatory=$true)]
[string]
$SiteName,
[Alias('Path')]
[string]
$VirtualPath = '',
... |
combined_dataset/train/non-malicious/921.ps1 | 921.ps1 |
$resourceGroup = "myResourceGroup"
$location = "westeurope"
$vmName = "myVM"
$cred = Get-Credential -Message "Enter a username and password for the virtual machine."
New-AzResourceGroup -Name $resourceGroup -Location $location
New-AzVM `
-ResourceGroupName $resourceGroup `
-Name $vmName `
-Location $locati... |
combined_dataset/train/non-malicious/4331.ps1 | 4331.ps1 | function Get-Hash
{
[CmdletBinding()]
Param
(
[string]
$locationString
)
if(-not $locationString)
{
return ""
}
$sha1Object = New-Object System.Security.Cryptography.SHA1Managed
$stringHash = $sha1Object.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($lo... |
combined_dataset/train/non-malicious/sample_14_15.ps1 | sample_14_15.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Microsoft.PowerShell.Utility\Import-LocalizedData -BindingVariable Strings -FileName Strings -ErrorAction Ignore
Microsoft.PowerShell.Management\Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 | ForEach-Object {
. $PSItem.FullName
}
... |
combined_dataset/train/non-malicious/878.ps1 | 878.ps1 | function new-hdinsightwithscriptaction {
$ErrorActionPreference = "Stop"
$context = Get-AzContext
if ($context -eq $null)
{
Connect-AzAccount
}
$context
$resourceGroupName = Read-Host -Prompt "Enter the resource group name"
$location = Read-Host ... |
combined_dataset/train/non-malicious/sample_0_32.ps1 | sample_0_32.ps1 | #
# PowerConsole profile
#
<#
.SYNOPSIS
Clear the host content.
.DESCRIPTION
This function replaces the standard Clear-Host and is aliased by "cls".
#>
function Clear-Host
{
$host.PrivateData.ClearHost()
}
<#
.SYNOPSIS
Simple path completion function for PowerConsole.
#>
funct... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.