filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
sample_54_10.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.PostgreSql.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.PostgreSql.internal.psm1'
if(Test-Path $internalModulePath) {
... | 0 |
sample_9_2.ps1 | . ./utils_cts.ps1
SkipSecondExecution
$ClusterKey="HKLM:\Cluster"
if (Test-Path $ClusterKey) {
Import-Module FailoverClusters
$SharedVolumesRedirected_Summary = new-object PSObject
$SharedVolumesRedirected = Get-ClusterSharedVolume | Where-Object {$_.SharedVolumeInfo[0].RedirectedAccess}
foreach (... | 0 |
986.ps1 | Param(
[parameter(Mandatory=$true)]
$CsvFilePath
)
$ErrorActionPreference = "Stop"
$scriptsPath = $PSScriptRoot
if ($PSScriptRoot -eq "") {
$scriptsPath = "."
}
. "$scriptsPath\asr_logger.ps1"
. "$scriptsPath\asr_common.ps1"
. "$scriptsPath\asr_csv_processor.ps1"
Function ProcessItemImpl($processor, $cs... | 0 |
sudo for Powershell_3.ps1 | ## sudo.ps1
#
# Authors: rbellamy, pezhore, mrigns, This guy: http://tsukasa.jidder.de/blog/2008/03/15/scripting-sudo-with-powershell,
# other powershell peoples
#
# Sources:
# http://tsukasa.jidder.de/blog/2008/03/15/scripting-sudo-with-powershell
# http://www.ainotenshi.org/%E2%80%98sud... | 0 |
Invoke-BPAModeling.ps1 | <#
NAME: Invoke-BPAModeling.ps1
AUTHOR: Jan Egil Ring
EMAIL: jer@powershell.no
COMMENT: Script to invoke Best Practices Analyzer on remote computers.
Requires Windows Server 2008 R2 on target computers, and Windows PowerShell 2.0 on the computer running the script from.
F... | 0 |
sample_16_74.ps1 | #
# Module manifest for module 'PowerShellEditorServices.VSCode'
#
# Generated by: daviwil
#
# Generated on: 6/16/2017
#
@{
# Script module or binary module file associated with this manifest.
RootModule = "$PSScriptRoot/bin/Microsoft.PowerShell.EditorServices.VSCode.dll"
# Version number of this module... | 0 |
TheGameOfLife_1.ps1 | #TheGameOfLife.ps1
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
$SCRIPT:hostProperties = @{};
$SCRIPT:hostState = $null;
$SCRIPT:BoardWidth = 50;
$SCRIPT:BoardHeight = 50;
Function Initialize-Host
{
Param(
[Parameter(Mandatory=$false)]
$wndTitle = "Game of Life... | 0 |
sample_17_26.ps1 | #
# Module manifest for module 'OCI.PSModules.Opensearch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Opensearch.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
... | 0 |
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()]
[... | 0 |
Start-RDP.ps1 | ########################################################################################################################
# NAME
# Start-RDP
#
# SYNOPSIS
# Opens a remote desktop connection to another computer.
#
# SYNTAX
# Start-RDP [[-Server] <string>] [[-Width] <int>] [[-Height] <int>]
# Star... | 0 |
sample_62_12.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... | 0 |
3944.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.","") }... | 0 |
1691.ps1 |
function Get-OfficeVersion ($computer = $env:COMPUTERNAME) {
$version = 0
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $computer)
try {
$reg.OpenSubKey('SOFTWARE\Microsoft\Office').GetSubKeyNames() | % {
if ($_ -match '(\d+)\.') {
if ([int... | 0 |
sample_39_86.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... | 0 |
1885.ps1 |
Describe "Write-Host with default Console Host" -Tags "Slow","Feature" {
BeforeAll {
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
$testData = @(
@{ Name = '-Separator'; Command = "Write-Host a,b,c -Separator '+'"; returnCount = 1; returnValue = @("a+b... | 0 |
sample_60_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... | 0 |
Test-SqlConnection_1.ps1 | #######################
<#
Version History
v1.0 - Chad Miller - Initial release
v1.1 - Chad Miller - Fixed issues, added colorized HTML output
#>
Add-Type -AssemblyName System.Xml.Linq
$Script:CMServer = 'MyServer'
#######################
function Test-Ping
{
param([Parameter(Mandatory=$true, V... | 0 |
Select-ToString_2.ps1 | [CmdletBinding(DefaultParameterSetName='DefaultParameter')]
param(
[Parameter(ValueFromPipeline=$true)]
[System.Management.Automation.PSObject]
${InputObject},
[Parameter(ParameterSetName='DefaultParameter', Position=0, Mandatory=$true)]
[System.String[]]
${Property},
[Parameter(... | 0 |
4177.ps1 |
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()]
[string]$Collection,
[ValidateNotNullOrEmpty()]
[string]$SQLServer,
[ValidateNotNullOrEmpty()]
[string]$SQLDatabase
)
$RebootList = Invoke-Sqlcmd -ServerInstance $SQLServer -Database $SQLDatabase -Query 'SELECT * FROM dbo.vSMS_CombinedDeviceResources WHERE Cl... | 0 |
3345.ps1 |
function New-Permission {
[PoshBot.BotCommand(Permissions = 'manage-permissions')]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string]$Name,
[parameter(Mandatory, Position = 1)]
[string]$Plugin,
... | 0 |
Start-Countdown_1.ps1 | function Start-Countdown{
<#
.Synopsis
Initiates a countdown on your session. Can be used instead of Start-Sleep.
Use case is to provide visual countdown progress during "sleep" times
.Example
Start-Countdown -Seconds 10
This method will clear the screen and display descending seconds
.Ex... | 0 |
sample_35_43.ps1 | #
# Module manifest for module 'OCI.PSModules.Streaming'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Streaming.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Co... | 0 |
sample_63_43.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... | 0 |
sample_24_61.ps1 | $env:CONFIG_PATH = ".\config/config.test.json"
$serviceConfig = Get-Content -Raw -Path $env:CONFIG_PATH | ConvertFrom-Json
Write-Host "Set variables for monitoring agent..."
$env:MONITORING_BUILD_VERSION = "0.0.0"
$env:MONITORING_CONFIG_VERSION = $serviceConfig.'Geneva:ConfigVersion'
$env:MONITORING_GCS_ACCOUNT ... | 0 |
Generate New Password.ps1 | function global:GET-NewPassword($PasswordLength, $Complexity) {
<#
.SYNOPSIS
Generates a New password with varying length and Complexity,
.DESCRIPTION
Generate a New Password for a User. Defaults to 8 Characters
with Moderate Complexity. Usage
GET-NEWPASSWORD or
GET-NEWPASSWORD $Length $Complexit... | 0 |
sample_17_74.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\nanoid@3.3.7\node_modules\nanoid\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\nanoid@3.3.... | 0 |
2376.ps1 |
param(
[Parameter()]
[ValidateNotNullOrEmpty()]
[string[]]$Section
)
$sections = @(
'Active Setup Temp Folders',
'BranchCache',
'Content Indexer Cleaner',
'Device Driver Packages',
'Downloaded Program Files',
'GameNewsFiles',
'GameStatisticsFiles',
'GameUpdateFiles',
'Internet Cache Files',
'Memory... | 0 |
sample_56_11.ps1 |
# Import the cluster setup utility module
$sdkInstallPath = (Get-ItemProperty 'HKLM:\Software\Microsoft\Service Fabric SDK').FabricSDKScriptsPath
$modulePath = Join-Path -Path $sdkInstallPath -ChildPath "ClusterSetupUtilities.psm1"
Import-Module $modulePath
function Set-LocalClusterReady([bool]$createOneNodeC... | 0 |
1375.ps1 |
function Get-CIisApplication
{
[CmdletBinding()]
[OutputType([Microsoft.Web.Administration.Application])]
param(
[Parameter(Mandatory=$true)]
[string]
$SiteName,
[Parameter()]
[Alias('Name')]
[string]
$VirtualPath
)... | 0 |
Add-TnsAdminEntry.ps1 | param
(
[string] $Name = $(Read-Host "Provide a value for parameter 'Name'"),
[string] $Protocol = 'TCP',
[string] $Hostname = $(Read-Host "Provide a value for parameter 'Hostname'"),
[string] $Port = '1521',
[string] $Sid = $(Read-Host "Provide a value for parameter 'Sid'"),
[System.IO.F... | 0 |
sample_45_35.ps1 | /* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2012-2014,2018,2020 The Linux Foundation. All rights reserved.
*/
#ifndef _DT_BINDINGS_QCOM_SPMI_VADC_H
#define _DT_BINDINGS_QCOM_SPMI_VADC_H
/* Voltage ADC channels */
#define VADC_USBIN 0x00
#define VADC_DCIN 0x01
#define VADC_VCHG_SNS 0x02
#defin... | 0 |
Get-Parameter_4.ps1 | function Get-Parameter ( $Cmdlet, [switch]$ShowCommon ) {
foreach ($paramset in (Get-Command $Cmdlet).ParameterSets){
$Output = @()
foreach ($param in $paramset.Parameters) {
if ( !$ShowCommon ) {
if ($param.aliases -match "vb|db|ea|wa|ev|wv|ov|ob") { continue }
}
$process = "" | Select-Object ... | 0 |
sample_59_3.ps1 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
#-------------------------------------------------------------------------
$ErrorActionPreference = "Stop"
$paramsRegKey = 'HKLM:\SYSTEM\CurrentControlSet\Services\ADSync\Param... | 0 |
sample_49_36.ps1 | <#
THE SCRIPT 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 FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETH... | 0 |
sample_64_90.ps1 | #
# Module manifest for module 'OCI.PSModules.Loadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loadbalancer.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditi... | 0 |
1424.ps1 |
function Enable-CNtfsCompression
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
[Alias('FullName')]
[string[]]$Path,
[Switch]$Recurse,
[Swi... | 0 |
426.ps1 | Register-PSFTeppScriptblock -Name "PSFramework-config-module" -ScriptBlock {
[PSFramework.Configuration.ConfigurationHost]::Configurations.Values.Module | Select-Object -Unique
} | 0 |
963.ps1 |
$rgName='MyResourceGroup'
$location='eastus'
$cred = Get-Credential -Message 'Enter a username and password for the virtual machine.'
New-AzResourceGroup -Name $rgName -Location $location
$fesubnet = New-AzVirtualNetworkSubnetConfig -Name 'MySubnet-FrontEnd' -AddressPrefix '10.0.1.0/24'
$besubnet = New-AzVirtual... | 0 |
sample_36_55.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_54_60.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 = '83.1.0'
... | 0 |
sample_64_4.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmtraces'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmtraces.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# Supported PSEditions
Co... | 0 |
64d622dd-3de1-4904-8512-d2f40cde9914.ps1 | #This scripts compares the agents that are installed in two zones and
#gives the agents that are not common.
#Usage:
#Compare-Agents.ps1 -server1 RMSServer1.contoso.com -server2 RMSServer2.contoso.com -output c:\\Temp.txt
#RMSServer1 is the one whose agents are to be moved.
param([string] $Server1,$Server2,$outp... | 0 |
sample_39_65.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.apach... | 0 |
sample_3_96.ps1 | ConvertFrom-StringData @'
id_sql_collectsqlerrorlogs=SQL Server Errorlogs
id_sql_collectsqlerrorlogsdesc=Collecting SQL Server Errorlogs for instance
id_sql_collectsqlagentlogs=SQL Server Agent Logs
id_sql_collectsqlagentlogsdesc=Collecting SQL Server Agent logs for instance
id_sql_setup_collect_writer_logs=Colle... | 0 |
sample_41_15.ps1 | #
# Module manifest for module 'PowerShellProTools'
#
# Generated by: Ironman Software, LLC
#
# Generated on: 2/20/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'PowerShellProTools.psm1'
# Version number of this module.
ModuleVersion = '2023.12.0'
# Supp... | 0 |
Get-FtpList.ps1 |
function Get-FtpList {
#.Synopsis
# Read a list of files (and directories) from FTP
#.Description
# An initial implementation of a string-parsing lister for FTP which converts lists to objects (in the one format that I've seen -- there are other formats)
#
# This implementation will use whatever proxy is set... | 0 |
211.ps1 |
[CmdletBinding(DefaultParameterSetName="All")]
PARAM (
[parameter(Mandatory = $true)]
$Credential,
[parameter(Mandatory = $true)]
$Vcenter,
[Parameter(mandatory=$true,ParameterSetName = "All")]
[Switch]$AllVib,
[Parameter(mandatory=$true,ParameterSetName = "VIBName")]
$VibName,
[Par... | 0 |
2476.ps1 |
function Get-AzrAvailableLun
{
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine]$VM
)
process
{
$luns = $VM.StorageProfile.DataDisks
if ($luns.Count -eq 0)
{
Write-Verbose -Message "No data disks found attached... | 0 |
sample_25_25.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 = '82.0.0'
# Supported PSEdition... | 0 |
sample_26_99.ps1 | # WARNING: this need to be set by the getExtVersion
$env:TEST_EXTENSION_VERSION = "2.3.1"
# get the local path
$myPath = Split-Path -parent $MyInvocation.MyCommand.Path
$env:TEST_LOCAL_PATH="$myPath"
if (-not [Environment]::GetEnvironmentVariable('TEST_EXTENSIONS_PATH')) {
$env:TEST_EXTENSIONS_PATH = $(Join-Path ... | 0 |
sample_62_8.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 = '89.0.0'
# Supported P... | 0 |
sample_0_56.ps1 | param( [string]$DataPath, [switch]$AcceptEula )
$version = "Evt-Collect (20240604)"
# by Gianni Bragante - gbrag@microsoft.com
Function EvtLogDetails {
param(
[string] $LogName
)
Write-Log ("Collecting the details for the " + $LogName + " log")
$cmd = "wevtutil gl """ + $logname + """ >>""" + $g... | 0 |
2463.ps1 | function Get-Weekday {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[ValidatePattern('sunday|monday|tuesday|wednesday|thursday|friday|saturday')]
[string]$Weekday
)
process {
try {
$Weekday = $Weekday.ToLower()
$DesiredWeekDay = [regex]::Matches($Weekday, 'sunday|monday|tuesday|wednesday|th... | 0 |
995.ps1 | Param(
[parameter(Mandatory=$true)]
$CsvFilePath
)
$ErrorActionPreference = "Stop"
$scriptsPath = $PSScriptRoot
if ($PSScriptRoot -eq "") {
$scriptsPath = "."
}
. "$scriptsPath\asr_logger.ps1"
. "$scriptsPath\asr_common.ps1"
. "$scriptsPath\asr_csv_processor.ps1"
Function ProcessItemImpl($processor, $cs... | 0 |
1058.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'Reset-HostsFile' {
$customHostsFile = ''
BeforeEach {
$Global:Error.Clear()
$customHostsFile = Join-Path $env:temp ([IO.Path]::GetRandomFileName())
@"
127.0... | 0 |
sample_0_2.ps1 | ##----------------------------------------------------------------------------
## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved.
##----------------------------------------------------------------------------
# Import string constants
. ./StringConstants.ps1
Stop-Service -Name $ServiceConsta... | 0 |
ISE-Comments_1.ps1 | #requires -version 2.0
## ISE-Comments module v 1.1
##############################################################################################################
## Provides Comment cmdlets for working with ISE
## ConvertTo-BlockComment - Comments out selected text with <# before and #> after
## ConvertTo-BlockUn... | 0 |
sample_8_10.ps1 | ConvertFrom-StringData @'
id_registrysizelimitcheck=Checking Registry Size Limit
id_registrysizelimitcheckdesc=Checking if Registry Size Limit setting is present on the system
id_registrysizelimitcheckrc=The RegistrySizeLimit entry exists in the registry. This may cause the computer to stop responding as well as log... | 0 |
Reset Time Sync Setting.ps1 | ########################################################
# Created by Brian English
# Brian.English@charlottefl.com
# eddiephoenix@gmail.com
#
# for Charlotte County Government
# No warranty suggested or implied
########################################################
# Purpose: Cycle through all VMs on a... | 0 |
PS2WCF_6.ps1 | <#
.SYNOPSIS
Functions to call WCF Services With PowerShell.
.NOTES
Version 1.2 11.02.2012
Requires Powershell v2 and .NET 3.5
Original version by Christian Glessner
Blog: http://www.iLoveSharePoint.com
Twitter: http://twitter.com/cglessner
Codeplex: http://codeplex.com/iLoveSharePoint
PowerS... | 0 |
sample_10_62.ps1 | #************************************************
# TS_SDPHTTPTests.ps1
# Version 1.0.1
# Date: 01/18/2013
# Author: andret
# Description: Test HTTP connectivity to URLs used in SDP Workflow
#************************************************
Import-LocalizedData -BindingVariable ScriptStrings
#Networking I... | 0 |
sample_67_43.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 ... | 0 |
PowerCLI 4.1.ps1 | $vmPath = "[Storage1] MyVM/MyVM.vmx"
$vm = New-VM –VMHost "192.168.1.10" –VMFilePath $vmPath -Name MyVM
# Check if there is an error and if so – handle it
if (!$?) {
if ($error[0].Exception –is [VMware.VimAutomation.ViCore.Types.V1.ErrorHandling.DuplicateName]) {
# A VM with the same name already exists. Ch... | 0 |
sample_21_34.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module -Name "$PSScriptRoot\..\Common\Rol... | 0 |
sample_31_68.ps1 | /* eslint-disable no-undef */
var plugin = require("plugin-vs-v2");
if (typeof plugin != "undefined") {
plugin.Messaging.addEventListener("pluginready", function () {
setHtmlText();
});
}
function setHtmlText() {
// resource strings used by docker.web.default.html
setTextContent("#dockerWebCor... | 0 |
2915.ps1 | properties {
$x = $null
$y = $null
$z = $null
}
task default -depends TestProperties
task TestProperties {
Assert ($x -ne $null) "x should not be null"
Assert ($y -ne $null) "y should not be null"
Assert ($z -eq $null) "z should be null"
}
| 0 |
sample_58_11.ps1 | #
# Module manifest for module 'OCI.PSModules.Networkloadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Networkloadbalancer.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Sup... | 0 |
sample_64_99.ps1 | 5PrintAllTranslations 限制不能與 IgnoreTranslations 限制一起使用。 >您無法將計算結果欄 '%{oii_column/}' 新增至混合式資料表 '%{oii_table/}'。請移除計算結果欄。M您無法新增用於對混合式工作表 '%{oii_table/}' 進行彙總的 'alternateOf' 資料行。請移除 'alternateOf' 資料行。v您無法建立用於彙總且參考混合式資料表 '%{oii_baseTable/}' 作為 BaseTable 的 'alternateOf' 資料行。請以 DirectQuery 模式參考基底資料表或移除 'alternateOf' 資料行。G您無法在... | 0 |
sample_7_58.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... | 0 |
2647.ps1 |
Add-Type -AssemblyName System.Web
function New-Header{
param([string]$action = "get"
,[string]$resType
,[string]$resourceId
,[string]$connectionKey)
$apiDate = (Get-Date).ToUniversalTime().ToString('R')
$keyBytes = [System.Convert]::FromBase64String($connectionKey) ... | 0 |
sample_20_97.ps1 | ConvertFrom-StringData @'
progressbar_id_crm_fileversion_outdated=Checking For Outdated Microsoft CRM File Versions
progressbar_id_crm_fileversion_outdateddesc=Checking Microsoft CRM File Version Information To Ensure Recent Updates Are Installed
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBc... | 0 |
1000.ps1 |
$myEndpoint = "<your-endpoint-URL>"
$subID = (Get-AzureRmSubscription -SubscriptionName "<subscription-name>").Id
New-AzureRmEventGridSubscription -ResourceId "/subscriptions/$subID" -Endpoint $myEndpoint -EventSubscriptionName demoSubscriptionToAzureSub
| 0 |
Locked accounts alerter.ps1 | #Created By: Ty Lopes
#Sept 2012
#Sript to be run by a scheduled task that monitors for a specific event ID (in this case account locked)
#The sript then reads the last correstponding event ID and emails the details
#I could only get this alert to work properly by using this method... There may be something easier/... | 0 |
Select-CLSCompliant.ps1 |
function Select-CLSCompliant {
#.Synopsis
# Outputs the same as "Select-Object *" with basic error handling for properties that are not CLS Compliant
[CmdletBinding()]
param([Parameter(ValueFromPipeline=$true)]$InputObject)
process {
foreach($in in $InputObject) {
$In | Select-Object *
tra... | 0 |
sample_5_98.ps1 | ConvertFrom-StringData @'
id_hypervregcheck=Checking SCSI Subkeys for Hyper-V
id_hypervregcheckdesc=Checking for Hyper-V SCSI Registry Subkeys
'@
# SIG # Begin signature block
# MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
#... | 0 |
sample_66_38.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
[CmdletBinding(DefaultParamet... | 0 |
2780.ps1 |
Param(
[Parameter(Mandatory=$False,Position=0)]
[switch]$NoStacking=$False
)
function Get-Median {
Param(
[Parameter(Mandatory=$True,Position=0)]
[double[]]$Data
)
$Data = $Data | Sort-Object
if ($Data.Count%2) {
$Median = $Data[[Math]::Floor($Data.Co... | 0 |
3586.ps1 |
function Test-SpatialAnchorsAccountOperations
{
$resourceGroup = TestSetup-CreateResourceGroup
$resourceLocation = "EastUS2"
$accountName = getAssetName
$createdAccount = New-AzSpatialAnchorsAccount -ResourceGroupName $resourceGroup.ResourceGroupName -Name $accountName -Location $resourc... | 0 |
1269.ps1 |
function Get-CHttpUrlAcl
{
[CmdletBinding(DefaultParameterSetName='AllUrls')]
[OutputType([Carbon.Security.HttpUrlSecurity])]
param(
[Parameter(ParameterSetName='ByWildcardUrl')]
[string]
$Url,
[Parameter(ParameterSetName='ByLiteralUrl')]
... | 0 |
sample_12_33.ps1 | ConvertFrom-StringData @'
id_mats_networkadapter=Network Adapter
id_mats_networkadaptertype=Type
id_mats_networkadapterspeed=Speed
id_mats_ipaddresses=IP Addresses
id_mats_defaultgateway=Default Gateway
id_mats_dnsservers=DNS Servers
id_mats_proxyenabled=Proxy Server
id_enabled=Enabled
id_mats_proxyserveradd=P... | 0 |
2820.ps1 | function Send-GraphiteEvent
{
[CmdletBinding()]
param
(
[CmdletBinding()]
[Parameter(Mandatory = $true)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[ValidateScript({ $_ -match '^(http|https)\:\/\/.*' })]
[string]$GraphiteURL,
[P... | 0 |
3841.ps1 |
function Test-AzureContainerRegistry
{
$resourceGroupName = Get-RandomResourceGroupName
$classicRegistryName = Get-RandomRegistryName
$location = Get-ProviderLocation "Microsoft.ContainerRegistry/registries"
$replicationLocation = 'westus2'
try
{
New-AzResourceGroup -Name $resource... | 0 |
Firefox Bookmarks By Key.ps1 | if (!( gmo ShowUI)) {ipmo showui}
if(!(Get-Command DataGrid -ErrorAction SilentlyContinue)) {
Add-UIFunction -Type System.Windows.Controls.DataGrid
}
if(!(Get-Command DataGridTextColumn -ErrorAction SilentlyContinue)) {
Add-UIFunction -Type System.Windows.Controls.DataGridTextColumn
}
if(!(Get-Com... | 0 |
sample_40_97.ps1 | import os.path
import shutil
import subprocess
import psutil
import pytest
import salt.exceptions
pytestmark = [
pytest.mark.windows_whitelisted,
pytest.mark.skip_unless_on_windows,
pytest.mark.slow_test,
]
@pytest.fixture(scope="module")
def dsc(modules):
# We seem to be hitting an issue where the... | 0 |
Findup_30.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... | 0 |
sample_37_88.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.SYNOPSIS
Starts the language and debug services from the PowerShellEditorServices module.
.DESCRIPTION
PowerShell Editor Services Bootstrapper Script
----------------------------------------------
This script contains... | 0 |
sample_15_73.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 |
Get-WebsiteCertificate.ps1 | function Get-WebsiteCertificate {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)] [System.Uri]
$Uri,
[Parameter()] [System.IO.FileInfo]
$OutputFile,
[Parameter()] [Switch]
$UseSystemProxy,
[Parameter()] [Switch]
$UseDefaultCredentials,
[Parameter()] [Switch]
$TrustAllCerti... | 0 |
sample_54_89.ps1 | #
# Module manifest for module 'OCI.PSModules.Datacatalog'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datacatalog.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEdition... | 0 |
508.ps1 |
function Write-PPEventLog{
param(
[Parameter(Mandatory=$true)]
$Message,
[Parameter(Mandatory=$false)]
$EventLog,
[Parameter(Mandatory=$false)]
$EventId,
[Parameter(Mandatory=$false)]
$Source,
[Param... | 0 |
2375.ps1 | describe 'Get-FileViaSftp.ps1' {
$commandName = "$PSScriptRoot\Get-FileViaSftp.ps1"
mock 'Test-Path' {
$true
} -ParameterFilter { $Path -notlike 'Variable:\'}
mock 'Test-Path' {
$false
} -ParameterFilter { $Path -like 'Variable:\'}
mock 'Install-module'
mock 'New-SFTPSession' {
@{
SessionId = 0
}... | 0 |
sample_4_40.ps1 | #
# Module manifest for module 'OCI.PSModules.Datalabelingservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datalabelingservice.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Sup... | 0 |
sample_39_6.ps1 | #
# Module manifest for module 'OCI.PSModules.Vnmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vnmonitoring.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditi... | 0 |
add-OLPublicFolder.ps1 | function add-OLPublicFolder {
param (
[string]$PFName, #Name of the new Public Folder
$PFType, #Type of the new Public Folder
[string]$PFParent = "\\") ... | 0 |
sample_36_64.ps1 | # ---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------------------------... | 0 |
532.ps1 |
function Get-SPORole
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[Microsoft.SharePoint.Client.RoleType]$rType
)
$web = $clientContext.Web
if ($web -ne $null)
{
$roleDefs = $web.RoleDefinitions
$clientContext.Load($roleDefs)
$clientContext.ExecuteQuery()
$roleDef = $roleDef... | 0 |
1202.ps1 |
$tempDir = $null
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
$tempDir = New-TempDirectory -Prefix $PSCommandPath
}
function Stop-Test
{
Remove-Item $tempDir.FullName -Recurse
}
configuration IAmBrok... | 0 |
sample_18_3.ps1 | #
# Module manifest for module 'OCI.PSModules.Bds'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Bds.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
sample_65_48.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may c... | 0 |
Get-EnumValues.ps1 | function Get-EnumValues ( $EnumType ) {
# Code somewhat stolen from Joel here: http://huddledmasses.org/ideas-for-writing-composable-powershell-scripts/
Begin {
$listItems = @()
}
Process {
if( $_ -is [type] -and $_.IsEnum ) {
$listItems+= [Enum]::GetValues($_)
}
elseif( $_.GetType().IsEnum ) {
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.