full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/fc04d684-2f9d-418f-9f82-eaef4aa9cfcd.ps1
fc04d684-2f9d-418f-9f82-eaef4aa9cfcd.ps1
Function Get-DrsGroup { <# .SYNOPSIS Retrieves DRS groups from a cluster. .DESCRIPTION Retrieves DRS groups from a cluster. .PARAMETER Cluster Specify the cluster for which you want to retrieve the DRS groups .PARAMETER Name Specify the name of the DRS group you want to retrieve. .EXAMPLE Get-DrsGrou...
combined_dataset/train/non-malicious/sample_44_70.ps1
sample_44_70.ps1
$url = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise.msi'; if ([Environment]::Is64BitProcess) { $url = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi' } $wc = New-Object net.webclient $msiInstaller = "$env:temp\google-chrome.msi" Write-Host ...
combined_dataset/train/non-malicious/sample_29_86.ps1
sample_29_86.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 = '83.2.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_38_19.ps1
sample_38_19.ps1
# # Module manifest for module 'OCI.PSModules.Redis' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Redis.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/2954.ps1
2954.ps1
properties { $runTaskA = $false $taskBSucceded = $true } task default -depends TaskC task TaskA -precondition { $runTaskA -eq $true } { "TaskA executed" } task TaskB -postcondition { $taskBSucceded -eq $true } { "TaskB executed" } task TaskC -depends TaskA,TaskB { "TaskC executed." }
combined_dataset/train/non-malicious/sample_5_74.ps1
sample_5_74.ps1
ConvertFrom-StringData @' id_ctsDFSserver=DFS Server id_ctsDFSserverDescription=Collects information about DFS Server. '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAI...
combined_dataset/train/non-malicious/3052.ps1
3052.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe "Should -Be" { It "returns true if the 2 arguments are equal" { 1 | Should Be 1 1 | Should -Be 1 1 | Should -EQ 1 } It "returns true if the 2 arguments are equal and have different case" { ...
combined_dataset/train/non-malicious/Get-Parameter_12.ps1
Get-Parameter_12.ps1
param ( $Cmdlet, [switch]$ShowCommon, [switch]$Full ) $command = Get-Command $Cmdlet -ea silentlycontinue # resolve aliases (an alias can point to another alias) while ($command.CommandType -eq "Alias") { $command = Get-Command ($command.definition) } if (-not $command) { return } foreach ($p...
combined_dataset/train/non-malicious/sample_62_18.ps1
sample_62_18.ps1
/**************************************************************************** ** Resource object code ** ** Created by: The Resource Compiler for Qt version 6.6.2 ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ static const unsig...
combined_dataset/train/non-malicious/1670.ps1
1670.ps1
function ConvertTo-Bytes { param ( [string]$file ) if (!$file -or !(Test-Path $file)) { throw "file not found: '$file'" } [convert]::ToBase64String((Get-Content $file -Encoding Byte)) } function ConvertFrom-Bytes { param ( [string]$bytes, [string]$savepath ...
combined_dataset/train/non-malicious/2426.ps1
2426.ps1
function Get-MoreCowbell { [CmdletBinding()] param ( [Parameter()] [ValidateNotNullOrEmpty()] [switch]$Introduction, [Parameter()] [ValidateNotNullOrEmpty()] [int]$Repeat = 10, [Parameter()] [ValidateNotNullOrEmpty()] [string]$CowbellUrl = 'http://emmanuelprot.free.fr/Drums%20kit%20Manu/Cowbel...
combined_dataset/train/non-malicious/2086.ps1
2086.ps1
Describe "Additional static method tests" -Tags "CI" { Context "Basic static member methods" { BeforeAll { function Get-Name { "YES" } } It "test basic static constructor" { class Foo { static [string] $Name static Foo() { [Foo]::Na...
combined_dataset/train/non-malicious/sample_62_7.ps1
sample_62_7.ps1
########################################################### # # 'GCArcService' module # ########################################################### $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest Import-Module "$PSScriptRoot\ServiceHelper.psm1" $script:GCInstallPath = "$PSScriptRoot\..\..\...
combined_dataset/train/non-malicious/convert-vim2css.ps1
convert-vim2css.ps1
param( [string] $vimfile ) # some instructions we don't care for $ignorable = ( 'link', 'clear' ) $nrx = 'hi (?<n>\\w+)' $fgrx = 'guifg=(?<n>#\\w+)' $bgrx = 'guibg=(?<n>#\\w+)' $frx = 'gui=(?<n>\\S+)' (gc $vimfile) | ?{ ($_ -match $nrx) -and ($ignorable -notcontains $matches.n) } | %{ if ( $matche...
combined_dataset/train/non-malicious/sample_6_88.ps1
sample_6_88.ps1
# 2023-02-24 WalterE mod Trap #we# $startTime_AutoAdd = Get-Date trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" } Write-Host -Background...
combined_dataset/train/non-malicious/3444.ps1
3444.ps1
[CmdletBinding()] Param( [Parameter()] [Switch]$ValidateMarkdownHelp, [Parameter()] [Switch]$GenerateMamlHelp, [Parameter()] [string]$BuildConfig, [Parameter()] [string]$FilteredModules ) $ResourceManagerFolders = Get-ChildItem -Directory -Path "$PSScriptRoot\..\src" | Where-Object { $...
combined_dataset/train/non-malicious/sample_8_5.ps1
sample_8_5.ps1
#************************************************ # TS_HyperVXeon5500Check.ps1 # Version 1.0.1 # Date: 02-27-2011 # Author: Andre Teixeira - andret@microsoft.com # Description: This scripts checks the processors is an Intel Xeon processor 5500 series # If so, check binary versions of Hvax64.exe, Hv...
combined_dataset/train/non-malicious/1735.ps1
1735.ps1
param( $ETLFileName = '.\PerfViewData.etl', [Parameter(Mandatory)] [scriptblock] $ScriptBlock, $LogFileName = '.\perfview.log', $PowerShellPath = $(Get-Command -Name pwsh.exe).Source, $PerfViewPath = $(Get-Command -Name PerfView.exe).Source ) $EncodedScriptBlock = [System.Convert]::ToBa...
combined_dataset/train/non-malicious/4114.ps1
4114.ps1
[CmdletBinding()] param () $Profiles = (Get-ChildItem -Path REGISTRY::HKEY_USERS -Exclude *Classes | Where-Object {$_.Name -like '*S-1-5-21*'}).Name $ProfileArray = @() foreach ($Item in $Profiles) { $object = New-Object -TypeName System.Management.Automation.PSObject $object | Add-Member -MemberType NoteProperty ...
combined_dataset/train/non-malicious/sample_29_8.ps1
sample_29_8.ps1
<# .SYNOPSIS Deploys a Service Fabric application type to a cluster. .DESCRIPTION This script deploys a Service Fabric application type to a cluster. It is invoked by Visual Studio when deploying a Service Fabric Application project. .NOTES WARNING: This script file is invoked by Visual Studio. Its paramete...
combined_dataset/train/non-malicious/sample_42_68.ps1
sample_42_68.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Support.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Support.internal.psm1' if(Test-Path $internalModulePath) { $nul...
combined_dataset/train/non-malicious/3958.ps1
3958.ps1
function Test-PublicIpPrefixCRUD { $rgname = Get-ResourceGroupName $rname = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/publicIpPrefixes" $location = Get-ProviderLocation $resourceTypeParent "West Europe" $ip...
combined_dataset/train/non-malicious/2497.ps1
2497.ps1
param( $Client = 'GTE', $TrnSourcePath = '\\psqlrpt24\e$\MSSQL10.MSSQLSERVER\MSSQL\BAK', $TrnDestPath = '\\pcon310\Relateprod\FTP sites\') cls function create-7zip([String] $aDirectory, [String] $aZipfile){ [string]$pathToZipExe = "C:\Program Files\7-zip\7z.exe" [Array]$arguments = "a", "-t7z", "$aZipfil...
combined_dataset/train/non-malicious/4267.ps1
4267.ps1
function Inject-Shellcode ([switch]$x86, [switch]$x64, $ParentID, [switch]$RTLCreateUserThread, [switch]$QueueUserAPC,[switch]$Force, [switch]$Suspended, [Parameter(Mandatory=$true)]$Shellcode, $ProcID, $ProcPath, $ProcessName, $ProcName) { if($ProcName){ $ProcessName = $ProcName } if($ProcPath){ $ProcessPath...
combined_dataset/train/non-malicious/1873.ps1
1873.ps1
Describe "New-TemporaryFile" -Tags "CI" { It "creates a new temporary file" { $tempFile = New-TemporaryFile $tempFile | Should -Exist $tempFile | Should -BeOfType System.IO.FileInfo $tempFile | Should -BeLikeExactly "$([System.IO.Path]::GetTempPath())*" if (Test-Pat...
combined_dataset/train/non-malicious/2505.ps1
2505.ps1
[void][reflection.assembly]::LoadWithPartialName( "Microsoft.SqlServer.Smo" ); $smoApp = [Microsoft.SqlServer.Management.Smo.SmoApplication]; $smoApp::EnumAvailableSqlServers($false); $SQL = [System.Data.Sql.SqlDataSourceEnumerator]::Instance.GetDataSources() | ` foreach { "INSERT INTO dbo.FoundSQLServers VALUES ('$...
combined_dataset/train/non-malicious/86.88.239.115.ps1
86.88.239.115.ps1
function Set-IPAddress { param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"), [string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"), [string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"), [string]$gateway = $(read-host "Enter...
combined_dataset/train/non-malicious/sample_0_79.ps1
sample_0_79.ps1
##---------------------------------------------------------------------------- ## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved. ##---------------------------------------------------------------------------- # Import string constants . ./StringConstants.ps1 Stop-Service -Name $ServiceConsta...
combined_dataset/train/non-malicious/sample_37_59.ps1
sample_37_59.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 = '82.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/3181.ps1
3181.ps1
Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null Install-Module PSDepend -Force Invoke-PSDepend -Force Set-BuildEnvironment Invoke-psake .\.build\2.psake.ps1 exit ( [int]( -not $psake.build_success ) )
combined_dataset/train/non-malicious/sample_60_32.ps1
sample_60_32.ps1
# # Module manifest for module 'OCI.PSModules.Loganalytics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loganalytics.dll' # Version number of this module. ModuleVersion = '88.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/657.ps1
657.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 VerifyCatalogItemExists() { param( [Parameter(Mandatory = ...
combined_dataset/train/non-malicious/sample_43_80.ps1
sample_43_80.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 = '75.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/3512.ps1
3512.ps1
function Test-DataLakeAnalyticsJobRelationships { param ( $resourceGroupName = (Get-ResourceGroupName), $accountName = (Get-DataLakeAnalyticsAccountName), $dataLakeAccountName = (Get-DataLakeStoreAccountName), $location = "West US" ) try { New-AzResourceGroup -Name $resourceGroupName -Location $lo...
combined_dataset/train/non-malicious/1365.ps1
1365.ps1
function ConvertTo-Key { param( $From, $InputObject ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState if( $InputObject -isnot [byte[]] ) { if( $InputObject -is [SecureString] ) { $I...
combined_dataset/train/non-malicious/sample_52_26.ps1
sample_52_26.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# .Synopsis Group Policy tools use administrative template files (.admx, .adml) to populate policy settings in the user interface. This allows administrators to manage registry-based policy settings. This script installes Powe...
combined_dataset/train/non-malicious/sample_42_2.ps1
sample_42_2.ps1
# # Module manifest for module 'OCI.PSModules.Vnmonitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Vnmonitoring.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditi...
combined_dataset/train/non-malicious/2947.ps1
2947.ps1
task default -depends Test task Test -depends Compile, Clean {} task Compile -depends Clean { "Compile" } task Clean { "Clean" } taskTearDown { param($task) Assert ($task -ne $null) '$task should not be null' Assert (-not ([string]::IsNullOrWhiteSpace($task.Name))) '$task.Name should not be nul...
combined_dataset/train/non-malicious/266.ps1
266.ps1
function Connect-ExchangeOnline { param ( [system.string]$ConnectionUri = 'https://ps.outlook.com/powershell/', [Parameter(Mandatory)] $Credential ) PROCESS { TRY { if ($Credential.username -notlike '*@*') { ...
combined_dataset/train/non-malicious/192.ps1
192.ps1
[cmdletbinding()] PARAM ( [Parameter(Mandatory, HelpMessage = "You must specify the full path of the file")] [ValidateScript({ Test-Path -Path $_ })] $Path, [Parameter(Mandatory, HelpMessage = "You must specify the SheetName of the Excel file")] $Sheet) $FilePath = $path $SheetName = $Sheet $objExc...
combined_dataset/train/non-malicious/sample_51_97.ps1
sample_51_97.ps1
# # Module manifest for module 'OCI.PSModules.Datacatalog' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datacatalog.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEdition...
combined_dataset/train/non-malicious/1751.ps1
1751.ps1
Import-Module $PSScriptRoot/Apache/Apache.psm1 Write-Host -Foreground Blue "Get installed Apache Modules like *proxy* and Sort by name" Get-ApacheModule | Where-Object {$_.ModuleName -like "*proxy*"} | Sort-Object ModuleName | Out-Host Write-host -Foreground Blue "Restart Apache Server gracefully" Restart-Apache...
combined_dataset/train/non-malicious/1021.ps1
1021.ps1
$subscriptionId = '<Specify your subscription ID here>' Select-AzSubscription -SubscriptionId $subscriptionId $labRg = '<Specify your lab resource group name here>' $labName = '<Specify your lab name here>' $lab = Get-AzResource -ResourceId ('/subscriptions/' + $subscriptionId + '/resourceGroups/' + $labRg + '/prov...
combined_dataset/train/non-malicious/sample_11_63.ps1
sample_11_63.ps1
@{ GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" FunctionsToExport = @() CmdletsToExport = "Get-Credential", "Get-ExecutionP...
combined_dataset/train/non-malicious/Enable-MailboxJunkEmail..ps1
Enable-MailboxJunkEmail..ps1
@@# Author: Jon Webster @@# Name: Enable-MailboxJunkEmail @@# Created: 1/27/2009 # # Version: 1.0 # History: 1.0 01/27/2009 Initial version param( $Identity, [string]$CasURL, [string]$User, [string]$Password, $DomainController, [switch]$help ) BEGIN { Function Usage { Write-Host @' Ena...
combined_dataset/train/non-malicious/sample_37_24.ps1
sample_37_24.ps1
<# .SYNOPSIS Demonstrates how to write a command that works with paths that allow wildards and must exist. .DESCRIPTION This command also demonstrates how you need to supply a LiteralPath parameter when your Path parameter accepts wildcards. This is in order to handle paths like foo[1].txt. ...
combined_dataset/train/non-malicious/VMware Daily Report.ps1
VMware Daily Report.ps1
# vCheck - Daily Error Report # # Changes: # Version 1.10 - Added How many days old the snapshots are # Version 1.9 - Added ability to change user account which makes the WMI calls # Version 1.8 - Added Real name resolution via AD and sorted disk space by PerfFree # Version 1.7 - Added Event Logs for VMware war...
combined_dataset/train/non-malicious/1423.ps1
1423.ps1
function New-CTempDirectory { [CmdletBinding(SupportsShouldProcess=$true)] [OutputType([IO.DirectoryInfo])] param( [string] $Prefix ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $tempDir = [...
combined_dataset/train/non-malicious/sample_50_22.ps1
sample_50_22.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=Bu adda ve türde bir ortam değişkeni zaten var. EnvironmentErrorDoesNotExists=Bu adda ve türde bir ortam değişkeni yok. '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3Ag...
combined_dataset/train/non-malicious/Test-Host.ps1
Test-Host.ps1
function Test-Host { <# .Synopsis Test a host for connectivity using either WMI ping or TCP port .Description Allows you to test a host for connectivity before further processing .Parameter Server Name of the Server to Process. .Parameter ...
combined_dataset/train/non-malicious/sample_14_2.ps1
sample_14_2.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/sample_2_21.ps1
sample_2_21.ps1
// Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved. // ================================================================== // DCIM_IPMIAccountManagementService // ================================================================== [ dynamic, provider("dcismprovider"), Description ( ...
combined_dataset/train/non-malicious/29.ps1
29.ps1
param([switch]$WhatIf = $false, [switch]$Force = $false, [switch]$Verbose = $false) $installDir = Split-Path $MyInvocation.MyCommand.Path -Parent Import-Module $installDir\src\posh-git.psd1 Add-PoshGitToProfile -WhatIf:$WhatIf -Force:$Force -Verbose:$Verbose
combined_dataset/train/non-malicious/sample_31_77.ps1
sample_31_77.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_16_46.ps1
sample_16_46.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 = '75.1.0' # Supported PSEditions CompatiblePSEditions = 'Core', 'Desktop' # ID u...
combined_dataset/train/non-malicious/469.ps1
469.ps1
& "$PSScriptRoot\..\PSFramework\tests\pester.ps1"
combined_dataset/train/non-malicious/sample_38_52.ps1
sample_38_52.ps1
@{ RootModule = 'PSModule.psm1' ModuleVersion = '2.2.5' GUID = '1d73a601-4a6c-43c5-ba3f-619b18bbb404' Author = 'Microsoft Corporation' CompanyName = 'Microsoft Corporation' Copyright = '(c) Microsoft Corporation. All rights reserved.' D...
combined_dataset/train/non-malicious/2323.ps1
2323.ps1
$global:BlogUrl = 'www.adamtheautomator.com' $global:WpApiUri = "https://public-api.wordpress.com/rest/v1/sites/$global:BlogUrl/posts" $global:WpAuthorizeEndPoint = 'https://public-api.wordpress.com/oauth2/authorize' $global:WpTokenEndpoint = 'https://public-api.wordpress.com/oauth2/token' $global:WpComUse...
combined_dataset/train/non-malicious/2752.ps1
2752.ps1
if (Test-Path "$env:SystemRoot\handle.exe") { $data = (& $env:SystemRoot\handle.exe /accepteula -a) foreach($line in $data) { $line = $line.Trim() if ($line -match " pid: ") { $HandleId = $Type = $Perms = $Name = $null $pattern = "(?<ProcessName>^[-a-zA-Z0-9_.]+) ...
combined_dataset/train/non-malicious/2568.ps1
2568.ps1
param ( [string]$tfsServer = "TFSServerName", [string]$tfsLocation = "$/TFS/Project", [string]$localFolder ="c:\scripts", [string]$file, [string]$checkInComments = "Checked in from PowerShell" ) $clientDll = "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft....
combined_dataset/train/non-malicious/sample_25_86.ps1
sample_25_86.ps1
# # Module manifest for module 'OCI.PSModules.Aidocument' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aidocument.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/chkhash.ps1
chkhash.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/1431.ps1
1431.ps1
function ConvertTo-CContainerInheritanceFlags { [CmdletBinding()] [OutputType([Carbon.Security.ContainerInheritanceFlags])] param( [Parameter(Mandatory=$true,Position=0)] [Security.AccessControl.InheritanceFlags] $InheritanceFlags, [Parameter(Mandatory=$true,P...
combined_dataset/train/non-malicious/2574.ps1
2574.ps1
$ErrorActionPreference = "silentlycontinue" $Excel = New-Object -ComObject Excel.Application $Excel.visible = $False $Excel.DisplayAlerts = $false $ExcelWorkbooks = $Excel.Workbooks.Add() $Sheet = $ExcelWorkbooks.Worksheets.Item(1) $date = ( get-date ).ToString('yyyy/MM/dd') $save = "E:\Dexma\Logs\DatabaseBackup_...
combined_dataset/train/non-malicious/PowerOAuth 1.1.ps1
PowerOAuth 1.1.ps1
#requires -Version 2.0 ##requires -Module HttpRest -Version 1.2 # http://poshcode.org/1262 Set-StrictMode -Version 2.0 $null = [Reflection.Assembly]::LoadWithPartialName('System.Web') $safeChars = [char[]]'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~' function Get-OAuthBase { #.Synopsis ...
combined_dataset/train/non-malicious/finddupe_20.ps1
finddupe_20.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 $stream = $file.OpenRead(); $hashByteArray = $h...
combined_dataset/train/non-malicious/Add EventLogs to Mongo.ps1
Add EventLogs to Mongo.ps1
<# .NOTES AUTHOR: Sunny Chakraborty(sunnyc7@gmail.com) WEBSITE: http://tekout.wordpress.com CREATED: 8/20/2012 Requires: a) PowerShell v2 or better b) Requires Mongo Official C# driver https://github.com/mongodb/mongo-csharp-driver/downloads Tested using 1.5.0.X c) Thanks to Justin Dearing for this: https:...
combined_dataset/train/non-malicious/sample_10_75.ps1
sample_10_75.ps1
# Copyright 2008, Microsoft Corporation. All rights reserved. PARAM([string]$MachineName = $ComputerName,[string]$Path= $null) if($debug -eq $true){[void]$shell.popup("Run DC_DeploymentLogsLogs.ps1")} Import-LocalizedData -BindingVariable DeploymentLogsStrings Write-DiagProgress -Activity $DeploymentLogsS...
combined_dataset/train/non-malicious/get-SQLInstanceInfo_1.ps1
get-SQLInstanceInfo_1.ps1
function get-SQLInstanceInfo2 { param ( [Parameter(Mandatory=$True)][string]$ComputerName ) $InstanceInfos = @() $Instances = (new-object 'microsoft.sqlserver.management.smo.Wmi.ManagedComputer' "$ComputerName").Services | where-object{$_.type -eq 'SqlServer'} foreach($Instance in $Instances )...
combined_dataset/train/non-malicious/1967.ps1
1967.ps1
Describe "Measure-Object" -Tags "CI" { BeforeAll { $testObject = 1,3,4 $testObject2 = 1..100 } It "Should be able to be called without error" { { Measure-Object | Out-Null } | Should -Not -Throw } It "Should be able to call on piped input" { { $testObject | Measur...
combined_dataset/train/non-malicious/Get-CalendarWeek.ps1
Get-CalendarWeek.ps1
# Get-CalendarWeek by Holger Adam # Simple function to retrieve the calendar week to a given or the current date. # The function always assumes a calendar week rule of at least four days and the week starting with monday. function Get-CalendarWeek { param( $Date ) # check date input if ($Date -eq $nu...
combined_dataset/train/non-malicious/Get-LogicalDiskInfo.ps1
Get-LogicalDiskInfo.ps1
# ======================================================================== # # NAME: Get-LogicalDiskInfo.ps1 # # AUTHOR: Alex Ocampo , Daptiv Solutions LLC # DATE : 7/19/2011 # # COMMENT: Using WMI, script check logical disk information of a single # server or a group of servers. Script send email notificat...
combined_dataset/train/non-malicious/Kill Outlook + CopyPST_1.ps1
Kill Outlook + CopyPST_1.ps1
$rep_du_user = $env:userprofile $repertoire_pst = ($rep_du_user+"\\AppData\\Local\\Microsoft\\Outlook") $repertoire_sauvegarde = "directory" #Kill de outlook Get-Process | Where { $_.Name -Eq "outlook" } | stop-process #wait and see :) sleep 10 #copy des pst xcopy $repertoire_pst $repertoire_sauvegarde /D...
combined_dataset/train/non-malicious/4360.ps1
4360.ps1
function Install-NuGetClientBinaries { [CmdletBinding()] param ( [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [System.Management.Automation.PSCmdlet] $CallerPSCmdlet, [parameter()] [switch] $BootstrapNuGetExe, [Parameter()] ...
combined_dataset/train/non-malicious/sample_23_33.ps1
sample_23_33.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.DevCenterdata.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.DevCenterdata.Module]::Instance # Export nothing to clear implici...
combined_dataset/train/non-malicious/3694.ps1
3694.ps1
function Test-DataSetCrud { try { $resourceGroup = getAssetName $AccountName = getAssetName $ShareName = getAssetName $DataSetName = getAssetName $StorageAccountId = getAssetName $ContainerName = getAssetName $createdContainerDataset = New-AzDataShareDataSet -ResourceGroupName $resourceGroup -Acco...
combined_dataset/train/non-malicious/Expand-Alias 2.0.ps1
Expand-Alias 2.0.ps1
#requires -version 2.0 ## ResolveAlias Module v2.0 ######################################################################################################################## ## Version History ## 1.0 - First Version. "It worked on my sample script" ## 1.1 - Now it parses the $(...) blocks inside strings ## 1.2 - So...
combined_dataset/train/non-malicious/3170.ps1
3170.ps1
Function Get-WinEventData { [cmdletbinding()] param( [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, ValueFromRemainingArguments=$false, Position=0 )] [System.Diagnostics....
combined_dataset/train/non-malicious/sample_45_7.ps1
sample_45_7.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-Weather 2.2.ps1
Get-Weather 2.2.ps1
#require -version 2.0 #require -shellid PoshConsole ################################################################################################### ## Get-Weather ## Parse and display the current weather and forecast from yahoo RSS ## Note that you _could_ modify this a bit to return "current condition" and "...
combined_dataset/train/non-malicious/sample_46_98.ps1
sample_46_98.ps1
function AddFilterToQuery { [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.DoNotExportAttribute()] param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [System.String] $Query, [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] ...
combined_dataset/train/non-malicious/sample_64_99.ps1
sample_64_99.ps1
5PrintAllTranslations 限制不能與 IgnoreTranslations 限制一起使用。>您無法將計算結果欄 '%{oii_column/}' 新增至混合式資料表 '%{oii_table/}'。請移除計算結果欄。M您無法新增用於對混合式工作表 '%{oii_table/}' 進行彙總的 'alternateOf' 資料行。請移除 'alternateOf' 資料行。v您無法建立用於彙總且參考混合式資料表 '%{oii_baseTable/}' 作為 BaseTable 的 'alternateOf' 資料行。請以 DirectQuery 模式參考基底資料表或移除 'alternateOf' 資料行。G您無法在...
combined_dataset/train/non-malicious/Deleted-Folders.ps1
Deleted-Folders.ps1
function Deleted-Folders(){ param ( $Computer, [String[]]$SeachFoldersDeleted ) $Info = $null $Disks = $null trap {Write-Host "Error WmiObject $Computer";Continue} $Disks += Get-WmiObject win32_logicaldisk -ComputerName $Computer | Where-Object {$_.Size -ne $null} foreach ($Disk in $Disks){ if...
combined_dataset/train/non-malicious/sample_62_35.ps1
sample_62_35.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/Compare-TwitterNames.ps1
Compare-TwitterNames.ps1
#This script will compare the names of the people you follow on Twitter #and the people following you. It returns a comparison object consisting #of the Twitter name of a subject and a side indicator - #"<=" means that you are following a subject who is not following you, #"=>" means that you are followed by so...
combined_dataset/train/non-malicious/sample_41_27.ps1
sample_41_27.ps1
@{ RootModule = 'PSReadLine.psm1' NestedModules = @("Microsoft.PowerShell.PSReadLine2.dll") ModuleVersion = '2.1.0' GUID = '5714753b-2afd-4492-a5fd-01d9e2cff8b5' Author = 'Microsoft Corporation' CompanyName = 'Microsoft Corporation' Copyright = '(c) Microsoft Corporation. All rights reserved.' Description = 'Gr...
combined_dataset/train/non-malicious/sample_63_64.ps1
sample_63_64.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-DelegateType.ps1
Get-DelegateType.ps1
Set-StrictMode -Version 2 function Get-DelegateType { <# .Synopsis Declares a non-generic delegate type for the method signature provided. .Description The Get-DelegateType function is the equivalent to declaring a delegate type in C# with the 'delegate' keyword. PowerShell has no such equivalent, hence this...
combined_dataset/train/non-malicious/sample_48_86.ps1
sample_48_86.ps1
# # Module manifest for module 'OCI.PSModules.Goldengate' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Goldengate.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_4_25.ps1
sample_4_25.ps1
#************************************************ # TS_StoreAppsFailureForVideoResolutionCheck.ps1 # Version 1.0.1 # Date: 3/13/2013 # Author: v-blchen # Description: [Idea ID 6253] [Windows] Win8:APP - Store Apps do not launch due to video resolution # Rule number: 6253 # Rule URL: http://sharepoint/sites/ru...
combined_dataset/train/non-malicious/sample_23_52.ps1
sample_23_52.ps1
# Instructions: select the entire file and hit F8 to # load the extensions. To see the list of registered # extensions and run them, hit Ctrl+Shift+P, type 'addi' # and run the "Show additional commands from PowerShell modules" # command. A quick pick list will appear with all 3 # extensions registered. Selecti...
combined_dataset/train/non-malicious/Resizer of pictures_3.ps1
Resizer of pictures_3.ps1
[reflection.assembly]::LoadWithPartialName("System.Drawing") $SizeLimit=1280 # required size of picture's long side $logfile="resizelog.txt" # log file for errors $toresize=$args[0] # list of directories to find and resize images. can be empty @@ if ([string]$toresize -eq &#8220;&#8221;) { # if ...
combined_dataset/train/non-malicious/1568.ps1
1568.ps1
function Restart-MrServiceOrDie { [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] param ( [Parameter(Mandatory=$true, ValueFromPipeline=$true)] [System.ServiceProcess.ServiceController[]]$Service ) BEGIN { $StartTime...
combined_dataset/train/non-malicious/Blow up ESXi.ps1
Blow up ESXi.ps1
foreach ($i in 10..1) { Set-VMHostAdvancedConfiguration -name Annotations.WelcomeMessage -value "This host will self destruct in $i" } Start-Sleep 10 Set-VMHostAdvancedConfiguration -name Annotations.WelcomeMessage -value ""
combined_dataset/train/non-malicious/Write-Log_4.ps1
Write-Log_4.ps1
function Write-Log { #region Parameters [cmdletbinding()] Param( [Parameter(ValueFromPipeline=$true,Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Message, [Parameter()] [ValidateSet(ōErrorö, ōWarnö, ōInfoö)] [string] $Level = ōInfoö, [Parameter()] [Switch] $NoConsole...
combined_dataset/train/non-malicious/755.ps1
755.ps1
using module ..\GitHubTools.psm1 using module ..\ChangelogTools.psm1 [CmdletBinding()] param( [Parameter(Mandatory)] [string] $GitHubToken, [Parameter(Mandatory)] [string] $PSExtensionSinceRef, [Parameter(Mandatory)] [string] $PsesSinceRef, [Parameter()] [version] ...
combined_dataset/train/non-malicious/sample_66_66.ps1
sample_66_66.ps1
# Import the helper functions Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [parameter(Mandatory = $true)] [System.String] $Category ) #Write-Verbose "Use this cmdlet t...
combined_dataset/train/non-malicious/4316.ps1
4316.ps1
function Get-FindModuleParameterTestManifest { ConvertFrom-Json -InputObject @" { "TestCaseManifest": { "Parameters": { "Variations": [ { ...
combined_dataset/train/non-malicious/Get-PSExecutionPolicy.ps1
Get-PSExecutionPolicy.ps1
#Notes #1. x86 properites will be empty for x86 machines as this property only pertains x64 machines which have both x64 and x86 shells. #2. If policy registry key is not present then restricted is the effective setting param($computerName=$env:computerName) $reg = Get-WmiObject -List -Namespace root\\default -...
combined_dataset/train/non-malicious/Get-NextPrime_1.ps1
Get-NextPrime_1.ps1
$primes = 2,3,5 #,7,11,13,17,19,23 $primeIndex = 0 function Get-NextPrime { [CmdletBinding(DefaultParameterSetName="KnownPrime")] param( [Parameter(Position=0,ParameterSetName="KnownPrime")] $knownPrime = $(if($primeIndex -lt $primes.Count){ $primes[$primeIndex] } else { $primes[-1] } ) , ...