full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_51_59.ps1
sample_51_59.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 = '74.1.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_48_75.ps1
sample_48_75.ps1
function getWorldMatrix(element) { return element.getTrait("WorldTransform").value; } var isOrtho = false; function getCameraElement() { var camera = document.elements.findElementByTypeId("Microsoft.VisualStudio.3D.PerspectiveCamera"); if (camera == null) { isOrtho = true; came...
combined_dataset/train/non-malicious/Get-Link.ps1
Get-Link.ps1
param([Parameter(ValueFromPipelineByPropertyName=$true)][Alias("PSPath")][string]$Path) begin { Add-Type -TypeDef @" using System; using System.IO; using System.Text; using System.Drawing; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; namespace Huddled.Interop { ...
combined_dataset/train/non-malicious/sample_61_74.ps1
sample_61_74.ps1
# # Copyright (c) Microsoft Corporation. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ...
combined_dataset/train/non-malicious/sample_57_81.ps1
sample_57_81.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ param ( [Parameter(Manda...
combined_dataset/train/non-malicious/355.ps1
355.ps1
function Get-PSFLoggingProvider { [CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFLoggingProvider')] Param ( [Alias('Provider', 'ProviderName')] [string] $Name = "*" ) begin { } process { [PSFramework.Logging.ProviderHost]::Providers.Values | Where-Objec...
combined_dataset/train/non-malicious/4077.ps1
4077.ps1
[CmdletBinding()] param ( [ValidateNotNullOrEmpty()][string]$SCCMServer='BNASCCM', [ValidateNotNullOrEmpty()][string]$SCCMDrive='BNA', [ValidateNotNullOrEmpty()][string]$SCCMCollection = 'All Systems', [switch]$ReportOnly ) function Get-RelativePath { [CmdletBinding()][OutputType([string])] param () $Path...
combined_dataset/train/non-malicious/sample_18_88.ps1
sample_18_88.ps1
ConvertFrom-StringData @' id_adinfo_status=Active Directory Environment id_adinfo_wait=Gathering information regarding the Active Directory forest, domains, sites and trusts. '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE...
combined_dataset/train/non-malicious/619.ps1
619.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, [switch]$Uninstall ) $Configs = @{ Url = "https://github.com/adobe/brackets/releases/download/sprint-38/Brackets.Sprint.38.msi" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\" Executable = "C:\Program Files (x86)\B...
combined_dataset/train/non-malicious/2401.ps1
2401.ps1
function ShowMenu { [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$Title, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$ChoiceMessage, [Parameter()] [ValidateNotNullOrEmpty()] [string]$NoMessage = 'No thanks' ) $yes = New-Object System.Manag...
combined_dataset/train/non-malicious/sample_41_36.ps1
sample_41_36.ps1
# # Module manifest for module 'OCI.PSModules.Managementagent' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Managementagent.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported P...
combined_dataset/train/non-malicious/sample_55_89.ps1
sample_55_89.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 = '84.0.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/sample_13_84.ps1
sample_13_84.ps1
@{ GUID="{Fb6cc51d-c096-4b38-b78d-0fed6277096a}" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" RootModule="Microsoft.Management.Infrastructure.CimCmdlets" RequiredAssembli...
combined_dataset/train/non-malicious/sample_5_19.ps1
sample_5_19.ps1
# Rule ID 4878 # --------- # http://sharepoint/sites/rules/Rule%20Submissions/Dynamics-CRM_crexin_2012-07-17-03-54-15.xml # # Description: Checks the GAC for CRM Assemblies and issues a warning if they aren't the same version as the CrmVerServer.dll. # Related KB: https://vkbexternal.partners.extranet.microso...
combined_dataset/train/non-malicious/1149.ps1
1149.ps1
$serviceBaseName = 'CarbonGrantControlServiceTest' $serviceName = $serviceBaseName $servicePath = Join-Path $TestDir NoOpService.exe $user = 'CrbnGrantCntrlSvcUsr' $password = [Guid]::NewGuid().ToString().Substring(0,9) + "Aa1" $userPermStartPattern = "/pace =$($env:ComputerName)\$user*" function Star...
combined_dataset/train/non-malicious/sample_64_16.ps1
sample_64_16.ps1
# # Module manifest for module 'OCI.PSModules.Integration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Integration.dll' # Version number of this module. ModuleVersion = '90.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_61_24.ps1
sample_61_24.ps1
@{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.ServiceFabric.Powershell' # Version number of this module. ModuleVersion = '3.1.0.0' # ID used to uniquely identify this module GUID = 'd2c42633-5254-4a82-a312-1dc0697a55cd' # Author of this module Author = '...
combined_dataset/train/non-malicious/sample_44_38.ps1
sample_44_38.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 License...
combined_dataset/train/non-malicious/sample_23_64.ps1
sample_23_64.ps1
<# .SYNOPSIS     Dirty Idle Assessment .DESCRIPTION     Automates start msedge and mail app. .PARAMETER #> Param( [parameter(Mandatory = $true)] [string] $StartOrStop ) try { if ($StartOrStop -eq "start") { Start-Process -FilePath https://www.amazon.com start-sleep -Seconds 1 ...
combined_dataset/train/non-malicious/sample_7_37.ps1
sample_7_37.ps1
ConvertFrom-StringData @' id_netbasicinfo=Networking Information id_netbasicinfoobtaining=Obtaining basic networking information '@ # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBA...
combined_dataset/train/non-malicious/sample_37_32.ps1
sample_37_32.ps1
param( # Folder access path for observability drive [string] [parameter(Mandatory=$true)] $AccessPath, # Name of subfolder config file to read [string] [Parameter(Mandatory=$true)] $SubFolderConfigFileName ) $observabilityNugetPath = "$PSScriptRoot\..\.." Import-Module "$o...
combined_dataset/train/non-malicious/3054.ps1
3054.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe "Parse-ShouldArgs" { It "identifies assertion functions" { $parsedArgs = Parse-ShouldArgs TestFunction $parsedArgs.AssertionMethod | Should Be TestFunction $parsedArgs = Parse-ShouldArgs Not, TestFunction ...
combined_dataset/train/non-malicious/Migrate UserFolder_2.ps1
Migrate UserFolder_2.ps1
param( $RootFolder = "\\\\server1\\users", $NewRootFolder = "\\\\server2\\users", $LogFolder = "C:\\Projects\\HomeDirs", $NewSubFolders = @("Documents","Favorites","Desktop","Links","Contacts"), $domain = "domain", [switch]$SetACL ) $UserFolders = gci -Path $RootFolder | ?{$_.PSIsContainer} $UserFolders | fore...
combined_dataset/train/non-malicious/sample_61_53.ps1
sample_61_53.ps1
# # Module manifest for module 'OCI.PSModules.Apigateway' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apigateway.dll' # Version number of this module. ModuleVersion = '83.3.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/Copy-FilePlus.ps1
Copy-FilePlus.ps1
<# .SYNOPSIS Copies a file from one location to another while displaying a GUI progress window. .PARAMETER Path Specifies the filename or FileInfo object representing file to be copied. Right now, this must be fully-qualified, relative paths will produce an error. Try it with Get-Item or Get-ChildItem, this wor...
combined_dataset/train/non-malicious/sample_40_56.ps1
sample_40_56.ps1
<# .SYNOPSIS This script checks for potential CFA issues in the logs from the resultOutputDir. It looks for CFA detections and taint events in the logs and constructs a list of CFADetection objects. It then adds some diagnotics messages and guidance for each process. It also constructs a list of fi...
combined_dataset/train/non-malicious/3699.ps1
3699.ps1
function Test-GetAgreementTerms { $PublisherId = "microsoft-ads" $ProductId = "windows-data-science-vm" $PlanId = "windows2016" $agreementTerms = Get-AzMarketplaceTerms -Publisher $PublisherId -Product $ProductId -Name $PlanId Assert-NotNull $agreementTerms Assert-NotNull $agreementTerms.Licens...
combined_dataset/train/non-malicious/sample_60_52.ps1
sample_60_52.ps1
lテーブル '%{oii_table/}' を確認してください。推定されるパーティション テーブルでは、少なくとも 1 つの AlternateOf 定義が、ベース テーブルを参照している列を指している必要があります。kRefreshPolicy が定義されているため、テーブル '%{oii_table/}' を確認してください。推論されたパーティション テーブルに RefreshPolicy が定義されていない可能性があります。šテーブル '%{oii_table/}' には、他のテーブルとは異なるベース テーブルを指す 1 つ以上の集計関数があるため、確認してください。推論されたパーティション テーブルに 1 つ以上の集計関数が...
combined_dataset/train/non-malicious/Set-IPAddress_5.ps1
Set-IPAddress_5.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_33_15.ps1
sample_33_15.ps1
Import-LocalizedData -BindingVariable VvsTxt -FileName AzStackHci.MOCStack.Strings.psd1 function Test-MOCStackVolume { <# .SYNOPSIS Verify if the available free space in the volume, meets the size threshold required by MOCStack during the deployment scenario. .DESCRIPTION Verify if the a...
combined_dataset/train/non-malicious/sample_16_67.ps1
sample_16_67.ps1
#************************************************ # TS_2K3PoolUsageMaximum.ps1 # Version 1.0.1 # Date: 5/8/2012 # Author: v-kaw # Description: [Idea ID 2446] [Windows] Determining the trimming threshold set by the Memory Manager # Rule number: 2446 # Rule URL: //sharepoint/sites/rules/Rule%20Submissions/Forms...
combined_dataset/train/non-malicious/3042.ps1
3042.ps1
function Should-Throw([scriptblock] $ActualValue, $ExpectedMessage, $ErrorId, [type]$ExceptionType, [switch] $Negate, [string] $Because, [switch] $PassThru) { $actualExceptionMessage = "" $actualExceptionWasThrown = $false $actualError = $null $actualException = $null $actualExceptionLine = $nu...
combined_dataset/train/non-malicious/1254.ps1
1254.ps1
function Test-CIisWebsite { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Name ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $manager = New-Object 'Microsoft.Web.Ad...
combined_dataset/train/non-malicious/sample_54_62.ps1
sample_54_62.ps1
# param ( # [string]$Workspace # ) # $CreateJson = $PSScriptRoot + "\Create-Json.ps1" # $AlcDir = Join-Path $ProjectDir "Compiler\" # $CacheDir = Join-Path $AlcDir ".alpackages" # Set-Location $ProjectDir\RequiredApps # $BuildApps = Get-Content .\InstallOrder.json | ConvertFrom-Json # # update Requi...
combined_dataset/train/non-malicious/sample_15_33.ps1
sample_15_33.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> function Get-ConditionalForwardingForVMs { ...
combined_dataset/train/non-malicious/sample_10_61.ps1
sample_10_61.ps1
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. @{ RootModule = './Microsoft.PowerShell.PSResourceGet.dll' NestedModules = @('./Microsoft.PowerShell.PSResourceGet.psm1') ModuleVersion = '1.0.2' CompatiblePSEditions = @...
combined_dataset/train/non-malicious/ShowUI Text Converter_1.ps1
ShowUI Text Converter_1.ps1
#Import-Module showui $Windowparam = @{ Width = 500 Height = 400 Title = 'Fun Text Converter' Background = '#C4CBD8' WindowStartupLocation = 'CenterScreen' AsJob = $True } #Create Window New-Window @Windowparam { New-Grid -Rows *,Auto,*,Auto -Children { New-TextBox -Row...
combined_dataset/train/non-malicious/Set-AppCompatFlag.ps1
Set-AppCompatFlag.ps1
<# .SYNOPSIS Sets the Compatibility flags for an application. .EXAMPLE Set-AppCompatFlag.ps1 -Path 'c:\\windows\\system32\\WindowsPowerShell\\v1.0\\PowerShell_ISE.exe' This sets the RUNASADMIN flag for the ISE .EXAMPLE Set-AppCompatFlag...
combined_dataset/train/non-malicious/936.ps1
936.ps1
$uniqueId=$(-join ((97..122) + (48..57) | Get-Random -Count 15 | % {[char]$_})) $apiVersion = "2015-04-08" $location = "West US 2" $resourceGroupName = "MyResourceGroup" $accountName = "mycosmosaccount-$uniqueId" $apiType = "EnableGremlin" $accountResourceType = "Microsoft.DocumentDb/databaseAccounts" $databaseN...
combined_dataset/train/non-malicious/sample_30_96.ps1
sample_30_96.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 = '73.1.0' # Supported P...
combined_dataset/train/non-malicious/Get-FactualData.ps1
Get-FactualData.ps1
# Get data from factual.com. Currently you need an API key to even query data so you'll # have to set one up before you can use this. Set your API key to the global variable # APIKEY. Hopefully one day factual will allow reads without requiring API keys, which # is why I chose not to make it an argument to the funct...
combined_dataset/train/non-malicious/sample_43_61.ps1
sample_43_61.ps1
@{ IncludeRules = @( 'PSPlaceOpenBrace', 'PSPlaceCloseBrace', 'PSUseConsistentWhitespace', 'PSUseConsistentIndentation', 'PSAlignAssignmentStatement', 'PSUseCorrectCasing' ) Rules = @{ PSPlaceOpenBrace = @{ Enable ...
combined_dataset/train/non-malicious/Compare-SQLResultSet.ps1
Compare-SQLResultSet.ps1
<# .SYNOPSIS Compares two result sets from SQL queries for differences. .DESCRIPTION Compares the result sets from two SQL queries and outputs the differences. Currently the function only handles similarly shaped result sets. That is, result sets with the same number and names of columns. Functiona...
combined_dataset/train/non-malicious/sample_13_66.ps1
sample_13_66.ps1
# Localized 05/07/2022 03:02 AM (GMT) 303:7.0.30723 MsmqBpa.psd1 # # Only add new (name,value) pairs to the end of this table # Do not remove, insert or re-arrange entries # ConvertFrom-StringData @' ###PSLOC start localizing # # Install on non-DC servers # InstallOnNonDC_Title=MSMQ should b...
combined_dataset/train/non-malicious/2838.ps1
2838.ps1
function LoadConfiguration { param( [string]$configdir = (Split-Path -Path $PSScriptRoot -Parent) ) $configFilePath = Join-Path -Path $configdir -ChildPath $script:psakeConfigFile $defaultConfigFilePath = Join-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -ChildPath $script:psakeCon...
combined_dataset/train/non-malicious/sample_57_96.ps1
sample_57_96.ps1
# # Module manifest for module 'OCI.PSModules.Cloudmigrations' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Cloudmigrations.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported P...
combined_dataset/train/non-malicious/3607.ps1
3607.ps1
function Get-RoleName { return getAssetName } function Test-GetRoleNonExistent { $rgname = Get-DeviceResourceGroupName $dfname = Get-DeviceName $name = Get-RoleName Assert-ThrowsContains { Get-AzDataBoxEdgeRole $rgname $dfname $name } "not find" } function Test-CreateRole { $rgname = Ge...
combined_dataset/train/non-malicious/3996.ps1
3996.ps1
function Test-E2EVariableAsset { $resourceGroupName = "to-delete-01" $automationAccountName = "fbs-aa-01" $output = Get-AzAutomationAccount -ResourceGroupName $resourceGroupName -AutomationAccountName $automationAccountName -ErrorAction SilentlyContinue $variableName = "CreateNewVariableW...
combined_dataset/train/non-malicious/Findup_2.ps1
Findup_2.ps1
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using Microsoft.Win32; using System.IO; namespace ConsoleApplication1 { public class FileInfoExt { pu...
combined_dataset/train/non-malicious/Convert-BounceToX_7.ps1
Convert-BounceToX_7.ps1
# $Id: Convert-BounceToX500.ps1 610 2010-11-16 00:39:19Z jon $ # $Revision: 610 $ #.Synopsis # Convert Bounce to X500 #.Description # Convert URL Encoded address in a Bounce message to an X500 address # that can be added as an alias to the mail-enabled object #.Parameter bounceAddress # URL Encoded bounce...
combined_dataset/train/non-malicious/Invoke-Inline.ps1
Invoke-Inline.ps1
################################################################################ ## Invoke-Inline.ps1 (originally from Lee Holmes) ## Library support for inline C# ## ## Modified by Joel Bennett to accept include statements, and return collections ## ## Usage ## 1) Define just the body of a C# method, and s...
combined_dataset/train/non-malicious/sample_41_71.ps1
sample_41_71.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_41_12.ps1
sample_41_12.ps1
# # Module manifest for module 'OCI.PSModules.Threatintelligence' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Threatintelligence.dll' # Version number of this module. ModuleVersion = '75.1.0' # Suppo...
combined_dataset/train/non-malicious/sample_17_93.ps1
sample_17_93.ps1
@{ GUID="CA046F10-CA64-4740-8FF9-2565DBA61A4F" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Get-WinEvent", "New-WinEvent", "Get-C...
combined_dataset/train/non-malicious/sample_61_77.ps1
sample_61_77.ps1
# # Module manifest for module 'OCI.PSModules.Apigateway' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apigateway.dll' # Version number of this module. ModuleVersion = '89.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/1983.ps1
1983.ps1
Describe "Add-Member DRT Unit Tests" -Tags "CI" { It "Mandatory parameters should not be null nor empty" { { Add-Member -Name $null } | Should -Throw -ErrorId "ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand" { Add-Member -Name "" }...
combined_dataset/train/non-malicious/sample_36_8.ps1
sample_36_8.ps1
# # Module manifest for module 'OCI.PSModules.Cims' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Cims.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions CompatiblePS...
combined_dataset/train/non-malicious/sample_43_87.ps1
sample_43_87.ps1
function Add-WACSRVolumes { <# .SYNOPSIS .DESCRIPTION .PARAMETER sourceAddVolumePartnership .PARAMETER destinationAddVolumePartnership .PARAMETER sourceRGName .PARAMETER sourceComputerName .PARAMETER destinationRGName .PARAMETER destinationComputerName .ROLE Administrators #> Param ( ...
combined_dataset/train/non-malicious/sample_9_27.ps1
sample_9_27.ps1
# TS_CRM_ORG_Version_Deployment_CHECK.ps1 # Rule to look for organizations that are newer than the deployment # Created: 5/24/2012 # Author: Jonathan Randall #****************************************************************************************************************** # Last Modified: 2023-02-18 by #we# #r...
combined_dataset/train/non-malicious/sample_15_12.ps1
sample_15_12.ps1
# Rule ID 4628 # --------- # http://sharepoint/sites/rules/Rule%20Submissions/Dynamics-CRM_ehagen_2012-06-11-03-02-42.xml # # Description: This checks to see if the data types on each CRM registry key is correct. # # Related KB #----------- # Script Author: jrandall # PARAM($RegistryPath=$null) #r...
combined_dataset/train/non-malicious/sample_22_27.ps1
sample_22_27.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 = '79.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/3418.ps1
3418.ps1
function Test-GetAllADGroups { $groups = Get-AzureRmADGroup Assert-NotNull($groups) foreach($group in $groups) { Assert-NotNull($group.DisplayName) Assert-NotNull($group.Id) } } function Test-GetADGroupWithSearchString { param([string]$displayName) ...
combined_dataset/train/non-malicious/sample_2_36.ps1
sample_2_36.ps1
#************************************************ # TS_BackupSystemStateKB2182466.ps1 # Version 1.0.1 # Date: 5/30/2012 # Author: v-kaw # Description: [Idea ID 1922] [Windows] On Windows 2008 R2 and Windows 7 System state backup fails with event id 5 and error 2155347997 # Rule number: 1922 # Rule URL: //shar...
combined_dataset/train/non-malicious/Manage ASP_3.NET Providers.ps1
Manage ASP_3.NET Providers.ps1
# Manage_ASP_NET_Providers.ps1 # by Chistian Glessner # http://iLoveSharePoint.com # have to be initialized. If you want to change the app config you have to restart PowerShell param($appConfigPath=$(throw "-appConfigPath is mandatory")) # App config path have to be set before loading System.Web.dll [System.A...
combined_dataset/train/non-malicious/My Profile.ps1
My Profile.ps1
## If your PC doesn't have this set already, someone could tamper with this script... ## but at least now, they can't tamper with any of the scripts that I auto-load! Set-ExecutionPolicy AllSigned Process ## Set the profile directory first, so we can refer to it from now on. Set-Variable ProfileDir (Split-Path $MyI...
combined_dataset/train/non-malicious/sample_57_73.ps1
sample_57_73.ps1
# # Module manifest for module 'OCI.PSModules.Accessgovernancecp' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Accessgovernancecp.dll' # Version number of this module. ModuleVersion = '85.2.0' # Suppo...
combined_dataset/train/non-malicious/sample_21_18.ps1
sample_21_18.ps1
#************************************************ # DC_NetworkShortcuts.ps1 # Version 1.0: # Version 1.1, July28,2014: Changed from the .NET call for "NetworkShorts" to the Powershell call with "NetHood" # Date: 2014 # Author: Boyd Benson (bbenson@microsoft.com); Ed Barnes (edb@microsoft.com); # Description: Col...
combined_dataset/train/non-malicious/sample_38_35.ps1
sample_38_35.ps1
# # Module manifest for module 'OCI.PSModules.Apmconfig' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apmconfig.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_30_8.ps1
sample_30_8.ps1
# # Module manifest for module 'OCI.PSModules.Keymanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Keymanagement.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEdi...
combined_dataset/train/non-malicious/207.ps1
207.ps1
[CmdletBinding(DefaultParameterSetName = "Group")] PARAM ( [Parameter(ParameterSetName = "Group", Mandatory = $true, HelpMessage = "You must specify at least one Active Directory group")] [ValidateNotNull()] [Alias('DN', 'DistinguishedName', 'GUID', 'SID', 'Name')] [string[]]$Group, [Parameter...
combined_dataset/train/non-malicious/572.ps1
572.ps1
function Add-SPOChoicesToField { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string[]] $choices, [Parameter(Mandatory=$true, Position=2)] [string] $fieldName, [Parameter(Mandatory=$true, Position=3)] [string] $listTitle ) Write-Host "Adding choices to field $fieldName...
combined_dataset/train/non-malicious/1727.ps1
1727.ps1
function Update-ServiceNowTableEntry{ [CmdletBinding(ConfirmImpact='High')] Param( [parameter(mandatory=$true)] [parameter(ParameterSetName='SpecifyConnectionFields')] [parameter(ParameterSetName='UseConnectionObject')] [parameter(ParameterSetName='SetGlobalAuth')] [...
combined_dataset/train/non-malicious/Get-VMHostNetworks.ps1
Get-VMHostNetworks.ps1
Function Get-VMHostNetworks { <# .SYNOPSIS Return a list of networks from a given host .DESCRIPTION After connecting to your VI server, we get a list of virtual switches on the datacenter and from that we pull out the VHostID that matches the server we pass...
combined_dataset/train/non-malicious/sample_38_14.ps1
sample_38_14.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/Autoload (beta 4).ps1
Autoload (beta 4).ps1
#Requires -Version 2.0 ## Version History ## beta 4 - 2010.05.10 ## I made a few tweaks and bug fixes while testing it's use with PowerBoots. ## beta 3 - 2010.05.10 ## fix for signed scripts (strip signature) ## beta 2 - 2010.05.09 ## implement module support ## beta 1 - 2010.04.14 ...
combined_dataset/train/non-malicious/1876.ps1
1876.ps1
Describe "Get-RunspaceDebug" -Tags "CI" { Context "Check return types of RunspaceDebug" { It "Should return Microsoft.Powershell.Commands.PSRunspaceDebug as the return type" { $rs = Get-RunspaceDebug $rs | Should -Not -BeNullOrEmpty $rs[0] | Should -BeOfType "Microsoft.PowerShell.Com...
combined_dataset/train/non-malicious/sample_46_72.ps1
sample_46_72.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 = '83.1.0' # Supported PSEdition...
combined_dataset/train/non-malicious/sample_64_49.ps1
sample_64_49.ps1
param([string] $AgentInstallDir) #Get the agent updater module path using intallation directory details $AgentInstallDir=$AgentInstallDir.Trim() $AgentUpdaterModulePath=Join-Path -Path $AgentInstallDir -ChildPath "Kailani.Afs.Updater.Cmdlets.dll" Write-Host "Running the agent updater action from $AgentUpdaterModu...
combined_dataset/train/non-malicious/sample_56_43.ps1
sample_56_43.ps1
# # Module manifest for module 'OCI.PSModules.Identity' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Identity.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/sample_21_12.ps1
sample_21_12.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/1479.ps1
1479.ps1
function Convert-HelpToHtml { param( [Parameter(Mandatory=$true,ValueFromPipeline=$true)] [string[]] $Name, [string] $DisplayName, [string[]] $Syntax, [string] $Modu...
combined_dataset/train/non-malicious/A Process Block.ps1
A Process Block.ps1
Process { #Get the type of object we have $InputTypeName = $_.GetType().Name #Do something with that object #is it VMware? if ( $InputTypeName -eq "VMHostImpl" ) { $output = $_ | Get-View | Select-Object $VMHost_UUID #is it Xen? } elseif ($InputTypeName -eq "Host"){ $output = $_ | g...
combined_dataset/train/non-malicious/sample_13_35.ps1
sample_13_35.ps1
# # Module manifest for module 'OCI.PSModules.Osubbillingschedule' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osubbillingschedule.dll' # Version number of this module. ModuleVersion = '73.1.0' # Sup...
combined_dataset/train/non-malicious/sample_52_34.ps1
sample_52_34.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> <# .DESCRIPTION This function takes the config...
combined_dataset/train/non-malicious/2761.ps1
2761.ps1
ForEach ($NameSpace in "root\subscription","root\default") { Get-WmiObject -Namespace $NameSpace -Query "select * from __EventFilter" }
combined_dataset/train/non-malicious/EchoTest.cmd.ps1
EchoTest.cmd.ps1
@Echo 00: %0 @Echo 01: %1 @Echo 02: %2 @Echo 03: %3 @Echo 04: %4 @Echo 05: %5 @Echo 06: %6 @Echo 07: %7 @Echo 08: %8 @Echo 09: %9 @Echo All together, it looked like this to DOS: @Echo %0 %*
combined_dataset/train/non-malicious/sample_38_78.ps1
sample_38_78.ps1
const lang = Object.freeze({ "displayName": "PowerShell", "name": "powershell", "patterns": [{ "begin": "<#", "beginCaptures": { "0": { "name": "punctuation.definition.comment.block.begin.powershell" } }, "end": "#>", "endCaptures": { "0": { "name": "punctuation.definition.comment.block.end.powershell" } }, "name": "co...
combined_dataset/train/non-malicious/Get-WebSite_3.ps1
Get-WebSite_3.ps1
function Get-WebPage { <# .SYNOPSIS Downloads web page from site. .DESCRIPTION Downloads web page from site and displays source code or displays total bytes of webpage downloaded .PARAMETER Url URL of the website to test access to. .PARAMETER UseDefaultCredentials Use the currently authentica...
combined_dataset/train/non-malicious/sample_24_85.ps1
sample_24_85.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 License...
combined_dataset/train/non-malicious/3904.ps1
3904.ps1
function Test-CertificateCrudOperations { $context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext $thumbprintAlgorithm = "sha1" $localDir = ($pwd).Path $certPathVs = $localDir + "/Resources/BatchTestCert01.cer" $x509cert = New-Object Sy...
combined_dataset/train/non-malicious/Get-WMIVersions_3.ps1
Get-WMIVersions_3.ps1
#Requires -Version 2 param ( $Credential, $ComputerName ) # The official way to detect .NET versions is to look at their known location on the hard drive as per # this article: http://msdn.microsoft.com/en-us/kb/kb00318785.aspx # thanks to David M (http://twitter.com/makovec) for the WQL $query = "select name...
combined_dataset/train/non-malicious/New-XVM_4.ps1
New-XVM_4.ps1
#Examples <# New-XVM -Name "WS2012-TestServer01" -SwitchName "Switch(192.168.2.0/24)" -VhdType NoVHD New-XVM -Name "WS2012-TestServer02" -SwitchName "Switch(192.168.2.0/24)" -VhdType ExistingVHD -VhdPath 'D:\\vhds\\WS2012-TestServer02.vhdx' New-XVM -Name "WS2012-TestServer03" -SwitchName "Switch(192.168.2.0/24)" ...
combined_dataset/train/non-malicious/3234.ps1
3234.ps1
class CommandParser { [ParsedCommand] static Parse([Message]$Message) { $commandString = [string]::Empty if (-not [string]::IsNullOrEmpty($Message.Text)) { $commandString = $Message.Text.Trim() } $cmdArray = $commandString.Split(' ') $command = $cmdArr...
combined_dataset/train/non-malicious/out-form with sort colum.ps1
out-form with sort colum.ps1
I think OUT-FORM is a very usefull function. I've added code to sort columns by clicking on headers. You nedd just add the columnTag parameters specifing if colunm value is text or numeric: out-form -data (get-process) -columnNames ("Name", "ID" ) -columnProperties ("Name", "ID") -columnTag ("Text", "Numeric") ...
combined_dataset/train/non-malicious/sample_60_84.ps1
sample_60_84.ps1
# # Module manifest for module 'OCI.PSModules.Databasetools' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasetools.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_50_47.ps1
sample_50_47.ps1
# # Module manifest for module 'OCI.PSModules.Autoscaling' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Autoscaling.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEdition...
combined_dataset/train/non-malicious/Read-HostMasked_1.ps1
Read-HostMasked_1.ps1
function Read-HostMasked([string]$prompt="Password") { $password = Read-Host -AsSecureString $prompt; $BSTR = [System.Runtime.InteropServices.marshal]::SecureStringToBSTR($password); $password = [System.Runtime.InteropServices.marshal]::PtrToStringAuto($BSTR); [System.Runtime.InteropServices.Marshal]::Zero...
combined_dataset/train/non-malicious/sample_31_89.ps1
sample_31_89.ps1
# # Module manifest for module 'OCI.PSModules.Apmcontrolplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apmcontrolplane.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported P...
combined_dataset/train/non-malicious/sample_42_61.ps1
sample_42_61.ps1
function Add-WACSTScheduledTaskAction { <# .SYNOPSIS Adds a new action to existing scheduled task actions. .DESCRIPTION Adds a new action to existing scheduled task actions. .ROLE Administrators .PARAMETER taskName The name of the task .PARAMETER taskPath The task path. .PARAMETER action...
combined_dataset/train/non-malicious/sample_31_18.ps1
sample_31_18.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 = '73.1.0' # Supported PSEdition...