full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/sample_52_5.ps1 | sample_52_5.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.apach... |
combined_dataset/train/non-malicious/Select-ToString_2.ps1 | Select-ToString_2.ps1 | [CmdletBinding(DefaultParameterSetName='DefaultParameter')]
param(
[Parameter(ValueFromPipeline=$true)]
[System.Management.Automation.PSObject]
${InputObject},
[Parameter(ParameterSetName='DefaultParameter', Position=0, Mandatory=$true)]
[System.String[]]
${Property},
[Parameter(... |
combined_dataset/train/non-malicious/Convert-BounceToX_9.ps1 | Convert-BounceToX_9.ps1 | # $Id: Convert-BounceToX500.ps1 610 2010-11-16 00:39:19Z jon $
# $Revision: 610 $
#.Synopsis
# Convert Bounce to X500
#.Description
# Convert URL Encoded address in a Bounce message to an X500 address
# that can be added as an alias to the mail-enabled object
#.Parameter bounceAddress
# URL Encoded bounce... |
combined_dataset/train/non-malicious/sample_56_38.ps1 | sample_56_38.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/932.ps1 | 932.ps1 |
$apiVersion = "2015-04-08"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$tableName = "table1"
$accountResourceName = $accountName + "/table/"
$tableResourceName = $accountName + "/table/" + $tableName
$tableResourceType = "Microsoft.DocumentDb/databaseAccounts/apis/tables"
Read-Host -Pro... |
combined_dataset/train/non-malicious/3767.ps1 | 3767.ps1 |
function Test-GetAzLogicAppTrigger
{
$resourceGroup = TestSetup-CreateResourceGroup
$resourceGroupName = $resourceGroup.ResourceGroupName
$workflowName = getAssetname
$location = Get-Location "Microsoft.Logic" "workflows" "West US"
$definitionFilePath = Join-Path "Resources" "TestSimpleWorkflowTrig... |
combined_dataset/train/non-malicious/3278.ps1 | 3278.ps1 |
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '', Scope='Class', Target='*')]
class SlackBackend : Backend {
[string[]]$MessageTypes = @(
'channel_rename'
'member_joined_channel'
'member_left_channel'
'message'
... |
combined_dataset/train/non-malicious/1947.ps1 | 1947.ps1 |
Describe "Get-Unique DRT Unit Tests" -Tags "CI" {
It "Command get-unique works with AsString switch" {
$inputArray = "aa","aa","Aa","ba","BA","BA"
$results = $inputArray | Get-Unique -AsString
$results.Length | Should -Be 4
$results[0] | Should -BeExactly "aa"
$results[1]... |
combined_dataset/train/non-malicious/sample_51_44.ps1 | sample_51_44.ps1 | define({"artv":{"smartview":[645],},"artvi":{"smartview":[645],},"artvie":{"smartview":[645],},"artview":{"smartview":[645],},"as":{"as":[645],},"as91":{"as9132":[407],},"as913":{"as9132":[407],},"as9132":{"as9132":[407],},"asci":{"ascii":[127,147,214,239,368,397,496],},"ascii":{"ascii":[127,147,214,239,368,397,496],},... |
combined_dataset/train/non-malicious/sample_15_20.ps1 | sample_15_20.ps1 | [cmdletbinding()]
param([string]$targetBinary, [string]$installedDir, [string]$tlogFile, [string]$copiedFilesLog)
$g_searched = @{}
# Note: installedDir is actually the bin\ directory.
$g_install_root = Split-Path $installedDir -parent
$g_is_debug = (Split-Path $g_install_root -leaf) -eq 'debug'
# Ensure we create th... |
combined_dataset/train/non-malicious/sample_11_22.ps1 | sample_11_22.ps1 | #************************************************
# DC_RDSRDWeb.ps1
# Version 1.0.1
# Date: 21-01-2012
# Author: Daniel Grund - dgrund@microsoft.com
# Description:
# This script gets the IIS config
# 1.0.0 Beta release
# 1.0.1 Release
# TODO get windows\web\rdweb dir
#****************************************... |
combined_dataset/train/non-malicious/1880.ps1 | 1880.ps1 |
Describe "Using delimiters with Export-CSV and Import-CSV behave correctly" -tags "Feature" {
BeforeAll {
$delimiters = "/", " ", "@", "
"{", "}", "|", "<", ">", ";", "'",
'"', "~", "!", "%", "^", "*", "_", "+", ":",
"?", "-", "=", "[", "]", "."
$... |
combined_dataset/train/non-malicious/sample_42_53.ps1 | sample_42_53.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 = '75.1.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/BridgeBot 1.0.ps1 | BridgeBot 1.0.ps1 | ## Depends on the PoshXmpp.dll from http://CodePlex.com/PowerXmpp
#requires -pssnapin PoshXmpp
## Requires System.Web for the RSS-feed option
[Reflection.Assembly]::LoadWithPartialName("System.Web") | Out-Null
##########################################################################################
# @Author: Joe... |
combined_dataset/train/non-malicious/sample_8_58.ps1 | sample_8_58.ps1 | ConvertFrom-StringData @'
id_scheduletasks=Schedule Tasks Information
id_scheduletasksobtaining=Obtaining information about schedule tasks
id_scheduletaskssection=Schedule Tasks Information
id_scheduletasksoutput=Schedule Tasks List
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBgl... |
combined_dataset/train/non-malicious/sample_3_66.ps1 | sample_3_66.ps1 | #
# Module manifest for module 'OCI.PSModules.Vulnerabilityscanning'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vulnerabilityscanning.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
#... |
combined_dataset/train/non-malicious/2033.ps1 | 2033.ps1 |
Describe "UntrustedDataMode tests for variable assignments" -Tags 'CI' {
BeforeAll {
$testModule = Join-Path $TestDrive "UntrustedDataModeTest.psm1"
Set-Content -Path $testModule -Value @'
$scriptVar = 15
$Global:globalVar = "Hello"
function Test-Untrusted
... |
combined_dataset/train/non-malicious/704.ps1 | 704.ps1 |
function Connect-RsReportServer
{
[CmdletBinding()]
param
(
[AllowEmptyString()]
[AllowNull()]
[string]
$ComputerName,
[Alias('SqlServerInstance')]
[string]
$ReportServerInstance,
[Alias('SqlServerVersion')]
... |
combined_dataset/train/non-malicious/503.ps1 | 503.ps1 |
function Disable-InternetExplorerEnhancedSecurityConfiguration{
[CmdletBinding()]
param(
)
$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}"
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF... |
combined_dataset/train/non-malicious/sample_0_44.ps1 | sample_0_44.ps1 | #************************************************
# TS_SelectClusterNodes.ps1
# Version 1.0.1
# Date: 02-09-2011
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script asks customer to select the cluster nodes on which the diagnostic will obtain data from
#*************************************... |
combined_dataset/train/non-malicious/VMware and NetApp file f.ps1 | VMware and NetApp file f.ps1 | Add-PSSnapin VMware.VimAutomation.Core
Import-Module DataOntap
$cred = Get-VICredentialStoreItem -Host nau-vc.naucom.com -File c:\\users\\aaworkman\\powershell\\credentials.xml
Connect-VIServer nau-vc -User $cred.User -Password $cred.Password
$esxhost = "fargo-esx2.naucom.com"
$numberofclones = 10
$loc = Get-Fo... |
combined_dataset/train/non-malicious/sample_48_36.ps1 | sample_48_36.ps1 | #
# Module manifest for module 'OCI.PSModules.Limits'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Limits.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_31_7.ps1 | sample_31_7.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.MarketplaceOrdering.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module]::Instance
# Export nothing to c... |
combined_dataset/train/non-malicious/Import-Certificate_1.ps1 | Import-Certificate_1.ps1 | function Import-Certificate
{
param
(
[IO.FileInfo] $CertFile = $(throw "Paramerter -CertFile [System.IO.FileInfo] is required."),
[string[]] $StoreNames = $(throw "Paramerter -StoreNames [System.String] is required."),
[switch] $LocalMachine,
[switch] $CurrentUser,
[string] $CertPassword,
[switc... |
combined_dataset/train/non-malicious/Check Modules path_2..ps1 | Check Modules path_2..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/sample_29_5.ps1 | sample_29_5.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_38_87.ps1 | sample_38_87.ps1 |
param()
# generate rest API client
$errorActionPreference = "Stop"
# cleanup if exists
if (Test-Path ./clients) {
Write-Host "Removing old clients ..."
# we are on gitlab?
if ($null -ne $env:IS_GITLAB_CI) {
rm -rf ./clients
} else {
sudo rm -rf ./clients
}
}
if (Test-Path ./tor... |
combined_dataset/train/non-malicious/3428.ps1 | 3428.ps1 |
function Test-GetSubscriptionsEndToEnd
{
$allSubscriptions = Get-AzureRmSubscription
$firstSubscription = $allSubscriptions[0]
$id = $firstSubscription.Id
$tenant = $firstSubscription.TenantId
$name = $firstSubscription.Name
$subscription = $firstSubscription
Assert-True { $subscription -ne $null ... |
combined_dataset/train/non-malicious/sample_18_29.ps1 | sample_18_29.ps1 | #
# Module manifest for module 'OCI.PSModules.Licensemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSE... |
combined_dataset/train/non-malicious/Find-String_2.ps1 | Find-String_2.ps1 | <#
.Synopsis
Searches text files by pattern and displays the results.
.Description
Searches text files by pattern and displays the results.
.Notes
Based on versions from http://weblogs.asp.net/whaggard/archive/2007/03/23/powershell-script-to-find-strings-and-highlight-them-in-the-output.aspx and from http://pos... |
combined_dataset/train/non-malicious/2343.ps1 | 2343.ps1 |
$remove_users_found = $false
$today_object = Get-Date
$today_string = get-date -Format 'MM-dd-yyyy hh:mm tt'
$unused_conditions_met = {
!$_.isCriticalSystemObject -and
(!$_.Enabled -or
$_.PasswordExpired -or
!$_.LastLogonDate -or
($_.LastLogonDate.AddDays(60) -lt ... |
combined_dataset/train/non-malicious/sample_1_58.ps1 | sample_1_58.ps1 | // Copyright (c) 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
// ==================================================================
// DCIM_NetworkTransceiverView
// ==================================================================
[
Description ("DCIM_NetworkTransceiverView represents a Network ... |
combined_dataset/train/non-malicious/sample_65_55.ps1 | sample_65_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Networkfirewall'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Networkfirewall.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_0_59.ps1 | sample_0_59.ps1 | ConvertFrom-StringData @'
id_powercfg=Obtaining Power Manager Information
id_powercfgdesc=Running powercfg.exe to obtain power settings information
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JN... |
combined_dataset/train/non-malicious/sample_0_50.ps1 | sample_0_50.ps1 | @{
GUID="c61d6278-02a3-4618-ae37-a524d40a7f44 "
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
ModuleToProcess="PSDiagnostics.psm1"
Func... |
combined_dataset/train/non-malicious/Write-Log.ps1 | Write-Log.ps1 | function Write-Log {
#region Parameters
[cmdletbinding()]
Param(
[Parameter(ValueFromPipeline=$true,Mandatory=$true)] [ValidateNotNullOrEmpty()]
[string] $Message,
[Parameter()] [ValidateSet(“Error”, “Warn”, “Info”)]
[string] $Level = “Info”,
[Parameter()] [ValidateRange(1,30)]
... |
combined_dataset/train/non-malicious/2821.ps1 | 2821.ps1 | Function Start-SQLStatsToGraphite
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory = $false)]
[switch]$TestMode
)
$PSBoundParameters['ExcludePerfCounters'] = $true
$PSBoundParameters['SqlMetrics'] = $true
Start-StatsToGraphite @PSBoundParameters
} |
combined_dataset/train/non-malicious/Wake-OrphanedVMHost.ps1 | Wake-OrphanedVMHost.ps1 | #requires -pssnapin VMware.VimAutomation.Core
# http://get-admin.com/blog/?p=342
#Get any cluster that has DPM Enabled
$Clusters = @()
$Clusters += Get-Cluster -verbose:$false | Where-Object { (Get-View -VIObject $_ -verbose:$false).ConfigurationEx.DpmConfigInfo.Enabled }
Write-Verbose "$(get-date -uformat %T) Fo... |
combined_dataset/train/non-malicious/104237c9-a8e9-419e-b285-638b60444a56.ps1 | 104237c9-a8e9-419e-b285-638b60444a56.ps1 | # by @bernd_k aka @sqlsulidae http://sqlsulidae.blogspot.com/
#
# This is an extension of the script you find at
# http://www.sqlmusings.com/2009/08/21/sql-server-powershell-how-to-view-your-ssrs-reports-rdl-using-powershell-and-reportviewer/
# I show ... |
combined_dataset/train/non-malicious/132.ps1 | 132.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 ... |
combined_dataset/train/non-malicious/4382.ps1 | 4382.ps1 | function Get-ModuleDependencies
{
Param (
[Parameter(Mandatory=$true)]
[PSModuleInfo]
$PSModuleInfo,
[Parameter(Mandatory=$true)]
[string]
$Repository,
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PS... |
combined_dataset/train/non-malicious/7fb49cb3-a349-4afb-ac39-1027dd643188.ps1 | 7fb49cb3-a349-4afb-ac39-1027dd643188.ps1 | function Get-Parameter
{
[OutputType('System.String')]
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)]
[String]$Command,
[Parameter(Position=1)]
[String[]]$Name=@('*'),
[Parameter()]
[ValidateSet('Name','Type','Pos','BV','... |
combined_dataset/train/non-malicious/sample_6_80.ps1 | sample_6_80.ps1 | ConvertFrom-StringData @'
id_ctsdirectaccessclient=DirectAccess Client
id_ctsdirectaccessclientdescription=Collects information about DirectAccess client.
id_ctstcpip=TCPIP
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEe... |
combined_dataset/train/non-malicious/sample_5_72.ps1 | sample_5_72.ps1 | ConvertFrom-StringData @'
id_ctsdhcpserver=DHCP Server
id_ctsdhcpserverdescription=Collects information about DHCP Server.
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAI... |
combined_dataset/train/non-malicious/1580.ps1 | 1580.ps1 | function Out-MrSpeech {
[CmdletBinding()]
param (
[Parameter(Mandatory,
ValueFromPipeline)]
[string]$Phrase
)
Add-Type -AssemblyName System.Speech
$voice = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer
$voice.Speak($Phrase)
} |
combined_dataset/train/non-malicious/1295.ps1 | 1295.ps1 |
function Set-CServiceAcl
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[Parameter(Mandatory=$true)]
[Security.AccessControl.DiscretionaryAcl]
$Dacl
)
Set-StrictMode ... |
combined_dataset/train/non-malicious/sample_53_84.ps1 | sample_53_84.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
[CmdletBinding(DefaultParamet... |
combined_dataset/train/non-malicious/sample_33_74.ps1 | sample_33_74.ps1 | #
# Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker'
#
# Generated by: Microsoft Corporation
#
# Generated on: 19/01/2022
#
@{
# Script module or binary module file associated with this manifest.
RootModule = ''
# Version number of this module.
ModuleVersion = '1.2100.25... |
combined_dataset/train/non-malicious/sample_5_7.ps1 | sample_5_7.ps1 | #
# This script launches the VC redist executable and handles certain error scenarios.
#
param(
[Parameter(Mandatory=$true)][String][ValidateNotNullOrEmpty()]$PayloadDirectory,
[Parameter(Mandatory=$true)][String][ValidateSet("arm64","x64","x86")]$Architecture,
[Parameter(Mandatory=$true)][String][Val... |
combined_dataset/train/non-malicious/Set-Domain_1.ps1 | Set-Domain_1.ps1 | function Set-Domain {
param( [switch]$help,
[string]$domain=$(read-host "Please specify the domain to join"),
[System.Management.Automation.PSCredential]$credential = $(Get-Crdential)
)
$usage = "`$cred = get-credential `n"
$usage += "Set-AvaDomain -domain corp.avanade.org -credential `$cred`n"
... |
combined_dataset/train/non-malicious/sample_3_89.ps1 | sample_3_89.ps1 | ConvertFrom-StringData @'
id_veritasvxiobadconfigflags_sd=VXIO device has a bad state flag and this may cause shadown copies of Veritas volumes to fail.
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE... |
combined_dataset/train/non-malicious/scriptable telnet client_1.ps1 | scriptable telnet client_1.ps1 | @@function read-stream ([Parameter(Posistion=0,Mandatory=$true)][validatenotnull()]
[System.Net.Sockets.NetworkStream]$stream,
[String]$expect = "")
{
$buffer = new-object system.byte[] 1024
$enc = new-object system.text.asciiEncoding
## Read all the data available from the stream, writing it to the
#... |
combined_dataset/train/non-malicious/1074.ps1 | 1074.ps1 |
& (Join-Path -Path $PSScriptRoot 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'Read-File' {
$file = ''
function Lock-File
{
param(
$Seconds
)
Start-Job -ScriptBlock {
$file = [IO.File]::Open($using:file, 'Open', 'Read'... |
combined_dataset/train/non-malicious/sample_26_49.ps1 | sample_26_49.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"
... |
combined_dataset/train/non-malicious/sample_12_65.ps1 | sample_12_65.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-ExecutionPolicy", "Set-E... |
combined_dataset/train/non-malicious/sample_4_18.ps1 | sample_4_18.ps1 | #************************************************
# TS_ServicingPendingXml.ps1
# Version 1.0.1
# Date: 6/6/2012
# Author: v-alyao
# Description: [Idea ID 3472] [Windows] Pending Transactions Rule Idea - Pending.xml
# Rule number: 3472
# Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.a... |
combined_dataset/train/non-malicious/3743.ps1 | 3743.ps1 | $pfxpwd='123'
$securepfxpwd=$pfxpwd | ConvertTo-SecureString -AsPlainText -Force
$data=123
$securedata=$data | ConvertTo-SecureString -AsPlainText -Force
$pfxPassword = "123"
function CreateAKVCertificate(
[string] $keyVault,
[string] $certificateName)
{
$pfxPath = Get-FilePathFromCommonData 'importpfx0... |
combined_dataset/train/non-malicious/Get-StaticMethodDefin.ps1 | Get-StaticMethodDefin.ps1 | #Steven Murawski
#http://blog.usepowershell.com
#03/20/2009
function Get-StaticMethodDefinition()
{
param ($Method, [Type]$Type=$null)
BEGIN
{
if ($Type -ne $null)
{
$Type | Get-StaticMethodDefinition $Method
}
}
PROCESS
{
if ($_ -ne $null)
{
$_ | Get-Member -Name $Method -St... |
combined_dataset/train/non-malicious/sample_49_71.ps1 | sample_49_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubbillingschedule'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubbillingschedule.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Sup... |
combined_dataset/train/non-malicious/3976.ps1 | 3976.ps1 |
function Test-VirtualHubRouteTableCRUD
{
$rgName = Get-ResourceGroupName
$rglocation = Get-ProviderLocation "ResourceManagement" "westcentralus"
$virtualWanName = Get-ResourceName
$virtualHubName = Get-ResourceName
$expressRouteGatewayName = Get-ResourceName
$routeTable1Name = ... |
combined_dataset/train/non-malicious/sample_59_89.ps1 | sample_59_89.ps1 | function Get-DockerHostSession {
$Session = Get-PSSession | Where-Object ComputerName -eq (Get-ValueFromALTestRunnerConfig -keyName 'dockerHost') | Where-Object State -eq Opened
if ($null -eq $Session) {
$Script = "New-PSSession -ComputerName $(Get-ValueFromALTestRunnerConfig -KeyName 'dockerHost') "
... |
combined_dataset/train/non-malicious/sample_13_75.ps1 | sample_13_75.ps1 | steps:
- script: git submodule update --init
displayName: 'Fetch submodules'
- task: UsePythonVersion@0
inputs:
versionSpec: $(PYTHON_VERSION)
addToPath: true
architecture: $(PYTHON_ARCH)
- script: python -m pip install --upgrade pip wheel
displayName: 'Install tools'
- script: python -m pip install... |
combined_dataset/train/non-malicious/sample_41_55.ps1 | sample_41_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Vbsinst'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vbsinst.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_56_18.ps1 | sample_56_18.ps1 | #
# Module manifest for module 'OCI.PSModules.Queue'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Queue.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/1001.ps1 | 1001.ps1 |
$myEndpoint = "<your-endpoint-URL>"
Set-AzContext -Subscription "<subscription-name-or-ID>"
New-AzEventGridSubscription -Endpoint $myEndpoint -EventSubscriptionName demoSubscriptionToAzureSub
|
combined_dataset/train/non-malicious/sample_11_0.ps1 | sample_11_0.ps1 | ##------------------------------------------------------------------
## <copyright file="Uninstall-StandaloneObservability.ps1" company="Microsoft">
## Copyright (C) Microsoft. All rights reserved.
## </copyright>
##------------------------------------------------------------------
[CmdletBinding(SupportsSh... |
combined_dataset/train/non-malicious/sample_26_92.ps1 | sample_26_92.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Set-AMT3PDS {
<#
.Synopsis
Stores data in the Intel Active Management Technology Third Party Data Storage
.Description
This CmdLet stores data into the Intel Active Management Technology (AMT) Third Party Data Storage (3PD... |
combined_dataset/train/non-malicious/VMtoolsUpgrade-disable_2.ps1 | VMtoolsUpgrade-disable_2.ps1 | #####################################################################
# Purpose: "Check and upgrade Tools during power cycling"
# Author: David Chung
# Support: IT Infrastructure
# Docs: N/A
#
# Instruction: 1. Create CSV file with list of servers
# 2. Execute script from PowerCLI
# 3. Enter... |
combined_dataset/train/non-malicious/3246.ps1 | 3246.ps1 |
class Role : BaseLogger {
[string]$Name
[string]$Description
[hashtable]$Permissions = @{}
Role([string]$Name, [Logger]$Logger) {
$this.Name = $Name
$this.Logger = $Logger
}
Role([string]$Name, [string]$Description, [Logger]$Logger) {
$this.Name = $Name
$this.D... |
combined_dataset/train/non-malicious/sample_49_46.ps1 | sample_49_46.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/Set-Computername_2.ps1 | Set-Computername_2.ps1 | function Set-ComputerName {
param( [switch]$help,
@@ [string]$originalPCName=$(read-host "Please specify the current name of the computer"),
[string]$computerName=$(read-host "Please specify the new name of the computer"))
@@ $usage = "set-ComputerName -originalPCname CurrentName -computername AnewName"
... |
combined_dataset/train/non-malicious/sample_20_56.ps1 | sample_20_56.ps1 | # Source: https://github.com/edbarnes-msft/DrDAV/blob/master/Test_MsDavConnection.ps1
<# Script name: tss_MSDavConnection.ps1
Purpose: - check WebDAV/WebClient related settings and connectivity
#>
param(
[Parameter(Mandatory=$False,Position=0,HelpMessage='Choose a writable output folder location, i.e. C:\Temp\ ... |
combined_dataset/train/non-malicious/sample_17_9.ps1 | sample_17_9.ps1 | ConvertFrom-StringData @'
id_netframeworkngenfiles_title=.Net Framework nGen files
id_netframeworkngenfiles_status=Collecting .Net Framework nGen files
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE... |
combined_dataset/train/non-malicious/sample_5_84.ps1 | sample_5_84.ps1 | import{a as t}from"./chunk-S2TTJTNL.js";import"./chunk-JW2F22G4.js";var e=Object.freeze({displayName:"Stata",fileTypes:["do","ado","mata"],foldingStartMarker:"\\{\\s*$",foldingStopMarker:"^\\s*\\}",name:"stata",patterns:[{include:"#ascii-regex-functions"},{include:"#unicode-regex-functions"},{include:"#constants"},{inc... |
combined_dataset/train/non-malicious/sample_38_96.ps1 | sample_38_96.ps1 | export function displayLastSelectedItem(id) {
var item = document.getElementById(id);
var scroll = document.getElementById(id + "-scroll");
if (!!item && !!scroll) {
try {
// To be optimized (how to detect the end of scroll container?)
for (var i = 0; i < 10; i++) {
... |
combined_dataset/train/non-malicious/sample_49_6.ps1 | sample_49_6.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ManagedServiceIdentity.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.ManagedServiceIdentity.Module]::Instance
# Export nothin... |
combined_dataset/train/non-malicious/4302.ps1 | 4302.ps1 |
. "$PSScriptRoot\PSGetFindModuleTests.Manifests.ps1"
. "$PSScriptRoot\PSGetTests.Generators.ps1"
function SuiteSetup {
Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue
Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue
$script:MyDocumentsModulesP... |
combined_dataset/train/non-malicious/sample_34_66.ps1 | sample_34_66.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 = '79.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/1514.ps1 | 1514.ps1 |
function Assert-True
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
[object]
$Condition,
[Parameter(Position=1)]
[string]
$Message
)
Set-StrictMode -Version 'Latest'
if( -not $condition )
{
Fail ... |
combined_dataset/train/non-malicious/Log4Net.xslt.ps1 | Log4Net.xslt.ps1 | <?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2"
version="1.0">
<xsl:output method="html" indent="yes" encoding="US-ASCII"/>
<xsl:temp... |
combined_dataset/train/non-malicious/sample_24_89.ps1 | sample_24_89.ps1 | #
# Module manifest for module 'OCI.PSModules.Visualbuilder'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Visualbuilder.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_39_2.ps1 | sample_39_2.ps1 | #
# Module manifest for module 'OCI.PSModules.Ocvp'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ocvp.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/chkhash_7.ps1 | chkhash_7.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... |
combined_dataset/train/non-malicious/sample_5_36.ps1 | sample_5_36.ps1 | ConvertFrom-StringData @'
id_depdisabled4gbcheck=Checking if DEP settings
id_depdisabled4gbcheckdesc=Checking if Data Execution Protection is enabled
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63... |
combined_dataset/train/non-malicious/Manual DNS Scavenging.ps1 | Manual DNS Scavenging.ps1 | #==========================================================================
#
# PowerShell Source File
#
# AUTHOR: Stephen Wheet
# NAME: dnsscavenge.ps1
# Version: 1.2
# Date: 8/12/10
#
# COMMENT:
# This script was created to manually scavenge DNS records for a given
# period. Specify the date of last r... |
combined_dataset/train/non-malicious/sample_24_97.ps1 | sample_24_97.ps1 | let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl();
let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/docker.webCore.eventHandlers.js"];
let currentScriptElement = document.querySelector("script[src='Scripts/docker.webCore.plugin.js']");
if (currentScriptElement !== nu... |
combined_dataset/train/non-malicious/1246.ps1 | 1246.ps1 |
[CmdletBinding()]
param(
)
Set-StrictMode -Version 'Latest'
Write-Verbose ('Checking if Carbon module loaded.')
if( -not (Get-Module -Name 'Carbon') )
{
Write-Verbose ('Loading Carbon module.')
Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon.psd1' -Resolve) -Global
}
|
combined_dataset/train/non-malicious/sample_60_42.ps1 | sample_60_42.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_47_46.ps1 | sample_47_46.ps1 | #
# Module manifest for module 'OCI.PSModules.Opsi'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Opsi.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/Netapp SDK.ps1 | Netapp SDK.ps1 | #Jason Ochoa 9/16/09
#Set up NaServerObject
$null = [reflection.assembly]::loadfile('C:\\DotNet\\ManageOntap.dll')
$Toaster1 = new-Object netapp.manage.naserver('Toaster1',1,0)
$Toaster1.setadminuser("admin",'password')
#-------------------functions to be remade
function global:Get-DF-s ($NaServer){#this data... |
combined_dataset/train/non-malicious/sample_7_46.ps1 | sample_7_46.ps1 | #************************************************
# DC_DSMisc.ps1
# Version 1.0.1
# Date: 07-10-2009
# VBScript by Craig Landis (clandis@microsoft.com)
# PS1 by Andret Teixeira
#************************************************
Import-LocalizedData -BindingVariable DSMiscStrings -FileName DC_DSMisc -UICulture e... |
combined_dataset/train/non-malicious/chkhash_27.ps1 | chkhash_27.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... |
combined_dataset/train/non-malicious/sample_21_68.ps1 | sample_21_68.ps1 | import { isScalar } from '../nodes/Node.js';
function mapIncludes(ctx, items, search) {
const { uniqueKeys } = ctx.options;
if (uniqueKeys === false)
return false;
const isEqual = typeof uniqueKeys === 'function'
? uniqueKeys
: (a, b) => a === b ||
(isScalar(a) &&
... |
combined_dataset/train/non-malicious/sample_45_81.ps1 | sample_45_81.ps1 | # region Generated
# ----------------------------------------------------------------------------------
# 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 obt... |
combined_dataset/train/non-malicious/Dir for days.ps1 | Dir for days.ps1 | #Initialize Global Variables
$NumYears = 0
$NumMonths = 0
$NumDays = 0
$LeapYearTest = 0
$FirstDate = ''
$LastDate = ''
$LastDateFeb = ''
$destination = Join-Path $env:USERPROFILE '\\Desktop\\Export Data' #Tells program where to write directory structure
#Get the first date from user
$FirstDate = Read-host ... |
combined_dataset/train/non-malicious/chkhash_2.ps1 | chkhash_2.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... |
combined_dataset/train/non-malicious/2485.ps1 | 2485.ps1 |
[CmdletBinding(DefaultParameterSetName = 'TCP')]
[OutputType([System.Management.Automation.PSCustomObject])]
param (
[Parameter(Mandatory)]
[string]$ComputerName,
[Parameter(Mandatory)]
[int]$Port,
[Parameter()]
[ValidateSet('TCP', 'UDP')]
[string]$Protocol = 'TCP',
[Parameter(ParameterSetName = 'TCP... |
combined_dataset/train/non-malicious/sample_13_4.ps1 | sample_13_4.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 = '75... |
combined_dataset/train/non-malicious/Get_Set Signature _2.0.ps1 | Get_Set Signature _2.0.ps1 | #Requires -version 2.0
## Authenticode.psm1 updated for PowerShell 2.0 (with time stamping)
####################################################################################################
## Wrappers for the Get-AuthenticodeSignature and Set-AuthenticodeSignature cmdlets
## These properly parse paths, so they... |
combined_dataset/train/non-malicious/2788.ps1 | 2788.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(Protocol,
State,
Component,
Process) as Cnt,
Protocol,
State,
Component,
Process
FROM
*netstat.csv
WHERE
ConPid not in ('0'; '4') and
State = 'LISTENING'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.