filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
sample_1_0.ps1 | #
# Module manifest for module 'OCI.PSModules.Clusterplacementgroups'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Clusterplacementgroups.dll'
# Version number of this module.
ModuleVersion = '92.1.0'
... | 0 |
1826.ps1 |
Describe "Join-Path cmdlet tests" -Tags "CI" {
$SepChar=[io.path]::DirectorySeparatorChar
BeforeAll {
$StartingLocation = Get-Location
}
AfterEach {
Set-Location $StartingLocation
}
It "should output multiple paths when called with multiple -Path targets" {
Setup -Dir SubDir1
(Join-Path -P... | 0 |
347.ps1 | function Reset-PSFConfig
{
[CmdletBinding(DefaultParameterSetName = 'Pipeline', SupportsShouldProcess = $true, ConfirmImpact = 'Low', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Reset-PSFConfig')]
param (
[Parameter(ValueFromPipeline = $true, ParameterSetName = 'Pipeline')]
[PSFramework... | 0 |
sample_15_84.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(Mand... | 0 |
sample_57_94.ps1 | #
# Module manifest for module 'OCI.PSModules.Aivision'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aivision.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditions
Comp... | 0 |
4046.ps1 |
param([string]$outputDir = $(throw "You must specify the output path to emit the generated file"),
[string]$configuration = $(throw "You must specify the build configuration"))
function WrapText($width = 74, $indent = 8) {
begin {
$indent = " " * $indent
$whitespace = "`t`r`n ".ToCh... | 0 |
Set-PsBreakPointLastErro.ps1 | Set-StrictMode -Version Latest\n\n$lastError = $error[0]\nSet-PsBreakpoint $lastError.InvocationInfo.ScriptName `\n $lastError.InvocationInfo.ScriptLineNumber
| 0 |
Get-FileEncoding.ps1 | <#
.SYNOPSIS
Gets file encoding.
.DESCRIPTION
The Get-FileEncoding function determines encoding by looking at Byte Order Mark (BOM).
Based on port of C# code from http://www.west-wind.com/Weblog/posts/197245.aspx
.EXAMPLE
Get-ChildItem *.ps1 | select FullName, @{n='Encoding';e={Get-FileEncoding $_.FullName}} | ... | 0 |
Get-PSVersion.ps1 | Set-Alias Ver Get-PSVersion
function Get-PSVersion
{
[string]$Major = ($PSVersionTable).PSVersion.Major
[string]$Minor = ($PSVersionTable).PSVersion.Minor
[string]$Out = $Major + '.' + $Minor
Write-Output $Out
}
| 0 |
sample_28_37.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Aks.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Aks.internal.psm1'
if(Test-Path $internalModulePath) {
$null = Impo... | 0 |
2531.ps1 |
param ([string]$sqlserver, [string]$filename)
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Replication") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Rmo") | out-null
$TableQuery = "SELECT DISTINCT Server
FROM SQLDatabases
WHERE DatabaseName LIKE '%distribution%'
... | 0 |
1085.ps1 |
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$EnvVarName = "CarbonRemoveEnvironmentVar"
function Assert-NoTestEnvironmentVariableAt( $Scope )
{
$actualValue = [Environment]::GetEnvironmentVariable($EnvVarName, $Scope)
It ('sho... | 0 |
sample_41_16.ps1 | #
# Module manifest for module 'OCI.PSModules.Oda'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Oda.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
Get-Hostname.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... | 0 |
1198.ps1 |
$userDomain = $env:USERDNSDOMAIN
$computerDomain = Get-WmiObject 'Win32_ComputerSystem' | Select-Object -ExpandProperty Domain
if( (Get-Service -Name MSMQ -ErrorAction SilentlyContinue) -and $userDomain -eq $computerDomain )
{
$publicQueueName = 'CarbonTestGetQueue-Public'
$privateQueueName = 'Ca... | 0 |
sample_46_50.ps1 | #
# Module manifest for module 'OCI.PSModules.Fleetsoftwareupdate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Fleetsoftwareupdate.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Sup... | 0 |
17.ps1 | . $PSScriptRoot\Shared.ps1
. $modulePath\Utils.ps1
$expectedEncoding = if ($PSVersionTable.PSVersion.Major -le 5) { "utf8" } else { "ascii" }
Describe 'Utils Function Tests' {
Context 'Add-PoshGitToProfile Tests' {
BeforeAll {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDec... | 0 |
sample_16_25.ps1 | Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: vsts
Created-By: Apache Maven
Build-Jdk: 11.0.21
Name: com/microsoft/azure/toolkit/lib/appservice/deploy/FlexFunctionDe
ployHandler.html
SHA-256-Digest: hWh6bXy5Ig28HsqQWMIuLTIM/NEKTGekpbZxQzgnnu4=
Name: jquery/jszip-utils/dist/jszip-utils.j... | 0 |
2622.ps1 |
Import-Module C:\git-repositories\PowerShell\MSFVMLab\MSFVMLab.psm1 -Force
$LabConfig = Get-Content C:\git-repositories\PowerShell\MSFVMLab\LabVMS.json | ConvertFrom-Json
$WorkingDirectory = $LabConfig.WorkingDirectory
$Domain = $LabConfig.Domain
$LocalAdminCred = Import-Clixml "$WorkingDirectory\vmlab_localadmin.xml... | 0 |
1461.ps1 |
function Test-CRegistryKeyValue
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$Path,
[Parameter(Mandatory=$true)]
[string]
$Name
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $... | 0 |
sample_3_51.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... | 0 |
sample_27_15.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 = '74.1.0'
# Support... | 0 |
sample_17_15.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... | 0 |
sample_21_91.ps1 | #
# Module manifest for module 'OCI.PSModules.Licensemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSE... | 0 |
sample_61_82.ps1 | <#
.SYNOPSIS
MSRD-Collect global functions
.DESCRIPTION
Module for the MSRD-Collect global functions
.NOTES
Author : Robert Klemencz
Requires : At least PowerShell 5.1 (This module is not for stand-alone use. It is used automatically from within the main MSRD-Collect.ps1 script)
Version... | 0 |
Beginner event 10 .ps1 | #
# Summer 2009 Scripting games
# Beginner Event 10 - The 1,500-Meter race
# http://blogs.technet.com/heyscriptingguy/archive/2009/06/18/hey-scripting-guy-2009-scripting-games-event-10-details-beginner-and-advanced-1-500-meter-race.aspx
#
# ToDo: In this event, you must write a script that will count down from th... | 0 |
sample_46_43.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... | 0 |
sample_29_14.ps1 | # make sure we stop on exceptions
$ErrorActionPreference = "Stop"
# This object reprents the result value for tab expansion functions when no result is returned.
# This is so that we can distinguish it from $null, which has different semantics
$NoResultValue = New-Object PSObject -Property @{ NoResult = $true }
... | 0 |
sample_51_92.ps1 | ## Copyright (c) Microsoft Corporation. All rights reserved.
<#
.SYNOPSIS
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans.
.DESCRIPTION
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans. These performance recordings contain Microsoft-Antimal... | 0 |
sample_3_1.ps1 | #************************************************
# TS_MemoryManagerSystemPagesCheck.ps1
# Version 1.0.1
# Date: 5/14/2012
# Author: v-kaw
# Description: [Idea ID 2389] [Windows] Hang caused by kernel memory depletion due 'SystemPages' reg key with wrong value
# Rule number: 2389
# Rule URL: //sharepoint/site... | 0 |
2624.ps1 |
Import-Module C:\git-repositories\PowerShell\MSFVMLab\MSFVMLab.psm1 -Force
$LabConfig = Get-Content C:\git-repositories\PowerShell\MSFVMLab\LabVMS.json | ConvertFrom-Json
$WorkingDirectory = $LabConfig.WorkingDirectory
$Domain = $LabConfig.Domain
$dc = ( $LabConfig.Servers | Where-Object {$_.Class -eq 'DomainContro... | 0 |
sample_60_4.ps1 | #
# Module manifest for module 'OCI.PSModules.Computecloudatcustomer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Computecloudatcustomer.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
... | 0 |
1512.ps1 |
function Assert-NotEqual
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
$Expected,
[Parameter(Position=1)]
$Actual,
[Parameter(Position=2)]
$Message
)
if( $Expected -eq $Actual )
{
... | 0 |
PowerShellServer Cmdlet .ps1 | \n#Global Hashtable to Control all Powershell Server Runspace\nSet-Variable -name '__PSRUNSPACES__' -scope 'global' -value @{} -force\n\nfunction global:New-PowerShellServerRunspace\n{\n param(\n $Credential,\n $ErrorAction='Stop',\n [switch]$Force,\n $Password,\n $Port=22,\n $Server='127.0.0.1',\n $SSHAccept,\n... | 0 |
sample_32_4.ps1 | #
# Module manifest for module 'msft.sme.sdn.route-tables'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'msft.sme.sdn.route-tables.psm1'
# Version number of this module.
ModuleVersion = '3.3.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to... | 0 |
368.ps1 | function Get-PSFTypeSerializationData
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSPossibleIncorrectUsageOfAssignmentOperator", "")]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFTypeSerializationData')]
Param (
[Parameter(ValueFromPipeline = $true)]
[obj... | 0 |
ESX host NTP Settings.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... | 0 |
sample_5_90.ps1 | ConvertFrom-StringData @'
id_setupapilogs=Setup API Logs
id_setupapilogsobtaining=Obtaining SetupAPI.*.Log
id_setupapilogsoutput=SetupAPI Log
id_setupapilogsoutputdesc=Device Drivers Instalation Logs
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3... | 0 |
sample_14_59.ps1 | #************************************************
# TS_ClusterValidationTests.ps1
# Version 1.0.1
# Date: 07-24-2009
# Author: Andre Teixeira - andret@microsoft.com
# Hacked by Jacques Boulet - jaboulet@microsoft.com - 2019-02-21
# Description: This script is used to obtain cluster validation report.
# ... | 0 |
sample_55_25.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
# RemoveMDS.ps1
# Kill all Monitoring processes and clean up tra... | 0 |
sample_49_18.ps1 | [KillbotsRuleset]
Name=Killbots
Name[ar]=معركة الآليين
Name[bs]=Ubij botove
Name[ca]=Killbots
Name[ca@valencia]=Killbots
Name[cs]=Killbots
Name[da]=Killbots
Name[de]=Killbots
Name[el]=Killbots
Name[en_GB]=Killbots
Name[eo]=Killbots
Name[es]=Killbots
Name[et]=Killbots
Name[eu]=Killbots
Name[fi]=Killbots
Name[fr]=Killbot... | 0 |
3613.ps1 |
function Test-NewAzureRmAlertRuleWebhook
{
try
{
Assert-Throws { New-AzAlertRuleWebhook } "Cannot process command because of one or more missing mandatory parameters: ServiceUri."
$actual = New-AzAlertRuleWebhook 'http://hello.com'
Assert-AreEqual $actual.ServiceUri 'http://... | 0 |
3986.ps1 |
function ServiceBusTests {
$location = Get-Location
$resourceGroupName = getAssetName "RGName-"
$namespaceName = getAssetName "Namespace1-"
$namespaceName2 = getAssetName "Namespace2-"
Write-Debug "Create resource group"
New-AzResourceGroup -Name $resourceGroupName -... | 0 |
3658.ps1 |
function Test-CreateElasticPool
{
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
$rg = Create-ResourceGroupForTest $location
$server = Create-ServerForTest $rg $location
try
{
$poolName = Get-ElasticPoolName
$job = New-AzSqlElasticPool -ServerName $server.Server... | 0 |
sample_22_89.ps1 | [CmdletBinding()]
param()
function findExistingImportModuleDirectives([Parameter(Mandatory=$true)][string]$path)
{
if (!(Test-Path $path))
{
return
}
$fileContents = Get-Content $path
$fileContents -match 'Import-Module.+?(?=posh-vcpkg)'
return
}
$scriptsDir = split-path -parent $scri... | 0 |
sample_16_24.ps1 | # Copyright ?2009, Microsoft Corporation. All rights reserved.
# You may use this code and information and create derivative works of it,
# provided that the following conditions are met:
# 1. This code and information and any derivative works may only be used for
# troubleshooting a) Windows and b) products for ... | 0 |
sample_62_6.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 = @(... | 0 |
sample_37_89.ps1 | #
# Module manifest for module 'OCI.PSModules.Dts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dts.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
50.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... | 0 |
sample_7_0.ps1 | # $ConfigXMLPath = $Path ### Do not remove this param line
# 2023-02-20 WalterE mod Trap #we#
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $... | 0 |
sample_65_56.ps1 | #
# Script module for module 'Az.Migrate' that is executed when 'Az.Migrate' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 07/04/2024 08:22:40
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
... | 0 |
sample_54_52.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module -Name "$PSScriptRoot\..\..\Physica... | 0 |
sample_22_58.ps1 | #Volumetric soil moisture content
'Volumetric soil moisture content' = {
discipline = 2 ;
parameterCategory = 0 ;
parameterNumber = 9 ;
}
#Upper layer soil temperature
'Upper layer soil temperature' = {
discipline = 2 ;
parameterCategory = 3 ;
parameterNumber = 1 ;
}
#Upper layer soil moisture
'Upper laye... | 0 |
sample_30_4.ps1 | import { isScalar } from '../nodes/Node.js';
function mapIncludes(ctx, items, search) {
const { uniqueKeys } = ctx.options;
if (uniqueKeys === false)
return false;
const isEqual = typeof uniqueKeys === 'function'
? uniqueKeys
: (a, b) => a === b ||
(isScalar(a) &&
... | 0 |
1649.ps1 |
| : |
| : |
$ a = " < |