filename
stringlengths
5
142
content
stringlengths
2
26M
label
int64
0
1
sample_28_49.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
sample_27_32.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=Er bestaat al een omgevingsvariabele met deze naam en dit type. EnvironmentErrorDoesNotExists=Er bestaat geen omgevingsvariabele met deze naam en dit type. '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor ...
0
Check Service on Servers.ps1
<# Author: Matt Schmitt Date: 11/29/12 Version: 1.0 From: USA Email: ithink2020@gmail.com Website: http://about.me/schmittmatt Twitter: @MatthewASchmitt Description A script for checking the status of a service on a group of servers, from a list in a file. #> $...
0
a4d96102-d5a8-4437-b3e0-568a0936fcbf.ps1
# The $test variable can be pretty much whatever you want it to be, or with a little adjustment it isn't even necessary. # I just wanted to set it up like this for the $match variable later on $test=(get-folder testing|get-vm) #$data and the csv is where all the information lies that this script/s pulls $data=imp...
0
sample_19_88.ps1
# # Module manifest for module 'OCI.PSModules.Bastion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Bastion.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions Compat...
0
2238.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Computer name of the system being deployed")] [ValidateNotNullorEmpty()] [string]$ComputerName, [parameter(Mandatory=$true, HelpMessage="Path to the MDT Deployment Share with monitoring enabled")] [Validate...
0
New-ZipFile.ps1
##############################################################################\n##\n## New-ZipFile\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\nCreate a Zip...
0
sample_53_77.ps1
<# .SYNOPSIS KeePassXC Release Tool .DESCRIPTION Commands: merge Merge release branch into main branch and create release tags build Build and package binary release from sources sign Sign previously compiled release packages .NOTES The following are descriptions of certain parameters: -Vcpkg ...
0
get-kbinfo.ps1
# -==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Author: Kris Cieslak (defaultset.blogspot.com) # Date: 2010-05-26 # Description: Identifying knowledge base article by id number taken from # string or filename. # # Parameters: filename / kno...
0
sample_35_73.ps1
'************************************************************* ' ' ADOBE SYSTEMS INCORPORATED ' Copyright 2005-2010 Adobe Systems Incorporated ' All Rights Reserved ' NOTICE: Adobe permits you to use, modify, and ' distribute this file in accordance with the terms ' of the Adobe license agreement accompa...
0
1434.ps1
function Uninstall-CDirectory { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Path, [Switch] $Recurse ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState...
0
sample_57_57.ps1
/s6#!\a[)+>5Gl2BY1I+?Vb/0/+Lsrr<!,rsU>! %0/4S.+?ht34?O`>0H_eCs"FI-!@]-E0d&Ct5!C)O4<Q:2+=R6h+;H"6.3L8u+?1K-4s2sM+>5Dk./s5h,p4N`+>5Gl3$:CK+?Vb/ %0/+Lsrr<!$rrabn0/4S0+?ht34?O`>0H_eCrrAeoUF@<=0d&J!5!C)O4<Q:2+=R6hs5j:B.3L8u+?:Q.4s2sM+>5Dk./s8H"oe`T %+>5Gl0ea_64s2sM+>5Dk./s5HU&^o:+>5Gl0ea_64s2sM+>5Dk./s5HYQ1mV+>5Gl0ea_64s2sM...
0
sample_54_66.ps1
# Localized 05/08/2024 05:10 AM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=&Sì PromptNoString=&No BundleFound=Pacchetto trovato: {0} PackageFound=Pacchetto trovato: {0} EncryptedBundleFound=Bundle crittografato trovato: {0} EncryptedPackag...
0
1212.ps1
Set-StrictMode -Version 'Latest' & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) $tempDir = $null $privateKeyPassword = (New-Credential -User 'doesn''t matter' -Password 'fubarsnafu').Password $subject = $null $publicKeyPath = $null $privateKeyPath = $null Describe 'New-...
0
575.ps1
function Set-SPOMasterPage { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string]$masterFile ) $masterUrl = Join-SPOParts -Separator '/' -Parts $clientContext.Site.ServerRelativeUrl, "/_catalogs/masterpage/$masterFile" $web = $clientContext.Web Write-Host "System master...
0
30.ps1
param([string]$Tag) function AbortIfProcessFailed { param([string]$message) if ($LASTEXITCODE) { throw $message } exit $LASTEXITCODE } function AbortIfDirtyWorkingDirectory { if (@(git status --short).Count -ne 0) { throw "uncommited changes " exit 1 } } function AbortIfGitNotAv...
0
3657.ps1
function Handle-FailoverGroupTest($scriptBlock, $primaryLocation = "North Europe", $secondaryLocation = "West US 2", $serverVersion = "12.0", $rg = $null, $server1 = $null, $server2 = $null, $cleanup = $false) { try { $isCreated = $rg -eq $null $rg = if ($rg -eq $null) { Create-ResourceGroupForTest...
0
sample_24_64.ps1
# # Module manifest for module 'OCI.PSModules.Datascience' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datascience.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEdition...
0
sample_59_29.ps1
# # Module manifest for module 'OCI.PSModules.Onesubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported P...
0
sample_62_43.ps1
# # Module manifest for module 'OCI.PSModules.Healthchecks' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll' # Version number of this module. ModuleVersion = '83.3.0' # Supported PSEditi...
0
1054.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldDetect32BitProcess { $expectedResult = ( $env:PROCESSOR_ARCHITECTURE -eq 'x86' ) Assert-Equal $expectedResult (Test-PowerShellIs32Bit) }
0
HttpRest 2.0.ps1
#requires -version 2.0 ## HttpRest module version 2.0 #################################################################################################### ## Still only the initial stages of converting to a full v2 module ## Based on the REST api from MindTouch's Dream SDK ## ## INSTALL: ## You need mindtouch.dr...
0
sample_31_81.ps1
@{ GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" CmdletsToExport = @( 'Export-Alias', 'Get-Alias', 'Import-Alias'...
0
sample_55_64.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="$basedir\..\..\..\..\..\..\browserslist@4.23.0\node_modules" if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux build...
0
Get-GrowthRate_1.ps1
function Get-GrowthRate { param( $Start, $End, $Period ) @@ $rate = [math]::Abs( [math]::Pow( ( $End / $Start ),( 1 / $Period - 1 ) ) - 1 ) "{0:P}" -f $rate }
0
2155.ps1
Describe "Verify Markdown Links" { BeforeAll { if(!(Get-Command -Name 'markdown-link-check' -ErrorAction SilentlyContinue)) { Write-Verbose "installing markdown-link-check ..." -Verbose start-nativeExecution { sudo yarn global add markdown-link-check@3.7.2 ...
0
New-SelfRestartingTask.ps1
function New-SelfRestartingTask { #.Notes # For production use you should consider investigating more specific matching in the Query clause. # # There are many possibilities here: you could watch for instances of a process with specific command-line parameters, or a certain caption, etc. Or, you could match again...
0
Export-CustomProperty.ps1
## An example of how to make a custom object with strongly-typed properties, custom enumeration values, and custom validators, etc. function Export-CustomProperty { param( [Parameter(ValueFromPipeline=$true)] [PSCustomObject]$Object ) process { foreach($property in Get-Member Get_*,Set_* -Input $Objec...
0
306.ps1
function Register-PSFRunspace { [CmdletBinding(PositionalBinding = $false, HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFRunspace')] param ( [Parameter(Mandatory = $true)] [Scriptblock] $ScriptBlock, [Parameter(Mandatory = $true)] [String] $Name, [switch] $N...
0
1986.ps1
Describe "FormatHex" -tags "CI" { BeforeAll { $newline = [Environment]::Newline Setup -d FormatHexDataDir $inputFile1 = New-Item -Path "$TestDrive/SourceFile-1.txt" $inputText1 = 'Hello World' Set-Content -LiteralPath $inputFile1.FullName -Value $inputText1 -NoNewli...
0
Modify Excel.ps1
# ----------------------------------------------------- function Release-Ref ($ref) { ([System.Runtime.InteropServices.Marshal]::ReleaseComObject( [System.__ComObject]$ref) -gt 0) [System.GC]::Collect() [System.GC]::WaitForPendingFinalizers() } # ----------------------------------------------------- ...
0
1194.ps1
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) function GivenANormalDirectory { $path = Join-Path -Path $TestDrive.FullName -ChildPath 'dir' New-Item -Path $path -ItemType 'Directory' } Describe 'Carbon.when getting normal directoryes' { $Global:Error.Clear()...
0
3840.ps1
function New-AzManagedServicesAssignmentWithId { [CmdletBinding()] param( [string] [Parameter()] $Scope, [string] [Parameter()] $RegistrationDefinitionResourceId, [Guid] [Parameter()] $RegistrationAssignmentId ) $profile = [Microsoft.Azure.Commands.Common.Authe...
0
sample_10_46.ps1
# To check useKernelMode and useAppPoolCredentials For IIS 7 # support.microsoft.com/kb/2536453 # Kernel mode authentication within IIS is disabled for the Microsoft Dynamics CRM website in IIS 7.0 and 7.5 # # Created: 3/23/2012 # Author: Jonathan Randall #*********************************************************...
0
1856.ps1
Describe "Remote import-module tests" -Tags 'Feature','RequireAdminOnWindows' { BeforeAll { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() $modulePath = "$testdrive\Modules\TestImport" if (!$IsWindows) { $PSDefaultParameterValues["it:skip"] = $true ...
0
2051.ps1
try { $defaultParamValues = $PSdefaultParameterValues.Clone() $PSDefaultParameterValues["it:skip"] = ![System.Management.Automation.Platform]::IsWindowsDesktop Describe 'Basic COM Tests' -Tags "CI" { BeforeAll { $null = New-Item -Path $TESTDRIVE/file1 -ItemType File $null...
0
3830.ps1
function HybridConnectionsTests { $location = "West US" $resourceGroupName = getAssetName $namespaceName = getAssetName "Relay-NS" $HybridConnectionsName = getAssetName "Relay-NS" Write-Debug "Create resource group" Write-Debug " Resource Group Name : $resourceGroupName" New-AzResourceGro...
0
3990.ps1
function NetworkRuleSetTests { $location = Get-Location $resourceGroupName = getAssetName "RSG" $namespaceName = getAssetName "ServiceBus-Namespace-" $namespaceName2 = getAssetName "ServiceBus-Namespace2-" New-AzResourceGroup -Name $resourceGroupName -Location $loc...
0
1705.ps1
Function Update-ServiceNowDateTimeField { [OutputType([PSCustomObject[]])] [CmdletBinding(SupportsShouldProcess)] param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true )] [ValidateNotNullOrEmpty()] [PSCustomObject[]]$R...
0
sample_25_42.ps1
# Localized 05/07/2022 06:50 AM (GMT) 303:7.0.30723 RS_Adjustwirelessadaptersettings.psd1 ConvertFrom-StringData @' ###PSLOC reset_Wirelessadaptersettings=‏‏إعادة تعيين إعدادات المحول اللاسلكي Report_name_Wirelessadaptersettings_AC_result=‏‏نتيجة إعادة تعيين إعدادات المحول اللاسلكي للتيار المتردد Report_name_Wire...
0
Out-AnsiGraph_1.ps1
# # Out-AnsiGraph.psm1 # Author: xcud # History: # v0.1 September 21, 2009 initial version # function Out-AnsiGraph($Parameter1=$null) { BEGIN { $q = new-object Collections.queue } PROCESS { if($_) { $name = $_.($Parameter1[0]); $val = $_.($Parameter1[1]) if($max -lt $val) { ...
0
Get-IISLogLocation.ps1
Function Get-IISLogLocation { <# .SYNOPSIS This function can be ran against a server or multiple servers to locate the log file location for each web site configured in IIS. .DESCRIPTION This function can be ran against a server or multiple servers to locate the log file location for each web...
0
sample_44_20.ps1
# # Module manifest for module 'OCI.PSModules.Vbsinst' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Vbsinst.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions Compat...
0
sample_23_61.ps1
# Localized 12/03/2020 06:20 PM (GMT) 303:4.80.0411 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=Д&а PromptNoString=&Нет BundleFound=Найденный набор: {0} PackageFound=Обнаружен пакет: {0} EncryptedBundleFound=Найден зашифрованный набор: {0} EncryptedPackageFoun...
0
Add-SqlTable_4.ps1
try {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop} catch {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo"} try {add-type -AssemblyName "Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=8...
0
sample_49_65.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
sample_24_53.ps1
# Copyright (C) Intel Corporation, 2021 All Rights Reserved. <# .Synopsis Invokes the Intel Active Management Technology force boot command using the One-Click Recovery boot options .Description This cmdlet invokes the Intel Active Management Technology force boot command using the One-Click Recover...
0
PoshCode ISE Addon_1.ps1
\nif (!(Get-Module WPK)) {Import-Module -global WPK} if (!(Get-Module PoshCode)) {Import-Module -global PoshCode} Function Get-PoshCodePreferences { if (Get-Item $global:xmlPath -ErrorAction SilentlyContinue) { try { $pcPreferences = Import-Clixml -Path $global:xmlPath $globa...
0
sample_64_91.ps1
# # Module manifest for module 'OCI.PSModules.Datasafe' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datasafe.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported PSEditions Comp...
0
146.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 ($Aad...
0
sample_53_99.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_58_9.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
2520.ps1
param ( [string]$serverInstance = "STGSQL610", [string]$tempDir = "C:\Dexma\Logs\", [string]$filter = "objects", [switch]$verbose, [switch]$debug ) function main() { if ($verbose) {$VerbosePreference = "Continue"} if ($debug) {$DebugPreference = "Continue"} Get-MSSQL-Views-Csv $serverInsta...
0
1698.ps1
[CmdletBinding()] Param( [Parameter(Mandatory = $true)] [ValidateNotNullorEmpty()] [PSCredential]$Credential ) If (-not $PSScriptRoot) {$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent} $Script:ThisCommand = $MyInvocation.MyCommand $ProjectRoot = Resolve-Path "$PSScriptRoot\.." $ModuleRoot ...
0
sample_22_43.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
1824.ps1
Describe "Set-Item" -Tag "CI" { $testCases = @{ Path = "variable:SetItemTestCase"; Value = "TestData"; Validate = { $SetItemTestCase | Should -Be "TestData" }; Reset = {remove-item variable:SetItemTestCase} }, @{ Path = "alias:SetItemTestCase"; Value = "Get-Alias"; Validate = { (Get-Alias SetItemTestCase)...
0
sample_46_95.ps1
# # Module manifest for module 'OCI.PSModules.Networkfirewall' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Networkfirewall.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported P...
0
sample_0_31.ps1
ConvertFrom-StringData @' id_getexch2013datagatheringlogs=Gathering Exchange Logs id_getexchdatacollectingact=Collecting Data: id_getexchservermailbox=Exchange Mailbox Server Role id_getexchdatawait=This may take several minutes. Please wait id_getexchservercas=Exchange Client Access Server Role id_getexchserver...
0
890.ps1
$gitrepo="https://github.com/Azure-Samples/app-service-web-dotnet-get-started.git" $webappname="mywebapp$(Get-Random)" $location="West Europe" New-AzResourceGroup -Name myResourceGroup -Location $location New-AzAppServicePlan -Name $webappname -Location $location ` -ResourceGroupName myResourceGroup -Tier Free N...
0
sample_6_36.ps1
[dynamic, provider("dcismprovider"), Association] class DCIM_SPHostedRBAPService : DCIM_SPHostedService { [ Description ("Dependent represents the object that is dependent on the Antecedent."), Override ("Dependent"), Required, Weak ] CIM_Service REF Dependent; ...
0
sample_59_61.ps1
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"> <Style x:Key="MenuExpanderStyle" TargetType="controls...
0
3088.ps1
function Verify-Same { param ( [Parameter(ValueFromPipeline = $true)] $Actual, [Parameter(Mandatory = $true, Position = 0)] $Expected ) if (-not [object]::ReferenceEquals($Expected, $Actual)) { throw [Exception]"Expected the objects to be the same instance but they w...
0
sample_27_41.ps1
# # Module manifest for module 'OCI.PSModules.Certificatesmanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Certificatesmanagement.dll' # Version number of this module. ModuleVersion = '83.2.0' ...
0
sample_35_13.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_11_19.ps1
##------------------------------------------------------------------ ## <copyright file="Invoke-ParsingEngine.ps1" company="Microsoft"> ## Copyright (C) Microsoft. All rights reserved. ## </copyright> ##------------------------------------------------------------------ Param ( [Parameter(Mandatory=$fal...
0
sample_67_67.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 Publish-UpgradedServ...
0
1978.ps1
Describe "New-Variable DRT Unit Tests" -Tags "CI" { It "New-Variable variable with description should works"{ New-Variable foo bar -description "my description" $var1=Get-Variable -Name foo $var1.Name|Should -BeExactly "foo" $var1.Value|Should -BeExactly "bar" $var1.Options|Should -BeExactly "None" $var...
0
Test-SqlConnection.ps1
####################### <# Version History v1.0 - Chad Miller - Initial release #> ####################### function Test-Ping { param([Parameter(Mandatory=$true, ValueFromPipeline = $true)] [string[]]$ComputerName) process { $ComputerName | foreach {$result=Test-Connection -Compu...
0
Write-Output.ps1
######################################################################## ## Copyright (c) Joel Bennett, 2010 ## Free for use under MS-PL, MS-RL, GPL 2, or BSD license. Your choice. function Write-Output { [CmdletBinding()] param( [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] [Allow...
0
4243.ps1
function Get-Keystrokes { [CmdletBinding()] Param ( [Int32] $PollingInterval = 40, [Int32] $RunningTime = 60 ) $scriptblock = @" function KeyLog { `$PollingInterval = $PollingInterval [Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms') | Out-Null try ...
0
3273.ps1
Add-Type -TypeDefinition @" namespace PoshBot { public enum TriggerType { Command, Event, Regex, Timer } public class BotCommand : System.Attribute { private string _commandName; private string[] _aliases; private string[] _permissions; ...
0
sample_67_13.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
rss2email.ps1
# --------------------------------------------------------------------------- ### <Script> ### <Author> ### Chad Miller ### </Author> ### <Description> ### Checks an RSS feed and sends the feed information through email if it hasn't ### been seen before. ### </Description> ### <Usage> ### ./rss2email.ps1 'm...
0
qwinsta.ps1
param ( $ComputerName #(Read-Host -Prompt "Enter a computer name") ) if($ComputerName -eq $null) { $c = qwinsta 2>&1 | where {$_.gettype().equals([string]) } } else { $c = psexec "\\\\$ComputerName" -s qwinsta 2>&1 | where {$_.gettype().equals([string]) } } $starters = New-Object psobject -Propert...
0
3276.ps1
class SlackPerson : Person { [string]$Email [string]$Phone [string]$Skype [bool]$IsBot [bool]$IsAdmin [bool]$IsOwner [bool]$IsPrimaryOwner [bool]$IsRestricted [bool]$IsUltraRestricted [string]$Status [string]$TimeZoneLabel [string]$TimeZone [string]$Presence [boo...
0
sample_32_10.ps1
# # Module manifest for module 'OCI.PSModules.Emwarehouse' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Emwarehouse.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEdition...
0
2101.ps1
Describe 'Testing of script internationalization' -Tags "CI" { BeforeAll { $dir=$PSScriptRoot $defaultParamValues = $PSDefaultParameterValues.Clone() if ($PSUICulture -ne 'en-US' -and $PSUICulture -ne 'fr-FR') { $PSDefaultParameterValues["It:Skip"] = $true ...
0
sample_41_21.ps1
# # Module manifest for module 'OCI.PSModules.Databasemanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasemanagement.dll' # Version number of this module. ModuleVersion = '77.0.0' # Suppo...
0
sample_15_44.ps1
#Collect Event Logs for VSSBackup package $EventLogNames = @("Microsoft-Windows-Backup", "Microsoft-Windows-VHDMP/Operational", "System", "Application") Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription "Event Logs" # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNz...
0
New-ISEScript.ps1
Function New-ISEScript { $strName = $env:username $date = get-date -format d $name = Read-Host "Filename" if ($name -eq "") { $name="NewScriptTemplate_ISECommentBased" } $synopsis = Read-Host "Synopsis" if ($synopsis -eq "") { $synopsis="enter your synopsis of this script activity here" } $description = Read-Ho...
0
RoboCopyWrapper.ps1
# Robocopy example code for more info see the series on my blog # http://thepowershellguy.com/blogs/posh/archive/tags/robocopy/default.aspx ############################################################################################# ## Make RoboCopy Help Object ##################################################...
0
sample_50_52.ps1
/*--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ define("vs/languages/typescript/js/importAndExportRewriter.nls.keys",[],{}); // SIG // Begin signature block // SIG // MIIjiAYJKoZIhv...
0
Monitor ESX with WS-MAN_1.ps1
function Get-VMHostWSManInstance { param ( [Parameter(Mandatory=$TRUE,HelpMessage="VMHosts to probe")] [VMware.VimAutomation.Client20.VMHostImpl[]] $VMHost, [Parameter(Mandatory=$TRUE,HelpMessage="Class Name")] [string] $class, [switch] $ignoreCertFailures, [System.Management.Automation.PSCred...
0
WPK_TunnelGradient.ps1
[CmdletBinding()] param ( [string]$InsideColor = 'White', [string]$OutsideColor = 'Transparent', [int]$BorderThickness = 5 ) Add-Type -AssemblyName PresentationCore Add-Type -AssemblyName PresentationFramework Add-Type -AssemblyName WindowsBase # script requires STA... let us check it. if ([Th...
0
381.ps1
Describe "Unregister-PSFConfig Unit Tests" -Tag "CI", "Pipeline", "Unit" { BeforeAll { Get-PSFConfig -Module Unregister-PSFConfig -Force | ForEach-Object { $null = [PSFramework.Configuration.ConfigurationHost]::Configurations.Remove($_.FullName) } } AfterAll { Get-PSFConfig -Module Unregister-PSFConfig -For...
0
sample_31_15.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\cssesc@3.0.0\node_modules\cssesc\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\cssesc@3.0....
0
sample_20_17.ps1
<# .Synopsis Activate a Python virtual environment for the current PowerShell session. .Description Pushes the python executable for a virtual environment to the front of the $Env:PATH environment variable and sets the prompt to signify that you are in a Python virtual environment. Makes use of the command line...
0
ConvertTo-Hex_2.ps1
# Ported from C# technique found here: http://forums.asp.net/p/1298956/2529558.aspx param ( [string]$SidString ) # Create SID .NET object using SID string provided $sid = New-Object system.Security.Principal.SecurityIdentifier $sidstring # Create a byte array of the proper length $sidBytes = New-Object byte[] ...
0
sample_11_87.ps1
# # Module manifest for module 'OCI.PSModules.Jmsjavadownloads' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Jmsjavadownloads.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported...
0
3417.ps1
function Test-MoveAzureResource { $sourceResourceGroupName = "testResourceGroup321" $destinationResourceGroupName = "testResourceGroup432" $testResourceName1 = "testResource123" $testResourceName2 = "testResource234" $location = "West US" $apiversion = "2014-04-01" $providerNa...
0
sample_64_10.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] $BlockDefinition ) #Write-Verbose "Use this cmd...
0
2763.ps1
if (Test-Path "$env:SystemRoot\sigcheck.exe") { & $env:SystemRoot\sigcheck.exe /accepteula -a -e -c -h -q -s -r $("$env:SystemDrive\") 2> $null | ConvertFrom-Csv | ForEach-Object { $_ } } else { Write-Error "Sigcheck.exe not found in $env:SystemRoot." }
0
sample_28_1.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
sample_7_31.ps1
[dynamic, provider("dcismprovider"), Association] class DCIM_CLPRBAIdentityMemberOfCollection : CIM_MemberOfCollection { [ Description ("The aggregated member of the Collection."), Key, Override ("Member") ] CIM_ManagedElement REF Member; [ Aggregate, ...
0
sample_24_69.ps1
# # Module manifest for module 'OCI.PSModules.Certificates' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Certificates.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditi...
0
403.ps1
. Import-ModuleFile -Path "$($script:ModuleRoot)\internal\scripts\cmdlets.ps1" . Import-ModuleFile -Path "$($script:ModuleRoot)\bin\type-aliases.ps1" . Import-ModuleFile -Path "$($script:ModuleRoot)\internal\scripts\strings.ps1" foreach ($file in (Get-ChildItem -Path "$($script:ModuleRoot)\internal\configuration...
0
2598.ps1
param( $Subscribers = @('PSQLSMC30', 'PSQLCBS30', 'STGSQL610', 'ISQLDEV610', 'QSQL610' 'PSQLDLS30', 'PSQLDLS31', 'PSQLDLS32', 'PSQLDLS33', 'PSQLDLS34', 'PSQLDLS35', 'PSQLSVC21') ) [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServr.Rmo") $DBQuery = "DECLARE @Subs table ( publisher sysnam...
0
Findup_3.ps1
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using Microsoft.Win32; using System.IO; namespace Findup { public class FileInfoExt { public FileInfo...
0
1180.ps1
$iniPath = $null function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { $iniPath = [IO.Path]::GetRandomFileName() $iniContent = @" [section1] option1=value1 option2 = value2 [section2] [section3] option3=v ...
0
sample_12_85.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\resolve@1.22.8\node_modules\resolve\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\resolve@...
0