full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
combined_dataset/train/non-malicious/Get-LastBootUpTime.ps1 | Get-LastBootUpTime.ps1 | <#
.SYNOPSIS
Gets the start time of the PC
.DESCRIPTION
The Get-LastBootUpTime function returns an LBUT object that represents the
time the computer started. You can use Get-LabstBootUpTime to generate the up
time of a PC. By default it uses EventID 6005 from the System log to determine
when the PC started.... |
combined_dataset/train/non-malicious/Execute-SQLCommand.ps1 | Execute-SQLCommand.ps1 | function Execute-SQLCommand {param( [string]$Server, #the host name of the SQL server
[string]$Database, #the name of the database
[System.Data.SqlClient.SqlCommand]$Command) #the command to execute (name of stored procedure)
$sqlConnection = New-Object System.Data.SqlClient.SqlCo... |
combined_dataset/train/non-malicious/2050.ps1 | 2050.ps1 |
Describe "Adapter Tests" -tags "CI" {
Context "Property Adapter Tests" {
BeforeAll {
$pso = [System.Diagnostics.Process]::GetCurrentProcess()
$processName = $pso.Name
if(-not ('TestCodeMethodClass' -as "type"))
{
class TestCodeMethodClass {... |
combined_dataset/train/non-malicious/sample_19_58.ps1 | sample_19_58.ps1 | //
// Notice Regarding Standards. AMD does not provide a license or sublicense to
// any Intellectual Property Rights relating to any standards, including but not
// limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4;
// AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP... |
combined_dataset/train/non-malicious/sample_6_61.ps1 | sample_6_61.ps1 | #************************************************
# TS_HPWMICheck.ps1
# Version 1
# Date: 5-6-15
# Author: jasonf
# Description: check to see if HP WMI provider causes autorecover regkey corruption
#************************************************
Import-LocalizedData -BindingVariable ScriptStrings
$RuleAp... |
combined_dataset/train/non-malicious/Out-AnsiGraph.ps1 | Out-AnsiGraph.ps1 | #
# Out-AnsiGraph.psm1
# Author: xcud
# History:
# v0.1 September 21, 2009 initial version
#
# PS Example> ps | select -first 5 | sort -property VM | Out-AnsiGraph ProcessName, VM
# AEADISRV ███ 14508032
# audiodg █████... |
combined_dataset/train/non-malicious/2295.ps1 | 2295.ps1 |
$vCenterServer = "server.contoso.com"
$DataCenterName = "Datacenter"
$DataStoreName = "DCStore"
$VMName = "WINREF01"
$VMPath = "VMStore:\" + $DataCenterName + "\" + $DataStoreName + "\" + $VMName
try {
if(-not (Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) {
Add-PSSnapin VMwa... |
combined_dataset/train/non-malicious/1994.ps1 | 1994.ps1 |
Describe "Read-Host" -Tags "Slow","Feature" {
Context "[Console]::ReadKey() implementation on non-Windows" {
BeforeAll {
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
$assetsDir = Join-Path -Path $PSScriptRoot -ChildPath assets
if ($IsWindows) {
... |
combined_dataset/train/non-malicious/sample_20_30.ps1 | sample_20_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 = '79.0.0'
# Supported P... |
combined_dataset/train/non-malicious/sample_1_97.ps1 | sample_1_97.ps1 | ConvertFrom-StringData @'
id_hypervnet=Hyper-V Networking Information
id_hypervnetobtaining=Obtaining advanced networking information
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIB... |
combined_dataset/train/non-malicious/sample_55_70.ps1 | sample_55_70.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Une variable d’environnement de ce nom et de ce type existe déjà.
EnvironmentErrorDoesNotExists=Aucune variable d’environnement de ce nom et de ce type n'existe.
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5... |
combined_dataset/train/non-malicious/3878.ps1 | 3878.ps1 | function Test-SimpleQuery
{
$wsId = "DEMO_WORKSPACE"
$query = "union * | take 10"
$results = Invoke-AzOperationalInsightsQuery -WorkspaceId $wsId -Query $query
AssertQueryResults $results 10
}
function Test-SimpleQueryWithTimespan
{
$wsId = "DEMO_WORKSPACE"
$query = "union * | take 10"
$t... |
combined_dataset/train/non-malicious/sample_61_4.ps1 | sample_61_4.ps1 | var OfficeaicopilotStrings={ChatContainerKeepItActionButtonText:"Conservar",ChatContainerUndoActionButtonText:"Desfacer",ChatContainerInsertActionButtonText:"Inserir",ChatContainerFeedbackNudgeContent:"Axúdanos a aprender e a adestrar os modelos marcando os resultados que xeren os LLM cun polgar cara arriba ou cara aba... |
combined_dataset/train/non-malicious/sample_65_92.ps1 | sample_65_92.ps1 | #
# Script module for module 'Az.DataFactory' that is executed when 'Az.DataFactory' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 07/31/2024 06:54:56
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
... |
combined_dataset/train/non-malicious/sample_36_49.ps1 | sample_36_49.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/4317.ps1 | 4317.ps1 |
function RegisterTestRepository {
$testRepoRegistered = Get-PSRepository -Name $TestRepositoryName -ErrorAction SilentlyContinue
if (-not $testRepoRegistered) {
Register-PSRepository -Name $TestRepositoryName -SourceLocation $TestRepositorySource -InstallationPolicy Trusted
$testRepoRegi... |
combined_dataset/train/non-malicious/sample_27_13.ps1 | sample_27_13.ps1 | #
# Module manifest for module 'OCI.PSModules.Loggingsearch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loggingsearch.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEdi... |
combined_dataset/train/non-malicious/sample_42_66.ps1 | sample_42_66.ps1 | # Localized 06/28/2023 07:58 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Rozwiązywanie problemów
Troubleshoot_DetectDVDDevice=Trwa sprawdzanie urządzenia DVD...
Troubleshoot_DetectDVDvideoDecoder=Trwa sprawdzanie dekodera wideo służącego do odtwarzania dys... |
combined_dataset/train/non-malicious/31.ps1 | 31.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aa... |
combined_dataset/train/non-malicious/Set-PSODefaultProperties.ps1 | Set-PSODefaultProperties.ps1 | function Set-PSODefaultProperties {
param(
[PSObject]$Object,
[string[]]$DefaultProperties
)
if( $DefaultProperties -ne $null ) {
$name = $Object.PSObject.TypeNames[0]
$xml = "<?xml version='1.0' encoding='utf-8' ?><Types><Type>"
... |
combined_dataset/train/non-malicious/2128.ps1 | 2128.ps1 |
Describe "Test restricted language check method on scriptblocks" -Tags "CI" {
BeforeAll {
set-strictmode -v 2
function list {
$l = [System.Collections.Generic.List[String]]::new()
$args | ForEach-Object {$l.Add($_)}
, $l
}
}
... |
combined_dataset/train/non-malicious/Services Auto NotRunning.ps1 | Services Auto NotRunning.ps1 | Get-WmiObject Win32_Service -ComputerName . |`
where {($_.startmode -like "*auto*") -and `
($_.state -notlike "*running*")}|`
select DisplayName,Name,StartMode,State|ft -AutoSize
|
combined_dataset/train/non-malicious/72.ps1 | 72.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aa... |
combined_dataset/train/non-malicious/656.ps1 | 656.ps1 |
$reportPortalUri = if ($env:PesterPortalUrl -eq $null) { 'http://localhost/reports' } else { $env:PesterPortalUrl }
$reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl }
function VerifyFileWasDownloaded()
{
param(
[Parameter(Mandatory = ... |
combined_dataset/train/non-malicious/InkScape utilities.ps1 | InkScape utilities.ps1 | <#
.SYNOPSIS
Inkscape utility cmdlets
MIT License
Copyright (c) 2012-2013 Justin Dearing <zippy1981@gmail.com>
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 the Software without restriction, inclu... |
combined_dataset/train/non-malicious/sample_36_21.ps1 | sample_36_21.ps1 | Import-Module $(Join-Path $PSSCriptRoot Helpers.psm1)
(git remote show origin | Get-Matches "(?mi)HEAD branch: (?<branch>[^\r\n]+)" ).branch
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIB... |
combined_dataset/train/non-malicious/SynchronizationScript.ps.ps1 | SynchronizationScript.ps.ps1 | #------- Get-SPServiceContext
function Get-SPServiceContext([Microsoft.SharePoint.Administration.SPServiceApplication]$profileApp)
{
if($profileApp -eq $null)
{
#----- Get first User Profile Service Application
$profileApp = @(Get-SPServiceApplication | ? { $_.TypeName -eq "User Profile ... |
combined_dataset/train/non-malicious/3148.ps1 | 3148.ps1 |
$LogPath = "$PSScriptRoot\Log.txt"
[bool]$SendMailOnError = $true
$SmtpServer = ""
$MailFrom = ""
[String[]]$MailTo = @("","")
$MailSubject = "[Script Error] Title..."
$Error.Clear()
$Cred = Invoke-Expression -Command "$PSScriptRoot\Get-ManagedCredential.ps1 -FilePath $PSScriptRoot\cred.xml"
Start-... |
combined_dataset/train/non-malicious/543.ps1 | 543.ps1 |
function Open-SPOSubsite
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$relativeUrl
)
Open-SPOSite -relativeUrl $relativeUrl
}
|
combined_dataset/train/non-malicious/sample_21_31.ps1 | sample_21_31.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Import-EditorCommand {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[OutputType([Microsoft.PowerShell.EditorServices.Extensions.EditorCommand, Microsoft.PowerShell.EditorServices])]
[Cmdle... |
combined_dataset/train/non-malicious/3792.ps1 | 3792.ps1 |
function Test-Image
{
param ($loc)
$rgname = Get-ComputeTestResourceName
try
{
if ($loc -eq $null)
{
$loc = Get-ComputeVMLocation;
}
New-AzResourceGroup -Name $rgname -Location $loc -Force;
$vmsize = 'St... |
combined_dataset/train/non-malicious/2358.ps1 | 2358.ps1 |
$MaxAge = 180
$rules = @(
{ $_.PasswordLastSet -lt [DateTime]::Now.Subtract([TimeSpan]::FromDays($MaxAge)) },
{ $_.LastLogonDate -lt [DateTime]::Now.Subtract([TimeSpan]::FromDays($MaxAge)) },
{ $_.Enabled -eq $false },
{ $_.PasswordExpired -eq $true }
)
Get-AdUser -Filter * -Properties PasswordLast... |
combined_dataset/train/non-malicious/228.ps1 | 228.ps1 | Function Add-LocalGroupMember
{
[cmdletBinding()]
Param (
[Parameter(Mandatory = $True)]
[string[]]$ComputerName,
[Parameter(Mandatory = $True)]
[string]$GroupName,
[Parameter(Mandatory = $True)]
[string]$Domain,
[Parameter(Mandatory = $True)]
... |
combined_dataset/train/non-malicious/Get-CInfo_1.ps1 | Get-CInfo_1.ps1 | function Get-CInfo {
param($Comp)
Function PC-Name{
param ($compname)
$ADS = Get-ADComputer -Filter {name -eq $compname} -Properties * | Select-Object -Property name
If($ads -eq $null) {$false}
ELSE{$True}
}
$ping = PC-Name $COMP
if ($ping -eq $true) {
Write-Host -ForegroundColor G... |
combined_dataset/train/non-malicious/sample_61_21.ps1 | sample_61_21.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-PrivateKeyPath_1.ps1 | Get-PrivateKeyPath_1.ps1 | #requires -Version 2.0
#
# Example 1:
# Get-PrivateKeyPath CN=DO_NOT_TRUST_FiddlerRoot -StoreName My -StoreScope CurrentUser
# Example 2:
# Get-PrivateKeyPath D359ECDC338CFDDCE86DDDA99BE36286BAE2018A
function Get-PrivateKeyPath
{
param
(
[Parameter(Mandatory = $true, Position = 0)]
[string]
$Certifi... |
combined_dataset/train/non-malicious/BufferBox 3.1.ps1 | BufferBox 3.1.ps1 | ####################################################################################################
## This script is just a demonstration of some of the things you can do with the buffer
## in the default PowerShell host... it serves as a reminder of how much work remains on
## PoshConsole, and as an inspiration t... |
combined_dataset/train/non-malicious/sample_46_11.ps1 | sample_46_11.ps1 | #
# Module manifest for module 'OCI.PSModules.Genericartifactscontent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Genericartifactscontent.dll'
# Version number of this module.
ModuleVersion = '83.2.0... |
combined_dataset/train/non-malicious/sample_1_73.ps1 | sample_1_73.ps1 | #jc jclauzel edited as part of SDP to TSS migration 17/02/2023
# Last Modified: 2023-02-24 by #we#
$debug = $false
# Load Common Library:
. ./utils_cts.ps1
. ./utils_MBS.ps1
. ./utils_CRM.ps1
$CRMServerNotInstalledTitle="Microsoft Dynamics CRM Server Not Installed."
$CRMServerNotInstalledDescription = "Th... |
combined_dataset/train/non-malicious/sample_64_42.ps1 | sample_64_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/1241.ps1 | 1241.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory)]
[string[]]
$Path,
[string]
$Filter,
[string[]]
$Include,
[string[]]
$Exclude,
[Switch]
$Recurse
)
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPat... |
combined_dataset/train/non-malicious/sample_14_97.ps1 | sample_14_97.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/Roll-Dice_1.ps1 | Roll-Dice_1.ps1 | # Roll-Dice.ps1
# Cody Bunch
# ProfessionalVMware.com
Begin {
$rand = New-Object System.Random
$dice = $rand.next(1,3)
}
Process {
if ( $_ -isnot [VMware.VimAutomation.Types.Snapshot] ) { continue }
if ($dice -gt 1) {
$_ | Remove-Snapshot -Confirm:$false
Write-Host "$_.Name OH NOES! Has been del... |
combined_dataset/train/non-malicious/1785.ps1 | 1785.ps1 |
Describe "PSDiagnostics cmdlets tests." -Tag "CI", "RequireAdminOnWindows" {
BeforeAll {
$LogType = 'Analytic'
$OriginalDefaultParameterValues = $PSDefaultParameterValues.Clone()
if (-not $IsWindows) {
$PSDefaultParameterValues["it:skip"] = $true
}
else{
... |
combined_dataset/train/non-malicious/2157.ps1 | 2157.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(
Mandatory = $true,
ParameterSetName = "Download",
HelpMessage = "Generate a download configuration file for Office."
)]
[ValidateNotNullOrEmpty()]
[switch]$DownloadFile,
[parameter(
Mandatory = $true,
... |
combined_dataset/train/non-malicious/sample_18_81.ps1 | sample_18_81.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Já existe uma variável de ambiente com este nome e tipo.
EnvironmentErrorDoesNotExists=Não existe uma variável de ambiente com este nome e tipo.
'@
# SIG # Begin signature block
# MIIoKQYJKoZIhvcNAQcCoIIoGjCCKBYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3A... |
combined_dataset/train/non-malicious/208.ps1 | 208.ps1 | function Add-SCSMReviewActivityReviewer
{
[CmdletBinding()]
PARAM
(
[System.String]$UserName,
[Boolean]$veto = $false,
[Boolean]$mustvote = $false,
$WorkItemID
)
BEGIN { Import-Module -Name SMLets -ErrorAction Stop }
PROCESS
{
$ADUserClas... |
combined_dataset/train/non-malicious/1643.ps1 | 1643.ps1 |
$comps = 1..10
$index = 0
$total = @($comps).Count
$starttime = $lasttime = Get-Date
foreach ($comp in $comps) {
$index++
$currtime = (Get-Date) - $starttime
$avg = $currtime.TotalSeconds / $index
$last = ((Get-Date) - $lasttime).TotalSeconds
$left = $total - $index
$WrPrgParam = @{
... |
combined_dataset/train/non-malicious/Terminate process _ user.ps1 | Terminate process _ user.ps1 | #Ty Lopes - Calgary - Oct 2012
#(Troy is a huge nerd)
#How to kill a process by username
#Originally created for a script (running under a sched task) that was not closing excel application after enumerating throught the excel file
#Powershell does not seem to close excel properly using the workbook.close functio... |
combined_dataset/train/non-malicious/Get-HotFix.ps1 | Get-HotFix.ps1 | # The Get-HotFix function gets the quick-fix engineering (QFE) updates that have been applied to the local computer or to remote computers and filter those hotfixes named "file 1".
# There is Get-HotFix cmdlet in PowerShell V2. This is an attempt to bring similar functionality to V1.
function Get-HotFix {
param (... |
combined_dataset/train/non-malicious/Boots DataGrid Binding.ps1 | Boots DataGrid Binding.ps1 | #load boots#
Import-Module Powerboots
function Export-NamedControl {
[CmdletBinding()]
param(
[Parameter(ValueFromPipeline=$true, Position=1, Mandatory=$true)]
$Root = $BootsWindow
)
process {
Invoke-BootsWindow $Root {
$control = $BootsWindow
while($control) {
$control = $... |
combined_dataset/train/non-malicious/sample_3_91.ps1 | sample_3_91.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/4158.ps1 | 4158.ps1 |
Set-Variable -Name DefaultPrinter -Scope Global -Force
cls
If ((Test-Path $env:APPDATA"\DefaultPrinter.txt") -eq $true) {
Remove-Item -Path $env:APPDATA"\DefaultPrinter.txt" -Force
}
$DefaultPrinter = Get-WmiObject -Class win32_printer -ComputerName "localhost" -Filter "Default='true'" | Select-Object ShareName
Wr... |
combined_dataset/train/non-malicious/sample_7_11.ps1 | sample_7_11.ps1 |
$OutputFile= $Computername + "_reg_Cluster.hiv"
RegSave -RegistryKey "HKLM\Cluster" -OutputFile $OutputFile -fileDescription "Cluster Hive"
$OutputFile= $Computername + "_reg_ClusSvc.txt"
RegQuery -RegistryKeys "HKLM\SYSTEM\CurrentControlSet\services\ClusSvc" -OutputFile $OutputFile -fileDescription "ClusSvc" -R... |
combined_dataset/train/non-malicious/sample_39_90.ps1 | sample_39_90.ps1 |
function New-AzDataProtectionBackupConfigurationClientObject{
[OutputType('PSObject')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates new backup configuration object')]
param(
[Parameter(Mandatory, HelpMessage='Datasource T... |
combined_dataset/train/non-malicious/sample_17_58.ps1 | sample_17_58.ps1 | function trySetDesignerProp(tname, ttype, val) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0);
trait.value = val;
// services.debug.trace(tname + "=" + val);
}
if (command.getTrait("state").value == 0) {
command.getTrait("state").value = 2;
trySetDesignerProp("snap",... |
combined_dataset/train/non-malicious/3539.ps1 | 3539.ps1 |
function Get-ResourceGroupLocation
{
$location = Get-Location "Microsoft.RecoveryServices" "vaults" "West US";
$outputLocation = $location.ToLower()
$outputLocation = $outputLocation -replace '\s', ''
$outputLocation = $outputLocation -replace '-', ''
$outputLocation = $outputLocation -replace '_', '... |
combined_dataset/train/non-malicious/sample_39_81.ps1 | sample_39_81.ps1 | #
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
<#
.SYNOPSIS
Installs dotnet cli
.DESCRIPTION
Installs dotnet cli. If dotnet installation already exists in the given director... |
combined_dataset/train/non-malicious/68.ps1 | 68.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aa... |
combined_dataset/train/non-malicious/706.ps1 | 706.ps1 |
function Out-RsRestCatalogItem
{
[CmdletBinding()]
param (
[Alias('RsFolder')]
[Parameter(Mandatory = $True, ValueFromPipeline = $true)]
[string[]]
$RsItem,
[ValidateScript({ Test-Path $_ -PathType Container})]
[Parameter(Mandatory = $True)]
[str... |
combined_dataset/train/non-malicious/sample_17_47.ps1 | sample_17_47.ps1 |
account-settings-title = Подешавања аутентификације
account-channel-title = Подразумевани канали
chat-autologin =
.label = Пријави ме при покретању
chat-encryption-generic = Генерички
chat-encryption-log =
.label = Укључи с краја на крај шифроване поруке у записницима разговора
chat-encryption-label = Изворно ... |
combined_dataset/train/non-malicious/3330.ps1 | 3330.ps1 |
function Get-PendingCommand {
[PoshBot.BotCommand(
Aliases = ('pending', 'pendingcommands')
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot
)
$contexts = $Bot.DeferredCommandExecutionContexts.Values
if ($contexts.Count -gt 0) {
$expireMinutes =... |
combined_dataset/train/non-malicious/3047.ps1 | 3047.ps1 |
function Should-BeOfType($ActualValue, $ExpectedType, [switch] $Negate, [string]$Because) {
if ($ExpectedType -is [string]) {
$parsedType = ($ExpectedType -replace '^\[(.*)\]$', '$1') -as [Type]
if ($null -eq $parsedType) {
throw [ArgumentException]"Could not find type [$P... |
combined_dataset/train/non-malicious/617.ps1 | 617.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "https://my.vmware.com/group/vmware/details?downloadGroup=PCLI550&productId=352"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs | ForEach-Object{
try{
... |
combined_dataset/train/non-malicious/sample_41_58.ps1 | sample_41_58.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/Findup_8.ps1 | Findup_8.ps1 | using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.IO;
namespace Findup
{
public class FileInfoExt
{
public FileInfoExt(FileInfo fi)
... |
combined_dataset/train/non-malicious/sample_56_49.ps1 | sample_56_49.ps1 | # Localized 07/02/2024 06:19 PM (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_29_10.ps1 | sample_29_10.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 format file.ps1 | sample format file.ps1 | ## UI Automation v 1.8 -- REQUIRES the Reflection module (current version: http://poshcode.org/3174 )
##
# WASP 2.0 is getting closer, but this is still just a preview:
# -- a lot of the commands have weird names still because they're being generated ignorantly
# -- eg: Invoke-Toggle.Toggle and Invoke-Invoke.Invo... |
combined_dataset/train/non-malicious/948.ps1 | 948.ps1 |
$uniqueId=$(-join ((97..122) + (48..57) | Get-Random -Count 10 | % {[char]$_}))
$apiVersion = "2015-04-08"
$location = "West US 2"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount-$uniqueId"
$accountResourceType = "Microsoft.DocumentDb/databaseAccounts"
$databaseResourceType = "Microsoft.Docu... |
combined_dataset/train/non-malicious/sample_45_69.ps1 | sample_45_69.ps1 | #
# Module manifest for module 'OCI.PSModules.Rover'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Rover.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/2469.ps1 | 2469.ps1 |
$files = [ordered]@{
'SQLSysClrTypes.msi' = 'http://go.microsoft.com/fwlink/?LinkID=239644&clcid=0x409'
'SharedManagementObjects.msi' = 'http://go.microsoft.com/fwlink/?LinkID=239659&clcid=0x409'
'PowerShellTools.msi' = 'http://go.microsoft.com/fwlink/?LinkID=239656&clcid=0x409'
'azure-powershell.0.9.8.msi' =... |
combined_dataset/train/non-malicious/sample_8_23.ps1 | sample_8_23.ps1 | ConvertFrom-StringData @'
id_telnetsystemaccount_sd=The Telnet service is running under Local System account and this may cause problems with Plug and Play device installation.
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3Ag... |
combined_dataset/train/non-malicious/sample_22_50.ps1 | sample_22_50.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
function Set-WmiHandlesPerHostLimit
{
[Cm... |
combined_dataset/train/non-malicious/2225.ps1 | 2225.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true,HelpMessage="Site Server where SQL Server Reporting Services are installed")]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1})]
[string]$ReportServer,
[parameter(Mandatory=$true,HelpMessage="SiteCode of the Repor... |
combined_dataset/train/non-malicious/sample_45_98.ps1 | sample_45_98.ps1 | <Viewbox Width="16" Height="16" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup ClipGeometry="M0,0 V512 H512 V0 H0 Z">
<DrawingGroup Opacity="1">
... |
combined_dataset/train/non-malicious/sample_53_56.ps1 | sample_53_56.ps1 | #
# Module manifest for module 'OCI.PSModules.Datalabelingservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datalabelingservice.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Sup... |
combined_dataset/train/non-malicious/sample_49_88.ps1 | sample_49_88.ps1 | # Localized 07/06/2023 04:55 PM (GMT) 303:7.0.30723 cl_localizationdata.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Solución de problemas
Troubleshoot_DetectDVDDevice=Comprobando dispositivo de DVD...
Troubleshoot_DetectDVDvideoDecoder=Comprobando decodificador de video para la reproducción de DVD.... |
combined_dataset/train/non-malicious/sample_60_40.ps1 | sample_60_40.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/New-RssFeed.ps1 | New-RssFeed.ps1 | # Creates an RSS feed
# Parameter input is for "site": Path, Title, Url, Description
# Pipeline input is for feed items: hashtable with Title, Link, Author, Description, and pubDate keys
param (
$Path = "$( throw 'Path is a mandatory parameter.' )",
$Title = "Site Title",
$Url = "http://$( $env:computername )"... |
combined_dataset/train/non-malicious/sample_19_25.ps1 | sample_19_25.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/4307.ps1 | 4307.ps1 |
function SuiteSetup {
Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue
Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue
$script:ProgramFilesModulesPath = Get-AllUsersModulesPath
$script:MyDocumentsModulesPath = Get-CurrentUserModulesPath
... |
combined_dataset/train/non-malicious/sample_38_68.ps1 | sample_38_68.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/sample_55_47.ps1 | sample_55_47.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.2.0'
# Supported PSEditions
CompatiblePSEd... |
combined_dataset/train/non-malicious/sample_24_1.ps1 | sample_24_1.ps1 | using namespace System.Management.Automation
using namespace System.Management.Automation.Language
# This is an example profile for PSReadLine.
#
# This is roughly what I use so there is some emphasis on emacs bindings,
# but most of these bindings make sense in Windows mode as well.
Import-Module PSReadLine
... |
combined_dataset/train/non-malicious/2625.ps1 | 2625.ps1 | function Import-CsvToSqTable {
[CmdletBinding()]
param([string]$InstanceName
,[string]$Database
,[string]$SourceFile
,[string]$SqlDataType = 'VARCHAR(255)'
,[pscredential]$SqlCred
,[string]$StagingTableName
,[Switch]$Append
)
if(-not (Test-Path $SourceFile) -and $Sour... |
combined_dataset/train/non-malicious/sample_2_74.ps1 | sample_2_74.ps1 | ConvertFrom-StringData @'
id_ctsnlb=Network Load Balancing (NLB)
id_ctsnlbdescription=Collects information about Network Load Balancing (NLB).
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
#... |
combined_dataset/train/non-malicious/Sort IE Favorites_1.ps1 | Sort IE Favorites_1.ps1 | $Results = gci $env:userprofile\\favorites -rec -inc *.url |
? {select-string -inp $_ -quiet "^URL=http"} |
select @{Name="Name"; Expression={[IO.Path]::GetFileNameWithoutExtension($_.FullName)}},
@{Name="URL"; Expression={get-content $_ | ? {$_ -match "^URL=http"} | % {$_.Substring(4)}}}
New-Item $env:userprofil... |
combined_dataset/train/non-malicious/sample_9_68.ps1 | sample_9_68.ps1 | #************************************************
# TS_DetectMTU1514.ps1
# Version 1.0
# Date: 02/06/2014
# Author: BBenson
# Description: Detect if LinkMTU is set to 1514.
# Rule number: 262751
# Rule ID: 7a316c95-272b-4207-983d-57acb91d0eea
# Rule URL: https://kse.microsoft.com/Contribute/Idea/1456f71b-f3... |
combined_dataset/train/non-malicious/2236.ps1 | 2236.ps1 |
$DailyBackupFolder = "\\fileshare\ContentLibrary\Daily"
$ArchiveFolder = "\\fileshare\ContentLibrary\Archive"
$Date = (Get-Date).ToShortDateString()
$DateKeep = (Get-Date).AddDays(-2).ToShortDateString()
$DailyFolder = "$($ArchiveFolder)\$($Date)"
if (-not(Test-Path -Path $DailyFolder)) {
New-Item -Type Directo... |
combined_dataset/train/non-malicious/3896.ps1 | 3896.ps1 |
function Test-VolumeCrud
{
$currentSub = (Get-AzureRmContext).Subscription
$subsid = $currentSub.SubscriptionId
$resourceGroup = Get-ResourceGroupName
$accName = Get-ResourceName
$poolName = Get-ResourceName
$poolName2 = Get-ResourceName
$volName1 = Get-ResourceName
$vol... |
combined_dataset/train/non-malicious/sample_56_60.ps1 | sample_56_60.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 = '85.1.0'
# Supported PSEditions
Compatible... |
combined_dataset/train/non-malicious/sample_45_70.ps1 | sample_45_70.ps1 | #
# Module manifest for module 'OCI.PSModules.Core'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Core.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
CompatiblePS... |
combined_dataset/train/non-malicious/sample_39_20.ps1 | sample_39_20.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Já existe uma variável de ambiente com este nome e tipo.
EnvironmentErrorDoesNotExists=Não existe uma variável de ambiente com este nome e tipo.
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3A... |
combined_dataset/train/non-malicious/sample_17_18.ps1 | sample_17_18.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_63_55.ps1 | sample_63_55.ps1 | #
# Copyright 2018-2024 HP Development Company, L.P.
# All Rights Reserved.
#
# NOTICE: All information contained herein is, and remains the property of HP Inc.
#
# The intellectual and technical concepts contained herein are proprietary to HP Inc
# and may be covered by U.S. and Foreign Patents, patents in p... |
combined_dataset/train/non-malicious/sample_43_69.ps1 | sample_43_69.ps1 | #
# Module manifest for module 'PowerShellEditorServices'
#
# Generated by: daviwil
#
# Generated on: 5/12/2016
#
@{
# Script module or binary module file associated with this manifest.
RootModule = if ($PSEdition -eq 'Core')
{
'bin/Core/Microsoft.PowerShell.EditorServices.Hosting.dll'
}... |
combined_dataset/train/non-malicious/sample_56_39.ps1 | sample_56_39.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_44_40.ps1 | sample_44_40.ps1 | # These Pester tests are for the for parameter-* and ex-path* snippets.
# Take a look at the .vscode\tasks.json file to see how you can create
# and configure a test task runner that will run all the Pester tests
# in your workspace folder.
# To run these Pester tests, press Ctrl+Shift+T or press Ctrl+Shift+P,
#... |
combined_dataset/train/non-malicious/Get_Set Signature (CTP3)_1.ps1 | Get_Set Signature (CTP3)_1.ps1 | #Requires -version 2.0
## Authenticode.psm1 updated for CTP 3
####################################################################################################
## Wrappers for the Get-AuthenticodeSignature and Set-AuthenticodeSignature cmdlets
## These properly parse paths, so they don't kill your pipeline and ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.