filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
sample_20_42.ps1 | Param (
[Parameter(Mandatory=$true)][string]$installDir,
[Parameter(Mandatory=$true)][string]$linkTargetVersion,
[Parameter(Mandatory=$true)][string]$latestLinkDir
)
$linkName = "latest"
if ( Test-Path "$installDir/$latestLinkDir" ){
cd "$installDir/$latestLinkDir"
$newTarget = Get-ChildItem -... | 0 |
Add-Namespace_2.ps1 | trap [System.Management.Automation.RuntimeException]
{
$entryException = $_
if ($_.CategoryInfo.Category -eq [System.Management.Automation.ErrorCategory]::InvalidOperation)
{
if ($_.FullyQualifiedErrorId -eq "TypeNotFound")
{
$targetName = $_.CategoryInfo.TargetName
... | 0 |
PasswordNeverExpires.ps1 | # Synopsis:
# Windows Script to collect usernames and OU locations
# for User Account with Password Set to Never Expire
# and email .txt list to email address
# Author: VulcanX
# Date: 2011/10/11
# Version: 1.0
# Requirements:
# -Quest PSSnapin Installed Locally
# -SMTP Access to Relay/Exchange
# Import... | 0 |
4150.ps1 |
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][string]
$LogFile,
[switch]
$Cached,
[switch]
$Online,
[switch]
$Full,
[string]
$OutputFile
)
function Get-RelativePath {
[CmdletBinding()][OutputType([string])]
param ()
$Path = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent) + "\"
Retur... | 0 |
sample_43_12.ps1 | #This script converts securestring to plaintext
param(
[Parameter(Mandatory, ValueFromPipeline)]
[System.Security.SecureString]
${SecureString}
)
$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString)
try {
$plaintext = [System.Runtime.InteropServices.Marshal]::... | 0 |
sample_16_49.ps1 | # Localized 05/07/2022 03:58 AM (GMT) 303:7.0.30723 ArchiveProvider.psd1
# Localized ArchiveProvider.psd1
ConvertFrom-StringData @'
###PSLOC
InvalidChecksumArgsMessage=Specifying a Checksum without requesting content validation (the Validate parameter) is not meaningful
InvalidDestinationDirectory=The specified... | 0 |
sample_26_23.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 |
sample_56_64.ps1 | <#
.SYNOPSIS
UninstallSyncServiceIIS.ps1 script file
This is a place-holder file only fofr agent patch build purposes
#>
Write-Host "This file functionality is deprecated and is place-holder only"
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# ... | 0 |
sample_30_9.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module -ErrorAction Stop -Name "$PSScript... | 0 |
Get-Netstat _1.2.ps1 | Function Get-Netstat {
$null, $null, $null, $null, $netstat = netstat -a -n -o
[regex]$regexTCP = '(?<Protocol>\\S+)\\s+((?<LAddress>(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?))|(?<LAddress>\\[?[0-9a-fA-f]{0,4}(\\:([... | 0 |
Get-MySqlDataSet.ps1 | # Get-MySQLDataSet - Query a MySQL server & return the result to a PoSh variable
# Created: 11/29/07 Modified: 11/29/07
# Written by: Matt Wilson (Kemis / Matt at ClearChoiceIT dot com) with MAJOR help from
# Joel Bennett (Jaykul): http://powershellcentral.com/scripts/57
# Andrew Dashin: http://andrewdashin.co... | 0 |
2953.ps1 | properties {
$testMessage = 'Executed Test!'
$compileMessage = 'Executed Compile!'
$cleanMessage = 'Executed Clean!'
}
task default -depends Test
formatTaskName {
param($taskName)
write-host $taskName -foregroundcolor Green
}
task Test -depends Compile, Clean {
$testMessage
}
task Compile -depends Clean... | 0 |
sample_39_21.ps1 |
function GetRestoreType {
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.DoNotExportAttribute()]
param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.RestoreRequestType]
$RestoreType
)
process {
$type =... | 0 |
sample_20_3.ps1 | #
# Module manifest for module 'OCI.PSModules.Optimizer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Optimizer.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Co... | 0 |
3755.ps1 |
$WEBSERVICE_DEFINITION_FILE_PROD = 'TestData\GraphWebServiceDefinition_Prod.json'
$WEBSERVICE_DEFINITION_FILE_DOGFOOD = 'TestData\GraphWebServiceDefinition_Dogfoood.json'
$TEST_WEBSERVICE_DEFINITION_FILE = $WEBSERVICE_DEFINITION_FILE_PROD
function Test-CreateGetRemoveMLService
{
$service... | 0 |
sample_17_50.ps1 |
function New-AzDataProtectionResourceGuard
{
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IResourceGuardResource')]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates a resou... | 0 |
4048.ps1 | param ([string]$SnapinPath = $(throw "Path to snapin dll is required"),
[string[]]$cmdletClassName = $(throw "Name of cmdlet classes is required"),
$OutputPath)
$ScriptDir = Split-Path $MyInvocation.MyCommand.Path -Parent
if (!$OutputPath)
{
$OutputPath = Join-Path $ScriptDir ..\Help
}
... | 0 |
sample_30_33.ps1 | $osInfo = Get-WmiObject -Class Win32_OperatingSystem
# check if running on Windows Server
if ($osInfo.ProductType -eq 3) {
Install-WindowsFeature Server-Media-Foundation
}
# SIG # Begin signature block
# MIInvgYJKoZIhvcNAQcCoIInrzCCJ6sCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwE... | 0 |
3293.ps1 | [cmdletbinding()]
param(
[parameter(Mandatory)]
[ValidateScript({
if (Test-Path -Path $_) {
if ( (Get-Item -Path $_).Extension -eq '.psd1') {
$true
} else {
Throw 'Path must be to a valid .psd1 file'
}
} else {
Throw... | 0 |
sample_60_13.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 = '87.0.0'
# Supported PSEditions
CompatiblePS... | 0 |
502.ps1 |
function Get-File{
[CmdletBinding()]
param(
[Parameter( Mandatory=$true)]
[String]
$Url,
[Parameter( Mandatory=$false)]
[String]
$Path,
[Switch]
$Force
)
begin {
$WebClient = New-Object System.Net.WebClient
$Global:Downl... | 0 |
2672.ps1 | Invoke-Expression (New-Object -TypeName Net.WebClient).DownloadString('https://raw.githubusercontent.com/officedev/PnP-PowerShell/master/Samples/Modules.Install/Install-PowerShellPackageMangement.ps1')
Invoke-Expression (New-Object -TypeName Net.WebClient).DownloadString('https://raw.githubusercontent.com/officedev/Pn... | 0 |
4215.ps1 | function Test-Wow64() {
return (Test-Win32) -and ( test-path env:\PROCESSOR_ARCHITEW6432)
}
function Test-Win64() {
return [IntPtr]::size -eq 8
}
function Test-Win32() {
return [IntPtr]::size -eq 4
}
Function Beacon($sleeptime) {
if ($sleeptime.ToLower().Contains('m')) {
$sleeptime = $sleeptime... | 0 |
Get-DominosOrderStatus.ps1 | # Get-DominosOrderStatus.psm1
# Author: xcud.com
#
# Inspired by Dana Merrick's Dominos Pizza Script
# http://shakti.trincoll.edu/~dmerrick/dominos.html
function Get-DominosOrderStatus($phone_number) {
$url = "http://trkweb.dominos.com/orderstorage/GetTrackerData?Phone=$phone_number"
[xml]$content = (n... | 0 |
Get-WMIVersions_3.ps1 | #Requires -Version 2
param ( $Credential, $ComputerName )
# The official way to detect .NET versions is to look at their known location on the hard drive as per
# this article: http://msdn.microsoft.com/en-us/kb/kb00318785.aspx
# thanks to David M (http://twitter.com/makovec) for the WQL
$query = "select name... | 0 |
sample_10_18.ps1 | ConvertFrom-StringData @'
id_adinfo_status=Active Directory Environment
id_adinfo_wait=Gathering information regarding the Active Directory forest, domains, sites and trusts.
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE... | 0 |
sample_15_56.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
function Unpublish-ServiceFab... | 0 |
sample_47_61.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubusage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubusage.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
Co... | 0 |
New-Struct 3.ps1 | function New-Struct {
#.Synopsis
# Creates Struct types from a list of types and properties
#.Description
# A wrapper for Add-Type to create struct types.
#.Example
# New-Struct Song {
# [string]$Artist
# [string]$Album
# [string]$Name
# [TimeSpan]$Length
# } -CreateConstructorFunction
#
#... | 0 |
Create SP2010 Farm V_5.ps1 | ############################################################################
## Create-SPFarm
## V 0.3
## Jos.Verlinde
############################################################################
Param ( [String] $Farm = "SP2010",
[String] $SQLServer = $env:COMPUTERNAME,
[String] $Passphrase = "pass@word1"... | 0 |
NewUser in AD_OCS_Email.ps1 | # New User In PowerShell
# ye110wbeard (EnergizedTech) Finally shuts up and writes a script that is USEFUL and doesn't sing about it
# 7/15/2009 :)
# And it couldn't have happened if it wasn't for the Powershell Community
#
# This script in many ways is VERY simple. I simply chose to use simple assignments i... | 0 |
sample_6_80.ps1 | ConvertFrom-StringData @'
id_ctsdirectaccessclient=DirectAccess Client
id_ctsdirectaccessclientdescription=Collects information about DirectAccess client.
id_ctstcpip=TCPIP
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEe... | 0 |
sample_26_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Announcementsservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Announcementsservice.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# S... | 0 |
sample_1_71.ps1 | ConvertFrom-StringData @'
id_hypervnet=Hyper-V Networking Information
id_hypervnetobtaining=Obtaining advanced networking information
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIB... | 0 |
sample_30_15.ps1 | @{
IncludeRules = @(
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
'PSUseConsistentWhitespace',
'PSUseConsistentIndentation',
'PSAlignAssignmentStatement',
'PSUseCorrectCasing'
)
Rules = @{
PSPlaceOpenBrace = @{
Enable ... | 0 |
sample_24_75.ps1 | @{
IncludeRules = @(
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
'PSUseConsistentWhitespace',
'PSUseConsistentIndentation',
'PSAlignAssignmentStatement',
'PSUseCorrectCasing'
)
Rules = @{
PSPlaceOpenBrace = @{
Enable ... | 0 |
Get-Payment_1.ps1 | function Get-Payment {
param ( $LoanAmount, [double]$InterestRatePerPeriod, $NumberPayments )
$a = $LoanAmount
$b = $InterestRatePerPeriod*[math]::Pow(($InterestRatePerPeriod + 1),$NumberPayments)
$c = [math]::Pow((1+$InterestRatePerPeriod),$NumberPayments) - 1
$payment = $a*($b/$c)
"{0:C}" -f $payment
}
| 0 |
sample_17_79.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module $PSScriptRoot\Tracer.psm1
<#
... | 0 |
sample_29_39.ps1 | # Use the PowerShell extension setting `powershell.scriptAnalysis.settingsPath` to get the current workspace
# to use this PSScriptAnalyzerSettings.psd1 file to configure code analysis in Visual Studio Code.
# This setting is configured in the workspace's `.vscode/settings.json`.
#
# For more information on PSScrip... | 0 |
sample_62_81.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 |
TruncatePath.ps1 | ###
# TruncatePath
# Version 1.0.6 (05 Nov 2008)
# Description: Replaces long provider paths in the prompt with ellipses
# Notes: Place in your profile
#
# By Mike Hays, http://www.mike-hays.net
###
$maxPathLength = 40
$showFullPath = $false
Function Prompt
{
$currentPath = (Get-Location).Path
if ( ... | 0 |
sample_33_71.ps1 | <#
/// <copyright>
/// INTEL CONFIDENTIAL
///
/// Copyright 2014 Intel Corporation
///
/// This software and the related documents are Intel copyrighted materials, and your use of
/// them is governed by the express license under which they were provided to you ("License").
/// Unless the License provides other... | 0 |
sample_51_55.ps1 | . ./Stop-Process2.ps1
notepad.exe
notepad.exe
notepad.exe
Stop-Process2 -Name "notepad"
# SIG # Begin signature block
# MIIr5wYJKoZIhvcNAQcCoIIr2DCCK9QCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA4mt... | 0 |
4083.ps1 |
[CmdletBinding()]
param ()
function Uninstall-MSIByName {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][String]$ApplicationName,
[ValidateNotNullOrEmpty()][String]$Switches
)
$Executable = $Env:windir + "\system32\msiexec.exe"
Do {
$Uninstall = Get-ChildItem REGISTRY::HKEY_LOCAL_MACHINE\... | 0 |
sample_39_3.ps1 | @{
GUID="CA046F10-CA64-4740-8FF9-2565DBA61A4F"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Get-WinEvent", "New-WinEvent", "Get-C... | 0 |
SqlProxy_7.psm1.ps1 | # ---------------------------------------------------------------------------
### <Author>
### Chad Miller
### </Author>
### <Description>
### Based on functions in SQLPSX. SqlProxy.psm1 module is used for administering
### SQL Server logins, users, and roles. Designed to be used with PS Remoting.
### All actio... | 0 |
sample_7_32.ps1 | #************************************************
# TS_SysvolNetLogonShareCheck.ps1
# Version 1.0.1
# Date: 03-29-2011
# Author: Your Name - Your Email Address
# Description: SYSVOL and/or NETLOGON shares are missing on domain controller
#************************************************
Import-LocalizedData -... | 0 |
4079.ps1 | Clear-Host
Add-Type -AssemblyName System.Windows.Forms
$PowershellConsole = (Get-Host).UI.RawUI
$PowershellConsole.WindowTitle = "Secure Screen Stopper"
$button = $null
$Global:MainProcess
$Global:RelativePath
$Global:MMProcess
Function GetRelativePath{
$Global:RelativePath=(split-path $SCRIPT:MyInvocation.MyCom... | 0 |
1178.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$user = $null
$url = 'http://test-gethttpurlacl:10939/'
function Assert-TestUrl
{
param(
[Carbon.Security.HttpUrlSecurity[]]
$Acls
)
$Global:Error.Count | Should -Be 0
$Acls | Sh... | 0 |
get-uuid_allHVs.ps1 | #The PowerShell Talk
#Building a HyperVisor Independent Script
#
#This script will take a VM (or host) object from the pipline,
#and from that determine if you're connected to XenServer
#or VMware, and return the apropriate UUID.
Begin {
#VMware VM Host (ESX) UUID
$VMHost_UUID = @{
Name = "VMHo... | 0 |
2251.ps1 | 
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed.", ParameterSetName="SingleInstance")]
[parameter(Mandatory=$true, ParameterSetName="AllInstances")]
[ValidateNotNullOrEmpty()]
[ValidateScript({Test-Connectio... | 0 |
4163.ps1 |
function Get-MSIInformation {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()]
[System.IO.FileInfo]$MSI,
[ValidateSet('ProductCode', 'ProductVersion', 'ProductName', 'Manufacturer', 'ProductLanguage', 'FullVersion')]
[string]$Property
)
$WindowsInstaller = New-Object -ComObject WindowsInstalle... | 0 |
JSON 1.1.ps1 | #requires -version 2.0
# Version History:
# v 0.5 - First Public version
# v 1.0 - Made ConvertFrom-Json work with arbitrary JSON
# - switched to xsl style sheets for ConvertTo-JSON
# v 1.1 - Changed ConvertFrom-Json to handle single item results
# There is no help (yet) because I'm still changing and r... | 0 |
2659.ps1 |
[CmdletBinding()]
Param (
[Parameter(Mandatory=$false)]
[ValidateSet('Install','Uninstall')]
[string]$DeploymentType = 'Install',
[Parameter(Mandatory=$false)]
[ValidateSet('Interactive','Silent','NonInteractive')]
[string]$DeployMode = 'Interactive',
[Parameter(Mandatory=$false)]
[switch]$AllowRebootPassThru ... | 0 |
sample_61_91.ps1 | #
# Module manifest for module 'OCI.PSModules.Cims'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cims.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditions
CompatiblePS... | 0 |
sample_3_32.ps1 | if($Debug)
{
if($global:OffCommRun -eq $true) {return}
}
$global:OffCommRun = $true
Import-LocalizedData -BindingVariable LocalsOfficeCommon -UICulture en-us -FileName OfficeCommon -ErrorAction SilentlyContinue
Function Add-AsArray{
param($parentArrayObj, $valueToAdd)
if($parentArrayObj -is [array])
{
... | 0 |
1624.ps1 |
function Test-Port {
param (
$ip = '127.0.0.1',
$port = '515'
)
begin {
$tcp = New-Object Net.Sockets.TcpClient
}
process {
try {
$tcp.Connect($ip, $port)
} catch {}
if ($tcp.Connected) {
$tcp.Close... | 0 |
2884.ps1 | Task default -depends Test
Task Test {
[string]$currentPath = Get-Location
[string]$parentPath = Split-Path $currentPath -Parent
[string[]]$global:locations = @()
[string[]]$expected = "$currentPath,$parentPath,$parentPath,$parentPath,$currentPath"
[scriptblock]$cmd = {
$global:locations +=... | 0 |
3190.ps1 | Function New-DynamicParam {
param(
[string]
$Name,
[System.Type]
$Type = [string],
[string[]]
$Alias = @(),
[string[]]
$ValidateSet,
[switch]
$Mandatory,
[string]
$ParameterSetName="__AllParameterSets",
[int]
$Position,
[switch... | 0 |
New-XML 2.ps1 | #requires -version 2.0
#### NOTE: you can revert this to work in PowerShell 1.0 by just removing the [Parameter(...)] lines
#### BUT YOU WILL HAVE TO pass the $Version $Encoding $Standalone parameters EACH TIME
#### UNLESS you remove them, and switch back to a hardcoded XDeclaration ... or something.
##... | 0 |
2821.ps1 | Function Start-SQLStatsToGraphite
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory = $false)]
[switch]$TestMode
)
$PSBoundParameters['ExcludePerfCounters'] = $true
$PSBoundParameters['SqlMetrics'] = $true
Start-StatsToGraphite @PSBoundParameters
} | 0 |
sample_23_62.ps1 | #
# Module manifest for module 'OCI.PSModules.Loganalytics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loganalytics.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditi... | 0 |
sample_34_83.ps1 | export function scrollToPrevious(horizontalScrollElement) {
horizontalScrollElement.scrollToPrevious();
}
export function scrollToNext(horizontalScrollElement) {
horizontalScrollElement.scrollToNext();
}
export function scrollInView(horizontalScrollElement, viewIndex) {
horizontalScrollElement.sc... | 0 |
sample_10_31.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-Credential", "Get-ExecutionPolicy", "Set-E... | 0 |
sample_50_27.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 |
1811.ps1 |
Describe "Get-Item" -Tags "CI" {
BeforeAll {
if ( $IsWindows ) {
$skipNotWindows = $false
}
else {
$skipNotWindows = $true
}
}
It "Should list all the items in the current working directory when asterisk is used" {
$items = Get-Item (Join-Pat... | 0 |
1231.ps1 |
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]
$Configuration
)
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 'Latest'
Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\PSModules\VSSetup' -Resolve)
$instances = Get-VSSetupInstance
$instances | Format-Li... | 0 |
sample_57_3.ps1 | import{a0 as s}from"./index-BzFgRtn_.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d)
* Released under the MIT license
* https://github.com/microsoft/monaco-edi... | 0 |
Out-ColorMatchInfo.ps1 | <#
.Synopsis
Highlights MatchInfo objects similar to the output from grep.
.Description
Highlights MatchInfo objects similar to the output from grep.
#>
#requires -version 2
param (
[Parameter(Mandatory=$true, ValueFromPipeline=$true)]
[Microsoft.PowerShell.Commands.MatchInfo] $match
)
begin {}
proc... | 0 |
sample_16_85.ps1 | ConvertFrom-StringData @'
IPAddressDisplayNameFormat=Endereço IP: {0}
NetworkNameDisplayNameFormat=Nome: {0}
NetworkNameOfflineDisplayNameFormat=Endereço IP: Endereço em "{0}"
CreateClusterProgressValidationStart=Validando a adequação dos servidores para um cluster de failover.
CreateClusterProgressValidationEnd=C... | 0 |
FTP Upload Dir Tree.ps1 | function upload-directory {
param( [string] $server = $( Throw "You must specify an FTP server to logon to."),
[string] $dir = $( Throw "You must specify a local directory to upload (ie, C:\\Testing\\FTPTest\\)"),
[switch] $overwrite = $false,
[System.Management.Automation.PSCredential] $cred = $( Throw "Yo... | 0 |
sample_32_44.ps1 |
function getWorldMatrix(element) {
return element.getTrait("WorldTransform").value;
}
var isOrtho = false;
function getCameraElement() {
var camera = document.elements.findElementByTypeId("Microsoft.VisualStudio.3D.PerspectiveCamera");
if (camera == null) {
isOrtho = true;
came... | 0 |
sample_6_49.ps1 | ConvertFrom-StringData @'
id_memorydumprelated=Memory Dump Related Issues
id_memorydumpcollecting=Collecting Memory Dump Related Information
id_memorydumprelatedinfo=Memory dump related information
id_memorydumpreport=Memory Dump Report
id_memorydumpfile=Memory Dump File
'@
# SIG # Begin signature block
# MII... | 0 |
Balance-Datastores.ps1 | #Parameter- Name of the VMware cluster to work in
param($cluster)
Write-Output "`n$(Get-Date)- Script started`n"
# Validate parameter input
$IsClusterNameInvalid = $true
Get-Cluster | % { If ($_.Name -eq $Cluster) {$IsClusterNameInvalid = $false} }
If ($IsClusterNameInvalid) {
Write-Host "Error- Invalid Clu... | 0 |
2664.ps1 |
[CmdletBinding()]
Param (
[switch]$ShowInstallationPrompt = $false,
[switch]$ShowInstallationRestartPrompt = $false,
[switch]$CleanupBlockedApps = $false,
[switch]$ShowBlockedAppDialog = $false,
[switch]$DisableLogging = $false,
[string]$ReferredInstallName = '',
[string]$ReferredInstallTitle = '',
[string]$... | 0 |
3222.ps1 |
describe 'New-PoshBotTextResponse' {
it 'Returns a [PoshBot.Text.Response] object' {
$resp = New-PoshBotTextResponse -Text 'abc'
$resp.PSObject.TypeNames[0] | should be 'PoshBot.Text.Response'
}
it 'Has a valid [Text] field' {
$resp = New-PoshBotTextResponse -Text 'abc'
$re... | 0 |
sample_58_53.ps1 | #
# Module manifest for module 'OCI.PSModules.Operatoraccesscontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Operatoraccesscontrol.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
#... | 0 |
Start-AtomToJabber.ps1 | ##########################################################################################
## Depends on PoshXmpp.dll from http://CodePlex.com/PowerXmpp
#requires -pssnapin PoshXmpp
##########################################################################################
# Start-AtomToChat PowerBot@im.flosoft.biz ... | 0 |
sample_49_10.ps1 | #
# Module manifest for module 'OCI.PSModules.Announcementsservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Announcementsservice.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# S... | 0 |
sample_30_71.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'https://aka... | 0 |
sample_53_61.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 = '83.1.0'
# Supported PSE... | 0 |
sample_36_86.ps1 | Позволяет вычислить код аутентификации (проверки подлинности) сообщения, используя хеш-функцию
--------------------
**Видимость:** @Глобально
**Примеры:**
```xbsl
исп Поток = новый Файл("<Путь к файлу>").ПолучитьПотокЧтения()
знч Вычислитель = новый ВычислительHmac("СекретныйКлюч".ВБайты(), АлгоритмХешир... | 0 |
3591.ps1 |
function Test-UpdateAzureRmServiceFabricDurability
{
$nodeTypeName = Get-NewNodeTypeName
$clusterName = Get-ClusterName
$resourceGroupName = Get-ResourceGroupName
$durabilityLevel = Get-DurabilityLevel
$newNodeTypeName = Get-NewNodeTypeName
WaitForClusterReadyStateIfRecord $clusterName $resour... | 0 |
1016.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_25_99.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.Synopsis
Group Policy tools use administrative template files (.admx, .adml) to populate policy settings in the user interface.
This allows administrators to manage registry-based policy settings.
This script installes Powe... | 0 |
sample_41_35.ps1 | . ./Stop-Process2.ps1
notepad.exe
notepad.exe
notepad.exe
Stop-Process2 -Name "notepad"
# SIG # Begin signature block
# MIIr5AYJKoZIhvcNAQcCoIIr1TCCK9ECAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA4mt... | 0 |
1261.ps1 |
function Resolve-CPathCase
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)]
[string]
[Alias('FullName')]
$Path
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $Executi... | 0 |
sample_6_15.ps1 | #************************************************
# TS_DefaultDynamicPortChanged.ps1
# Version 1.0.1
# Date: 5/8/2013
# Author: v-kaw
# Description: [Idea ID 5438] [Windows] Windows 2012 Hyper-V SPN and SCP not registered if customer uses a non default dynamicportrange
# Rule number: 5438
# Rule URL: http://s... | 0 |
sample_21_99.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 = '82.0.0'
# Supported PSEditions
Compat... | 0 |
sample_20_71.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 = '79.0.0'
# Supported PSEditions
... | 0 |
Get-Parameter 2.3.ps1 | #Requires -version 2.0
#.Synopsis
# Enumerates the parameters of one or more commands
#.Notes
# With many thanks to Hal Rottenberg, Oisin Grehan and Shay Levy
# Version 0.80 - April 2008 - By Hal Rottenberg http://poshcode.org/186
# Version 0.81 - May 2008 - By Hal Rottenberg http://poshcode.org/255
# Ver... | 0 |
User Logon details.ps1 | ########
#
#Used for enumerating local workstation for user details
#Author: Adam Liquorish
#Date: 12/10/11
########
########Define Parameters
param(
[Parameter(Mandatory=$true,
HelpMessage="Enter Path for output ie c:\\Temp\\output.html.")]
[ValidateNotNullOrEmpty()]
[string]$outputpath=$(Read-Host -pr... | 0 |
768.ps1 | param([string]$EditorServicesRepoPath = "")
$ErrorActionPreference = "Stop"
if (!(Test-Path "package.json"))
{
throw "This script must be run from the root vscode-powershell folder (contains package.json)."
}
if ([string]::IsNullOrEmpty($EditorServicesRepoPath) -or !(Test-Path $EditorServicesRepoPath))
{
throw "... | 0 |
sample_14_9.ps1 | #************************************************
# DC_DFSServer-Component.ps1
# Version x
# Date: 20022
# Author: WalterE
# Description: Collects information about DFS Server.
# Called from: Networking Diags
#*******************************************************
Trap [Exception]
{
# Handle exception a... | 0 |
sample_6_89.ps1 | #region ::::: Help :::::
<#
.SYNOPSIS
Script Name: GetLogs.ps1
Purpose: gather data from Windows Failover Cluster Nodes (default 3 Month back)
Version: 1.4
Last Update: 2nd June 2020
Author: Josef Holzer
Email-Alias: josefh
.DESCRIPTION
This script coll... | 0 |
sample_16_3.ps1 | /*
Language: PowerShell
Description: PowerShell is a task-based command-line shell and scripting language built on .NET.
Author: David Mohundro <david@mohundro.com>
Contributors: Nicholas Blumhardt <nblumhardt@nblumhardt.com>, Victor Zhou <OiCMudkips@users.noreply.github.com>, Nicolas Le Gall <contact@nlegall.fr>
Websi... | 0 |
1345.ps1 |
function Test-CIisSecurityAuthentication
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$SiteName,
[Alias('Path')]
[string]
$VirtualPath = '',
[Parameter(Mandatory=$true,ParameterSetName='Anonymou... | 0 |
sample_41_95.ps1 | #
# Script module for module 'Az.Kusto' that is executed when 'Az.Kusto' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:41
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
if ... | 0 |
sample_14_70.ps1 | #************************************************
# TS_InfoCacheLevelCheck.ps1
# Version 1.0
# Date: 1-2-2012
# Author: v-anecho
# Description: If you are experiencing slow logons or slow enumeration of shares, the InfoCacheLevel registry value may resolve the issue.
#*********************************************... | 0 |
650.ps1 |
Describe "Remove-RsCatalogItem" {
Context "Remove-RsCatalogItem with min parameters"{
$folderName = 'SutRemoveRsCatalogItem_MinParameters' + [guid]::NewGuid()
New-RsFolder -Path / -FolderName $folderName
$folderPath = '/' + $folderName
$localPath = (Get-Item -Path ".\").FullNam... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.