full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/repr.ps1 | repr.ps1 | function repr {
[CmdletBinding()]
[OutputType([string])]
Param(
[Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]
$InputObject)
process {
if($null -eq $InputObject) {
$PSCmdlet.WriteObject('$null')
}
elseif($InputObject -is ... |
combined_dataset/train/non-malicious/360.ps1 | 360.ps1 | function Get-PSFResultCache
{
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFResultCache')]
param (
[ValidateSet('Value','All')]
[string]
$Type = 'Value'
)
switch ($Type)
{
'All'
{
New-Object PSObject -Property @{
Result = ([PSFramework.ResultCa... |
combined_dataset/train/non-malicious/sample_48_52.ps1 | sample_48_52.ps1 | #
# Module manifest for module 'OCI.PSModules.Osmanagementhub'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osmanagementhub.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_65_85.ps1 | sample_65_85.ps1 | # Sample diagnostic function
#
# Wrapped in a region same name as function name
# Change the name and code as needed
#
# You can test your diagnostic function by running xray in developer mode, e.g.:
# .\xray.ps1 -Diagnostic net_dnscli_KB4562541_sample -DevMode
#region net_dnscli_KB4562541_sample
<#
Compone... |
combined_dataset/train/non-malicious/sample_61_80.ps1 | sample_61_80.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/sample_10_0.ps1 | sample_10_0.ps1 | ##----------------------------------------------------------------------------
## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved.
##---------------------------------------------------------------------------
# Import shared functions and vars
. .\Commonalities.ps1
. .\StringConstants.ps1
Wr... |
combined_dataset/train/non-malicious/sample_34_75.ps1 | sample_34_75.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/sample_40_99.ps1 | sample_40_99.ps1 | #
# Script module for module 'Az.LogicApp' that is executed when 'Az.LogicApp' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 02/29/2024 09:34:59
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
... |
combined_dataset/train/non-malicious/sample_35_81.ps1 | sample_35_81.ps1 | #
# Module manifest for module 'OCI.PSModules.Waa'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waa.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_61_89.ps1 | sample_61_89.ps1 | <#
.SYNOPSIS
MSRD-Collect 'data collection' specific functions
.DESCRIPTION
Module for the MSRD-Collect local 'data collection' functions
.NOTES
Author : Robert Klemencz
Requires : At least PowerShell 5.1 (This module is not for stand-alone use. It is used automatically from within the main... |
combined_dataset/train/non-malicious/sample_40_32.ps1 | sample_40_32.ps1 | #
# Module manifest for module 'OCI.PSModules.Datascience'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datascience.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/Read-Choice_1.ps1 | Read-Choice_1.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/sample_0_65.ps1 | sample_0_65.ps1 | #************************************************
# TS_VeritasVXIOBadConfigFlags.ps1
# Version 1.0.1
# Date: 5/16/2012
# Author: v-kaw
# Description: [Idea ID 3919] [Windows] Create Shadow Copy fail only on VERTIAS storage foundation volume
# Rule number: 3919
# Rule URL: //sharepoint/sites/rules/Rule%20Submi... |
combined_dataset/train/non-malicious/sample_23_18.ps1 | sample_23_18.ps1 | #
# Module manifest for module 'OCI.PSModules.Optimizer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Optimizer.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_23_97.ps1 | sample_23_97.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/sample_59_83.ps1 | sample_59_83.ps1 | #
# Module manifest for module 'OCI.PSModules.Filestorage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Filestorage.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported PSEdition... |
combined_dataset/train/non-malicious/sample_5_28.ps1 | sample_5_28.ps1 | #
# Module manifest for module 'OCI.PSModules.Dns'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dns.dll'
# Version number of this module.
ModuleVersion = '92.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_0_81.ps1 | sample_0_81.ps1 | ConvertFrom-StringData @'
id_repadmin=RepAdmin Log Files
id_repadminobtaining=Running RepAdmin tool and obtaining output
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBA... |
combined_dataset/train/non-malicious/3965.ps1 | 3965.ps1 |
function Test-PublicIpAddressCRUD
{
$rgname = Get-ResourceGroupName
$rname = Get-ResourceName
$domainNameLabel = Get-ResourceName
$rglocation = Get-ProviderLocation ResourceManagement
$resourceTypeParent = "Microsoft.Network/publicIpAddresses"
$location = Get-ProviderLocation... |
combined_dataset/train/non-malicious/Get-HtmlHelp 3.2.ps1 | Get-HtmlHelp 3.2.ps1 | ## Get-HtmlHelp - by Joel Bennett
## version 3.2
#####################################################################
## Cool Example, using ShowUI:
## Import-Module HtmlHelp
## Import-Module ShowUI -Vers 1.4
## function Show-Help { [CmdletBinding()]param([String]$Name)
## Window { WebBrowser -... |
combined_dataset/train/non-malicious/sample_1_77.ps1 | sample_1_77.ps1 | # To check organizations that are not updated on the CRM server.
#
# Rule to look for organizations that have not been updated to correct version.
#
# Created: 1/25/2012
# Author: Jonathan Randall
#******************************************************************************************************************
... |
combined_dataset/train/non-malicious/ConvertTo-Hex_2.ps1 | ConvertTo-Hex_2.ps1 | # Ported from C# technique found here: http://forums.asp.net/p/1298956/2529558.aspx
param ( [string]$SidString )
# Create SID .NET object using SID string provided
$sid = New-Object system.Security.Principal.SecurityIdentifier $sidstring
# Create a byte array of the proper length
$sidBytes = New-Object byte[] ... |
combined_dataset/train/non-malicious/sample_64_64.ps1 | sample_64_64.ps1 | <!--
* @Description:
* @Author: czw
* @Date: 2022-07-05 20:09:56
* @FilePath: \vscode-background-cover\CHANGELOG.md
-->
## 更新日志
#### ver 0.1.0 (2018/10/17)
第一版发布
#### ver 1.0.0 (2018/11/08)
添加随机更换背景的功能
#### ver 1.1.0 (2019/01/04)
添加卸载钩子
#### ver 1.1.1 (2019/03/16)
增加图片透明度(对于亮度低的图片)
##... |
combined_dataset/train/non-malicious/2057.ps1 | 2057.ps1 |
Describe "Update-ModuleManifest tests" -tags "CI" {
BeforeEach {
$testModulePath = "testdrive:/module/test.psd1"
New-Item -ItemType Directory -Path testdrive:/module > $null
}
AfterEach {
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue testdrive:/module
}
It "... |
combined_dataset/train/non-malicious/771.ps1 | 771.ps1 |
param(
[string]$EditorServicesRepoPath = $null
)
$script:PackageJson = Get-Content -Raw $PSScriptRoot/package.json | ConvertFrom-Json
$script:IsPreviewExtension = $script:PackageJson.name -like "*preview*" -or $script:PackageJson.displayName -like "*preview*"
Write-Host "`n
task ResolveEditorServicesPat... |
combined_dataset/train/non-malicious/sample_47_30.ps1 | sample_47_30.ps1 | #
# Module manifest for module 'OCI.PSModules.Resourcemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Resourcemanager.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported P... |
combined_dataset/train/non-malicious/Get-RecurseMember.ps1 | Get-RecurseMember.ps1 | function Get-RecurseMember {
<#
.Synopsis
Does a recursive search for unique users that are members of an AD group.
.Description
Recursively gets a list of unique users that are members of the specified
group, expanding any groups that are members out into their member users.
Note: Requires the Ques... |
combined_dataset/train/non-malicious/sample_54_71.ps1 | sample_54_71.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
function Publish-UpgradedServ... |
combined_dataset/train/non-malicious/sample_49_60.ps1 | sample_49_60.ps1 | Import-LocalizedData -BindingVariable lanTxt -FileName AzStackHci.AddNode.Strings.psd1
function Test-ADCredential {
[CmdletBinding()]
param (
[pscredential]
$ActiveDirectoryCredential
)
try
{
$severity = 'CRITICAL'
$adModuleExists = [bool](Get-Module Activ... |
combined_dataset/train/non-malicious/Convert-TextObject.ps1 | Convert-TextObject.ps1 | ##############################################################################\n##\n## Convert-TextObject\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\nConve... |
combined_dataset/train/non-malicious/1665.ps1 | 1665.ps1 |
Write-Host 'Gathering Stats, Please Wait..'
$Mailboxes = Get-Mailbox -ResultSize Unlimited | Select UserPrincipalName, Identity, ArchiveStatus
$index = 0
$total = @($Mailboxes).Count
$starttime = $lasttime = Get-Date
$MailboxSizes = foreach ($Mailbox in $Mailboxes)
{
$index++
$currtime = (Get-Date) - $sta... |
combined_dataset/train/non-malicious/sample_20_0.ps1 | sample_20_0.ps1 | # Localized 05/07/2022 03:59 AM (GMT) 303:7.0.30723 PSDesiredStateConfiguration.Resource.psd1
# Localized 04/21/2015 09:07 AM (GMT) 303:4.80.0411 PSDesiredStateConfiguration.Resource.psd1
# Localized PSDesiredStateConfigurationResource.psd1
ConvertFrom-StringData @'
###PSLOC
CheckSumFileExists=File '{0}' alrea... |
combined_dataset/train/non-malicious/sample_48_61.ps1 | sample_48_61.ps1 | #
# Module manifest for module 'Az.Automation'
#
# Generated by: Microsoft Corporation
#
# Generated on: 12/15/2023
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.Automation.psm1'
# Version number of this module.
ModuleVersion = '1.10.0'
# Supported PSEdit... |
combined_dataset/train/non-malicious/sample_36_86.ps1 | sample_36_86.ps1 | Позволяет вычислить код аутентификации (проверки подлинности) сообщения, используя хеш-функцию
--------------------
**Видимость:** @Глобально
**Примеры:**
```xbsl
исп Поток = новый Файл("<Путь к файлу>").ПолучитьПотокЧтения()
знч Вычислитель = новый ВычислительHmac("СекретныйКлюч".ВБайты(), АлгоритмХешир... |
combined_dataset/train/non-malicious/1962.ps1 | 1962.ps1 |
using namespace System.Diagnostics
function Invoke-AppleScript
{
param(
[string]$Script,
[switch]$PassThru
)
Write-Verbose "running applescript: $Script"
$result = $Script | osascript
if($PassThru.IsPresent)
{
return $result
}
}
function Get-WindowCountMacOS {
... |
combined_dataset/train/non-malicious/sample_38_65.ps1 | sample_38_65.ps1 | #
# Module manifest for module 'OCI.PSModules.Common'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Common.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/sample_59_77.ps1 | sample_59_77.ps1 | #
# Module manifest for module 'OCI.PSModules.Mediaservices'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Mediaservices.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_13_15.ps1 | sample_13_15.ps1 | ConvertFrom-StringData @'
id_systemfiles_title=System Files
id_systemfiles_status=Collecting System Files
id_systemfilesdirectorylistings_title=System Files Directory Listings
id_systemfilesdirectorylistings_status=Collecting System Files Directory Listings
id_systemfilesacllistings_title=System Files ACL Listings... |
combined_dataset/train/non-malicious/1810.ps1 | 1810.ps1 |
Describe "Basic Alias Provider Tests" -Tags "CI" {
Context "Validate basic PSDrive Cmdlets" {
BeforeAll {
$psDriveRoot = "TestDrive:"
$psDriveName = "PsTestDriveName"
}
BeforeEach {
New-PSDrive -Name $psDriveName -PSProvider FileSystem -Ro... |
combined_dataset/train/non-malicious/840.ps1 | 840.ps1 | Param(
[parameter(Mandatory=$true)]
$SubscriptionId,
[parameter(Mandatory=$true)]
$VaultName,
[parameter(Mandatory=$true)]
$ConfigurationServer,
[parameter(Mandatory=$true)]
$CsvOutput
)
class ProtectableItemInfo
{
[string]$Machine
[string]$ProtectionStatus
}
$currentContext = ... |
combined_dataset/train/non-malicious/sample_23_53.ps1 | sample_23_53.ps1 | if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`" `"$args`"" -Verb RunAs;
Break
}
Function WriteToken {
... |
combined_dataset/train/non-malicious/sample_27_6.ps1 | sample_27_6.ps1 | #
# Module manifest for module 'OCI.PSModules.Generativeaiinference'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Generativeaiinference.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
#... |
combined_dataset/train/non-malicious/1276.ps1 | 1276.ps1 |
function Get-CServiceConfiguration
{
[CmdletBinding()]
[OutputType([Carbon.Service.ServiceInfo])]
param(
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,Position=0)]
[string]
$Name,
[Parameter(ValueFromPipelineByPropertyName=$true)]
[A... |
combined_dataset/train/non-malicious/sample_47_8.ps1 | sample_47_8.ps1 | #
# Module manifest for module 'OCI.PSModules.Analytics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Analytics.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Co... |
combined_dataset/train/non-malicious/sample_38_23.ps1 | sample_38_23.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'https://aka... |
combined_dataset/train/non-malicious/sample_28_95.ps1 | sample_28_95.ps1 | #
# Module manifest for module 'OCI.PSModules.Certificates'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Certificates.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_10_81.ps1 | sample_10_81.ps1 | #************************************************
# TS_NetworkDTCEnabled.ps1
# Version 1.0.0
# Date: 03-23-2012
# Author: Jeremy LaBorde - jlaborde
# Description: Checks to see if Network DTC
# is enabled
#
#************************************************
. .\DistSvcs_Utils.ps1
Import-LocalizedData -B... |
combined_dataset/train/non-malicious/New-XVM_12.ps1 | New-XVM_12.ps1 | #Example
#New-XVM -ComputerName HYPERVSVR02 -Name "TLG-INET2" -SwitchName "External(192.168.1.0/24)" -VhdType Differencing -ParentVhdPath 'D:\\vhds\\Windows #Server 2012 RC Base.vhdx'
Function New-XVM
{
[cmdletbinding()]
Param
(
[Parameter(Mandatory=$false,Position=1)]
[string]$Co... |
combined_dataset/train/non-malicious/sample_29_36.ps1 | sample_29_36.ps1 | #
# Module manifest for module 'Microsoft.Online.SharePoint.PowerShell'
#
# Generated by: Microsoft Corportation
#
# Generated on: 8/29/2011
#
@{
# Script module or binary module file associated with this manifest
ModuleToProcess = 'Microsoft.Online.SharePoint.PowerShell.dll'
# Version number of this modu... |
combined_dataset/train/non-malicious/sample_5_24.ps1 | sample_5_24.ps1 | ]Calculated table '%{oii_table/}' must have only one partition with source of type Calculated.æDirect Lake モードには Direct Lake データ ソースが必要です。Direct Lake モードのテーブルは、SQL または OneLake データソースの種類である必要があります。次の Direct Lake テーブル %{oii_TableNames/} のデータ ソース定義を確認し、修正してください。詳細については、https://go.microsoft.com/fwlink/?linkid=2215281 を参照して... |
combined_dataset/train/non-malicious/sample_32_29.ps1 | sample_32_29.ps1 | param(
[Parameter(Mandatory = $true)]
[string[]]$paths,
[int]$retry_count = 0
)
# Delete paths using parallel jobs.
$jobs = $paths | ForEach-Object {
Start-Job -ScriptBlock {
param(
[string]$path,
[int]$retry_count = 0
)
if (Test-Path -Lit... |
combined_dataset/train/non-malicious/sample_57_43.ps1 | sample_57_43.ps1 | #
# Module manifest for module 'OCI.PSModules.Onesubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_2_14.ps1 | sample_2_14.ps1 | ConvertFrom-StringData @'
id_klist=Kerberos tickets and TGT
id_klistobtaining=Running KList utility to obtain Kerberos related information
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7... |
combined_dataset/train/non-malicious/sample_31_90.ps1 | sample_31_90.ps1 | <#
.SYNOPSIS
Script that installs the Wix Toolset
.DESCRIPTION
This script installs the Wix Toolset and it's dependency .Net Framework 3.5
.EXAMPLE
install_wix.ps1
#>
param(
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD
)
#------------------... |
combined_dataset/train/non-malicious/sample_59_98.ps1 | sample_59_98.ps1 | @{
GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @('MSFT_MpPerformanceRecording.psm1')
FormatsToProcess = @(... |
combined_dataset/train/non-malicious/sample_5_99.ps1 | sample_5_99.ps1 | #************************************************
# DC_KBInstallLogs.ps1
# Version 1.0.1
# Date: 8-29-2012
# Author: Kate Wang (v-kaw)
# Description: This script would collect %windir%\kb*.log when running on a Windows Server 2003 and XP to a compressed file named $ComputerName_KBInstallLogs.zip
#***************... |
combined_dataset/train/non-malicious/sample_27_62.ps1 | sample_27_62.ps1 | #
# Module manifest for module 'OCI.PSModules.Sch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Sch.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/2371.ps1 | 2371.ps1 | function Send-File
{
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string[]]$Path,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$Destination,
[Parameter(Mandatory)]
[System.Management.Automation.Runspaces.PSSession]$Session
)
process
{
foreach ... |
combined_dataset/train/non-malicious/Invoke-Web 4.2.ps1 | Invoke-Web 4.2.ps1 | function ConvertTo-Dictionary {
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true,ParameterSetName="Hashtable")]
[Hashtable[]]$Hashtable,
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName="WebHeaders")]
[System.Collections.Specialized.Na... |
combined_dataset/train/non-malicious/sample_19_68.ps1 | sample_19_68.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 = '74.1.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
# ID u... |
combined_dataset/train/non-malicious/sample_22_34.ps1 | sample_22_34.ps1 | #
# Module manifest for module 'OCI.PSModules.Osmanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osmanagement.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_35_78.ps1 | sample_35_78.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 = '79.0.0'
# Supported PSEditions
Compatib... |
combined_dataset/train/non-malicious/Find sharable storage.ps1 | Find sharable storage.ps1 | # This function returns all datastores that can be shared amongst ESX hosts.
function Get-ShareableDatastore {
# Get all datastores.
$datastores = Get-Datastore
# Load the HostStorageSystems of all hosts.
$hosts = Get-VMHost | Get-View -property ConfigManager
$storageSystems = @()
foreach ($h in $hosts) ... |
combined_dataset/train/non-malicious/sample_28_69.ps1 | sample_28_69.ps1 | #
# Module manifest for module 'OCI.PSModules.Disasterrecovery'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Disasterrecovery.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported... |
combined_dataset/train/non-malicious/2640.ps1 | 2640.ps1 |
$dbs = Invoke-Sqlcmd -ServerInstance localhost -Database tempdb -Query "SELECT name FROM sys.databases WHERE recovery_model_desc = 'FULL' and state_desc = 'ONLINE'"
$datestring = (Get-Date -Format 'yyyyMMddHHmm')
foreach($db in $dbs.name){
$dir = "C:\Backups\$db"
if( -not (Test-Path $dir)){New-Item ... |
combined_dataset/train/non-malicious/sample_44_5.ps1 | sample_44_5.ps1 | #
# Module manifest for module 'OCI.PSModules.Logging'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Logging.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Compat... |
combined_dataset/train/non-malicious/sample_38_34.ps1 | sample_38_34.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 = '80.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_29_57.ps1 | sample_29_57.ps1 | Import-Module ADSync
Get-ChildItem -Path "$PSScriptRoot\PSScripts\*.ps1" | % { . $_.FullName }
Set-Variable ADSyncDiagnosticsOutputPath "$env:ALLUSERSPROFILE\AADConnect" -option Constant
$global:AADTenantCredential = $null
$global:AscCustomScriptObjectProperty = 'IsAscCustomScriptObject'
#
# AADConnect Ge... |
combined_dataset/train/non-malicious/sample_7_17.ps1 | sample_7_17.ps1 | #************************************************
# DC_DPMEventLogs.ps1
# Version 1.0.1
# Date: 06-29-2011
# Author: Patrick Lewis - patlewis@microsoft.com
# Description: This script get DPM related event logs
#************************************************
if($debug -eq $true){[void]$shell.popup("Run DC_DPMEv... |
combined_dataset/train/non-malicious/sample_48_22.ps1 | sample_48_22.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
function ParseInterval
{
$args[0] = $args[0].Substring(1)
$DatePart = $args[0].Split("T")[0]
$TimePart = $args[0].Split("T")[1]
$YearPart = "0"
$MonthPart = "0"
$DayPart = "0"
$HourPart = "0"
$MinPart = "0"
$SecPart ... |
combined_dataset/train/non-malicious/1691.ps1 | 1691.ps1 |
function Get-OfficeVersion ($computer = $env:COMPUTERNAME) {
$version = 0
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computer)
try {
$reg.OpenSubKey('SOFTWARE\Microsoft\Office').GetSubKeyNames() | % {
if ($_ -match '(\d+)\.') {
if ([int... |
combined_dataset/train/non-malicious/2431.ps1 | 2431.ps1 |
[CmdletBinding()]
[OutputType('System.Management.Automation.PSCustomObject')]
param (
[Parameter(Mandatory,
ValueFromPipeline,
ValueFromPipelineByPropertyName)]
[ValidateScript({Test-Connection -ComputerName $_ -Quiet -Count 1})]
[string]$Computername,
[Parameter()]
[int]$RetryInterval = 10
)
begin {
$Er... |
combined_dataset/train/non-malicious/sample_41_4.ps1 | sample_41_4.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... |
combined_dataset/train/non-malicious/OnTapSDK_Discoverability.ps1 | OnTapSDK_Discoverability.ps1 | # Glenn Sizemore www . Get-Admin . com
# Requires the NetApp OnTap SDK v3.5
# Get-NaAPI
# Will return a list of ZAPI Calls that the filer supports. Can be used
# as a poor man's Get-Command for the OnTap SDK.
#########################################################################
# Usage:
# Connect to the f... |
combined_dataset/train/non-malicious/Import-Methods_1.ps1 | Import-Methods_1.ps1 | # [CmdletBinding()]
param(
#[Parameter(Position=1,ValueFromPipeline=$true)]
[type]$type
,
#[Parameter()]
#[Alias("Properties")]
[switch]$IncludeProperties
)
BEGIN {
function MakeFunction() {
PROCESS {
$func = "function:global:$($_.name)"
if (test-path $func) { remove-item ... |
combined_dataset/train/non-malicious/sample_4_29.ps1 | sample_4_29.ps1 | ConvertFrom-StringData @'
id_ctscertificates=Certificates
id_ctscertificatesdescription=Collects information about Certificates.
id_ctscertificatesmachinestore=Certificates
id_ctscertificatesmachinestoredescription=Collecting information about certificates in the machine store.
id_ctscertificatesuserstore=Certific... |
combined_dataset/train/non-malicious/PowerShell_ISE Profile_1.ps1 | PowerShell_ISE Profile_1.ps1 | #--------------------------------------------------------------------------------------------------------------
#Convert Untitled1.ps1 to ASCII encoding
$psise.CurrentPowerShellTab.Files | % {
# set private field which holds default encoding to ASCII
$_.gettype().getfield("encoding","nonpublic,instance").... |
combined_dataset/train/non-malicious/COE_IMAGE.ps1 | COE_IMAGE.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/sample_15_7.ps1 | sample_15_7.ps1 | ConvertFrom-StringData @'
###PSLOC
FrameworkModuleName = AzStackHci.EnvironmentChecker
CurrentVersion = Current version of {0} is {1}
UpdateToVersion = Run the following to update to {0}: \n \nPress crtl+c to stop the current cmdlet \nRemove-Module -Name {1} -Force \nUpdate-Module -Name {1} \nImport-Module -Name {1... |
combined_dataset/train/non-malicious/sample_13_42.ps1 | sample_13_42.ps1 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apa... |
combined_dataset/train/non-malicious/sample_1_14.ps1 | sample_1_14.ps1 | <#
.SYNOPSIS
Scenario module for collecting Microsoft Remote Desktop Smart Card related data
.DESCRIPTION
Collect Smart Card related troubleshooting data
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedback : https://aka.ms... |
combined_dataset/train/non-malicious/3822.ps1 | 3822.ps1 |
function Test-Disk
{
$rgname = Get-ComputeTestResourceName;
$diskname = 'disk' + $rgname;
try
{
$loc = Get-ComputeVMLocation;
New-AzResourceGroup -Name $rgname -Location $loc -Force;
$subId = Get-SubscriptionIdFromResourceGroup $rgname;
$mock... |
combined_dataset/train/non-malicious/Execute in PowerShell.ps1 | Execute in PowerShell.ps1 | #===================================================================================
#
# Filename: AddExecuteInPowerShellToPS1Files.ps1
#
# Author: Nigel Boulton
#
# Version: 1.00
#
# Date: 9 Nov 2008
#
# Mod dates:
#
# Purpose: To add context menu items for .ps1 files in Windows Explorer, to
# allow... |
combined_dataset/train/non-malicious/sample_0_33.ps1 | sample_0_33.ps1 | Import-LocalizedData -BindingVariable WMIStrings -FileName DC_WMISecurityCenter -UICulture en-us
Write-DiagProgress -Activity $WMIStrings.ID_SecurityCenter -Status $WMIStrings.ID_SecurityCenterDesc
$OutputFile = $ComputerName + "_SecurityCenter.txt"
$file = new-item -type file $OutputFile | Out-Null #_#
# Compu... |
combined_dataset/train/non-malicious/AutoArchive.ps1 | AutoArchive.ps1 | # AutoArchive PowerShell Script
# http://powershell.codeplex.com
param (
[ValidateNotNullOrEmpty()]
[Parameter(
Mandatory = $true)
]
[string] $Source,
[int] $RetentionDays,
[array] $Include,
[array] $Exclude,
[switch] $Recurse )
# Load Zip Module
Import-Module PowerZip
# Che... |
combined_dataset/train/non-malicious/sample_53_13.ps1 | sample_53_13.ps1 | #
# Module manifest for module 'OCI.PSModules.Jms'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jms.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/Demo-ShouldProcess.ps1 | Demo-ShouldProcess.ps1 | [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact="Medium")]
param([Switch]$Force)
$RejectAll = $false;
$ConfirmAll = $false;
foreach($file in ls) {
if($PSCmdlet.ShouldProcess( "Removed the file '$($file.Name)'",
"Remove the file '$($file.Name)'?",
... |
combined_dataset/train/non-malicious/ISE-CopyOutPutToEditor_2.ps1 | ISE-CopyOutPutToEditor_2.ps1 | function ISE-CopyOutPutToEditor () {
$count = $psise.CurrentPowerShellTab.Files.count
$psIse.CurrentPowerShellTab.Files.Add()
$Newfile = $psIse.CurrentPowerShellTab.Files[$count]
$Newfile.Editor.Text = $psIse.CurrentPowerShellTab.Output.Text
$Newfile.Editor.Focus()
}
$null = $psISE.CurrentPow... |
combined_dataset/train/non-malicious/Desktop.ps1 | Desktop.ps1 | #region License
// Desktop 1.1
// *
// Copyright (C) 2004 http://www.onyeyiri.co.uk
// Coded by: Nnamdi Onyeyiri
//
// This code may be used in any way you desire except for commercial use.
// The code can be freely redistributed unmodified as long as all of the authors
//... |
combined_dataset/train/non-malicious/sample_17_13.ps1 | sample_17_13.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al... |
combined_dataset/train/non-malicious/sample_66_62.ps1 | sample_66_62.ps1 | #
# Module manifest for module 'OCI.PSModules.Workrequests'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Workrequests.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/sample_17_20.ps1 | sample_17_20.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... |
combined_dataset/train/non-malicious/sample_49_92.ps1 | sample_49_92.ps1 | #
# Module manifest for module 'OCI.PSModules.Mysql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Mysql.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/4039.ps1 | 4039.ps1 |
function Test-SkuCreate
{
$profileName = getAssetName
$resourceGroup = TestSetup-CreateResourceGroup
$profileLocation = "EastUS"
$profileSku = "Standard_Microsoft"
$createdProfile = New-AzCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroupName -Locatio... |
combined_dataset/train/non-malicious/sample_46_74.ps1 | sample_46_74.ps1 | param (
[switch] $Full = $false,
[string] $Output = "$($env:TEMP)\telemetry"
)
# mappings of WMI class
$topic_class = @{
system = 'win32_computersystem'
csproduct = 'win32_computersystemproduct'
cpu = 'win32_processor'
baseboard = 'win32_baseboard'
nic = ... |
combined_dataset/train/non-malicious/4121.ps1 | 4121.ps1 |
[CmdletBinding()]
param
(
[string]$AppsFile = 'Applications.txt',
[ValidateNotNullOrEmpty()][string]$ConsoleTitle = 'Application Shortcuts',
[switch]$OutputToTextFile,
[switch]$GetApplicationList
)
function Add-AppToStartMenu {
[CmdletBinding()][OutputType([boolean])]
param
(
[Parameter(Mandatory = ... |
combined_dataset/train/non-malicious/sample_63_69.ps1 | sample_63_69.ps1 | #
# Module manifest for module 'OCI.PSModules.Certificates'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Certificates.dll'
# Version number of this module.
ModuleVersion = '89.0.0'
# Supported PSEditi... |
combined_dataset/train/non-malicious/get-ESXiHostConfigBackup_1.ps1 | get-ESXiHostConfigBackup_1.ps1 | <#
.SYNOPSIS
Creates config bundle backup for ESXi hosts. Works where 80 is blocked to ESXi host
Originally script by Alan Renouf (http://www.virtu-al.net/2011/02/23/backing-up-the-esxi-system-image)
Heavily Modified by Jimmy Hester
.DESCRIPTION
Checks for connection to a vCenter or ESXi server
If not connected... |
combined_dataset/train/non-malicious/2072.ps1 | 2072.ps1 |
using namespace System.Diagnostics
using namespace System.Management.Automation.Internal
Describe "PowerShell Command Debugging" -tags "CI" {
BeforeAll {
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
}
function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn)
{
... |
combined_dataset/train/non-malicious/1692.ps1 | 1692.ps1 |
filter notnull {
$props = @()
$obj = $_
$obj | gm -m *property | % { if ( $obj.$($_.name) ) {$props += $_.name} }
$obj | select $props
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.