full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/sample_24_62.ps1
sample_24_62.ps1
$global:VerbosePreference = 'Continue' Function Write-Custom-Output { Param([string]$message) $date = Get-Date $newMessage = '[{0}] {1}' -f $date, $message Write-Output $newMessage } trap [Exception] { Write-Custom-Output "WARN: Terminating error encountered on line $($_.Invoc...
combined_dataset/train/non-malicious/Write-DataTable.ps1
Write-DataTable.ps1
####################### <# .SYNOPSIS Writes data only to SQL Server tables. .DESCRIPTION Writes data only to SQL Server tables. However, the data source is not limited to SQL Server; any data source can be used, as long as the data can be loaded to a DataTable instance or read with a IDataReader instance. .INPUTS...
combined_dataset/train/non-malicious/sample_13_49.ps1
sample_13_49.ps1
# # Module manifest for module 'OCI.PSModules.Usage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Usage.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/sample_4_70.ps1
sample_4_70.ps1
#************************************************ # Rule ID 29 from http://sharepoint/sites/diag/Rules/_layouts/listform.aspx?PageType=4&ListId=%7b1F944AAF-10B3-4442-8AA8-4A1EF2B0F5F8%7d&ID=29&ContentTypeID=0x0100969570CC59987E4BADAD7118A311DB4D #************************************************ # TS_ClusterCNOCheck....
combined_dataset/train/non-malicious/b4865a35-f8b9-4235-90a9-91f1b81e8dc1.ps1
b4865a35-f8b9-4235-90a9-91f1b81e8dc1.ps1
[reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint") | out-null [reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server") | out-null [reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server.Search") | out-null @@#NOTE: I've set strict crawl freshness/crawl duration/success rati...
combined_dataset/train/non-malicious/sample_45_12.ps1
sample_45_12.ps1
# # Module manifest for module 'OCI.PSModules.Osubusage' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osubusage.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/sample_54_78.ps1
sample_54_78.ps1
KerberosAdministrationGuide,Release1.21.3-xdn=dnSpeciestheLDAPobjectthatwillcontaintheKerberosprincipalbeingcreated.-xlinkdn=dnSpeciestheLDAPobjecttowhichthenewlycreatedKerberosprincipalobjectwillpoint.-xcontainerdn=container_dnSpeciesthecontainerobjectunderwhichtheKerberosprincipalistobecre-ated.-xtktpolicy=policyA...
combined_dataset/train/non-malicious/ESX host NTP Settings_1.ps1
ESX host NTP Settings_1.ps1
<#====================================================================================== File Name : ESX-NTP.ps1 Original Author : Kenneth C. Mazie : Description : This is a VMware PowerCLI script for synchronizing NTP settings across : all ESX hosts in a Vi...
combined_dataset/train/non-malicious/Feeds Module.ps1
Feeds Module.ps1
#Requires -Version 2.0 DATA loc { # en-US convertfrom-stringdata @' RootName = (Root) FolderCaption = Folder: {0} FeedCaption = Feed: {0} MarkReadStatus = Marking all items read DownloadStatus = Downloading all items AsyncDownloadStatus = Beginning download of all items '@ } # Import local...
combined_dataset/train/non-malicious/sample_28_50.ps1
sample_28_50.ps1
using namespace System.Management.Automation using namespace System.Management.Automation.Language Register-ArgumentCompleter -Native -CommandName 'fd' -ScriptBlock { param($wordToComplete, $commandAst, $cursorPosition) $commandElements = $commandAst.CommandElements $command = @( 'fd' for...
combined_dataset/train/non-malicious/sample_31_58.ps1
sample_31_58.ps1
# ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Licen...
combined_dataset/train/non-malicious/2522.ps1
2522.ps1
param( $SQLServer = 'XSQLUTIL19', $Database = 'Chevron_ES27060' ) $BigTables= DIR SQLSERVER:\SQL\$SQLServer\DEFAULT\Databases\$Database\Tables | sort-Object -Property RowCount -desc | select-Object -First 20 $excel = new-object -comobject excel.application $excel.visible = $true $chartType = "microsoft.office...
combined_dataset/train/non-malicious/Convert-BounceToX_2.ps1
Convert-BounceToX_2.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/sample_52_46.ps1
sample_52_46.ps1
########################################################### # # 'ExtensionService' module # ########################################################### $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest Import-Module "$PSScriptRoot\ServiceHelper.psm1" $script:GCInstallPath = "$PSScriptRoot\.....
combined_dataset/train/non-malicious/sample_56_66.ps1
sample_56_66.ps1
<Көп суретті сақтау орны ажыратылған кезде әдіс орындалмайды.iҚысқа мерзім ішінде пайдаланушы деректер көзін жаңартуға тым көп сұраулар жібергендіктен, сұрау шектелді.aDirect Lake кестесін жаңартуға рұқсат жеткіліксіз. Осы деректер жиынтығын жасаушыға хабарласыңыз.Дерекқор суретінің метадеректерін сақтау сәтсіз аяқтал...
combined_dataset/train/non-malicious/4125.ps1
4125.ps1
[CmdletBinding()] param ( [string]$BIOSPassword = $null ) function Get-Architecture { [CmdletBinding()][OutputType([string])] param () $OSArchitecture = (Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture).OSArchitecture Return $OSArchitecture } function Get-BIOSPasswordStatus { ...
combined_dataset/train/non-malicious/sample_67_4.ps1
sample_67_4.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/SharpSSH Module_1.ps1
SharpSSH Module_1.ps1
################################################## # cmdlets ################################################## #------------------------------------------------- # New-SharpSession #------------------------------------------------- # Usage: New-SharpSession -? #-------------------------------------------------...
combined_dataset/train/non-malicious/sample_3_26.ps1
sample_3_26.ps1
ConvertFrom-StringData @' id_citrixappsensecheck=Checking the presence of Citrix AppSense id_citrixappsensecheckdesc=Checking if Citrix AppSense is installed on machine id_citrixappsensecheckrs=Appsense application with EM 8.1 was detected in conjunction with Citrix Servers. This may cause logoff and disconnect issu...
combined_dataset/train/non-malicious/2698.ps1
2698.ps1
filter ConvertTo-String { [OutputType([String])] Param ( [Parameter( Mandatory = $True, Position = 0, ValueFromPipeline = $True )] [ValidateScript({-not (Test-Path $_ -PathType Container)})] [String] $Path ) $FileStream = New-Obj...
combined_dataset/train/non-malicious/4206.ps1
4206.ps1
Set-Variable -Name CurrentOU -Scope Global -Force Set-Variable -Name NewOU -Scope Global -Force cls Import-Module activedirectory [string]$NewOU = "OU=BNA, OU=Computers, OU=Front Office, DC=ACME, DC=COM" $CurrentOU = get-adcomputer $env:computername Write-Host "Computer Name:"$env:computername ...
combined_dataset/train/non-malicious/sample_43_0.ps1
sample_43_0.ps1
/////////////////////////////////////////////////////////////////////////////// // Helper to set a designer prop /////////////////////////////////////////////////////////////////////////////// function setDesignerProp(tname, ttype, tvalue) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)...
combined_dataset/train/non-malicious/3849.ps1
3849.ps1
function Test-File { Param( [Parameter(Mandatory = $True)] [string] $StorageAccountName, [Parameter(Mandatory = $True)] [string] $ResourceGroupName ) New-TestResourceGroupAndStorageAccount -ResourceGroupName $ResourceGroupName -Stora...
combined_dataset/train/non-malicious/82.ps1
82.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 ($Aad...
combined_dataset/train/non-malicious/sample_39_44.ps1
sample_39_44.ps1
#------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. #------------------------------------------------------------------------- Function Test-ADSyncAzureActiveDirectoryConnectivity { if ($isNonInteractiveMode) { ...
combined_dataset/train/non-malicious/sample_7_7.ps1
sample_7_7.ps1
ConvertFrom-StringData @' id_activity_utils=Initializing Diagnostics id_utils_init=Gathering environment details and detecting roles... '@ # SIG # Begin signature block # MIIoQgYJKoZIhvcNAQcCoIIoMzCCKC8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQ...
combined_dataset/train/non-malicious/509.ps1
509.ps1
function Add-DomainUserToLocalGroup{ param( [Parameter(Mandatory=$true)] [String] $Domain, [Parameter(Mandatory=$true)] [String] $User, [Parameter(Mandatory=$true)] [String] $Group, [Parameter(Mandatory=$true)] [String] $Computer, [Parameter(Mandatory=$false)] $Credenti...
combined_dataset/train/non-malicious/3321.ps1
3321.ps1
function Add-GroupUser { [PoshBot.BotCommand(Permissions = 'manage-groups')] [cmdletbinding()] param( [parameter(Mandatory)] $Bot, [parameter(Mandatory, Position = 0)] [string]$Group, [parameter(Mandatory, Position = 1)] [string]$User ) if ($g...
combined_dataset/train/non-malicious/sample_32_56.ps1
sample_32_56.ps1
@{ GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @( 'MSFT_MpComputerStatus.cdxml', 'MSFT_Mp...
combined_dataset/train/non-malicious/sample_22_39.ps1
sample_22_39.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> function Test-NetworkIPv4Address { [Cmdlet...
combined_dataset/train/non-malicious/sample_46_25.ps1
sample_46_25.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/2871.ps1
2871.ps1
Framework '4.7.2' task default -depends MsBuild task MsBuild { if ( $IsMacOS -OR $IsLinux ) {} else { $output = &msbuild /version /nologo 2>&1 Assert ($output -NotLike '15.0') '$output should contain 15.0' } }
combined_dataset/train/non-malicious/sample_20_1.ps1
sample_20_1.ps1
# Load Common Library # Load Reporting Utilities #_#$debug = $false . ./utils_cts.ps1 . ./TS_RemoteSetup.ps1 # 2023-02-20 WalterE mod Trap #we# trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationIn...
combined_dataset/train/non-malicious/3783.ps1
3783.ps1
function Test-StorageSyncService { $resourceGroupName = Get-ResourceGroupName Write-Verbose "RecordMode : $(Get-StorageTestMode)" try { $storageSyncServiceName = Get-ResourceName("sss") $resourceGroupLocation = Get-ResourceGroupLocation $resourceLocat...
combined_dataset/train/non-malicious/sample_67_3.ps1
sample_67_3.ps1
$ServerCertificateName = "CN=ServiceFabricServerCert" $ClientCertificateName = "CN=ServiceFabricClientCert" function IsSecurityX509([string]$ClusterConfigFilePath) { $jsonConfig = Get-Content $ClusterConfigFilePath -Raw | ConvertFrom-Json $properties = $jsonConfig.properties if ($properties -ne $Nul...
combined_dataset/train/non-malicious/2910.ps1
2910.ps1
Task default -depends CheckDocs Task CheckDocs { $NL = [System.Environment]::NewLine $docArray = @(Invoke-psake .\nested\docs.ps1 -docs -nologo | Out-String -Stream -Width 120) $docString = (($docArray | Foreach-Object Trim) -join $NL).Trim() $expectedDoc = @" Name Alias Depends On ...
combined_dataset/train/non-malicious/3669.ps1
3669.ps1
function Test-GetServerServiceObjective { $rg = Create-ResourceGroupForTest $rg | Out-String | Write-Output $server = Create-ServerForTest $rg $server | Out-String | Write-Output $requestedSlo = "GP_Gen5_2" $requestedSloFilter = "GP_Gen*_2" try { $o = Get-AzSqlServerServiceObjective $rg...
combined_dataset/train/non-malicious/1771.ps1
1771.ps1
Import-Module (Join-Path -Path $PSScriptRoot 'certificateCommon.psm1') -Force Describe "CmsMessage cmdlets and Get-PfxCertificate basic tests" -Tags "CI" { BeforeAll { $certLocation = New-GoodCertificate $certLocation | Should -Not -BeNullOrEmpty | Out-Null $protectedCertLocation = New-...
combined_dataset/train/non-malicious/sample_28_77.ps1
sample_28_77.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ##################################################################################################### # # Registers the WinRM endpoint for this instance of PowerShell. # # If the parameters '-PowerShellHome' were specified, it means that t...
combined_dataset/train/non-malicious/649.ps1
649.ps1
function Get-TestUser() { if (-not $env:RsUser) { throw 'Environment variable RsUser is not defined!' } return $env:RsUser } Describe "New-RsRestSession" { Context "Create a new session object" { It "Should work for default Url" { $session = New-RsRestSession -Verbose ...
combined_dataset/train/non-malicious/sample_58_20.ps1
sample_58_20.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/sample_57_61.ps1
sample_57_61.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux builds of Node # are installed in the same directory $exe=".exe" } $ret=0 if (Test-Path "$basedir/node$exe") { # Suppor...
combined_dataset/train/non-malicious/2218.ps1
2218.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed.")] [ValidateNotNullOrEmpty()] [string]$SiteServer, [parameter(Mandatory=$true, HelpMessage="Specify installation method.")] [ValidateNotNullOrEmpty()] [...
combined_dataset/train/non-malicious/sample_0_17.ps1
sample_0_17.ps1
##---------------------------------------------------------------------------- ## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved. ##---------------------------------------------------------------------------- # Import shared functions and vars . ./Commonalities.ps1 # Script used to reinstall...
combined_dataset/train/non-malicious/Set-ADUserRandomPassword_1.ps1
Set-ADUserRandomPassword_1.ps1
###########################################################################" # # NAME: Set-ADUserRandomPassword.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # # COMMENT: This script are used to set a random password for the Active Directory user with the username provided by the user who ru...
combined_dataset/train/non-malicious/sample_39_55.ps1
sample_39_55.ps1
if ( (Test-Path .web\bufferSource.ts) -and (Test-Path .web\fetchSource.ts) -and (Test-Path .web\extension.ts) -and (Test-Path .web\package-lock.json) -and (Test-Path .web\package.json) -and (Test-Path .web\.vscode\extensions.json) -and (Test-Path .web\.vscode\launch.json) -and (Test-Path...
combined_dataset/train/non-malicious/Start-Demo 3.3.3.ps1
Start-Demo 3.3.3.ps1
## Start-Demo.ps1 ################################################################################################## ## This is an overhaul of Jeffrey Snover's original Start-Demo script by Joel "Jaykul" Bennett ## ## I've switched it to using ReadKey instead of ReadLine (you don't have to hit Enter each time) ## ...
combined_dataset/train/non-malicious/1082.ps1
1082.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) $user = $null $url = 'http://test-granthttpurlpermission:10383/' function Start-Test { $user = Resolve-Identity -Name $CarbonTestUser.UserName } function Stop-Test { netsh http delete urlacl url=$url } function Tes...
combined_dataset/train/non-malicious/sample_22_25.ps1
sample_22_25.ps1
[cmdletbinding()] param([string]$targetBinary, [string]$installedDir, [string]$tlogFile, [string]$copiedFilesLog) $g_searched = @{} # Note: installedDir is actually the bin\ directory. $g_install_root = Split-Path $installedDir -parent $g_is_debug = (Split-Path $g_install_root -leaf) -eq 'debug' # Ensure we create th...
combined_dataset/train/non-malicious/83.ps1
83.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/1463.ps1
1463.ps1
function Get-CPrivilege { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Identity ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState [Carbon.Security.Privilege]::GetPrivi...
combined_dataset/train/non-malicious/sample_57_24.ps1
sample_57_24.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_34_58.ps1
sample_34_58.ps1
# # Module manifest for module 'Az.PolicyInsights' # # Generated by: Microsoft Corporation # # Generated on: 03/27/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.PolicyInsights.psm1' # Version number of this module. ModuleVersion = '1.6.5' # Supported...
combined_dataset/train/non-malicious/3874.ps1
3874.ps1
function Test-CreateNewAppServicePlan { $rgname = Get-ResourceGroupName $whpName = Get-WebHostPlanName $location = Get-Location $capacity = 2 $skuName = "S2" try { New-AzResourceGroup -Name $rgname -Location $location $job = New-AzAppServicePlan -ResourceGroupName $rgname -Name $whp...
combined_dataset/train/non-malicious/sample_3_93.ps1
sample_3_93.ps1
ConvertFrom-StringData @' id_clusterlogsoutputdesc=Cluster logs id_clusterlogsobtaining=Obtaining cluster logs '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0...
combined_dataset/train/non-malicious/2067.ps1
2067.ps1
using namespace System.Management.Automation using namespace System.Collections.ObjectModel Describe 'ProxyCommand Tests' -Tags "CI" { BeforeAll { function NormalizeCRLF { param ($helpObj) if($helpObj.Synopsis.Contains("`r`n")) { $helpObjText = ($helpO...
combined_dataset/train/non-malicious/sample_42_92.ps1
sample_42_92.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 = '77.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/sample_1_21.ps1
sample_1_21.ps1
#************************************************ # DC_Kerberos-Component.ps1 # Version 1.0 # Date: 2009-2014 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about Kerberos. # Called from: Main Networking Diag #******************************************************* Import-Lo...
combined_dataset/train/non-malicious/Xml Module _1.6.ps1
Xml Module _1.6.ps1
#requires -version 2.0 # Improves over the built-in Select-XML by leveraging Remove-XmlNamespace http`://poshcode.org/1492 # to provide a -RemoveNamespace parameter -- if it's supplied, all of the namespace declarations # and prefixes are removed from all XML nodes (by an XSL transform) before searching. # IMP...
combined_dataset/train/non-malicious/sample_18_53.ps1
sample_18_53.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 = '75.1.0' # Supported PSEditions Comp...
combined_dataset/train/non-malicious/713.ps1
713.ps1
function Out-RsRestFolderContent { [CmdletBinding()] param ( [Parameter(Mandatory = $True, ValueFromPipeline = $true)] [string] $RsFolder, [ValidateScript({ Test-Path $_ -PathType Container})] [Parameter(Mandatory = $True)] [string] $Destination,...
combined_dataset/train/non-malicious/3858.ps1
3858.ps1
function Test-NewDirectConnectionWithV4V6 { $asn = makePeerAsn 65000 $kind = isDirect $true; $loc = "Los Angeles" $peeringLocation = getPeeringLocation $kind $loc; $facilityId = $peeringLocation[0].PeeringDBFacilityId $bandwidth = getBandwidth Write-Debug "Creating Connection at $facilityId" $...
combined_dataset/train/non-malicious/sample_16_81.ps1
sample_16_81.ps1
ConvertFrom-StringData @' progressbar_id_crmassembliesdetectedingac=Searching Global Assembly Cache For Microsoft Dynamics CRM Assemblies progressbar_id_crmassembliesdetectedingacdesc=Searching Global Assembly Cache For Microsoft Dynamics CRM Assemblies '@ # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIo...
combined_dataset/train/non-malicious/Hash Checker_1.ps1
Hash Checker_1.ps1
#.Synopsis # Test the HMAC hash(es) of a file #.Description # Takes the HMAC hash of a file using specified algorithm, and optionally, compare it to a baseline hash #.Example # Test-Hash npp.5.3.1.Installer.exe -HashFile npp.5.3.1.release.md5 # # Searches the provided hash file for a line matching the "...
combined_dataset/train/non-malicious/sample_50_83.ps1
sample_50_83.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/687.ps1
687.ps1
function Set-RsDatabase { [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')] param ( [Parameter(Mandatory = $True)] [string] $DatabaseServerName, [switch] $IsRemoteDatabaseServer, [Parameter(Mandatory = $True)] [Alias('Datab...
combined_dataset/train/non-malicious/1562.ps1
1562.ps1
function Get-MrVssProvider { [CmdletBinding()] param ( [ValidateNotNullOrEmpty()] [string[]]$ComputerName = $env:COMPUTERNAME, [System.Management.Automation.Credential()]$Credential = [System.Management.Automation.PSCredential]::Empty ) $Params = @{ ComputerNa...
combined_dataset/train/non-malicious/sample_8_32.ps1
sample_8_32.ps1
ConvertFrom-StringData @' id_fcinfo=Fibre Channel Information id_fcinforunning=Running Fibre Channel Information Tool (FCInfo) id_fcinfooutput=FCInfo Output id_fcinfooutputdesc=Fibre Channel Information Tool (FCInfo) output '@ # SIG # Begin signature block # MIIoUAYJKoZIhvcNAQcCoIIoQTCCKD0CAQExDzANBglghkgBZQME...
combined_dataset/train/non-malicious/Get-Uptime.ps1
Get-Uptime.ps1
Function Get-Uptime { <# .SYNOPSIS Displays Uptime since last reboot .PARAMETER Computername .EXAMPLE Get-Uptime Server1 .EXAMPLE "Server1", "Server2"|Get-Uptime .EXAMPLE (Get-Uptime Sever1)."Time Since Last Reboot" #> [CmdletBinding()] Param ( [Parameter(Mandatory=$True,ValueFromPipeline=$true,P...
combined_dataset/train/non-malicious/sample_35_50.ps1
sample_35_50.ps1
function trySetDesignerProp(tname, ttype, val) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = val; } if (command.getTrait("state").value == 0) { command.getTrait("state").value = 2; trySetDesignerProp("embedMedia", "bool", true); } else { command.get...
combined_dataset/train/non-malicious/sample_38_44.ps1
sample_38_44.ps1
[ "[QueryStringParams]" "[FormParams]" "[MultipartFormData]" "[Cookies]" "[Captures]" "[Asserts]" "[Options]" "[BasicAuth]" ] @attribute (comment) @comment [ (key_string) (json_key_string) ] @variable.other.member (value_string) @string (quoted_string) @string (json_string) @string (file_value) ...
combined_dataset/train/non-malicious/sample_61_86.ps1
sample_61_86.ps1
<# .SYNOPSIS NewSelfSignedCertificate.ps1 script file This is a place-holder file only for agent patch build purposes #> Write-Host "This file functionality is deprecated and is place-holder only" # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # ...
combined_dataset/train/non-malicious/3516.ps1
3516.ps1
function Test-LinkCrud { $createdLink = Create-VirtualNetworkLink $false Assert-NotNull $createdLink Assert-NotNull $createdLink.Etag Assert-NotNull $createdLink.Name Assert-NotNull $createdLink.ZoneName Assert-NotNull $createdLink.ResourceGroupName Assert-AreEqual 1 $createdLink.Tags.Count Assert...
combined_dataset/train/non-malicious/sample_26_0.ps1
sample_26_0.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\typescript@5.3.3\node_modules\typescript\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\typ...
combined_dataset/train/non-malicious/sample_53_37.ps1
sample_53_37.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 = '82.0.0' # Supported PSEditions Co...
combined_dataset/train/non-malicious/Compare-DellUpdates.ps1
Compare-DellUpdates.ps1
#Requires -version 2 #Author: Nathan Linley #More details: http://myitpath.blogspot.com/2012/02/dell-components-check-for-updates-via.html #OUTPUT FORMAT: #Component : FlashBIOS Updates #path : PE2850_BIOS_WIN_A07.EXE #vendorVersion : A07 #currentversion : A05 #releaseDate : May 23, 2008 ...
combined_dataset/train/non-malicious/sample_56_21.ps1
sample_56_21.ps1
let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl(); let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/aspire.eventHandlers.js"]; let currentScriptElement = document.querySelector("script[src='Scripts/aspire.plugin.js']"); if (currentScriptElement !== null) { scrip...
combined_dataset/train/non-malicious/sample_44_2.ps1
sample_44_2.ps1
ConvertFrom-StringData -StringData @' AdapterNotFound = 找不到指定的介面卡:{0} InvalidParams = 無效的參數組。請參閱 cmdlet 說明以查看有效的參數集。 InvalidParamsAdapterAndName = 您無法同時指定 Name 與 Adapter 參數。 InvalidParamsConfigAndModule = 您無法同時指定 Module 與 Configuration 參數。 InvalidModule = {0}:{1} 並非有效的模組名稱。請使用下列指令以查看有效的模組:"Get-IntelEthernetLogConf...
combined_dataset/train/non-malicious/4108.ps1
4108.ps1
[CmdletBinding()] param ( [ValidateNotNullOrEmpty()][string]$PrinterName ) Clear-Host $Files = Get-ChildItem -Path $env:windir"\system32\spool\printers" -Filter *.SHD $DeleteFiles = @() foreach ($File in $Files) { $Contents = [System.IO.File]::ReadAllBytes($File.FullName) $Contents = $Contents | Where-Object...
combined_dataset/train/non-malicious/4309.ps1
4309.ps1
function SuiteSetup { Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue $script:IsWindowsOS = (-not (Get-Variable -Name IsWindows -ErrorAction Ignore)) -or $IsWindows $script:ProgramFilesModul...
combined_dataset/train/non-malicious/sample_62_30.ps1
sample_62_30.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux builds of Node # are installed in the same directory $exe=".exe" } $ret=0 if (Test-Path "$basedir/node$exe") { # Suppor...
combined_dataset/train/non-malicious/1953.ps1
1953.ps1
Describe "ConvertTo--SecureString" -Tags "CI" { Context "Checking return types of ConvertTo--SecureString" { It "Should return System.Security.SecureString after converting plaintext variable"{ $PesterTestConvert = (ConvertTo-SecureString "plaintextpester" -AsPlainText -force) $PesterTestCo...
combined_dataset/train/non-malicious/1208.ps1
1208.ps1
$iniPath = $null function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { $iniPath = Join-Path ([IO.Path]::GetTempPath()) ([IO.Path]::GetRandomFileName()) New-Item $iniPath -ItemType File } function Stop-Test { ...
combined_dataset/train/non-malicious/sample_51_63.ps1
sample_51_63.ps1
@{ GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @( 'MSFT_MpComputerStatus.cdxml', 'MSFT_Mp...
combined_dataset/train/non-malicious/2507.ps1
2507.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 { [Flags()] //...
combined_dataset/train/non-malicious/Servers in Computers OU.ps1
Servers in Computers OU.ps1
function checkADSI() { $ADSIStat = "Servers in Computer OU" $error.clear() $errcnt = 0 $objDomain = New-Object System.DirectoryServices.DirectoryEntry("LDAP://CN=Computers,DC=domain,DC=com") $objSearcher = New-Object System.DirectoryServices.DirectorySearcher($objDomain) $objSearcher.Filter = ("(o...
combined_dataset/train/non-malicious/2946.ps1
2946.ps1
Framework '4.6.2' task default -depends MsBuild task MsBuild { if ( $IsMacOS -OR $IsLinux ) {} else { $output = &msbuild /version /nologo 2>&1 Assert ($output -NotLike '14.0') '$output should contain 14.0' } }
combined_dataset/train/non-malicious/sample_43_83.ps1
sample_43_83.ps1
Import-Module -Name "$PSScriptRoot\..\..\Common\StorageHelpers.psm1" -DisableNameChecking Import-Module -Name "$PSScriptRoot\..\VirtualMachine\VirtualMachine.psm1" -DisableNameChecking function Apply-DefenderUpdate { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [CloudEngine....
combined_dataset/train/non-malicious/sample_4_0.ps1
sample_4_0.ps1
# *********************************************************************************************** # File: utils_ConfigMgr12-ps1 # Version 1.0 # Date: 02-17-2012 - Last edit 2022-06-01 # Author: Vinay Pamnani - vinpa@microsoft.com # Description: Utility Script to load common variables/functions. View utils_ConfigM...
combined_dataset/train/non-malicious/1167.ps1
1167.ps1
Set-StrictMode -Version 'Latest' & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) $Path = $null $user = 'CarbonGrantPerms' $user2 = 'CarbonGrantPerms2' $containerPath = $null $regContainerPath = $null $privateKeyPath = Join-Path -Path $PSScriptRoot -ChildPath 'Cryptography...
combined_dataset/train/non-malicious/3528.ps1
3528.ps1
function Get-AzureRmPolicyEvent-ManagementGroupScope { $managementGroupName = Get-TestManagementGroupName $from = Get-TestQueryIntervalStart $policyEvents = Get-AzPolicyEvent -ManagementGroupName $managementGroupName -Top 10 -From $from Validate-PolicyEvents $policyEvents 10 } function Get-Azur...
combined_dataset/train/non-malicious/Prevent-Screensaver_2.ps1
Prevent-Screensaver_2.ps1
######################################################### # Prevent-Screensaver ######################################################### # This script "presses" a keyboard key every minute # for specified number of minutes which makes # Windows "think" you are at your desktop # so the screensaver does not start ...
combined_dataset/train/non-malicious/sample_28_65.ps1
sample_28_65.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function Clear-AMTSystemDefense { <# .Synopsis Clears all Intel Active Management Technology System Defense policies and filters .Description This CmdLet clears the Intel Active Management Technology (AMT) network access policy fro...
combined_dataset/train/non-malicious/sample_52_29.ps1
sample_52_29.ps1
# # Module manifest for module 'OCI.PSModules.Mediaservices' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Mediaservices.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_13_27.ps1
sample_13_27.ps1
# # Module manifest for module 'OCI.PSModules.Databasemigration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasemigration.dll' # Version number of this module. ModuleVersion = '81.0.0' # Support...
combined_dataset/train/non-malicious/3401.ps1
3401.ps1
function Test-SingleNetworkInterface { $rgname = Get-ComputeTestResourceName try { $loc = Get-ComputeVMLocation; New-AzureRmResourceGroup -Name $rgname -Location $loc -Force; $vmsize = 'Standard_A2'; $vmname = 'vm' + $rgname; ...
combined_dataset/train/non-malicious/ShowUI Weather Widget_2.ps1
ShowUI Weather Widget_2.ps1
## And a slick weather widget using Yahoo's forecast and images New-UIWidget -AsJob { Grid { Rectangle -RadiusX 10 -RadiusY 10 -StrokeThickness 0 -Width 170 -Height 80 -HorizontalAlignment Left -VerticalAlignment Top -Margin "60,40,0,0" -Fill { LinearGradientBrush -Start "0.5,0" -End "0.5,...
combined_dataset/train/non-malicious/sample_11_39.ps1
sample_11_39.ps1
@{ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Start-Transcript", "Stop-Transcript" ...
combined_dataset/train/non-malicious/4380.ps1
4380.ps1
function Test-ScriptInstalled { [CmdletBinding(PositionalBinding=$false)] Param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Name, [Parameter()] [string] $RequiredVersion ) $scriptInfo = $null $scriptFileName = "$Na...
combined_dataset/train/non-malicious/sample_6_18.ps1
sample_6_18.ps1
# Script: tss_GetFarmData.ps1 # from https://microsoft.sharepoint.com/teams/css-rds/SitePages/getfarmdata.aspx?xsdata=MDN8MDF8fDRhNGUxOTM4NmE3ZTQ0ODliNWJlMWQ2MDdmYjgwMjU2fDcyZjk4OGJmODZmMTQxYWY5MWFiMmQ3Y2QwMTFkYjQ3fDF8MHw2Mzc3NzU4NTEyODY0MjIxMDZ8R29vZHxWR1ZoYlhOVFpXTjFjbWwwZVZObGNuWnBZMlY4ZXlKV0lqb2lNQzR3TGpBd01EQWlMQ...