full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
combined_dataset/train/non-malicious/3943.ps1
3943.ps1
function Test-AzureFirewallPolicyCRUD { $rgname = Get-ResourceGroupName $azureFirewallPolicyName = Get-ResourceName $azureFirewallPolicyAsJobName = Get-ResourceName $resourceTypeParent = "Microsoft.Network/FirewallPolicies" $location = "westcentralus" $ruleGroupName = Get-Re...
combined_dataset/train/non-malicious/Invoke-ComplexScript.ps1
Invoke-ComplexScript.ps1
#############################################################################\n##\n## Invoke-ComplexScript\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nDemo...
combined_dataset/train/non-malicious/sample_52_17.ps1
sample_52_17.ps1
@{ GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @('MSFT_MpPerformanceRecording.psm1') FormatsToProcess = @(...
combined_dataset/train/non-malicious/sample_1_33.ps1
sample_1_33.ps1
#************************************************ # TS_AdapterKB980486Check.ps1 # Version 1.0 # Date: 11-8-2011 # Author: v-anecho # Description: It was detected that the number of 6to4 adapters exceeded the number of physical network adapters on this computer. This may be a symptom of the issue described in KB98...
combined_dataset/train/non-malicious/3676.ps1
3676.ps1
function Test-BlobAuditDatabaseUpdatePolicyWithStorage { $testSuffix = getAssetName Create-BlobAuditingTestEnvironment $testSuffix $params = Get-SqlBlobAuditingTestEnvironmentParameters $testSuffix try { Set-AzSqlDatabaseAudit -BlobStorageTargetState Enabled -ResourceGroupName $params.rgnam...
combined_dataset/train/non-malicious/593.ps1
593.ps1
function Update-PowerShellPowerUp{ if(!(Get-Command "git" -ErrorAction SilentlyContinue)){ Install-PPApp Git } cd $PSProfile.Path if(!(Test-Path -Path (Join-Path -Path $PSProfile.Path -ChildPath ".git"))){ git init git remote add origin $PSProfile.GitSource }elseif($(git config --get remote.origin....
combined_dataset/train/non-malicious/sample_18_71.ps1
sample_18_71.ps1
ConvertFrom-StringData @' id_lockingkb296264check=Checking Opportunistic Locking id_lockingkb296264checkdesc=Checking if Opportunistic Locking is disabled '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFl...
combined_dataset/train/non-malicious/sample_8_6.ps1
sample_8_6.ps1
ConvertFrom-StringData @' id_ctssmbclient=SMB Client Component id_ctssmbclientdescription=Collects information about the SMB Client component. '@ # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG #...
combined_dataset/train/non-malicious/2552.ps1
2552.ps1
function SQL-Query{ param([string]$Query, [string]$SqlServer = $DEFAULT_SQL_SERVER, [string]$DB = $DEFAULT_SQL_DB, [string]$RecordSeparator = "`t" ) $conn_options = ("Data Source=$SqlServer; Initial Catalog=$DB;" + "Integrated Security=SSPI") $conn = New-Object System.Data.SqlClient.SqlConnection($conn_...
combined_dataset/train/non-malicious/sample_58_1.ps1
sample_58_1.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
combined_dataset/train/non-malicious/2873.ps1
2873.ps1
Task Default -depends Compile,Test Task Compile -depends CompileSolutionA,CompileSolutionB Task Test -depends UnitTests,IntegrationTests Task CompileSolutionA -description 'Compiles solution A' {} Task CompileSolutionB {} Task UnitTests -alias 'ut' {} Task IntegrationTests {}
combined_dataset/train/non-malicious/Windows Startup Script_5.ps1
Windows Startup Script_5.ps1
<#====================================================================================== File Name : Startup.ps1 Original Author : Kenneth C. Mazie : Description : This is a Windows start-up script with pop-up notification and checks to : assure things are n...
combined_dataset/train/non-malicious/sample_36_45.ps1
sample_36_45.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_31_49.ps1
sample_31_49.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="C:\practice\demo\quick-reference\node_modules\.pnpm\node_modules" if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux ...
combined_dataset/train/non-malicious/Get-Hostname_1.ps1
Get-Hostname_1.ps1
# .SYNOPSIS # Print the hostname of the system. # .DESCRIPTION # This function prints the hostname of the system. You can additionally output the DNS # domain or the FQDN by using the parameters as described below. # .PARAMETER Short # (Default) Print only the computername, i.e. the same value as returned by $env...
combined_dataset/train/non-malicious/3013.ps1
3013.ps1
function InModuleScope { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [string] $ModuleName, [Parameter(Mandatory = $true)] [scriptblock] $ScriptBlock ) if ($null -eq (& $SafeCommands['Get-Variable'] -Name Pester -ValueOnly -ErrorAction ...
combined_dataset/train/non-malicious/sample_66_28.ps1
sample_66_28.ps1
# Copyright 2024 Google LLC # # 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
combined_dataset/train/non-malicious/3372.ps1
3372.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$True, Position=0)] [String]$PSVersion, [Parameter(Mandatory=$True, Position=1)] [String]$LastRelease, [Parameter(Mandatory=$True, Position=2)] [String]$CurrentRelease, [Parameter(Mandatory=$True, Position=3)] [String]$PathToShared, [Parameter(Mandatory=$True, Position=4)]...
combined_dataset/train/non-malicious/sample_0_85.ps1
sample_0_85.ps1
<# .SYNOPSIS Simplify data collection and diagnostics for troubleshooting Microsoft Remote Desktop (RDP/RDS/AVD/W365) related issues and a convenient method for submitting and following quick & easy action plans. .DESCRIPTION This script is designed to gather information to assist Microsoft Customer Suppo...
combined_dataset/train/non-malicious/sample_29_18.ps1
sample_29_18.ps1
var OfficeaicopilotStrings={ChatContainerKeepItActionButtonText:"Giữ lại",ChatContainerUndoActionButtonText:"Hoàn tác",ChatContainerInsertActionButtonText:"Chèn",ChatContainerFeedbackNudgeContent:"Vui lòng giúp chúng tôi tìm hiểu và đào tạo các mô hình của mình bằng cách cung cấp phản hồi thông qua các nút điều khiển t...
combined_dataset/train/non-malicious/sample_58_4.ps1
sample_58_4.ps1
# # Module manifest for module 'OCI.PSModules.Devops' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Devops.dll' # Version number of this module. ModuleVersion = '85.2.0' # Supported PSEditions Compatib...
combined_dataset/train/non-malicious/sample_60_56.ps1
sample_60_56.ps1
# # Module manifest for module 'OCI.PSModules.Dns' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dns.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported PSEditions CompatiblePSEd...
combined_dataset/train/non-malicious/View-Process_v2.ps1
View-Process_v2.ps1
function View-Process(){ param( [string[]]$ComputerNames, [string[]]$ProcessNames, $User ) if ($User -is [String]){ $Connection = Get-Credential -Credential $User } if ($ProcessNames -eq $null){ if ($Connection -eq $null){ foreach ($int1 in $ComputerNames){ $View_Process = gwmi "win32_pro...
combined_dataset/train/non-malicious/Run-Query (SharePoint)_1.ps1
Run-Query (SharePoint)_1.ps1
function Run-Query($siteUrl, $queryText) { [reflection.assembly]::loadwithpartialname("microsoft.sharePOint") | out-null [reflection.assembly]::loadwithpartialname("microsoft.office.server") | out-null [reflection.assembly]::loadwithpartialname("microsoft.office.server.search") | out-null $s = [microsoft.share...
combined_dataset/train/non-malicious/sample_3_69.ps1
sample_3_69.ps1
#************************************************ # TS_2K3CLSIDUserACLCheck.ps1 # Version 1.0.1 # Date: 6/12/2012 # Author: v-kaw # Description: [Idea ID 4368] [Windows] Windows Logon Slow and Explorer Slow # Rule number: 4368 # Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.aspx?ID=4...
combined_dataset/train/non-malicious/3567.ps1
3567.ps1
function Test-NewSubscription { $accounts = @(@{ ObjectId = "cdf813b6-bdc2-4df5-b150-00ccfd7580e2" }) Assert-True { $accounts.Count -gt 0 } $myNewSubName = GetAssetName $newSub = New-AzSubscription -EnrollmentAccountObjectId $accounts[0].ObjectId -Name $myNewSubName -Offe...
combined_dataset/train/non-malicious/sample_62_33.ps1
sample_62_33.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/Import-Certificate_5.ps1
Import-Certificate_5.ps1
#requires -Version 2.0 function Import-Certificate { param ( [IO.FileInfo] $CertFile = $(throw "Paramerter -CertFile [System.IO.FileInfo] is required."), [string[]] $StoreNames = $(throw "Paramerter -StoreNames [System.String] is required."), [switch] $LocalMachine, [switch] $CurrentUser, [string...
combined_dataset/train/non-malicious/2365.ps1
2365.ps1
[CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [string[]]$Computername, [Parameter(Mandatory)] [string]$DomainName, [Parameter(Mandatory)] [string]$UnjoinLocalCredentialXmlFilePath, [Parameter(Mandatory)] [string]$DomainCredentialXmlFilePath ) b...
combined_dataset/train/non-malicious/New-DFSRHealthReport.ps1
New-DFSRHealthReport.ps1
<# NAME: New-DFSRHealthReport.ps1 AUTHOR: Jan Egil Ring EMAIL: jan.egil.ring@powershell.no COMMENT: Script to generate a new DFS-R HTML Health Report for the Domain System Volume (SYSVOL) replication group using the native dfsradmin.exe tool. More information: You have a royalty-free right...
combined_dataset/train/non-malicious/4240.ps1
4240.ps1
function Invoke-EventVwrBypass { [CmdletBinding(SupportsShouldProcess = $True, ConfirmImpact = 'Medium')] Param ( [Parameter(Mandatory = $True)] [ValidateNotNullOrEmpty()] [String] $Command, [Switch] $Force ) $mscCommandPath = "HKCU:\Software\Classes\m...
combined_dataset/train/non-malicious/2537.ps1
2537.ps1
$server = "XSQLUTIL18" $database = "master" $query = " SELECT [sys].[tables].[name] , [sys].[tables].[create_date] , [sys].[tables].[modify_date] FROM sys.tables SELECT [sys].[columns].[name] , [sys].[columns].[max_length] , [sys].[columns].[precision] , [sys].[columns].[scale] FROM sys.columns SELE...
combined_dataset/train/non-malicious/Out-Voice 2.0.ps1
Out-Voice 2.0.ps1
# --------------------------------------------------------------------------- ## <Script> ## <Author> ## Joel "Jaykul" Bennett ## </Author> ## <Description> ## Outputs text as spoken words ## </Description> ## <Usage> ## Out-Speech "Hello World" ## </Usage> ## <Version>2.0</Version> ## </Script> # --------...
combined_dataset/train/non-malicious/sample_61_65.ps1
sample_61_65.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 = '89.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/INICIAR-RDP.ps1
INICIAR-RDP.ps1
######################################################################################################################## # NAME # Start-RDP # # SYNOPSIS # Opens a remote desktop connection to another computer. # # SYNTAX # Start-RDP [[-Server] <string>] [[-Width] <int>] [[-Height] <int>] # Star...
combined_dataset/train/non-malicious/sample_50_74.ps1
sample_50_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/4409.ps1
4409.ps1
function Get-ParametersHashtable { param( $Proxy, $ProxyCredential ) $ParametersHashtable = @{} if($Proxy) { $ParametersHashtable[$script:Proxy] = $Proxy } if($ProxyCredential) { $ParametersHashtable[$script:ProxyCredential] = $ProxyCredential } ...
combined_dataset/train/non-malicious/sample_31_50.ps1
sample_31_50.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 = '80.0.0' # Supported PSEdition...
combined_dataset/train/non-malicious/2775.ps1
2775.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$True,ValueFromPipeLine=$True,Position=0)] [String]$GUID ) Begin { $GUIDPattern = New-Object System.Text.RegularExpressions.Regex "([A-Fa-f0-9]{8}(?:-[A-Fa-f0-9]{4}){3}-[A-Fa-f0-9]{12})" $MSWinGUIDHT = @{ "DE61D971-5E...
combined_dataset/train/non-malicious/sample_61_9.ps1
sample_61_9.ps1
$ErrorActionPreference = 'Stop' <# .Synopsis Returns payload information from glcm. This info is required to send a heart beat request to AA #> function Get-HeartbeatInfo { [CmdletBinding()] param() $glcm = Get-DscLocalConfigurationManager $configurationName = "" $aaServerU...
combined_dataset/train/non-malicious/sample_28_6.ps1
sample_28_6.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/2258.ps1
2258.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")] [ValidateNotNullOrEmpty()] [ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})] [string]$SiteServer, [parameter(Mandatory=$false, HelpMessa...
combined_dataset/train/non-malicious/get windows product key_3.ps1
get windows product key_3.ps1
function get-windowsproductkey([string]$computer) { $Reg = [WMIClass] ("\\\\" + $computer + "\\root\\default:StdRegProv") $values = [byte[]]($reg.getbinaryvalue(2147483650,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion","DigitalProductId").uvalue) $lookup = [char[]]("B","C","D","F","G","H","J","K","M","P","Q","R"...
combined_dataset/train/non-malicious/2999.ps1
2999.ps1
Set-StrictMode -Version Latest Describe "New-Fixture" { It "Name parameter is mandatory:" { (get-command New-Fixture ).Parameters.Name.ParameterSets.__AllParameterSets.IsMandatory | Should -Be $true } Context "Only Name parameter is specified:" { It "Creates fixture in current directory:" ...
combined_dataset/train/non-malicious/826.ps1
826.ps1
$cred = Get-Credential $resourceGroupName = "myResourceGroup" $scaleSetName = "myScaleSet" $location = "EastUS" New-AzResourceGroup -ResourceGroupName $resourceGroupName -Location $location $subnet = New-AzVirtualNetworkSubnetConfig ` -Name "mySubnet" ` -AddressPrefix 10.0.0.0/24 $vnet = New-AzVirtualNetwo...
combined_dataset/train/non-malicious/4448.ps1
4448.ps1
function Install-Package { [CmdletBinding()] param ( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $FastPackageReference ) Write-Debug ($LocalizedData.ProviderApiDebugMessage -f ('Install-Package')) Install-PackageUtility -FastPackageReference...
combined_dataset/train/non-malicious/sample_30_52.ps1
sample_30_52.ps1
# # Module manifest for module 'OCI.PSModules.Audit' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Audit.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Compatible...
combined_dataset/train/non-malicious/1629.ps1
1629.ps1
function Save-ExcelasCSV { param ( [string[]]$files = $(Throw 'No files provided.'), [string]$OutFolder, [switch]$Overwrite ) BEGIN { function Release-Ref ($ref) { ([System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$ref) -gt 0) ...
combined_dataset/train/non-malicious/4172.ps1
4172.ps1
cls $File = Get-Content -Path "C:\Users\Mick\Desktop\BDD.log" -Force Foreach ($Entry in $File) { If (($Entry -like '*INSTALL - *') -and ($Entry -like '*ZTIWindowsUpdate*')) { $SplitLine = $Entry.Split('KB') $Update = $SplitLine[2] $Update = $Update.Split(')') $Update = $Update.Split('(') Write-Host "KB"...
combined_dataset/train/non-malicious/sample_33_18.ps1
sample_33_18.ps1
function trySetDesignerProp(tname, ttype, val) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = val; // services.debug.trace(tname + "=" + val); } if (command.getTrait("state").value == 0) { command.getTrait("state").value = 2; trySetDesignerProp("snap",...
combined_dataset/train/non-malicious/Office 365 - get email .ps1
Office 365 - get email .ps1
$Content = '$script:showWindowAsync = Add-Type –memberDefinition @”','[DllImport("user32.dll")]','public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);','“@ -name “Win32ShowWindowAsync” -namespace Win32Functions –passThru','function Show-PowerShell() {','$null = $showWindowAsync::ShowWindowAsync((Get-Pr...
combined_dataset/train/non-malicious/1795.ps1
1795.ps1
Describe "Basic Function Provider Tests" -Tags "CI" { BeforeAll { $existingFunction = "existingFunction" $nonExistingFunction = "nonExistingFunction" $text = "Hello World!" $functionValue = { return $text } $restoreLocation = Get-Location $newName = "renamedFunctio...
combined_dataset/train/non-malicious/sample_57_38.ps1
sample_57_38.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_37_55.ps1
sample_37_55.ps1
function Confirm-WACRSASZEnvironment { <# .SYNOPSIS Check whether environment is ASZ or HCI. Returns true if ASZ, false if not .DESCRIPTION Check whether environment is ASZ or HCI. Returns true if ASZ, false if not .ROLE Readers #> try { $regKeyPath = 'HKLM:/SOFTWARE/Microsoft/AzureStack' i...
combined_dataset/train/non-malicious/sample_23_84.ps1
sample_23_84.ps1
# # Module manifest for module 'OCI.PSModules.Visualbuilder' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Visualbuilder.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEdi...
combined_dataset/train/non-malicious/sample_17_59.ps1
sample_17_59.ps1
##---------------------------------------------------------------------------- ## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved. ##---------------------------------------------------------------------------- # Import string constants . ./StringConstants.ps1 # Import shared functions and var...
combined_dataset/train/non-malicious/sample_6_20.ps1
sample_6_20.ps1
ConvertFrom-StringData @' id_windowssearchlenovorapidbootcheck_st=The Windows Search service is stopped and the HyperW7Svc64.exe service was detected '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63J...
combined_dataset/train/non-malicious/2019.ps1
2019.ps1
Describe "SSH Remoting API Tests" -Tags "Feature" { Context "SSHConnectionInfo Class Tests" { BeforeAll { $skipTest = @(Get-Command 'ssh' -CommandType Application -ErrorAction SilentlyContinue).Count -eq 0 } AfterEach { if ($null -ne $rs) { ...
combined_dataset/train/non-malicious/sample_62_20.ps1
sample_62_20.ps1
LMetoda se ne može izvršiti kada je onemogućena pohrana s više snimki stanja.oZahtjev je ograničen, previše zahtjeva za ažuriranje izvora podataka koje pokreće korisnik u kratkom razdoblju.pNema dovoljno dozvola za osvježavanje tablice u načinu rada Direct Lake, obratite se autoru ovog skupa podataka.€Nije moguće zadrž...
combined_dataset/train/non-malicious/Compare-DellUpdates_1.ps1
Compare-DellUpdates_1.ps1
#Requires -version 2 #Author: Nathan Linley #Script: Computer-DellUpdates #Site: http://myitpath.blogspot.com #Date: 2/9/2012 param( [parameter(mandatory=$true)][ValidateScript({test-path $_ -pathtype 'leaf'})][string]$catalogpath, [parameter(mandatory=$true,ValueFromPipeline=$true)][string]$server ) fun...
combined_dataset/train/non-malicious/sample_35_87.ps1
sample_35_87.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\esbuild@0.19.12\node_modules\esbuild\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\esbuild...
combined_dataset/train/non-malicious/sample_63_16.ps1
sample_63_16.ps1
# # Module manifest for module 'OCI.PSModules.Osmanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osmanagement.dll' # Version number of this module. ModuleVersion = '85.1.0' # Supported PSEditi...
combined_dataset/train/non-malicious/sample_18_19.ps1
sample_18_19.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/Get-Parameter_16.ps1
Get-Parameter_16.ps1
function Get-Parameter { [OutputType('System.String')] [CmdletBinding()] param( [Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)] [ValidateNotNullOrEmpty()] [String]$Command, [Parameter(Position=1)] [String[]]$Name=@('*'), [Parameter()] [Validate...
combined_dataset/train/non-malicious/3207.ps1
3207.ps1
Function Get-AzureRmVmPublicIP { [cmdletbinding()] param( [string[]]$ResourceGroupName, [string[]]$VMName, [switch]$IncludeObjects, [switch]$VMStatus ) foreach($ResourceGroup in $ResourceGroupName) { Try { $All...
combined_dataset/train/non-malicious/sample_37_53.ps1
sample_37_53.ps1
# # Module manifest for module 'OCI.PSModules.Psql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Psql.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions CompatiblePS...
combined_dataset/train/non-malicious/Reflection Module 4.0.ps1
Reflection Module 4.0.ps1
#requires -version 2.0 # ALSO REQUIRES Autoload for some functionality # You should create a Reflection.psd1 with the contents: @{ RequiredModules = @("Autoload"); GUID="64b5f609-970f-4e65-b02f-93ccf3e60cbb"; ModuleVersion="3.5.0.0" } #History: # 1.0 - First public release (March 19, 2010) # 2.0 - Private Build ...
combined_dataset/train/non-malicious/3037.ps1
3037.ps1
function Should-BeLikeExactly($ActualValue, $ExpectedValue, [switch] $Negate, [String] $Because) { [bool] $succeeded = $ActualValue -clike $ExpectedValue if ($Negate) { $succeeded = -not $succeeded } if (-not $succeeded) { if ($Negate) { return New-Object psobject -Prop...
combined_dataset/train/non-malicious/Format-HexString.ps1
Format-HexString.ps1
## Format-HexString.ps1 ## Format a byte array as a hexadecimal string ## ## Example usage: ## get-content 'c:\\windows\\Coffee Bean.bmp' -encoding byte | Format-HexString | more ## Convert the input to an array of bytes. This is a strongly-typed variable, ## so that we're not trying to iterate over strings, d...
combined_dataset/train/non-malicious/2952.ps1
2952.ps1
Properties { $x = 1 } Task default -Depends RunNested1, RunNested2, CheckX Task RunNested1 { Invoke-psake .\nested\nested1.ps1 } Task RunNested2 { Invoke-psake .\nested\nested2.ps1 } Task CheckX{ Assert ($x -eq 1) '$x was not 1' }
combined_dataset/train/non-malicious/sample_40_21.ps1
sample_40_21.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # RemoveMDS.ps1 # Kill all Monitoring processes and clean up tra...
combined_dataset/train/non-malicious/netcast show downloader.ps1
netcast show downloader.ps1
cd M:\\Files\\Netcasts\\ShowName # switch to the diretory to store your content Import-Module BitsTransfer # enable BITS on host machine as a file transfer method $start=47 # start epidode number $end=170 # end epidode number $url="http://download.domain.com/episodes/" # URL of the download up to the ...
combined_dataset/train/non-malicious/903.ps1
903.ps1
$gitrepo="<replace-with-URL-of-your-own-GitHub-repo>" $gittoken="<replace-with-a-GitHub-access-token>" $webappname="mywebapp$(Get-Random)" $location="West Europe" New-AzResourceGroup -Name myResourceGroup -Location $location New-AzAppServicePlan -Name $webappname -Location $location ` -ResourceGroupName myResourceG...
combined_dataset/train/non-malicious/New-XML.ps1
New-XML.ps1
### A first stab at the worlds simplest DSL: ### How to generate XML from PowerShell, in code instead of string-substitution $xlr8r = [type]::gettype("System.Management.Automation.TypeAccelerators") $xlinq = [Reflection.Assembly]::Load("System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c56...
combined_dataset/train/non-malicious/sample_1_68.ps1
sample_1_68.ps1
#- Enumerate minifilter drivers via Fltmc.exe command Function RunFltmc ($FltmcCommand, [switch]$CollectFile) { $OutputFile = $ComputerName + "_Fltmc.TXT" $CommandLineToExecute = "cmd.exe /c $FltmcCommand >> $OutputFile" #header $date=Get-Date "-" * ($CommandLineToExecute.Length + 35) + "`r`n[$date]...
combined_dataset/train/non-malicious/sample_15_26.ps1
sample_15_26.ps1
#Collect Event Logs for Slow Logon/ Slow Boot troubleshooter $EventLogNames = "Setup" Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription "Event Logs" # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorB...
combined_dataset/train/non-malicious/sample_23_58.ps1
sample_23_58.ps1
# # Module manifest for module 'OCI.PSModules.Blockchain' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Blockchain.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions ...
combined_dataset/train/non-malicious/PowerShell Template_1.ps1
PowerShell Template_1.ps1
Function New-Script { $strName = $env:username $date = get-date -format d $name = Read-Host "Filename" if ($name -eq "") { $name="NewTemplate" } $email = Read-Host "eMail Address" if ($email -eq "") { $email="youremail@yourhost.com" } $file = New-Item -type file "$name.ps1" -force $template=@" ###############...
combined_dataset/train/non-malicious/Product key_2.ps1
Product key_2.ps1
from System import Array, Char, Console from System.Collections import ArrayList from Microsoft.Win32 import Registry def DecodeProductKey(digitalProductID): map = ("BCDFGHJKMPQRTVWXY2346789").ToCharArray() key = Array.CreateInstance(Char, 29) raw = ArrayList() i = 52 while i < 67: raw...
combined_dataset/train/non-malicious/sample_20_21.ps1
sample_20_21.ps1
# # Module manifest for module 'Az.Dns' # # Generated by: Microsoft Corporation # # Generated on: 23/04/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.Dns.psm1' # Version number of this module. ModuleVersion = '1.2.1' # Supported PSEditions Compatibl...
combined_dataset/train/non-malicious/sample_5_76.ps1
sample_5_76.ps1
# Localized 10/16/2024 05:34 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=&Evet PromptNoString=&Hayır BundleFound=Demet bulundu: {0} PackageFound=Paket bulundu: {0} EncryptedBundleFound=Şifreli demet bulundu: {0} EncryptedPackageFound=Şif...
combined_dataset/train/non-malicious/1764.ps1
1764.ps1
Describe "Windows Installer" -Tags "Scenario" { BeforeAll { $skipTest = -not $IsWindows $preRequisitesLink = 'https://aka.ms/pscore6-prereq' $linkCheckTestCases = @( @{ Name = "Universal C Runtime"; Url = $preRequisitesLink } @{ Name = "WMF 4.0"; Url = "https://ww...
combined_dataset/train/non-malicious/sample_45_34.ps1
sample_45_34.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-Acl", "Set-Acl", "Get-PfxCertific...
combined_dataset/train/non-malicious/sample_38_80.ps1
sample_38_80.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> Import-Module $PSScriptRoot\Tracer.psm1 funct...
combined_dataset/train/non-malicious/vibackup-lx.ps1
vibackup-lx.ps1
Param ( $viServer, $bakVM, $lxDest ) #region check if (!$viServer) { $viServer = Read-Host -Prompt "VI Server " } if (!$bakVM) { $bakVM = Read-Host -Prompt "VM to Backup " } if (!$lxDest) { $lxDest = Read-Host -Prompt "Backup Path (ex. /srv/backup) " } #endregion #region globalvars $encoding = "OEM" ...
combined_dataset/train/non-malicious/Find-AmazonBook.ps1
Find-AmazonBook.ps1
## Requires HttpRest http://poshcode.org/691 ## Add-Module HttpRest ##Or:## . HttpRest.ps1 ## YOU MUST Provide an Amazon Web Services key (AWSKey) and a $Book title #################################################################################################### Set-HttpDefaultUrl "http://ecs.amazonaws.com/onca/...
combined_dataset/train/non-malicious/727.ps1
727.ps1
function Set-RsDataSetReference { [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')] param ( [Alias('ItemPath')] [Parameter(Mandatory = $true)] [string[]] $Path, [Parameter(Mandatory = $true)] [string] $DataSetName, ...
combined_dataset/train/non-malicious/sample_50_31.ps1
sample_50_31.ps1
# # This private script adds $InterfaceType members to $psObject which invokes on $wrappedObject # Param( $psObject, $wrappedObject, [Type]$InterfaceType ) function GetInvoker { Param( $Target, $Method ) if ($Method.IsGenericMethodDefinition) { return {...
combined_dataset/train/non-malicious/3977.ps1
3977.ps1
function Check-CmdletReturnType { param($cmdletName, $cmdletReturn) $cmdletData = Get-Command $cmdletName; Assert-NotNull $cmdletData; [array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") }; [arra...
combined_dataset/train/non-malicious/103.ps1
103.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/Findup_17.ps1
Findup_17.ps1
using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using Microsoft.Win32; using System.IO; using System.Text.RegularExpressions; namespace Findup { public class FileLengthComparer : I...
combined_dataset/train/non-malicious/sample_20_16.ps1
sample_20_16.ps1
ConvertFrom-StringData @' id_detectlowpathmtu_activity=Detect low Path MTU id_detectlowpathmtu_status=Checking network adapters for low Path MTU connections. '@ # SIG # Begin signature block # MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7...
combined_dataset/train/non-malicious/sample_49_63.ps1
sample_49_63.ps1
!無法建立連線: 快取的認證已過期或密碼已更新。請重新輸入您的認證。#嘗試探索 PowerBI 環境時無法連線至 '%{strURL/}'。因為回應格式錯誤,所以 Power BI 後端端點搜尋失敗。無法呼叫 CertGetNameStringW。 無法驗證憑證鏈結。#指紋為 '%{strThumbprint/}' 的憑證簽發者不受信任。K此伺服器執行個體已在沒有設定安全通道憑證 (ServerSchannelTokenSignerCert) 的情況下啟動,不允許在執行階段期間設定憑證。C此伺服器執行個體已在有設定安全通道憑證 (ServerSchannelTokenSignerCert) 的情況下啟動,不允許將其清除。只允許...
combined_dataset/train/non-malicious/sample_18_55.ps1
sample_18_55.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Import-EditorCommand { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [OutputType([Microsoft.PowerShell.EditorServices.Extensions.EditorCommand, Microsoft.PowerShell.EditorServices])] [Cmdle...
combined_dataset/train/non-malicious/sample_18_54.ps1
sample_18_54.ps1
ConvertFrom-StringData @' id_systemservicediagnostic_sqlconnect=Connect to a Sql Server Instance id_systemservicediagnostic_sqlconnectdesc=Trying to connect to Sql Server id_axsqldataengine=Running SQL Query against Sql Server: %Server% id_axsqldataenginedesc=Checking sql configuration : %DC_Name% id_axsqlruleseng...
combined_dataset/train/non-malicious/2891.ps1
2891.ps1
Task default -Depends RunWhatIf Task RunWhatIf { try { $global:WhatIfPreference = $true $parameters = @{p1='whatifcheck';} Invoke-psake .\nested\whatifpreference.ps1 -parameters $parameters } finally { $global:WhatIfPreference = $false } }
combined_dataset/train/non-malicious/Import-ExcelToSQL_1.ps1
Import-ExcelToSQL_1.ps1
#Change these settings as needed $filepath = 'C:\\Users\\u00\\Documents\\backupset.xlsx' #Comment/Uncomment connection string based on version #Connection String for Excel 2007: $connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=`"$filepath`";Extended Properties=`"Excel 12.0 Xml;HDR=YES`";" #Connection S...
combined_dataset/train/non-malicious/1468.ps1
1468.ps1
function Convert-ModuleHelpToHtml { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $ModuleName, [string[]] $Script, [hashtable] $HeadingMap, [Switch] $SkipCommandHelp ) S...
combined_dataset/train/non-malicious/sample_20_63.ps1
sample_20_63.ps1
var state = command.getTrait("state"); var manipData = services.manipulators.getManipulatorData("CameraManipulator"); var mode = null; if (manipData != null) { mode = manipData.getTrait("CameraManipulationMode"); } var tool = new Object(); tool.activate = function () { state.value = 2; if...
combined_dataset/train/non-malicious/sample_59_72.ps1
sample_59_72.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...