filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
sample_58_38.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_13_22.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 |
622.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://sourceforge.net/projects/cpuminer/files/pooler-cpuminer-2.3.3-win64.zip"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs | ForEach-Object{
try{
... | 0 |
sample_11_9.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerinstances'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerinstances.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Suppo... | 0 |
3655.ps1 |
$instanceLocation = "eastus"
function Test-CreateManagedInstance
{
$rg = Create-ResourceGroupForTest
$vnetName = "vnet-newprovisioningtest3"
$subnetName = "ManagedInstance"
$managedInstanceName = Get-ManagedInstanceName
$version = "12.0"
$credentials = Get-ServerCredential
$licenseType = "... | 0 |
1531.ps1 | Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
$root = (Resolve-Path $PSScriptRoot\..\..).Path
$outFolder = "$root\out"
Import-Module $outFolder\platyPS -Force
$MyIsLinux = Get-Variable -Name IsLinux -ValueOnly -ErrorAction SilentlyContinue
$MyIsMacOS = Get-Variable -Name IsMacOS -ValueOnly -ErrorActi... | 0 |
sample_4_14.ps1 | #************************************************
# TS_Win7PrintUpdateRollupCheck.ps1
# Version 1.0.1
# Date: 6/8/2012
# Author: v-alyao
# Description: [Idea ID 4168] [Windows] Check for existence of 2647753 for printing issues
# Rule number: 4168
# Rule URL: http://sharepoint/sites/rules/Rule Submissions/Fo... | 0 |
899.ps1 | $appdirectory="<Replace with your app directory>"
$webappname="mywebapp$(Get-Random)"
$location="West Europe"
New-AzResourceGroup -Name myResourceGroup -Location $location
New-AzAppServicePlan -Name $webappname -Location $location `
-ResourceGroupName myResourceGroup -Tier Free
New-AzWebApp -Name $webappname -Loc... | 0 |
2414.ps1 |
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]$Name,
[Parameter(Mandatory)]
[string]$Manufacturer,
[Parameter(Mandatory)]
[ValidatePattern('[-+]?([0-9]*\.[0-9]+|[0-9]+)')]
[string]$SoftwareVersion,
[Parameter()]
[string]$Owner = 'Adam Bertram',
[Parameter()]
[string]$SupportContact = 'Adam Bertra... | 0 |
2541.ps1 |
Param
(
[parameter(Mandatory=$true, Position=0, HelpMessage="Define valdation type: All, Domain, Zone, ZoneAging, ZoneDelegation, Forwarder, RootHints")]
[Alias("Type")]
[String[]] $ValidationType,
[parameter(Mandatory=$false, Position=1, HelpMessage="Full path of cache files.")]
... | 0 |
3882.ps1 |
function Test-WorkspaceCreateUpdateDelete
{
$wsname = Get-ResourceName
$rgname = Get-ResourceGroupName
$wslocation = Get-ProviderLocation
New-AzResourceGroup -Name $rgname -Location $wslocation -Force
$workspace = New-AzOperationalInsightsWorkspace -ResourceGroupName $rgname -N... | 0 |
sample_51_52.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.MonitorWorkspace.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.MonitorWorkspace.internal.psm1'
if(Test-Path $internalModul... | 0 |
2109.ps1 |
Describe 'Test for cmdlet to support Ordered Attribute on hash literal nodes' -Tags "CI" {
BeforeAll {
If (-not $IsCoreCLR) {
Get-WmiObject -Query "select * from win32_environment where name='TestWmiInstance'" | Remove-WmiObject
}
}
AfterAll {
If (-not $IsCoreCLR) {
... | 0 |
sample_23_30.ps1 | #
# Module manifest for module 'OCI.PSModules.Nosql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Nosql.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Compatible... | 0 |
Interact with in-VM UI.ps1 | # First, start asynchronous tools update. We need to do it in a separate process
# because the update is a beta version which contains unsigned drivers and will
# be blocked by Windows' driver confirmation prompt
$updateScript = "
Add-PSSnapin VMware.VimAutomation*
Connect-VIServer $DefaultVIServer
Get-VM 'OldVMT... | 0 |
1305.ps1 |
function Add-CGroupMember
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[Parameter(Mandatory=$true)]
[string[]]
[Alias('Members')]
$Member
)
Set-StrictMode -Version 'L... | 0 |
sample_34_39.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"
... | 0 |
2189.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=$true, HelpMess... | 0 |
sample_28_72.ps1 | [CmdletBinding()]
param
(
[Parameter(ParameterSetName="BackInTime")]
[system.int32]$DaysSince = 1,
[Parameter(ParameterSetName="DateRange")]
[DateTime]$StartDate,
[Parameter(ParameterSetName="DateRange")]
[DateTime]$EndDate
)
$ARM_NS_API_Regex = "(?mi)(?<path>(?<apipath>(?<NS... | 0 |
2555.ps1 |
function invoke-sql
{
param(
[Parameter(Mandatory = $True)]
[string]$Query,
[Parameter(Mandatory = $True)]
[string]$DBName,
[Parameter(Mandatory = $True)]
[string]$DBServerName
)
$QueryTimeout = 36000
$ConnectionTimeout = 36000
$conn = New-Object System.Data.SqlClient.SQLCo... | 0 |
3189.ps1 | function Get-ADMigratedSourceObject {
[cmdletbinding()]
param(
[Parameter( Position=0,
Mandatory = $true,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
ParameterSetName='SAM')]
[string[]]$samA... | 0 |
2766.ps1 |
ForEach ($NameSpace in "root\subscription","root\default") { get-wmiobject -namespace $NameSpace -query "select * from __EventConsumer" }
| 0 |
sample_49_68.ps1 | # WARNING: this need to be set by the getExtVersion
$env:TEST_EXTENSION_VERSION = "2.4.0"
# 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 |
3031.ps1 | function Should-FileContentMatchExactly($ActualValue, $ExpectedContent, [switch] $Negate, [String] $Because) {
$succeeded = (@(& $SafeCommands['Get-Content'] -Encoding UTF8 $ActualValue) -cmatch $ExpectedContent).Count -gt 0
if ($Negate) {
$succeeded = -not $succeeded
}
$failureMessage = ... | 0 |
Get-LeaderBoard_2.ps1 | <#
.SYNOPSIS
Pulls down the leaderboards for the 2011 Scripting Games
.DESCRIPTION
Quick and dirty script to pull down the leaderboards for the 2011 scripting games.
Can choose either beginner or advanced via a command line switch. To see the output
in a table, you must pipe to "format-table -autosi... | 0 |
2789.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(Protocol,
substr(ForeignAddress, 0, last_index_of(ForeignAddress, '.')),
State,
Component,
Process) as Cnt,
Protocol,
substr(ForeignAddress, 0, last_index_of(ForeignAddress, '.')) as IP/24,
... | 0 |
sample_18_13.ps1 | param([int]$Count=50, [int]$DelayMilliseconds=200)
function Write-Item($itemCount) {
$i = 1
while ($i -le $itemCount) {
$str = "Output $i"
Write-Output $str
# In the gutter on the left, right click and select "Add Conditional Breakpoint"
# on the next line. Use the c... | 0 |
WhoIs.ps1 | param([String] $DomainName = '192.168.0.1')
$socket = New-Object System.Net.Sockets.Socket ([System.Net.Sockets.AddressFamily]::InterNetwork, [System.Net.Sockets.SocketType]::Stream, [System.Net.Sockets.ProtocolType]::Tcp)
$Socket.Connect('whois.arin.net', 43) | out-null
$bytes = [System.Text.Encoding]::ASCII.GetB... | 0 |
3778.ps1 |
function Test-StorageSync
{
Write-Verbose "RecordMode : $(Get-StorageTestMode)"
Get-Command Invoke-AzStorageSyncCompatibilityCheck
}
| 0 |
sample_39_24.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 = '83.2.0'
# Supported PSEdition... | 0 |
New-Struct_2.ps1 | ## New-Struct
## Creates a Struct class and emits it into memory
## The Struct includes a constructor which takes the parameters in order...
##
## Usage:
## # Assuming you have a csv file with no header and columns: artist,name,length
## New-Struct Song @{
## Artist=[string];
## Name=[string];
... | 0 |
sample_1_60.ps1 | #************************************************
# DC_BitsClient-Component.ps1
# Version 1.0: Created
# Version 1.1.08.13.14: Added collection for "HKLM\Software\Microsoft\Windows\CurrentVersion\BITS", and updated comment section.
# Version 1.2.10.20.14: Added -ErrorAction to correct an exception on some systems.
... | 0 |
Get-OnlineHelp_3.ps1 | #requires -version 2.0
## An update using New-WebServiceProxy to the MSDN ContentService instead of HttpRest
## See: http: //services.msdn.microsoft.com/ContentServices/ContentService.asmx
## YOU MUST SAVE THIS FILE AS Get-OnlineHelp.ps1 in your path, and call it as Get-OnlineHelp
## __OR__ dot-source it -- DO NO... | 0 |
sample_66_43.ps1 | param(
# Folder access path for observability drive
[string]
[parameter(Mandatory=$true)]
$AccessPath,
# Name of subfolder config file to read
[string]
[Parameter(Mandatory=$true)]
$SubFolderConfigFileName
)
$observabilityNugetPath = "$PSScriptRoot\..\.."
Import-Module "$o... | 0 |
sample_14_63.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_58_15.ps1 | #
# Module manifest for module 'OCI.PSModules.Generativeai'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Generativeai.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditi... | 0 |
sample_60_73.ps1 | #
# Module manifest for module 'OCI.PSModules.Limits'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Limits.dll'
# Version number of this module.
ModuleVersion = '90.0.0'
# Supported PSEditions
Compatib... | 0 |
Get Twitter RSS Feed_2.ps1 | param ([String] $ScreenName)
$client = New-Object System.Net.WebClient
$idUrl = "https://api.twitter.com/1/users/show.json?screen_name=$ScreenName"
$data = $client.DownloadString($idUrl)
$start = 0
$findStr = '"id":'
do {
$start = $data.IndexOf($findStr, $start + 1)
if ($start -gt 0) {
$s... | 0 |
PowerOAuth 1.1.ps1 | #requires -Version 2.0
##requires -Module HttpRest -Version 1.2
# http://poshcode.org/1262
Set-StrictMode -Version 2.0
$null = [Reflection.Assembly]::LoadWithPartialName('System.Web')
$safeChars = [char[]]'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~'
function Get-OAuthBase {
#.Synopsis
... | 0 |
4323.ps1 | function New-PSScriptInfoObject
{
[CmdletBinding(PositionalBinding=$false)]
Param
(
[Parameter(Mandatory=$true)]
[string]
$Path
)
$PSScriptInfo = Microsoft.PowerShell.Utility\New-Object PSCustomObject -Property ([ordered]@{})
$script:PSScriptInfoProperties | Microsoft.Po... | 0 |
4363.ps1 | function Log-ArtifactNotFoundInPSGallery
{
[CmdletBinding()]
Param
(
[Parameter()]
[string[]]
$SearchedName,
[Parameter()]
[string[]]
$FoundName,
[Parameter(Mandatory=$true)]
[string]
$operationName
)
if (-not $script:Telemet... | 0 |
Custom Object Factory Te.ps1 | <#
.SYNOPSIS
A template for a function that creates a PSObject
.DESCRIPTION
If you find yourself creating a lot of custom PSObjects with lots of Properties, this template
may help save you some typing. It discovers the function paramters, and uses them to create a hash
that is splatted against a (new-object ps... | 0 |
sample_67_33.ps1 | #
# Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker'
#
# Generated by: Microsoft Corporation
#
# Generated on: 19/01/2022
#
@{
# Script module or binary module file associated with this manifest.
RootModule = ''
# Version number of this module.
ModuleVersion = '1.2100.26... | 0 |
sample_22_80.ps1 | function trySetDesignerProp(tname, ttype, val) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0);
trait.value = val;
// services.debug.trace(tname + "=" + val);
}
if (command.getTrait("state").value == 0) {
command.getTrait("state").value = 2;
trySetDesignerProp("snap",... | 0 |
3067.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Should -BeOfType" {
It "passes if value is of the expected type" {
1 | Should BeOfType Int
2.0 | Should BeOfType ([double])
1 | Should -BeOfType Int
2.0 | Should -BeOfType ([double])
}
... | 0 |
sample_34_45.ps1 | #
# Module manifest for module 'OCI.PSModules.Genericartifactscontent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Genericartifactscontent.dll'
# Version number of this module.
ModuleVersion = '81.0.0... | 0 |
sample_27_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Email'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Email.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
Compatible... | 0 |
sample_17_68.ps1 | ConvertFrom-StringData @'
id_virtualization=Virtualization Information
id_virtualizationobtaining=Obtaining Information about Virtualization Environment
id_virtualizationoutput=Virtualization Information Output
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
... | 0 |
509.ps1 | function Add-DomainUserToLocalGroup{
param(
[Parameter(Mandatory=$true)]
[String]
$Domain,
[Parameter(Mandatory=$true)]
[String]
$User,
[Parameter(Mandatory=$true)]
[String]
$Group,
[Parameter(Mandatory=$true)]
[String]
$Computer,
[Parameter(Mandatory=$false)]
$Credenti... | 0 |
sample_22_90.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module NetSecurity
# Installs the Azur... | 0 |
Invoke-MoveRequest_1.ps1 | ###########################################################################
#
# NAME: Invoke-MoveRequest.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jer@powershell.no
#
# COMMENT: Script to use when migrating mailboxes to Microsoft Exchange Server 2010 Cross-Forest. Prepares user objects already
# moved to... | 0 |
sample_55_97.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.EventGrid.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.EventGrid.Module]::Instance
# Export nothing to clear implicit export... | 0 |
sample_3_46.ps1 | ConvertFrom-StringData @'
id_cts8021xclient=802.1x Client Component
id_cts8021xclientdescription=Collects information about 802.1x client component.
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63J... | 0 |
PowerBot 2.0.ps1 | ## PowerBot 2.0
## A simple framework to get you started writing your own IRC bots in PowerShell
####################################################################################################
## Requires Meebey.SmartIrc4net.dll to be in your ...\\WindowsPowerShell\\Libraries\\
## You can get Meebey.SmartIrc4n... | 0 |
sample_23_84.ps1 | #
# Module manifest for module 'OCI.PSModules.Visualbuilder'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Visualbuilder.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEdi... | 0 |
sample_2_79.ps1 | ########################################### INFO ################################################################
#This script assumes it is being executed from inside a clone of the DSC Service Repo.
#If this is not the case, then relational Paths will break if not adapted
#This script can be executed from inside ... | 0 |
2954.ps1 | properties {
$runTaskA = $false
$taskBSucceded = $true
}
task default -depends TaskC
task TaskA -precondition { $runTaskA -eq $true } {
"TaskA executed"
}
task TaskB -postcondition { $taskBSucceded -eq $true } {
"TaskB executed"
}
task TaskC -depends TaskA,TaskB {
"TaskC executed."
} | 0 |
Test-FileLock.ps1 | filter Test-FileLock {
if ($args[0]) {$filepath = gi $(Resolve-Path $args[0]) -Force} else {$filepath = gi $_.fullname -Force}
if ($filepath.psiscontainer) {return}
$locked = $false
trap {
Set-Variable -name locked -value $true -scope 1
continue
}
$inputStream = New-Objec... | 0 |
New-Shortcut_1.ps1 | #requires -version 2.0
function New-Shortcut {
<#
.SYNOPSIS
Creates a new shortcut (.lnk file) pointing at the specified file.
.DESCRIPTION
The New-Shortcut script creates a shortcut pointing at the target in the location you specify. You may specify the location as a folder path (which must exist), with a n... | 0 |
sample_34_94.ps1 | <#
# .DESCRIPTION
# Download and install MMAAgent & Microsoft Dependency agent
#
#>
$ErrorActionPreference = "Stop"
$isMmaRunning = (Get-Service -Name HealthService -ErrorAction SilentlyContinue).Status -eq 'Running'
$isServiceMapRunning = (Get-Service -Name MicrosoftDependencyAgent -ErrorAction Silentl... | 0 |
VMtoolsUpgrade_1.ps1 | #####################################################################
# TIAA-CREF VMWare Standard Scripts - PowerCLI
#
# Purpose: "Check and upgrade Tools during power cycling"
# Author: David Chung
# Support: IT Infrastructure
# Docs: N/A
#
# Instruction: 1. Create CSV file with list of servers
# ... | 0 |
sample_63_21.ps1 | #
# Module manifest for module 'OCI.PSModules.Integration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Integration.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported PSEdition... | 0 |
sample_28_32.ps1 | #
# Module manifest for module 'OCI.PSModules.Opa'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Opa.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
sample_64_54.ps1 | #
# Module manifest for module 'OCI.PSModules.Loggingingestion'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported... | 0 |
Finding Old or Unused Ac.ps1 | $dcs = [System.DirectoryServices.ActiveDirectory.Domain]::getcurrentdomain().DomainControllers | select name
$startdate = get-date('1/1/1601')
$lst = new-Object System.Collections.ArrayList
foreach ($dc in $dcs) {
$root = [ADSI] LDAP://$($dc.Name):389
$searcher = New-Object System.DirectoryServices.Directory... | 0 |
2125.ps1 |
Describe "Test trap" -Tags "CI" {
Context "Trap with flow control" {
It "Line after exception should NOT be continued when it's from a nested script block" {
$a = . {trap {"trapped"; continue;}; . {"hello"; throw "exception"; "world"}}
$a.Length | Should -Be 2
$a -join... | 0 |
Set-WebConfig_1.ps1 | function Set-WebConfigSqlConnectionString {
param( [switch]$help,
[string]$configfile = $(read-host "Please enter a web.config file to read"),
[string]$connectionString = $(read-host "Please enter a connection string"),
[switch]$backup = $TRUE
)
$usage = "`$conString = `"Data S... | 0 |
1720.ps1 | function Get-ServiceNowTableEntry {
[CmdletBinding(DefaultParameterSetName, SupportsPaging)]
param(
[parameter(mandatory = $true)]
[string]$Table,
[parameter(Mandatory = $false)]
[string]$OrderBy = 'opened_at',
[parameter(Mandatory = $fa... | 0 |
AddTo-HostsFile_2.ps1 | function AddTo-HostsFile{
<#
.DESCRIPTION
This function checks to see if an entry exists in the hosts file.
If it does not, it attempts to add it and verifies the entry.
.EXAMPLE
Networkign.AddTo-Hosts -IPAddress 192.168.0.1 -HostName MyMachine
.EXTERNALHELP
None.
.FORWARDHELPTARGE... | 0 |
Time-Stamp.ps1 | function Time-Stamp
{
return [System.DateTime]::Now.ToString("yyyy.MM.dd hh:mm:ss");
}
New-Alias -Name ts -Value Time-Stamp;
| 0 |
70.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aa... | 0 |
sample_5_22.ps1 | # Rule ID 4878
# ---------
# http://sharepoint/sites/rules/Rule%20Submissions/Dynamics-CRM_crexin_2012-07-17-03-54-15.xml
#
# Description: Checks the GAC for CRM Assemblies and issues a warning if they aren't the same version as the CrmVerServer.dll.
# Related KB: https://vkbexternal.partners.extranet.microso... | 0 |
sample_31_56.ps1 | #!powershell
# Copyright: (c) 2015, Jon Hawkesworth (@jhawkesworth) <jhawkesworth@protonmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.ArgvParser
#Requires -Module Ansible.ModuleUtils.CommandUtil
#Requires -Module Ansible.Mo... | 0 |
LibraryChart_3.ps1 | # ---------------------------------------------------------------------------
### <Script>
### <Author>
### Chad Miller
### </Author>
### <Description>
### Defines functions for wokring with Microsoft Chart Control for .NET 3.5 Framework
### Pipe output of Powershell command to Out-Chart function and specify c... | 0 |
3207.ps1 | Function Get-AzureRmVmPublicIP {
[cmdletbinding()]
param(
[string[]]$ResourceGroupName,
[string[]]$VMName,
[switch]$IncludeObjects,
[switch]$VMStatus
)
foreach($ResourceGroup in $ResourceGroupName)
{
Try
{
$All... | 0 |
Convert-ToMP3.ps1 | param([String] $inputPath, [String] $wildcard, [String] $outputPath = $inputPath
gci -path $inputPath\\$wildcard | % {
$outputFile = Join-Path $outputPath ($_.Name.Replace($_.Extension, '.mp3'))
vlc -I dummy $_.FullName ":sout=#transcode{acodec=mp3,ab=128,channels=6}:standard{access=file,mux=asf,dst=$outpu... | 0 |
4414.ps1 | function Test-ScriptFileInfo {
[CmdletBinding(PositionalBinding = $false,
DefaultParameterSetName = 'PathParameterSet',
HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=619791')]
Param
(
[Parameter(Mandatory = $true,
Position = 0,
ValueFromPipelineByPro... | 0 |
PowerShell Template_1.ps1 | Function New-Script
{
$strName = $env:username
$date = get-date -format d
$name = Read-Host "Filename"
if ($name -eq "") { $name="NewTemplate" }
$email = Read-Host "eMail Address"
if ($email -eq "") { $email="youremail@yourhost.com" }
$file = New-Item -type file "$name.ps1" -force
$template=@"
###############... | 0 |
346.ps1 | function Get-PSFConfigValue
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSPossibleIncorrectComparisonWithNull", "")]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFConfigValue')]
Param (
[Alias('Name')]
[Parameter(Mandatory = $true)]
[string]
$FullName... | 0 |
sample_28_30.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplace'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplace.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEdition... | 0 |
sample_63_85.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 |
4036.ps1 |
function Test-ValidateDeployment
{
$rgname = Get-ResourceGroupName
$rname = Get-ResourceName
$location = "West US 2"
New-AzResourceGroup -Name $rgname -Location $location
$list = Test-AzResourceGroupDeployment -ResourceGroupName $rgname -TemplateFile Build2014_Website_App.json -siteName $rname... | 0 |
Restart-IISAppPool.ps1 | function Restart-IISAppPool {
[CmdletBinding(SupportsShouldProcess=$true)]
#.Synopsis
# Restarts an IIS AppPool
#.Parameter ComputerName
# The name of a web server to restart the AppPool on
#.Parameter Pool
# The name of the AppPool to recycle (if you include wildcards, results in an init... | 0 |
sample_21_13.ps1 | ConvertFrom-StringData @'
id_ctsfirewallrunningcheck=Windows Firewall Running check
id_ctsfirewallrunningcheckdescription=Verify the Windows Firewall service is running
id_firewallrunningcheckdesc=The Windows Firewall service is not running
id_firewallstartmodecheckdesc=The Windows Firewall start mode is not set to... | 0 |
2764.ps1 |
schtasks /query /FO CSV /v | ConvertFrom-Csv
| 0 |
sample_44_56.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 |
sample_57_98.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 |
3910.ps1 |
function Test-TaskCRUD
{
param([string]$jobId)
$context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext
$taskId1 = "task1"
$taskId2 = "task2"
try
{
New-AzBatchTask -Id $taskId1 -JobId $jobId -CommandLine "cmd /c echo task1" -B... | 0 |
155.ps1 | Function Get-Something
{
PARAM (
[Alias("CN", "__SERVER", "PSComputerName")]
[String[]]$ComputerName = $env:COMPUTERNAME,
[Alias("RunAs")]
[System.Management.Automation.Credential()]
[pscredential]
$Credential = [System.Management.Automation.PSCredential]::Empty
... | 0 |
sample_33_32.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_11_33.ps1 | ConvertFrom-StringData @'
id_ex2003_exchdumpact=Exchange Support Tool - ExchDump
id_ex2003_exchdumpstat=Running ExchDump.exe to collect configuration information
id_ex2003_exchdumpreportsection=Exchange Configuration Information
id_ex2003_exchdumpfiledescription=Exchange Configuration Information
'@
# SIG # Beg... | 0 |
sample_55_15.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | 0 |
639.ps1 |
$PromptSettings = (Get-Host).UI.RawUI
$PromptSettings.BufferSize.Width = 120
$PromptSettings.BufferSize.Height = 999
$PromptSettings.WindowSize.Width = 120
$PromptSettings.WindowSize.Height = 50
$PromptSettings.MaxWindowSize.Width = 120
$PromptSettings.MaxWindowSize.Height = 50
$PromptSettings.MaxPhysicalWindowSize.Wi... | 0 |
3357.ps1 |
param(
[ValidateNotNull()]
[String[]]$Modules = @(
"Azs.AzureBridge.Admin",
"Azs.Backup.Admin",
"Azs.Commerce.Admin",
"Azs.Compute.Admin",
"Azs.Fabric.Admin",
"Azs.Gallery.Admin",
"Azs.InfrastructureInsights.Admin",
"Azs.KeyVault.A... | 0 |
3928.ps1 |
function Test-AzureIotDpsAccessPolicyLifeCycle
{
$Location = Get-Location "Microsoft.Devices" "Device Provisioning Service"
$IotDpsName = getAssetName
$ResourceGroupName = getAssetName
$AccessPolicyDefaultKeyName = "provisioningserviceowner"
$AccessPolicyDefaultRights = "ServiceConfig, D... | 0 |
sample_39_83.ps1 | # powershell completion for azcmagent -*- shell-script -*-
function __azcmagent_debug {
if ($env:BASH_COMP_DEBUG_FILE) {
"$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE"
}
}
filter __azcmagent_escapeStringWithSpecialChars {
$_ -replace '\s|#|@|\$... | 0 |
sample_26_22.ps1 | @{
IncludeRules=@('PSUseApprovedVerbs',
'PSReservedCmdletChar',
'PSReservedParams',
'PSShouldProcess',
'PSUseShouldProcessForStateChangingFunctions',
'PSUseSingularNouns',
'PSMissingModuleManifestField'... | 0 |
sample_3_23.ps1 | // Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved.
// ==================================================================
// DCIM_LocalUserIdentity
// ==================================================================
[ dynamic, provider("dcismprovider"),
Description (
"DCIM... | 0 |
1266.ps1 |
filter Protect-CString
{
[CmdletBinding()]
param(
[Parameter(Mandatory = $true, Position=0, ValueFromPipeline = $true)]
[object]
$String,
[Parameter(Mandatory=$true,ParameterSetName='DPAPICurrentUser')]
[Switch]
$... | 0 |
53.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aa... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.