filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
3861.ps1 |
function NewDirectConnectionV4V6($facilityId,$bandwidth)
{
Write-Debug "Creating Connection at $facilityId"
$md5 = getHash
$md5 = $md5.ToString()
Write-Debug "Created Hash $md5"
$rand1 = Get-Random -Maximum 20 -Minimum 3
$rand2 = Get-Random -Maximum 200 -Minimum 1
$sessionv4 = newIpV4Address $true ... | 0 |
sample_3_45.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 |
sample_20_22.ps1 | using namespace System.Management.Automation
using namespace System.Management.Automation.Language
# This is an example profile for PSReadLine.
#
# This is roughly what I use so there is some emphasis on emacs bindings,
# but most of these bindings make sense in Windows mode as well.
Import-Module PSReadLine
... | 0 |
4271.ps1 | function Invoke-DCSync
{
[CmdletBinding(DefaultParameterSetName="DumpCreds")]
Param(
[Parameter(Position = 0,ValueFromPipeline=$true)]
[Array[]]
$Users,
[String]
$GroupName,
[String]
$UserFilter,
[Switch]
$GetComputers = $false,
[Switch]
$OnlyActive = $true,
[Switc... | 0 |
Sendmail for PoSh 2 CTP3.ps1 | #region vars
$script:maileditor = "C:\\Programme\\vim\\vim72\\vim.exe"
$script:encryption = "C:\\Programme\\GNU\\GnuPG\\gpg.exe"
$script:enckey = "s.patrick1982@gmail.com"
$script:tempmail = "C:\\temp\\psmail.txt"
$script:sigmail = "C:\\temp\\halten\\sig.txt"
$script:mailbody = ""
#endregion vars
#region init... | 0 |
3429.ps1 |
param([bool]$uninstallLocalCert=$false, [bool]$runOnCIMachine=$false )
. "$PSScriptRoot\Common.ps1"
. "$PSScriptRoot\Assert.ps1"
. "$PSScriptRoot\InstallationTests.ps1"
. "$PSScriptRoot\AutoTestLogin.ps1"
$global:totalCount = 0;
$global:passedCount = 0;
$global:passedTests = @()
$global:failedTests = @... | 0 |
Invoke-Inline.ps1 | ################################################################################
## Invoke-Inline.ps1 (originally from Lee Holmes)
## Library support for inline C#
##
## Modified by Joel Bennett to accept include statements, and return collections
##
## Usage
## 1) Define just the body of a C# method, and s... | 0 |
sample_26_56.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"
AliasesTo... | 0 |
3.ps1 |
$shortGitParams = @{
add = 'n v f i p e u A N'
bisect = ''
blame = 'b L l t S p M C h c f n s e w'
branch = 'd D l f m M r a v vv q t u'
checkout = 'q f b B t l m p'
cherry = 'v'
'cherry-pick' = 'e x r m n s S X'
clean = 'd f i n q e x X'
clone = 'l s q v n o b u c'
commit = 'a ... | 0 |
sample_57_45.ps1 | # Web Deploy: Powershell script to configure automatic backups on the server.
# Copyright (C) Microsoft Corp. 2010
#
# Requirements: IIS 7, Windows Server 2008 (or higher)
#
$BackupSectionName = "system.webServer/wdeploy/backup"
$TurnedOnAttrName = "turnedOn"
$EnabledAttrName = "enabled"
$BackupPathAttrName = "... | 0 |
Logger.psm1 0.3.ps1 | <#
Name : Universal Log4Net Logging Module (Logger.psm1)
Version : 0.3
Author : Joel Bennett (MVP)
Site : http://www.HuddledMasses.org/
Version History:
0.3 - Cleanupable release.
Added Udp, Email, Xml and RollingXml, as well as a "Chainsaw":http`://logging.apache.org/log... | 0 |
sample_0_95.ps1 | [dynamic, provider("dcismprovider")]
class DCIM_RegisteredProfile : CIM_RegisteredProfile
{
[
Description ("The organization that defines this specification."),
Modelcorrespondence { "CIM_RegisteredSpecification.OtherRegisteredOrganization" },
Override ("RegisteredOrganization"),
... | 0 |
Enable-MailboxJunkEmail.ps1 | # Author: Jon Webster
# Name: Enable-MailboxJunkEmail
# Created: 1/27/2009
#
# Version: 1.0
# History: 1.0 01/27/2009 Initial version
#
# 18.11.2010 BRF Update for Microsoft Exchange SP3, Cookie Canary
param(
$Identity,
[string]$CasURL,
[string]$User,
[string]$Password,
$DomainController,
[switch... | 0 |
2421.ps1 |
[CmdletBinding()]
param (
[Parameter(Mandatory,
ValueFromPipeline,
ValueFromPipelineByPropertyName)]
[string]$ApplicationName,
[string]$PackageName,
[switch]$SkipRequirements,
[switch]$DistributeContent,
[switch]$OsdFriendlyPowershellSyntax,
[array]$AdditionalOptions = @(@{'Package' = @{ 'PkgFlag... | 0 |
sample_48_38.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 ... | 0 |
New-PrintJob.ps1 | <#
.SYNOPSIS
Log a print job to a file.
.DESCRIPTION
This script works in conjunction with an Event Trigger on the PrintService
event on our print servers. This script queries the Microsoft-Windows-PrintService/Operational
log for EventID 307, and returns the drive letter f... | 0 |
sample_61_53.ps1 | #
# Module manifest for module 'OCI.PSModules.Apigateway'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apigateway.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEditions
... | 0 |
Get-NestedGroups.ps1 | <#
.SYNOPSIS
Enumerate all AD group memberships of an account (including nested membership).
.DESCRIPTION
This script will return all the AD groups an account is member of.
.PARAMETER UserName
The username whose group membershipts to find.
.EXAMPLE
.\\Get-NestedGroups.ps1 'johndoe'
Name ... | 0 |
2435.ps1 | function Enable-DynamicDnsRegistration
{
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$ComputerName,
[Parameter()]
[ValidateNotNullOrEmpty()]
[pscredential]$Credential
)
$icmParams = @{
'ComputerName' = $ComputerName
}
if ($PSBoundParameters.ContainsKey('C... | 0 |
Get-SQLSaturdaySessions.ps1 | function Get-SQLSaturdaySessionList {
param(
[string] $Number = "111",
$GetUnscheduled
)
$baseUrl = "http://sqlsaturday.com/" + $Number
$url = $baseUrl + "/schedule.aspx"
$page = $null
try {
Write-Verbose "Initiating WebClient"
... | 0 |
sample_4_2.ps1 | ConvertFrom-StringData @'
id_dpm_information=DPM Information
id_dpm_errorlogs_files=DPM Errorlog Files
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAF... | 0 |
sample_41_75.ps1 | #
# Module manifest for module 'Microsoft.SME.CertificateManager'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.CertificateManager.psm1'
# Version number of this module.
ModuleVersion = '4.10.2'
# Supported PSEditions
# CompatiblePSEditions = @()
... | 0 |
sample_6_77.ps1 | #************************************************
# DC_MUP-Component.ps1
# Version x
# Date: 2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about the MUP components.
# (This information has been in the SMB Client output for years, but separating it into its own file now.)
... | 0 |
621.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.4.9.zip"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs | ForEach-Object{
try{
$_.... | 0 |
Disconnect-VMHost.ps1 | #requires -version 2 -pssnapin VMware.VimAutomation.Core
Function Disconnect-VMHost {
<#
.Summary
Used to Disconnect a Connected host from vCenter.
.Parameter VMHost
VMHost to Disconnect to virtual center
.Example
Get-VMHost | Where-Object {$_.state -eq "Connected"} | Di... | 0 |
sample_8_92.ps1 | ConvertFrom-StringData @'
id_ctsaddons=Setup App Compat Component
id_ctsaddonsdescription=Collects Setup App Compat information.
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIB... | 0 |
sample_60_38.ps1 | # region Generated
# ----------------------------------------------------------------------------------
# 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 obt... | 0 |
sample_51_4.ps1 | #########################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Extension Tools
#
#Requires -Version 4.0
#
#########################################################################################
add-type @"
usi... | 0 |
Boots & Background Jobs.ps1 | Import-Module PowerBoots
# This simulates a download function, say Jaykul's Get-Webfile
# You can output current progress for a large file, or if it's an array of links then out put the current (index/length)%
# You will need to run the function as a background thread in order for it to not interfere with the UI t... | 0 |
Select-CSVString_1.ps1 | # NAME
# Select-CSVString
#
# SYNOPSIS
# Convert CSV files to custom objects with properties
#
# SYNTAX
# Select-CSVString -pattern <string[]> -files (ls *) [-StartDate <DateTime>] [-EndDate <DateTime>]
param ([regex]$pattern,$files=("$($exinstall)TransportRoles\\Logs\\AgentLog","$($exinstall.substring(... | 0 |
sample_1_74.ps1 | ConvertFrom-StringData @'
id_certs=Certificate information
id_certsdesc=Collecting information on installed certificates
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBA... | 0 |
Move-Mailbox _2.ps1 | param(
#distribution group holding usermailbox(es)
[string] $DistGroup = "XC2010Move",
#move requests per batch/script run
[int] $BatchCount = 5
)
#remove user(s) without mailbox
Get-DistributionGroupMember $DistGroup | get-user -Filter {Recipienttype -eq "User"} -EA SilentlyContinue | Remove-DistributionGrou... | 0 |
844.ps1 |
$resourceGroupName = "<Azure resource group name>"
$dataFactoryName = "<Data factory name>"
$dataFactoryRegion = "East US"
$storageAccountName = "<Az.Storage account name>"
$storageAccountKey = "<Az.Storage account key>"
$sourceBlobPath = "<Azure blob container name>/<Azure blob input folder name>"
$sinkBlobPath = ... | 0 |
933.ps1 |
$apiVersion = "2015-04-08"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$tableName = "table1"
$tableThroughputResourceType = "Microsoft.DocumentDb/databaseAccounts/apis/tables/settings"
$tableThroughputResourceName = $accountName + "/table/" + $tableName + "/throughput"
Get-AzResource -Re... | 0 |
sample_66_48.ps1 | # Runs OptProf for MSBuild binaries based on an insertion build
trigger: none # Prevents this pipeline from triggering on check-ins
pr: none # don't run this on PR as well, this should only trigger off on MSBuild runs
schedules:
- cron: "0 9 * * Wed,Sat"
displayName: Weekly OptProf Run
branches:
includ... | 0 |
4409.ps1 | function Get-ParametersHashtable
{
param(
$Proxy,
$ProxyCredential
)
$ParametersHashtable = @{}
if($Proxy)
{
$ParametersHashtable[$script:Proxy] = $Proxy
}
if($ProxyCredential)
{
$ParametersHashtable[$script:ProxyCredential] = $ProxyCredential
}
... | 0 |
sample_22_18.ps1 | #
# Module manifest for module 'OCI.PSModules.Ailanguage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ailanguage.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
... | 0 |
2830.ps1 |
$manifestPath = "$PSScriptRoot/../src/psake.psd1"
$manifest = Import-PowerShellDataFile -Path $manifestPath
Remove-Module -Name psake -Force
Import-Module -Name $manifestPath -Force -Verbose:$false -ErrorAction Stop
$commands = Get-Command -Module psake -CommandType Cmdlet, Function, Workflow
foreach ($com... | 0 |
test.ps1 | function Write-EventDetail {
param(
$id
)
$id | Write-Host
$Event | Write-Host
$EventSubscriber | Write-Host
$Sender | Write-Host
$SourceEventArgs | Write-Host
$SourceArgs | Write-Host
}
'test'
| 0 |
Get # of Web Connections.ps1 | function Get-WebServiceConnections()
{
$results = @{}
$perfmon = new-object System.Diagnostics.PerformanceCounter
$perfmon.CategoryName = "Web Service"
$perfmon.CounterName = "Current Connections"
$cat = new-object System.Diagnostics.PerformanceCounterCategory("Web Service")
$instances = $cat.GetIn... | 0 |
sample_28_7.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... | 0 |
2727.ps1 |
Get-HotFix | Select-Object HotfixID, Caption, Description, InstalledBy | 0 |
3385.ps1 |
function Assert-Throws
{
param([ScriptBlock] $script, [string] $message)
try
{
&$script
}
catch
{
if ($message -ne "")
{
$actualMessage = $_.Exception.Message
Write-Output ("Caught exception: '$actualMessage'")
if ($actualMessage -eq $message)
{
... | 0 |
sample_28_2.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 = '81.0.0'
... | 0 |
1937.ps1 |
Describe "ConvertTo-Csv DRT Unit Tests" -Tags "CI" {
$inputObject = [pscustomobject]@{ First = 1; Second = 2 }
It "Test convertto-csv with psobject pipelined" {
$returnObject = $inputObject | ConvertTo-Csv -IncludeTypeInformation
$returnObject.Count | Should -Be 3
$returnObject[0] | S... | 0 |
Set-Computername_2.ps1 | function Set-ComputerName {
param( [switch]$help,
@@ [string]$originalPCName=$(read-host "Please specify the current name of the computer"),
[string]$computerName=$(read-host "Please specify the new name of the computer"))
@@ $usage = "set-ComputerName -originalPCname CurrentName -computername AnewName"
... | 0 |
sample_45_59.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... | 0 |
sample_44_90.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 |
Get_Set Signature 2.4.ps1 | #Requires -version 2.0
## Authenticode.psm1 updated for PowerShell 2.0 (with time stamping)
####################################################################################################
## Wrappers for the Get-AuthenticodeSignature and Set-AuthenticodeSignature cmdlets
## These properly parse paths, so th... | 0 |
SharpSSH Module.ps1 | ##################################################
# cmdlets
##################################################
#-------------------------------------------------
# New-SharpSession
#-------------------------------------------------
# Usage: New-SharpSession -?
#-------------------------------------------------... | 0 |
4422.ps1 | function New-ScriptFileInfo
{
[CmdletBinding(PositionalBinding=$false,
SupportsShouldProcess=$true,
HelpUri='https://go.microsoft.com/fwlink/?LinkId=619792')]
Param
(
[Parameter(Mandatory=$false,
Position=0,
ValueFromPi... | 0 |
sample_50_16.ps1 | #
# Script module for module 'Az.ApplicationInsights' that is executed when 'Az.ApplicationInsights' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:39
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
... | 0 |
3400.ps1 |
$PLACEHOLDER = "PLACEHOLDER1@"
function Get-ComputeTestResourceName
{
$stack = Get-PSCallStack
$testName = $null;
foreach ($frame in $stack)
{
if ($frame.Command.StartsWith("Test-", "CurrentCultureIgnoreCase"))
{
$testName = $frame.Command;
}
}
... | 0 |
sample_23_28.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_10_11.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 = '75.1.0'
# Supported PSEditions
... | 0 |
sample_9_84.ps1 | ConvertFrom-StringData @'
id_hpz12servicecheck=Checking the presence of HPZ12
id_hpz12servicecheckdesc=Checking if Net Driver HPZ12 or Pml Driver HPZ12 services are installed
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE... | 0 |
sample_14_92.ps1 | #
# Module manifest for module 'OCI.PSModules.Artifacts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Artifacts.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
Co... | 0 |
707.ps1 |
function Remove-RsRestFolder
{
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')]
param(
[Parameter(Mandatory = $True)]
[string]
$RsFolder,
[string]
$ReportPortalUri,
[Alias('ApiVersion')]
[ValidateSet("v2.0")]
[strin... | 0 |
Custom Speech Commands_2.ps1 | #Filename commands.ps1
import-module "G:\\Documents\\Speech Macros\\custom.psm1"
import-module "G:\\Documents\\Speech Macros\\alice.psm1"
Add-SpeechCommands @{
"test command" = { Say $(Respond "3:2,4:0-2") }
" * the percentages * " = { Say $(Percentages) }
" * star date * " = { Say "Current,... | 0 |
3982.ps1 |
function Test-AzureRmKubernetes
{
$resourceGroupName = Get-RandomResourceGroupName
$kubeClusterName = Get-RandomClusterName
$location = Get-ProviderLocation "Microsoft.ContainerService/managedClusters"
try
{
New-AzResourceGroup -Name $resourceGroupName -Location $location
if (isLiv... | 0 |
sample_7_40.ps1 | ConvertFrom-StringData @'
id_clusterinfo=Cluster Information
id_clusterinfoobtaining=Obtaining cluster basic information
id_clustername=Cluster Name
id_clusterdomain=Cluster Domain
id_clustercsv=Shared Volumes
id_clustercsvroot=Shared Volumes Root
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHj... | 0 |
Manage ASP_2.NET Providers.ps1 | # Manage_ASP_NET_Providers.ps1
# by Chistian Glessner
# http://iLoveSharePoint.com
# have to be initialized. If you want to change the app config you have to restart PowerShell
param($appConfigPath=$(throw "-appConfigPath is mandatory"))
{
# App config path have to be set before loading System.Web.dll
... | 0 |
sample_34_52.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\vite@5.0.12\node_modules\vite\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\vite@5.0.12\no... | 0 |
sample_5_89.ps1 | #************************************************
# DC_NPS-Component.ps1
# Version 1.0
# Date: 2009-2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about NPS/RADIUS.
# Called from: Networking Diagnostics
# [we] 2022-03-16: masked 'Shared secret'
#**************************... | 0 |
3333.ps1 |
function Get-Role {
[PoshBot.BotCommand(
Aliases = ('gr', 'getrole'),
Permissions = 'view-role'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Position = 0)]
[string]$Name
)
if ($PSBoundParameters.ContainsKey('Name')) {... | 0 |
846.ps1 |
$resourceGroupName = "<azure resource group name>"
$dataFactoryName = "<data factory name>"
$dataFactoryRegion = "East US"
$storageAccountName = "<Az.Storage account name>"
$storageAccountKey = "<Az.Storage account key>"
$azureSqlServer = "<azure sql server name>"
$azureSqlDatabase = "<azure sql database name>"
$a... | 0 |
4102.ps1 |
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][string]$SiteCode,
[ValidateNotNullOrEmpty()][string]$SCCMModule
)
function Get-RelativePath {
[CmdletBinding()][OutputType([string])]
param ()
$Path = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent) + "\"
Return $Path
}
Clear-Host
Import-Module ... | 0 |
sample_5_75.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_56_28.ps1 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apa... | 0 |
1017.ps1 |
$random = (New-Guid).ToString().Substring(0,8)
$subscriptionId = "my-azure-subscription-id"
$apimServiceName = "apim-$random"
$resourceGroupName = "apim-rg-$random"
$location = "Japan East"
$organisation = "Contoso"
$adminEmail = "admin@contoso.com"
Select-AzSubscription -SubscriptionId $subscriptionId
New... | 0 |
sample_28_20.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ElasticSan.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ElasticSan.internal.psm1'
if(Test-Path $internalModulePath) {
... | 0 |
2145.ps1 |
Describe 'Automatic variable $input' -Tags "CI" {
It '$input Type should be enumerator' -Skip {
function from_begin { [cmdletbinding()]param() begin { Write-Output -NoEnumerate $input } }
function from_process { [cmdletbinding()]param() process { Write-Output -NoEnumerate $input } }
... | 0 |
sample_7_71.ps1 | ConvertFrom-StringData @'
id_telnetsystemaccount_sd=The Telnet service is running under Local System account and this may cause problems with Plug and Play device installation.
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3Ag... | 0 |
2419.ps1 |
[CmdletBinding()]
param (
[switch]$DeclineAllNonMatches,
[switch]$SyncWsus,
[string]$LogFilePath = "$PsScriptRoot\SCCM-WSUSUpdateSync.log",
[ValidateScript({ Test-Connection -ComputerName $_ -Quiet -Count 1})]
[string]$CmSiteServer = '',
[string]$CmSiteCode = '',
[ValidateScript({ Test-Connection -ComputerName ... | 0 |
Impersonation.ps1 | $global:ImpContextStack = new-object System.Collections.Generic.Stack[System.Security.Principal.WindowsImpersonationContext]\n$global:IdStack = new-object System.Collections.Generic.Stack[System.Security.Principal.WindowsIdentity]\n\n\n$global:UserToysClass = Add-Type -Namespace Huddled -Name UserToys -MemberDefinition... | 0 |
1183.ps1 |
Set-StrictMode -Version 'Latest'
$taskName = $null
$credential = $null
$AllMonths = @( 'January','February','March','April','May','June','July','August','September','October','November','December' )
$today = Get-Date
$today = New-Object 'DateTime' $today.Year,$today.Month,$today.Day
& (Join-Path -Path $P... | 0 |
2406.ps1 | function Get-InstalledSoftware
{
[CmdletBinding()]
param (
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]$ComputerName = $env:COMPUTERNAME,
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]$Name,
[Parameter()]
[ValidatePattern('\b[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}\b')]
[string... | 0 |
Add-Slide.ps1 | function Add-Slide($pres, $maxShared, $vmUsages, $vmShared, $maxVM, $vmLoad) {
$slide = $pres.slides.range(1).duplicate()
#$totalSlides = ($pres.slides | Measure-Object).Count
#$pres.slides.range(2).moveto($totalSlides)
#region 1
# Add all the boxes. Skip the first position.
$i = 1
foreach ($position in... | 0 |
2193.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... | 0 |
sample_19_41.ps1 | ---
parameters:
- name: version
type: string
default: ''
- name: version_prefix
type: string
default: ''
- name: draft
type: boolean
default: false
- name: working_directory
type: string
default: $(Build.SourcesDirectory)
- name: gh_token
type: string
- name: repo
type: string
default: $(Buil... | 0 |
sample_41_42.ps1 | # Change Log
## 0.1.18(20240222)
- 使用neovim插件替换vim
## 0.1.17(20230703)
- 使用vscodeintellicode
## 0.1.16(20230626)
- 去掉Codeium (PS: 需要时单独启用, 每开启一个VSCode 都会启动两个language_server_windows_x64.exe进程, 窗口过多时会导致系统卡顿.)
## 0.1.15(20230323)
- 使用codeium替代codegeex
- 去掉code-spell-checker, vscodeintellicode
#... | 0 |
Remove-FTPFile_1.ps1 | function Remove-FTPFile ($Source,$UserName,$Password)
{
#Create FTP Web Request Object to handle connnection to the FTP Server
$ftprequest = [System.Net.FtpWebRequest]::Create($Source)
# set the request's network credentials for an authenticated connection
$ftprequest.Credentials = New-Object System.N... | 0 |
sample_49_45.ps1 | #
# Module manifest for module 'Microsoft.SME.Storage'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.Storage.psm1'
# Version number of this module.
ModuleVersion = '4.11.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to unique... | 0 |
3224.ps1 |
InModuleScope PoshBot {
describe 'Get-PoshBot' {
$script:botTracker = @{}
it 'Returns nothing if no jobs exist' {
Get-Poshbot | Should BeNullorEmpty
}
$guid1 = (New-Guid).ToString()
$guid2 = (New-Guid).ToString()
$script:botTracker.Add(1, @{
... | 0 |
sample_8_98.ps1 | ConvertFrom-StringData @'
progressbar_id_crm_org_update_check=Checking Microsoft CRM Organizations that have not been updated to latest revision
progressbar_id_crm_org_update_checkdesc=Checking Microsoft CRM Organizations that have not been updated to latest revision. Important database updates should be applied.
'@... | 0 |
sample_32_35.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
param (
[Parameter(Manda... | 0 |
3873.ps1 |
$TestOutputRoot = [System.AppDomain]::CurrentDomain.BaseDirectory;
$ResourcesPath = Join-Path (Join-Path $TestOutputRoot "ScenarioTests") "Resources"
function Get-WebsiteName
{
return getAssetName
}
function Get-TrafficManagerProfileName
{
return getAssetName
}
function Get-WebHostPlanName
{... | 0 |
sample_53_47.ps1 | #
# Module manifest for module 'OCI.PSModules.Resourcesearch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Resourcesearch.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSE... | 0 |
sample_62_72.ps1 | $TempPath = [Environment]::GetEnvironmentVariable("ProgramFiles(x86)")
Write-Output $TempPath;
$TARGET_DIR = "\??\" + $TempPath + "\InstallShield Installation Information" + "\{D2DA930B-CB5D-4DD6-BF62-BE6C310A353D}" + "\InstallManager.txt`0`0";
Write-Output $TARGET_DIR;
new-ItemProperty -path "HKLM:\SYSTEM\CurrentC... | 0 |
4015.ps1 | workflow Use-WorkflowCheckpointSample
{
Write-Output "Before Checkpoint."
start-sleep -s 20
Checkpoint-Workflow
Write-Output "After Checkpoint."
} | 0 |
Resolve-Error.ps1 | #############################################################################\n##\n## Resolve-Error\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\nDisplays de... | 0 |
sample_3_76.ps1 | ConvertFrom-StringData @'
id_crmcollectactivity=Collecting System Information
id_crmformattingdata=Formatting Data
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADA... | 0 |
sample_26_60.ps1 | #
# Module manifest for module 'OCI.PSModules.Workrequests'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Workrequests.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditi... | 0 |
VMWare Quick Migration_4.ps1 | #########################################
#Name: VMWare Quick Migration Function
#Author: Justin Grote <jgrote NOSPAMAT enpointe DOT com>
#Credit: Inspired by Mike DiPetrillo's Quick Migration Script: http://www.mikedipetrillo.com/mikedvirtualization/2008/10/quick-migration-for-vmware-the-power-of-powershell.html
#... | 0 |
sample_36_19.ps1 | Set-StrictMode -Version 2.0
$verbosePreference = "SilentlyContinue"
$warningPreference = 'Continue'
$errorActionPreference = 'Stop'
if (!([environment]::Is64BitProcess)) {
throw "BusinessCentralDevelopmentHelper cannot run in Windows PowerShell (x86), need 64bit mode"
}
$currentPrincipal = New-Object Sec... | 0 |
PurgeFile script..ps1 | <#
.SYNOPSIS
Purgefiles - recursively remove files with given extension and maximum age from a given path.
.DESCRIPTION
Read the synopsis
Example
PurgeFiles.psq -path C:\\temp -ext .tmp -max 24
.EXAMPLE
PurgeFiles.psq -path C:\\temp -ext .tmp -max 24
#>
# HISTORY
# 2010/01/29
# rluiten Created
pa... | 0 |
sample_23_36.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 = '75.1.0'
# Sup... | 0 |
3675.ps1 |
function Test-SetGetManagedInstanceEncryptionProtectorCI
{
$params = Get-SqlServerKeyVaultKeyTestEnvironmentParameters
$managedInstance = Get-ManagedInstanceForTdeTest $params
$mangedInstanceRg = $managedInstance.ResourceGroupName
$managedInstanceName = $managedInstance.ManagedInstanceName
$encry... | 0 |
sample_45_4.ps1 | #
# Module manifest for module 'OCI.PSModules.Secrets'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Secrets.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Compat... | 0 |
sample_21_68.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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.