filename
stringlengths
5
142
content
stringlengths
2
26M
label
int64
0
1
sample_47_86.ps1
using namespace System.Management.Automation using namespace System.Management.Automation.Language # This is an example profile for PSReadLine. # # This is roughly what I use so there is some emphasis on emacs bindings, # but most of these bindings make sense in Windows mode as well. Import-Module PSReadLine ...
0
SpeakToMe.ps1
<# inspired by HelloKitty script and Mike Hays's obsession for Julie Andrews added voice selection menu, should work for everyone anywhere interluded speaking by using string array joined with newline still need to figure out $voiceToUse code, it's working but I don't know why or how https://github.com/chriskenis/...
0
NTFS ACLs Folder Tree_1.ps1
####################################### # TITLE: listACL.ps1 # # AUTHOR: Santiago Fernandez Mu±oz # # # # DESC: This script generate a HTML # # report show all ACLs asociated with # # a Folder tree structure starting in # # root specified by the user ...
0
1682.ps1
function Get-FolderAccess { [CmdletBinding()] param ( [string]$Path = $PWD, [int]$Depth = 1, [switch]$ExpandGroups = $false, [switch]$ShowAllAccounts = $false, [switch]$DontOpen = $false, [ValidateSet('Console','HTML','Excel')] ...
0
sample_40_36.ps1
# -------------------------------------------------------------- # Copyright � Microsoft Corporation. All Rights Reserved. # Microsoft Corporation (or based on where you live, one of its affiliates) licenses this sample code for your internal testing purposes only. # Microsoft provides the following sample code ...
0
Invoke-SSH Wrapper.ps1
function Invoke-SSH { param ( [string]$Server = "$(throw 'Server is a mandatory parameter.')", $Credential = "$(throw 'Credential is a mandatory parameter.')", [switch]$Echo = $true, [string]$Command = "$(throw 'Command is a mandatory parameter.')" ) # Since function name is same as cmdlet, we have to...
0
103.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_19_10.ps1
data LocalizedData { # culture="en-US" ConvertFrom-StringData @' PathNotFoundError=The path '{0}' either does not exist or is not a valid file system path. ExpandArchiveInValidDestinationPath=The path '{0}' is not a valid file system directory path. InvalidZipFileExtensionError={0} is not a su...
0
Spin-Busy_2.ps1
## Spin-Busy displays a "spinning" character with each step reflecting a single pipeline object being passed. ## The current cursor position, fg/bg colors, screen width, etc. can be specified or automatically detected. ## ## This is *very* loosly adapted from Out-Working by Joel Bennett (http://powershellcentral.com...
0
sample_59_19.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
3160.ps1
function Get-FederationEndpoint{ [CmdletBinding()] Param( [Parameter(Mandatory=$true, HelpMessage="Domain name to get the ADFS endpoint for.")] [string]$domain, [Parameter(Mandatory=$false, HelpMessage="Flag for authentication command output.")] [switc...
0
474.ps1
function Convert-StringToScriptBlock{ param( [parameter(ValueFromPipeline=$true,Position=0)] [string] $String ) $ScriptBlock = [scriptblock]::Create($String) return $ScriptBlock }
0
sample_43_54.ps1
/////////////////////////////////////////////////////////////////////////////// // Helper to set a designer prop /////////////////////////////////////////////////////////////////////////////// function setDesignerProp(tname, ttype, tvalue) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)...
0
3364.ps1
Function CreateAdApp_Test { $adDisplayName = "TestAdAppForNodeCliTestCase" $subId = '2c224e7e-3ef5-431d-a57b-e71f4662e3a6' Create-ServicePrincipal -ADAppDisplayName "MyModTestApp1" -SubscriptionId 2c224e7e-3ef5-431d-a57b-e71f4662e3a6 -TenantId 72f988bf-86f1-41af-91ab-2d7cd011db47 -createADAppIfNotFound $tr...
0
sample_67_14.ps1
// This file is automatically generated by Teams Toolkit. // The teamsfx tasks defined in this file require Teams Toolkit version >= 5.0.0. // See https://aka.ms/teamsfx-tasks for details on how to customize each task. { "version": "2.0.0", "tasks": [ { // Check all required prerequisites. ...
0
2063.ps1
Describe "ScriptBlock.GetNewClosure()" -tags "CI" { BeforeAll { function SimpleFunction_GetNewClosure { param([ValidateNotNull()] $Name) & { 'OK' }.GetNewClosure() } function ScriptCmdlet_GetNewClosure { ...
0
sample_52_16.ps1
param( [String] $ccPath = $(gcm cc), [String] $projPath ) $ErrorActionPreference = "Stop"; $Stopwatch = [System.Diagnostics.Stopwatch]::new() function ElegantExit([String]$Result) { if (![string]::IsNullOrEmpty($Result)) { & "$($PSScriptRoot)/sendMetrics.ps1" -MetricNamespace...
0
sample_20_52.ps1
# # Module manifest for module 'OCI.PSModules.Dataflow' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dataflow.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions Comp...
0
sample_26_31.ps1
import 'processes' type backlogItem = Epic| AtomicUserStory| TaskBacklog; Backlog: 'backlog' id=ID '{' ( Name |Label |Description |userstories += (Epic| AtomicUserStory| TaskBacklog))* '}' ; Epic : 'epic' id=ID '{' (Name ...
0
sample_14_73.ps1
ConvertFrom-StringData @' id_remotedesktoplserverkb2512845_sd=The version of Terminal Services Licensing installed on this computer is incompatible with Windows Server 2008 (or newer) Remote Desktop Services '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgE...
0
sample_4_93.ps1
# ********************************************************************************************************************* # Version 1.0 # Date: 02-29-2012 # Author: Vinay Pamnani - vinpa@microsoft.com # Description: # Collects SQL Error Logs from the SQL Server hosting the ConfigMgr database. It creates a UNC Pat...
0
Get-WebSite_4.ps1
function Get-WebPage { <# .SYNOPSIS Downloads web page from site. .DESCRIPTION Downloads web page from site and displays source code or displays total bytes of webpage downloaded .PARAMETER Url URL of the website to test access to. .PARAMETER UseDefaultCredentials Use the currently authentica...
0
Convert-BounceToX_9.ps1
# $Id: Convert-BounceToX500.ps1 610 2010-11-16 00:39:19Z jon $ # $Revision: 610 $ #.Synopsis # Convert Bounce to X500 #.Description # Convert URL Encoded address in a Bounce message to an X500 address # that can be added as an alias to the mail-enabled object #.Parameter bounceAddress # URL Encoded bounce...
0
sample_18_63.ps1
# # Module manifest for module 'OCI.PSModules.Vnmonitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Vnmonitoring.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditi...
0
sample_20_30.ps1
# # Module manifest for module 'OCI.PSModules.Resourcemanager' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Resourcemanager.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported P...
0
sample_39_62.ps1
#!/usr/bin/env pwsh $PlaywrightFileName = Join-Path $PSScriptRoot "Microsoft.Playwright.dll" [Reflection.Assembly]::LoadFile($PlaywrightFileName) | Out-Null exit [Microsoft.Playwright.Program]::Main($args) # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3Ag...
0
test_1.ps1
[CmdletBinding()] param() "This file is in the $PSScriptRoot folder." # SIG # Begin signature block # MIIPGwYJKoZIhvcNAQcCoIIPDDCCDwgCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR # AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUtq5NTq7Q77yPgrtRePzRWHVn # THuggg...
0
Enable_Disable FusionLog.ps1
function global:Enable-FusionLog { Remove-ItemProperty HKLM:Software\\Microsoft\\Fusion -name EnableLog -ErrorAction SilentlyContinue [void](New-ItemProperty HKLM:Software\\Microsoft\\Fusion -name EnableLog -propertyType dword -ErrorAction Stop) Set-ItemProperty HKLM:Software\\Microsoft\\Fusion -...
0
sample_26_16.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> Import-Module $PSScriptRoot\RoleHelpers.psm1 [S...
0
sample_13_86.ps1
#=========================================================================== #DVInstaller.ps1 #---------------------------------------------------------------------------- #Copyright (C) 2021 Intel Corporation #SPDX-License-Identifier: MIT #--------------------------------------------------------------------------...
0
4303.ps1
function SuiteSetup { Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue $script:ProgramFilesScriptsPath = Get-AllUsersScriptsPath $script:MyDocumentsScriptsPath = Get-CurrentUserScriptsPath ...
0
Get-Link.ps1
param([Parameter(ValueFromPipelineByPropertyName=$true)][Alias("PSPath")][string]$Path) begin { Add-Type -TypeDef @" using System; using System.IO; using System.Text; using System.Drawing; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; namespace Huddled.Interop { ...
0
d9442693-acf2-4df5-8552-91dec539a96f.ps1
<# .SYNOPSIS Writes out the the words for 99 Bottle of Beer on the wall. .DESCRIPTION Writes out the the words for 99 Bottle of Beer on the wall. .PARAMETER BottlesOfBeerOnTheWall Give the starting number of how many bottles of beer that are on the wall. Valid range is 2 to 99. .PARAMETER Voice Use if y...
0
sample_24_96.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 = '80.0.0' # Supported PSEditions CompatiblePSEd...
0
476.ps1
function Get-TreeObjectArrayAsList{ param( $Array, $Attribute, $Level = 0 ) $Array = $Array.psobject.Copy() $Array | %{ $Childs = iex "`$_.$Attribute" $_ | select *, @{L="Level";E={$Level}} ...
0
Wizard template.ps1
####################################################################################################################### # File: wizard_template.ps1 # # Author: Alexander Petrovskiy ...
0
3611.ps1
function Get-BandwidthScheduleName { return getAssetName } function Test-GetNonExistingBandwidthSchedule { $rgname = Get-DeviceResourceGroupName $dfname = Get-DeviceName $bwname = Get-BandwidthScheduleName Assert-ThrowsContains { Get-AzDataBoxEdgeBandwidthSchedule -ResourceGroupName $rgname ...
0
1618.ps1
function Get-Files { [cmdletbinding()] param ( [parameter(ValueFromPipeline=$true)] [string[]]$Path = $PWD, [string[]]$Include, [string[]]$ExcludeDirs, [string[]]$ExcludeFiles, [switch]$Recurse, [sw...
0
319.ps1
function Register-PSFMessageEvent { [CmdletBinding(PositionalBinding = $false, HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFMessageEvent')] Param ( [Parameter(Mandatory = $true)] [string] $Name, [Parameter(Mandatory = $true)] [System.Management.Automation.ScriptBloc...
0
New-IseFile.ps1
function New-IseFile ($path = 'tmp_default.ps1') { $count = $psise.CurrentPowerShellTab.Files.count $null = $psIse.CurrentPowerShellTab.Files.Add() $Newfile = $psIse.CurrentPowerShellTab.Files[$count] $NewFile.SaveAs($path) $NewFile.Save([Text.Encoding]::default) $Newfile }
0
sample_22_74.ps1
# virtualenv activation module # Activate with `overlay use activate.nu` # Deactivate with `deactivate`, as usual # # To customize the overlay name, you can call `overlay use activate.nu as foo`, # but then simply `deactivate` won't work because it is just an alias to hide # the "activate" overlay. You'd need to call `...
0
sample_6_88.ps1
# 2023-02-24 WalterE mod Trap #we# $startTime_AutoAdd = Get-Date trap [Exception]{ WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" } Write-Host -Background...
0
sample_60_46.ps1
# Localized 07/02/2024 06:19 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=Д&а PromptNoString=&Нет BundleFound=Найденный набор: {0} PackageFound=Обнаружен пакет: {0} EncryptedBundleFound=Найден зашифрованный набор: {0} EncryptedPackageFoun...
0
Create-Printers_2.ps1
###########################################################################" # # NAME: Create-Printers.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # BLOG: http://blog.powershell.no # # COMMENT: Simple script to bulk-create printers on a print-server. Printers are imported from a csv-file....
0
SQL-Update.ps1
<# .SYNOPSIS Author:...Vidrine Date:.....2012/04/08 .DESCRIPTION Function uses the Microsoft SQL cmdlets 'Invoke-SQLcmd' to connect to a SQL database and run an UPDATE statement. The target record that will be updated is queried based on a table/column named 'ID'. Simply change this to query based on anot...
0
1747.ps1
[CmdletBinding()] param ( [ValidateNotNullOrEmpty()] [string] $Path = $PSScriptRoot, [switch] $Unregister ) Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' function Start-NativeExecution([scriptblock]$sb, [switch]$IgnoreExitcode) { $backupEAP = $script:ErrorActionPreference $scr...
0
sample_14_19.ps1
# # Module manifest for module 'OCI.PSModules.Database' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Database.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions Comp...
0
3808.ps1
function Test-SimpleNewVm { $vmname = Get-ResourceName try { $username = "admin01" $password = Get-PasswordForVM | ConvertTo-SecureString -AsPlainText -Force $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password...
0
Enable and Configure SNM.ps1
#Powershell Script To Install SNMP Services (SNMP Service, SNMP WMI Provider) #Variables :) $pmanagers = "ADD YOUR MANAGER(s)" $commstring = "ADD YOUR COMM STRING" #Import ServerManger Module Import-Module ServerManager #Check If SNMP Services Are Already Installed $check = Get-WindowsFeature | Where-Objec...
0
2628.ps1
Import-module SQLPS -DisableNameChecking -Force $backupfile = 'C:\TEMP\OPA2.0\OPA2.0\OPA2.0Analysis\SQL\OPAmanager.bak' $restoreserver = 'localhost' $restoredatabase = 'OPA' $restorefiles = @() $files = Invoke-Sqlcmd -ServerInstance $restoreserver -Database tempdb -Query "RESTORE FILELISTONLY FROM DISK='$backupfile'" ...
0
sample_1_24.ps1
##************************************************************************** #********************* AUTO GENERAGED - DO NOT MODIFY ********************** # This file is the source code for discoverset OperatingSystemCore # Version 4.07 # Date: 10/20/2014 #***********************************************************...
0
DirToday Extended.ps1
## NAME: Get-Dirty.ps1 ## AUTHOR: Barry Morrison ## LASTEDIT: 07/05/2011 16:18:33 <# .Synopsis Get's files from today's date. Will also return narrowed results based on keyword .Description Get's files from today's date. Will also return narrowed results based on keyword .Parameter...
0
sample_62_1.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
2014.ps1
. "$psscriptroot/TestRunner.ps1" $AssemblyName = "Microsoft.PowerShell.Commands.Utility" $excludeList = "CoreMshSnapinResources.resx", "ErrorPackageRemoting.resx", "FormatAndOut_out_gridview.resx", "UtilityMshSnapinResources.resx", "OutPrinterDisplayStrings.resx", "UpdateListStrings.resx", ...
0
2325.ps1
function Set-RdpSessionTimeout { [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string[]]$ComputerName, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidateSet('ActiveButIdle', 'Disconnected', 'Active')] [string]$SessionType, [Parameter(Mandatory)] [Valida...
0
sample_53_35.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
sample_49_92.ps1
# # Module manifest for module 'OCI.PSModules.Mysql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Mysql.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions Compatible...
0
3018.ps1
function New-MockObject { param ( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [type]$Type ) [System.Runtime.Serialization.Formatterservices]::GetUninitializedObject($Type) }
0
2858.ps1
function TaskSetup { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [scriptblock]$setup ) $psake.context.Peek().taskSetupScriptBlock = $setup }
0
sample_42_25.ps1
Import-LocalizedData -BindingVariable lcAdTxt -FileName AzStackHci.ExternalActiveDirectory.Strings.psd1 function Get-ParamFromCommandLineOrConfigFile { [CmdletBinding()] param ( [Parameter(Mandatory=$false)] [string] $ConfigurationJsonPath, [Parameter(Mandatory=$true)]...
0
sample_49_56.ps1
# # Module manifest for module 'OCI.PSModules.Emaildataplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Emaildataplane.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSE...
0
FuncionInfo_2.types.ps1xml.ps1
<?xml version="1.0" encoding="utf-8" ?> <Types> <Type> <Name>System.Management.Automation.FunctionInfo</Name> <Members> <ScriptProperty> <Name>Verb</Name> <GetScriptBlock> if ($this.Name.Contains("-")) { $this.Name.Substring(0,$this.Name.Indexof("-")) } else { $null ...
0
sample_18_62.ps1
#************************************************ # TS_2628581_HPUPDUpgrade.ps1 # Version 1.0.1 # TemplateVersion 1.2 # Date: 04/17/2012 08:02:35 # Author: jasonf # Description: Checks the registry for an HP UPD upgrade from 5.2 to 5.3 which is known to cause issues #********************************************...
0
1568.ps1
function Restart-MrServiceOrDie { [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] param ( [Parameter(Mandatory=$true, ValueFromPipeline=$true)] [System.ServiceProcess.ServiceController[]]$Service ) BEGIN { $StartTime...
0
sample_41_93.ps1
// Copyright (c) Microsoft Corporation. All rights reserved. "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function exitIfHostProcessNotRunning(processName, pid) { try { process.kill(pid, 0); } catch (error) { console.error('Unable to find parent process ' + processName + ':' + pi...
0
sample_9_16.ps1
ConvertFrom-StringData @' id_printerkb982728checkrt=Printer mapping may fail with an error message when you try to create a Point and Print connection and a Kyocera printer is installed '@ # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorB...
0
sample_0_7.ps1
<# .SYNOPSIS Simplify data collection and diagnostics for troubleshooting Microsoft Remote Desktop (RDP/RDS/AVD/W365) related issues and a convenient method for submitting and following quick & easy action plans. .DESCRIPTION This script is designed to gather information to assist Microsoft Customer Suppo...
0
sample_51_62.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.DnsResolver.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.DnsResolver.Module]::Instance # Export nothing to clear implicit ex...
0
1650.ps1
function Set-Wallpaper { param ( [string]$Path, [ValidateSet('Tile', 'Center', 'Stretch', 'Fill', 'Fit', 'Span')] [string]$Style = 'Fill' ) begin { Add-Type @" using System; using System.Runtime.InteropServices; using Microsoft.Win32; ...
0
Windows Startup Script.ps1
<#====================================================================================== File Name : Startup.ps1 Original Author : Kenneth C. Mazie : Description : This is a personal startup script with pop-up notification and : checks to assure things are not already r...
0
Save-Credentials.ps1
<# .SYNOPSIS The script saves a username and password, encrypted with a custom key to to a file. .DESCRIPTION The script saves a username and password, encrypted with a custom key to to a file. The key is coded into the script but should be changed before use. The key allows the password to be decryp...
0
4377.ps1
function Log-NonPSGalleryRegistration { [CmdletBinding()] Param ( [Parameter()] [string] $sourceLocation, [Parameter()] [string] $installationPolicy, [Parameter()] [string] $packageManagementProvider, [Parameter()] ...
0
sample_9_51.ps1
#************************************************ # DC_SQL_Registries.ps1 # Version 1.0 # Date: 8-19-2011 # Author: Shon Hauck - Shonh@Microsoft.com # # Description: Collect registry keys relevant to Directory Services support # # Version 1.1 # Modified: 03-11-2012 # Change: Added SQL Wow6432 keys to collec...
0
Write-ScriptVariables.ps1
function Write-ScriptVariables { $globalVars = get-variable -scope Global | % { $_.Name } Get-Variable -scope Script | Where-Object { $globalVars -notcontains $_.Name } | Where-Object { $_.Name -ne 'globalVars' } | Out-String }
0
Get-WebFile 3.5.ps1
## Get-WebFile.ps1 (aka wget for PowerShell) ############################################################################################################## ## Downloads a file or page from the web ## History: ## v3.5 - Add -Quiet switch to turn off the progress reports ... ## v3.4 - Add progress report for files w...
0
388.ps1
[CmdletBinding()] Param ( [switch] $SkipTest, [string[]] $CommandPath = @("$PSScriptRoot\..\..\functions", "$PSScriptRoot\..\..\internal\functions") ) if ($SkipTest) { return } $list = New-Object System.Collections.ArrayList Describe 'Invoking PSScriptAnalyzer against commandbase' { $commandFiles = Get-ChildI...
0
740.ps1
function Set-RsDataSourcePassword { [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')] param ( [Alias('ItemPath')] [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [string[]] $Path, [Parameter(Mandatory = $true)] [string] ...
0
sample_66_35.ps1
Get-Module | ForEach-Object { Remove-Module -Name $_.Name -Force } $PSModuleAutoloadingPreference = 'none' Import-Module Microsoft.PowerShell.Utility #Enforcing default PSModulePath to avoid getting unexpected modules to run instead of built-in modules $env:PSModulePath = "C:\Program Files\WindowsPowerShell\Modules...
0
3069.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe "Should -Contain" { It "passes if collection contains the value" { @(1, 'a', 3) | Should -Contain 'a' } It "fails collection does not contain the value" { { @(1, 'a', 3) | Should -Contain 'g' } | Verify...
0
sample_15_77.ps1
# # Module manifest for module 'OCI.PSModules.Oda' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Oda.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions CompatiblePSEd...
0
sample_56_0.ps1
$url = $args[0] Write-Host "Downloading Microsoft Edge" $wc = New-Object net.webclient $msiInstaller = "$env:temp\microsoft-edge-stable.msi" $wc.Downloadfile($url, $msiInstaller) Write-Host "Installing Microsoft Edge" $arguments = "/i `"$msiInstaller`" /quiet" Start-Process msiexec.exe -ArgumentList $arguments -Wait ...
0
sample_43_37.ps1
# # Module manifest for module 'OCI.PSModules.Threatintelligence' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Threatintelligence.dll' # Version number of this module. ModuleVersion = '82.0.0' # Suppo...
0
sample_55_21.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
182.ps1
function Set-NetworkLevelAuthentication { [CmdletBinding()] PARAM ( [Parameter(ValueFromPipeline,ValueFromPipelineByPropertyName)] [System.String[]]$ComputerName = $env:ComputerName, [Parameter(Mandatory)] [System.Boolean]$EnableNLA, [Alias("RunAs")] [Syst...
0
2544.ps1
param ( $server = $(read-host "Server ('localhost' okay)"), $instance = $(read-host "Instance ('default' okay)"), $database = $(read-host "Database"), $tables = $(read-host "Tables (wildcards okay)"), $file = $(read-host "Script path and file name") ) $errors = "c:\dexma\logs\psscripterrors.txt" trap { "...
0
Rollback Policy Module.ps1
Function Get-RollbackPolicy { <# .SYNOPSIS Retieves the current rollback policy on a local or remote computer .DESCRIPTION Retieves the current rollback policy on a local or remote computer .PARAMETER Computername The name of the computer or computers to perform the q...
0
sample_59_21.ps1
# # Module manifest for module 'OCI.PSModules.Workrequests' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Workrequests.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported PSEditi...
0
345.ps1
function Register-PSFConfigValidation { [CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFConfigValidation')] Param ( [Parameter(Mandatory = $true)] [string] $Name, [Parameter(Mandatory = $true)] [ScriptBlock] $ScriptBlock ) [PSFramework.Configuratio...
0
sample_5_87.ps1
# # Module manifest for module 'OCI.PSModules.Dashboardservice' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dashboardservice.dll' # Version number of this module. ModuleVersion = '93.0.0' # Supported...
0
1012.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" $certificateFilePath = "<Replace with path to the Certifica...
0
sample_33_34.ps1
# # Module manifest for module 'OCI.PSModules.Database' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Database.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Comp...
0
sample_33_39.ps1
. ./Stop-Process2.ps1 notepad.exe notepad.exe notepad.exe Stop-Process2 -Name "notepad" # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA4mt...
0
3705.ps1
function Disable-AzAdvisorRecommendationByNameParameter { $RecommendationId = "4fa2ff4f-dc90-9876-0723-1360fa9f4bd7" $DaysParam = 30 $propertiesCount = "5" $TTLValue = "30.00:00:00" $NameValue = "HardcodedSuppressionName" $queryResult = Disable-AzAdvisorRecommendation -RecommendationName $Recomm...
0
1804.ps1
Describe "Get-HotFix Tests" -Tag CI { BeforeAll { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() $skip = $false if (!$IsWindows) { $skip = $true } else { $qfe = Get-CimInstance Win32_QuickFixEngineering ...
0
sample_3_19.ps1
#************************************************ # DC_NetworkConnections-Component.ps1 # Version 1.0 # Version 1.1: Altered the runPS function correctly a column width issue. # Version 1.2 (4/26/14): Added table of contents. # Date: 2012-2014 # Author: Boyd Benson (bbenson@microsoft.com) # Description: # Call...
0
3487.ps1
function Test-SetGatewayCredential{ try { $cluster= Create-Cluster $username = "admin" $textPassword= "YourPw!00953" $password = ConvertTo-SecureString $textPassword -AsPlainText -Force $credential = New-Object System.Management.Automation.PSCredential($username, $password) $gateway...
0
Search-SPN.ps1
<# .SYNOPSIS This function is used for finding all AD objects with a given SPN. .DESCRIPTION Finds all AD objects that have a given SPN. Wildcard search patterns are acceptable. .PARAMETER SearchRoot The root path at which to search. Should be in the form of "LDAP://xyz". .PARAMETER ...
0
3139.ps1
$Title = "Continue" $Info = "Would you like to continue?" $Options = [System.Management.Automation.Host.ChoiceDescription[]] @("&Yes", "&No") [int]$DefaultChoice = 0 $Opt = $host.UI.PromptForChoice($Title , $Info, $Options, $DefaultChoice) switch($Opt) { 0 { Write-Verbose -Message "Yes" } 1 { Write-Verbo...
0
sample_64_48.ps1
<# .SYNOPSIS NewSelfSignedCertificate.ps1 script file This is a place-holder file only for agent patch build purposes #> Write-Host "This file functionality is deprecated and is place-holder only" # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # ...
0
sample_50_43.ps1
# # Module manifest for module 'PowerShellProTools' # # Generated by: Ironman Software, LLC # # Generated on: 1/17/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'PowerShellProTools.psm1' # Version number of this module. ModuleVersion = '2023.12.0' # Supp...
0