full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/1446.ps1 | 1446.ps1 |
function Set-CIniEntry
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]
$Path,
[Parameter(Mandatory=$true)]
[string]
$Name,
[string]
$Value,
[str... |
combined_dataset/train/non-malicious/sample_21_88.ps1 | sample_21_88.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/VMWare DS Migration.ps1 | VMWare DS Migration.ps1 | #####################################################
# Migrate a VM to new storage and set to Thin Prov #
#####################################################
# Set the VM name you want to move
$Server = 'SERVERNAME'
# Set the location you want to move the VM to
$DataStore = 'DATASTORE'
# Set the vCenter name... |
combined_dataset/train/non-malicious/sample_5_37.ps1 | sample_5_37.ps1 | #************************************************
# DC_DFSClient-Component.ps1
# Version 1.0
# Date: 2009-2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about DFS Client.
# Called from: Main Networking Diag, WebClient Interactive Diag, and others.
#************************... |
combined_dataset/train/non-malicious/3575.ps1 | 3575.ps1 |
$global:resourceType = "Microsoft.HealthcareApis/services"
function Test-AzRmHealthcareApisService{
$rgname = Get-ResourceGroupName
$rname = Get-ResourceName
$location = Get-Location
$offerThroughput = Get-OfferThroughput
$kind = Get-Kind
$object_id = Get-AccessPolicyObjectID;
try
{
... |
combined_dataset/train/non-malicious/sample_23_85.ps1 | sample_23_85.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias'... |
combined_dataset/train/non-malicious/2615.ps1 | 2615.ps1 | function New-LabVM{
[cmdletbinding()]
param([string][Parameter(Mandatory=$true)]$VMName
,[string][Parameter(Mandatory=$true)]$VMPath
,[string][Parameter(Mandatory=$true)]$VHDPath
,[string[]][Parameter(Mandatory=$true)]$VMSwitches
,[string[]]$ISOs
,[string]$VMSource
... |
combined_dataset/train/non-malicious/sample_9_46.ps1 | sample_9_46.ps1 |
#************************************************
# DC_EnvVars.ps1
# Version 2.0
# Date: 10-09-2012
# Author: clandis, andret
# Description: Collects environment variables (output of SET command)
#************************************************
Import-LocalizedData -BindingVariable EnvVarsStrings
Write-D... |
combined_dataset/train/non-malicious/sample_47_37.ps1 | sample_47_37.ps1 | #
# Module manifest for module 'OCI.PSModules.Waas'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waas.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_33_11.ps1 | sample_33_11.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
<#
.DESCRIPTION
Ensure XML is signed by Mi... |
combined_dataset/train/non-malicious/WSS_MOSS export.ps1 | WSS_MOSS export.ps1 | # Export sharepoint web contents with powershell like
# stsadm -o export -url http://localhost:80/wiki -filename export.cab -overwrite -versions 1
#
# http://www.sharepointblogs.com/mossms/default.aspx
# http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.deployment.aspx
param ( [string] $sitename = "h... |
combined_dataset/train/non-malicious/Audit Script_2.ps1 | Audit Script_2.ps1 | #####################################################
# #
# Audit script by Alan Renouf - Virtu-Al #
# Blog: http://teckinfo.blogspot.com/ #
# #
# Usage: Audit.ps1 'pathtolistofservers' #
# #
# The file is optional and needs to be a #
... |
combined_dataset/train/non-malicious/sample_17_69.ps1 | sample_17_69.ps1 | [CmdletBinding()]
param
(
[Parameter(Mandatory)]
[string]$AsOf,
[Parameter(Mandatory)]
[string]$Branch
)
Import-Module $(Join-Path $PSSCriptRoot Helpers.psm1)
(git rev-list -n 1 --before="$AsOf" "$branch")
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglg... |
combined_dataset/train/non-malicious/sample_30_49.ps1 | sample_30_49.ps1 | #
# Module manifest for module 'OCI.PSModules'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
# ID u... |
combined_dataset/train/non-malicious/sample_45_44.ps1 | sample_45_44.ps1 | <#
.SYNOPSIS
Powershell script to collect data about Geneva Metrics (AKA MDM, AKA Geneva Hot Path) data publication.
.DESCRIPTION
This script performs several operations for troubleshooting issues related to MetricsExtension such as:
- Collection of metric traffic.
- Collectio of information about the e... |
combined_dataset/train/non-malicious/Set-Computername_16.ps1 | Set-Computername_16.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"
if (... |
combined_dataset/train/non-malicious/1205.ps1 | 1205.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$user = $null
$url = 'http://test-revokehttpurlpermission:10383/'
function Start-Test
{
$user = Resolve-Identity -Name $CarbonTestUser.UserName
Grant-HttpUrlPermission -Url $url -Principal $user.FullName -Permission ... |
combined_dataset/train/non-malicious/chkhash_3.ps1 | chkhash_3.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/4361.ps1 | 4361.ps1 | function DeSerialize-PSObject
{
[CmdletBinding(PositionalBinding=$false)]
Param
(
[Parameter(Mandatory=$true)]
$Path
)
$filecontent = Microsoft.PowerShell.Management\Get-Content -Path $Path
[System.Management.Automation.PSSerializer]::Deserialize($filecontent)
} |
combined_dataset/train/non-malicious/sample_26_81.ps1 | sample_26_81.ps1 | # Localized 05/08/2024 05:10 AM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=是(&Y)
PromptNoString=否(&N)
BundleFound=找到了捆绑: {0}
PackageFound=找到包: {0}
EncryptedBundleFound=找到加密的包: {0}
EncryptedPackageFound=找到加密的包: {0}
CertificateFound=找到证书: ... |
combined_dataset/train/non-malicious/sample_4_68.ps1 | sample_4_68.ps1 | #
# Module manifest for module 'OCI.PSModules.Generativeaiagentruntime'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Generativeaiagentruntime.dll'
# Version number of this module.
ModuleVersion = '92.1... |
combined_dataset/train/non-malicious/547.ps1 | 547.ps1 |
function Add-SPOCurrencyFieldtoList
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string] $listTitle,
[Parameter(Mandatory=$true, Position=2)]
[string] $fieldName
)
$newField = "<Field Type='Currency' DisplayName='$fieldName' Name='$fieldName' required='FALSE'/>"
Add-... |
combined_dataset/train/non-malicious/sample_41_51.ps1 | sample_41_51.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/Get-BogonList.ps1 | Get-BogonList.ps1 | <#
.SYNOPSIS
Gets the bogon list.
.DESCRIPTION
The Get-BogonList script retrieves the bogon prefix list maintained by Team Cymru.
A bogon prefix is a route that should never appear in the Internet routing table.
A packet routed over the public Internet (not including over VPNs or other tunnels) s... |
combined_dataset/train/non-malicious/sample_41_78.ps1 | sample_41_78.ps1 | $resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent
# Import localization helper functions.
$helperName = 'PowerShellGet.LocalizationHelper'
$dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1"
Import-Module -Name $... |
combined_dataset/train/non-malicious/sample_54_55.ps1 | sample_54_55.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_21_1.ps1 | sample_21_1.ps1 | ConvertFrom-StringData @'
id_pagedpoold2dsymevent_sd=This Windows Server 2003 may run out of paged pool due to a version of symevent.sys.
id_kerneltagtokekb982010_sd=This machine have high usage of kernel memory pool tag Toke possibly caused by the DisableWindowsUpdateAccess user policy.
id_kerneltagrxm4setikb264745... |
combined_dataset/train/non-malicious/sample_55_15.ps1 | sample_55_15.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_67_23.ps1 | sample_67_23.ps1 | /*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.49.0(383fdf3fc0e1e1a024068b8d0fd4f3dcbae74d04)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-------------... |
combined_dataset/train/non-malicious/sample_64_75.ps1 | sample_64_75.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 = '85.2.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/Get-Clipboard.ps1 | Get-Clipboard.ps1 | #############################################################################\n##\n## Get-Clipboard\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\nRetrieve th... |
combined_dataset/train/non-malicious/sample_54_16.ps1 | sample_54_16.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.1.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_47_96.ps1 | sample_47_96.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.HealthcareApis.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.HealthcareApis.internal.psm1'
if(Test-Path $internalModulePat... |
combined_dataset/train/non-malicious/2427.ps1 | 2427.ps1 | $RegUninstallPaths = @(
'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall')
$VersionsToKeep = @('Java 7 Update 5')
Get-WmiObject Win32_Process | Where {$_.ExecutablePath -like '*Program FilesJava*'} |
Select @{n='Name';e={$_... |
combined_dataset/train/non-malicious/sample_7_42.ps1 | sample_7_42.ps1 | ConvertFrom-StringData @'
id_virtualization=Virtualization Information
id_virtualizationobtaining=Obtaining Information about Virtualization Environment
id_virtualizationoutput=Virtualization Information Output
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
... |
combined_dataset/train/non-malicious/ModuleWriteError.psm1.ps1 | ModuleWriteError.psm1.ps1 | ################################################################################
## Script Name: Module Write Error
## Created On: 1/7/2010
## Author: Thell Fowler
## Tribute: Joel 'Jaykul' Bennet
## File: ModuleWriteError.psm1
## Usage: import-module \\Path\\to\\module\\M... |
combined_dataset/train/non-malicious/sample_65_47.ps1 | sample_65_47.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
# Import Observability EventSource
$observabili... |
combined_dataset/train/non-malicious/sample_53_66.ps1 | sample_53_66.ps1 | #
# Module manifest for module 'OCI.PSModules.Threatintelligence'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Threatintelligence.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Suppo... |
combined_dataset/train/non-malicious/sample_10_99.ps1 | sample_10_99.ps1 | #************************************************
# TS_2628581_HPUPDUpgrade.ps1
# Version 1.0.1
# TemplateVersion 1.2
# Date: 04/17/2012 08:02:35
# Author: jasonf
# Description: Checks the registry for an HP UPD upgrade from 5.2 to 5.3 which is known to cause issues
#********************************************... |
combined_dataset/train/non-malicious/2445.ps1 | 2445.ps1 | function Start-PesterTest
{
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[ValidateScript({ Test-Path -Path $_ })]
[string]$Path,
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]$ComputerName,
[Parameter()]
[ValidateNotNullOrEmpty()]
[pscredential]$Credential... |
combined_dataset/train/non-malicious/FormsLib.ps1 | FormsLib.ps1 | # FormsLib.ps1
# contains some helper functions to create and modify Form controls
# in a PowerShell script used by RoboGUI.ps1
#
# /\\/\\o\\/\\/
# http://thePowerShellGuy.com
Function ConvertTo-HashTable ([string]$StringValue) {
invoke-expression ("@$StringValue".replace(',',';'))
}
Function ConvertTo... |
combined_dataset/train/non-malicious/PowerChart 0.5.ps1 | PowerChart 0.5.ps1 |
function New-PowerChart() {
[CmdletBinding(DefaultParameterSetName='DataTemplate')]
param(
[Parameter(Position=0, Mandatory=$true)]
[ValidateSet("Area","Bar","Bubble","Column","Line","Pie","Scatter")]
[String[]]
${ChartType}
,
[Parameter(Position=1, Mandatory=$true, HelpMessage='The data f... |
combined_dataset/train/non-malicious/2859.ps1 | 2859.ps1 | function BuildSetup {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[scriptblock]$setup
)
$psake.context.Peek().buildSetupScriptBlock = $setup
} |
combined_dataset/train/non-malicious/sample_29_19.ps1 | sample_29_19.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 = '83.2.0'
# Support... |
combined_dataset/train/non-malicious/sample_23_39.ps1 | sample_23_39.ps1 | var state = command.getTrait("state");
var manipData = services.manipulators.getManipulatorData("CameraManipulator");
var mode = manipData.getTrait("CameraManipulationMode");
var tool = new Object();
tool.activate = function () {
state.value = 2;
mode.value = 2; // Orbit mode
}
tool.deactivate = fun... |
combined_dataset/train/non-malicious/sample_1_44.ps1 | sample_1_44.ps1 | ConvertFrom-StringData @'
id_tcpipsettingscheck=Checking for KB 967224
id_tcpipsettingscheckdesc=Checking for modified TcpIp Reg Parameters
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX... |
combined_dataset/train/non-malicious/sample_14_81.ps1 | sample_14_81.ps1 | # Copyright ?2009, Microsoft Corporation. All rights reserved.
# You may use this code and information and create derivative works of it,
# provided that the following conditions are met:
# 1. This code and information and any derivative works may only be used for
# troubleshooting a) Windows and b) products for ... |
combined_dataset/train/non-malicious/ping check using dotNet _1.ps1 | ping check using dotNet _1.ps1 | function dnsref ($computername) {
$ErrorActionPreference = "SilentlyContinue"
$testrun=$Null
trap {
Write-Host "ERROR: $computername does not exist in DNS" -fore Yellow
Throw $_ }
$testrun=[net.dns]::GetHostByName($computername)
if ($testrun -eq $Null){
Write-Host "No DNS Record" }
else {
foreach ($ali... |
combined_dataset/train/non-malicious/Start-SQL 1.0.ps1 | Start-SQL 1.0.ps1 | # Start-Sql.ps1
###################################################################################################
# This is a SCRIPT which emits functions and variables into the global scope
# Most importantly, it uses a variable $SqlConnection which is expected to exist....
#
# On my computer, I set default val... |
combined_dataset/train/non-malicious/sample_13_51.ps1 | sample_13_51.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/sample_19_5.ps1 | sample_19_5.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\glob@10.3.10\node_modules\glob\dist\esm\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\glob@10.... |
combined_dataset/train/non-malicious/sample_13_18.ps1 | sample_13_18.ps1 | /*!---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*----------------------------------------------------------*/
var ko = require("knockout");
var Path = require("path");
// Standarize current directoy to avoid diferent expectations depending
... |
combined_dataset/train/non-malicious/sample_0_95.ps1 | sample_0_95.ps1 | [dynamic, provider("dcismprovider")]
class DCIM_RegisteredProfile : CIM_RegisteredProfile
{
[
Description ("The organization that defines this specification."),
Modelcorrespondence { "CIM_RegisteredSpecification.OtherRegisteredOrganization" },
Override ("RegisteredOrganization"),
... |
combined_dataset/train/non-malicious/sample_2_17.ps1 | sample_2_17.ps1 | [dynamic, provider("dcismprovider"),
Association, Description(
"DCIM_SystemDSensorevice is a derivation of "
"CIM_SystemDevice, and represents a System Device.")]
class DCIM_SystemSensorDevice : CIM_SystemDevice
{
[
Aggregate,
Description ("The parent system in the Associa... |
combined_dataset/train/non-malicious/sample_40_61.ps1 | sample_40_61.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/SharePoint build script.ps1 | SharePoint build script.ps1 | #BASEPATH variable should be explicitly set in every
#build script. It represents the "root"
#of the project folder, underneath which all tools, source, config settings,
#and deployment folder lie.
$global:basepath = (resolve-path ..).path
function Set-BasePath([string]$path)
{
$global:basepath = $path
}
... |
combined_dataset/train/non-malicious/1996.ps1 | 1996.ps1 |
Describe "Tab completion bug fix" -Tags "CI" {
It "Issue
$result = TabExpansion2 -inputScript "[system.manage" -cursorColumn "[system.manage".Length
$result.CompletionMatches | Should -HaveCount 1
$result.CompletionMatches[0].CompletionText | Should -BeExactly "System.Management"
}
... |
combined_dataset/train/non-malicious/The Letter Diamond_1.ps1 | The Letter Diamond_1.ps1 | ## Write a program which draws a diamond of the form illustrted
## below. The letter which is to appear at the widest point of the
## figure (E in the example) is to be specified as the input data.
## A
## B B
## C C
## D D
## E E
## D D
## ... |
combined_dataset/train/non-malicious/Kill-Process_1.ps1 | Kill-Process_1.ps1 | function Kill-Process() {
param(
[string[]]$ComputerNames,
[string[]]$ProcessNames,
$User
)
###########################################################################################################
if ($ProcessNames -eq $null) {Write-Error 'The parametre "ProcessNames" cannot be empty';break}
################... |
combined_dataset/train/non-malicious/sample_29_58.ps1 | sample_29_58.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_43_89.ps1 | sample_43_89.ps1 | @{
GUID="eb74e8da-9ae2-482a-a648-e96550fb8733"
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="© Microsoft Corporation. All rights reserved."
Description='PowerShell module for working with ZIP archives.'
ModuleVersion="1.2.5"
PowerShellVersion="3.0"
FunctionsToExport = @('Compress... |
combined_dataset/train/non-malicious/3964.ps1 | 3964.ps1 | function New-TestDeployment
{
param(
$rgName,
$location,
$virtualMachineName,
$storageAccountName,
$routeTableName,
$networkInterfaceName,
$networkSecurityGroupName,
$virtualNetworkName
)
$templateFile = "${PsScriptRoot}/../../TestData/Deploym... |
combined_dataset/train/non-malicious/sample_11_23.ps1 | sample_11_23.ps1 | #************************************************
# TS_UnableToAddNetworkPrintersErrorCheck.ps1
# Version 1.0.1
# Date: 7/19/2013
# Author: v-kaw
# Description: [KSE Rule] [ Windows V3] Presence of lots of folders inside \spool\prtprocs\ causes failure to install print queues
# Rule number: d4047602-196c-443f-9... |
combined_dataset/train/non-malicious/sample_34_70.ps1 | sample_34_70.ps1 | #
# Module manifest for module 'OCI.PSModules.Fleetsoftwareupdate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Fleetsoftwareupdate.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Sup... |
combined_dataset/train/non-malicious/Product key.ps1 | Product key.ps1 | function Get-SerialNumber {
$regVal = Get-ItemProperty $regDir.PSPath
$arrVal = $regVal.DigitalProductId
$arrBin = $arrVal[52..66]
$arrChr = "B", "C", "D", "F", "G", "H", "J", "K", "M", "P", "Q", "R", `
"T", "V", "W", "X", "Y", "2", "3", "4", "6", "7", "8", "9"
for ($i = 24; $i -ge 0; $i--... |
combined_dataset/train/non-malicious/LocalAdminGUI.ps1 | LocalAdminGUI.ps1 | Add-Type -AssemblyName PresentationCore
Add-Type -AssemblyName PresentationFramework
[xml]$XAML = @'
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="316" MinWidth="316" MaxWidth="316"
Title="Local Admins To... |
combined_dataset/train/non-malicious/sample_66_42.ps1 | sample_66_42.ps1 | ################################################################################
# MIT License
#
# Copyright (c) 2024 Microsoft and Contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in th... |
combined_dataset/train/non-malicious/sample_64_2.ps1 | sample_64_2.ps1 | #
# Module manifest for module 'OCI.PSModules.Globallydistributeddatabase'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Globallydistributeddatabase.dll'
# Version number of this module.
ModuleVersion =... |
combined_dataset/train/non-malicious/Veeam backup to OVF.ps1 | Veeam backup to OVF.ps1 | # This script runs a different OVF conversion depending on the Day of the week.
$VeeamJob = "JobName"
$server1 = 'ServerName'
asnp VMware.VimAutomation.Core -ErrorAction SilentlyContinue
asnp VeeamPSSnapin -ErrorAction SilentlyContinue
$Dest1 = "R:\\VMWARE\\OVF\\$Server1\\"
$OVFFile1 = "$($Dest1)$($Server1)... |
combined_dataset/train/non-malicious/337.ps1 | 337.ps1 | function Remove-PSFAlias
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $true)]
[string[]]
$Name,
[switch]
$Force
)
process
... |
combined_dataset/train/non-malicious/3671.ps1 | 3671.ps1 |
function Test-CreateInstancePool
{
$props = Get-InstancePoolTestProperties
$virtualNetwork = CreateAndGetVirtualNetworkForManagedInstance $props.vnetName $props.subnetName $props.location $props.resourceGroup
$subnetId = $virtualNetwork.Subnets.where({ $_.Name -eq $props.subnetName... |
combined_dataset/train/non-malicious/VI Report.ps1 | VI Report.ps1 | param( [string] $VIServer )
if ($VIServer -eq ""){
Write-Host
Write-Host "Please specify a VI Server name eg...."
Write-Host " powershell.exe Report.ps1 MYVISERVER"
Write-Host
Write-Host
exit
}
function PreReq
{
if ((Test-Path REGISTRY::HKEY_CLASSES_ROOT\\Word.Application) -eq $False){
Wr... |
combined_dataset/train/non-malicious/sample_59_61.ps1 | sample_59_61.ps1 | <ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit">
<Style x:Key="MenuExpanderStyle" TargetType="controls... |
combined_dataset/train/non-malicious/sample_34_22.ps1 | sample_34_22.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 = '73.1.0'
# Supported P... |
combined_dataset/train/non-malicious/DHCP Backup.ps1 | DHCP Backup.ps1 | <#
DHCP Backups Powershell Script
v1.1
2012-06-04
By VulcanX
.SYNOPSIS
This script will automate the backup of DHCP Databases and copy
them into a DFS Store at the following link:
\\\\domain.com\\DHCP
Each location has a seperate folder and once the backup... |
combined_dataset/train/non-malicious/sample_64_98.ps1 | sample_64_98.ps1 | try {
# Save the project root path
$projRoot = (Get-Location).Path + "\.."
# Check if the 'venv' directory exists
if (Test-Path "$projRoot/venv") {
# Remove the existing 'venv' directory
Remove-Item -Recurse -Force "$projRoot/venv"
Write-Host "Existing virtual environment remove... |
combined_dataset/train/non-malicious/HttpRest 1.4.ps1 | HttpRest 1.4.ps1 | #requires -version 2.0
## HttpRest module version 1.4
####################################################################################################
## Still only the initial stages of converting to a full v2 module
## Based on the REST api from MindTouch's Dream SDK
##
## INSTALL:
## You need mindtouch.dr... |
combined_dataset/train/non-malicious/1585.ps1 | 1585.ps1 |
function Find-MrParameterAlias {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]$CmdletName,
[ValidateNotNullOrEmpty()]
[string]$ParameterName = '*'
)
(Get-Command -Name $CmdletName).parameters.values |
Where-Object Name -like $ParameterName |
... |
combined_dataset/train/non-malicious/3198.ps1 | 3198.ps1 | Function Get-SQLInstance {
[cmdletbinding()]
Param (
[parameter(ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]
[Alias('__Server','DNSHostName','IPAddress')]
[string[]]$ComputerName = $env:COMPUTERNAME,
[switch]$WMI
)
Begin {
$baseKeys = ... |
combined_dataset/train/non-malicious/Get-OnlineHelp_3.ps1 | Get-OnlineHelp_3.ps1 | #requires -version 2.0
## An update using New-WebServiceProxy to the MSDN ContentService instead of HttpRest
## See: http: //services.msdn.microsoft.com/ContentServices/ContentService.asmx
## YOU MUST SAVE THIS FILE AS Get-OnlineHelp.ps1 in your path, and call it as Get-OnlineHelp
## __OR__ dot-source it -- DO NO... |
combined_dataset/train/non-malicious/finddupe_21.ps1 | finddupe_21.ps1 | 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
try
{
$stream = $file.OpenRead()
}
... |
combined_dataset/train/non-malicious/2784.ps1 | 2784.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(Protocol,
ForeignAddress,
State,
Component,
Process) as ct,
Protocol,
ForeignAddress,
State,
Component,
Process
FROM
*netstat.csv
WHERE
ConPid no... |
combined_dataset/train/non-malicious/3408.ps1 | 3408.ps1 |
function Test-CreateNewWebAppBackup
{
$rgName = Get-ResourceGroupName
$wName = Get-WebsiteName
$location = Get-Location
$whpName = Get-WebHostPlanName
$backupName = Get-BackupName
$tier = "Standard"
$stoName = 'sto' + $rgName
$stoContainerName = 'container' + $rgName
$s... |
combined_dataset/train/non-malicious/sample_31_74.ps1 | sample_31_74.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Ilyen nevű és típusú környezeti változó már létezik.
EnvironmentErrorDoesNotExists=Ilyen nevű és típusú környezeti változó nem létezik.
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaT... |
combined_dataset/train/non-malicious/sample_14_78.ps1 | sample_14_78.ps1 | ##----------------------------------------------------------------------------
## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved.
##----------------------------------------------------------------------------
# Import shared functions and vars
. ./Commonalities.ps1
# Script used to reinstall... |
combined_dataset/train/non-malicious/Get-MemberBody v2.ps1 | Get-MemberBody v2.ps1 | <#
Requires ILSpy
Tested with version 2.1.0.1603
http://ilspy.net/
You'll need to adjust this to your ILSpy path
#>
[void][System.Reflection.Assembly]::LoadFrom(".\\ILSpy.exe")
function Get-MemberBody
{
[CmdletBinding()]
param(
[Parameter(ParameterSetName="MI")]
[System.... |
combined_dataset/train/non-malicious/sample_23_20.ps1 | sample_23_20.ps1 | # Setting all environment variables for the venv
let path-name = (if ((sys).host.name == "Windows") { "Path" } { "PATH" })
let virtual-env = "C:\D_SAVE\Projects\Pyduino\env"
let bin = "Scripts"
let path-sep = ";"
let old-path = ($nu.path | str collect ($path-sep))
let venv-path = ([$virtual-env $bin] | path join)
let... |
combined_dataset/train/non-malicious/Get-MailboxesOverSizeLim_1.ps1 | Get-MailboxesOverSizeLim_1.ps1 | # -------------------------------------------------------------------------------
# Script: Get-MailboxesOverSizeLimit.ps1
# Author: Chris Brown
# Date: 04/04/2011 10:41:00
# Keywords:
# comments:
#
# Versioning
# 04/04/2011 CJB Initial Script
#
# ------------------------------------------------------------... |
combined_dataset/train/non-malicious/Get-Head.ps1 | Get-Head.ps1 | function Get-Head {
#.Synopsis
# Read the first few characters of a file, fast.
param(
# The path to the file (no powershell parsing happens here)
[Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)]
[Alias("Path","PSPath")]
[String]$FilePath,
# The number of characte... |
combined_dataset/train/non-malicious/2756.ps1 | 2756.ps1 |
$hashtype = "MD5"
function Compute-FileHash {
Param(
[Parameter(Mandatory = $true, Position=1)]
[string]$FilePath,
[ValidateSet("MD5","SHA1","SHA256","SHA384","SHA512","RIPEMD160")]
[string]$HashType = "MD5"
)
switch ( $HashType.ToUpper() )
{
"MD5" { $hash = [System.Securit... |
combined_dataset/train/non-malicious/sample_53_19.ps1 | sample_53_19.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/Array-Randomizer.ps1 | Array-Randomizer.ps1 | #======================================================================================
# File Name : Array-Randomizer.ps1
# Original Author : Kenneth C. Mazie (kcmjr at kcmjr.com)
# :
# Description : Originally written to regenerate the init.txt file for server
# ... |
combined_dataset/train/non-malicious/157.ps1 | 157.ps1 | function Get-LogFast
{
[CmdletBinding()]
PARAM (
$Path = "c:\Biglog.log",
$Match
)
BEGIN
{
$StreamReader = New-object -TypeName System.IO.StreamReader -ArgumentList (Resolve-Path -Path $Path -ErrorAction Stop).Path
}
PROCESS
{
while ($StreamReader.Peek() -gt -1)
{
$Line = $Stream... |
combined_dataset/train/non-malicious/sample_21_33.ps1 | sample_21_33.ps1 | ConvertFrom-StringData @'
id_ctsdirectaccessserver=DirectAccess Server
id_ctsdirectaccessserverdescription=Collects information about DirectAccess server.
id_ctsdirectaccessclient=DirectAccess Client
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3A... |
combined_dataset/train/non-malicious/sample_46_14.ps1 | sample_46_14.ps1 | ConvertFrom-StringData @'
###PSLOC
NoADModule = ActiveDirectory module is not installed. Please install the module and try again.
ComputerAccountMissing = No computer account for {0} found in OU {1}. Recovery keys are not avialable in Active Directory
ComputerAccountExists = Computer account(s) {0} look up OU {1} w... |
combined_dataset/train/non-malicious/get-uuid_allHVs.ps1 | get-uuid_allHVs.ps1 | #The PowerShell Talk
#Building a HyperVisor Independent Script
#
#This script will take a VM (or host) object from the pipline,
#and from that determine if you're connected to XenServer
#or VMware, and return the apropriate UUID.
Begin {
#VMware VM Host (ESX) UUID
$VMHost_UUID = @{
Name = "VMHo... |
combined_dataset/train/non-malicious/sample_59_0.ps1 | sample_59_0.ps1 | function EnsureAdminPrivileges([String]$mesageOnError)
{
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = new-object Security.Principal.WindowsPrincipal $identity
if (!($principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)))
{
Write-Error $m... |
combined_dataset/train/non-malicious/sample_3_37.ps1 | sample_3_37.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 = '92.1.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_45_59.ps1 | sample_45_59.ps1 | var OfficeaicopilotStrings={ChatContainerKeepItActionButtonText:"Giữ lại",ChatContainerUndoActionButtonText:"Hoàn tác",ChatContainerInsertActionButtonText:"Chèn",ChatContainerFeedbackNudgeContent:"Vui lòng giúp chúng tôi tìm hiểu và đào tạo các mô hình của mình bằng cách cung cấp phản hồi thông qua các nút điều khiển t... |
combined_dataset/train/non-malicious/sample_23_50.ps1 | sample_23_50.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.