filename
stringlengths
5
142
content
stringlengths
2
26M
label
int64
0
1
245.ps1
function Get-SCCMDeviceCollectionDeployment { [CmdletBinding()] PARAM ( [Parameter(Mandatory)] [System.String]$DeviceName, [Parameter(Mandatory)] [System.String]$SiteCode, [Parameter(Mandatory)] [System.String]$ComputerName, [Alias('RunAs')] ...
0
sample_29_13.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 = '81.0.0' ...
0
sample_33_96.ps1
[CmdletBinding()] param ( [Parameter(Mandatory)] [string]$Path, [Parameter()] [string]$Sha, [Parameter()] [string]$Before ) $string = "" if (![String]::IsNullOrEmpty($Before)) { try { $string = $($(git show "$($Before)^:$($Path)") -join "`r`n")3>&1 2>&1 } catch { ...
0
1619.ps1
function pingt { param( [Parameter(ValueFromPipeline=$true)] $comp = $env:COMPUTERNAME, $n = 4, [switch]$t ) if (!$comp) {Throw 'No host provided'} function callping { sleep 1 Write-Host $(Get-Date -f 'yyyy/MM/dd HH:mm:ss ') -NoNewline ping1 $...
0
sample_41_70.ps1
<############################################################## # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # ##############################################################>...
0
sample_17_86.ps1
# Localized 12/03/2020 06:20 PM (GMT) 303:4.80.0411 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=はい(&Y) PromptNoString=いいえ(&N) BundleFound=見つかったバンドル: {0} PackageFound=パッケージが見つかりました: {0} EncryptedBundleFound=暗号化されたバンドルが見つかりました: {0} EncryptedPackageFound=暗号化されたパッ...
0
sample_21_21.ps1
if($debug -eq $true){[void]$shell.popup("Run DC_FCInfo.ps1")} if ($OSArchitecture -eq 'ARM') { 'Skipping running {fcinfo.exe} since it is not supported in ' + $OSArchitecture + ' architecture.' | WriteTo-StdOut return } Import-LocalizedData -BindingVariable FCInfoStrings Write-DiagProgress -Activity $FCIn...
0
sample_42_99.ps1
@{ IncludeRules=@('PSAvoidUsingPlainTextForPassword', 'PSAvoidUsingComputerNameHardcoded', 'PSAvoidUsingConvertToSecureStringWithPlainText', 'PSUsePSCredentialType', 'PSAvoidUsingUserNameAndPasswordParams') } # SIG # Begin signature block ...
0
Update-Ipod.ps1
function Update-Ipod { $start = Get-Date $iTunesCOM = New-Object -comObject iTunes.Application $iTunesCOM.UpdateIPod() $elapsedTime = (Get-Date) - $start Write-Host "Elapsed Time: $elapsedTime" }
0
sample_65_67.ps1
# # Module manifest for module 'OCI.PSModules.Servicemanagerproxy' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicemanagerproxy.dll' # Version number of this module. ModuleVersion = '83.3.0' # Sup...
0
sample_44_41.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 = '79.0.0...
0
sample_46_66.ps1
function PSConsoleHostReadLine { [System.Diagnostics.DebuggerHidden()] param() ## Get the execution status of the last accepted user input. ## This needs to be done as the first thing because any script run will flush $?. $lastRunStatus = $? Microsoft.PowerShell.Core\Set-StrictMode -Off...
0
2326.ps1
function New-ScreenShot { [OutputType([System.IO.FileInfo])] [CmdletBinding()] param ( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidateScript({ -not (Test-Path -Path $_ -PathType Leaf) })] [ValidatePattern('\.jpg|\.jpeg|\.bmp')] [string]$FilePath ) begin { $ErrorActionPreference = '...
0
sample_53_82.ps1
<#PSScriptInfo .VERSION 1.0 .COMPANYNAME Microsoft .COPYRIGHT (c) 2022 ES365 FUNDAMENTALS SECURITY AND COMPLIANCE <es365funsandc@microsoft.com>. .PROJECTURI https://aka.ms/Wiki_ES365ConfFetch #> <# .SYNOPSIS .\Fetch-ES365FunSecurityConfig.ps1 .DESCRIPTION This scripts fetches all the requi...
0
927.ps1
$rgName='MyResourceGroup' $location='eastus' $cred = Get-Credential -Message 'Enter a username and password for the virtual machine.' New-AzResourceGroup -Name $rgName -Location $location $subnet = New-AzVirtualNetworkSubnetConfig -Name 'MySubnet' -AddressPrefix 192.168.1.0/24 $vnet = New-AzVirtualNetwork -Reso...
0
sample_17_34.ps1
#************************************************ # DC_NgenCollect.ps1 # Version 1.0 # Date: 2009-2019 # Author: Walter Eder (waltere@microsoft.com) # Description: Collects .Net Framework nGen files # Called from: TS_AutoAddCommands_Apps.ps1 #******************************************************* Trap [Excep...
0
sample_65_78.ps1
# # Copyright (c) Microsoft Corporation. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ...
0
Get-HelpInfo - PS V3.ps1
#requires -version 3 function Get-HelpInfo { write-progress -id 1 -Activity "Get-HelpInfo" -Status "Getting remote version table..." # could cache this $remote = & { $html = invoke-webrequest http://technet.microsoft.com/en-us/windowsserver/jj662920 $html.ParsedHtml.getElementsBy...
0
4191.ps1
[CmdletBinding()] param ( [ValidateNotNullOrEmpty()][string]$ReportFile = 'Applications.csv', [ValidateNotNullOrEmpty()][string]$ReportFileLocation = 'c:\windows\waller' ) function Get-AddRemovePrograms { [CmdletBinding()][OutputType([string])] param () $Architecture = Get-Architecture if ($Architecture...
0
1742.ps1
[cmdletbinding(DefaultParameterSetName='Build')] param( [Parameter(ParameterSetName='packageSigned')] [Parameter(ParameterSetName='Build')] [ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")] [string]$ReleaseTag, [Parameter(Mandatory,ParameterSetName='packageSigned')] [string] $Buil...
0
2947.ps1
task default -depends Test task Test -depends Compile, Clean {} task Compile -depends Clean { "Compile" } task Clean { "Clean" } taskTearDown { param($task) Assert ($task -ne $null) '$task should not be null' Assert (-not ([string]::IsNullOrWhiteSpace($task.Name))) '$task.Name should not be nul...
0
sample_48_40.ps1
# Localized 04/14/2024 08:54 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=&Sim PromptNoString=&Não BundleFound=Encontrou o pacote: {0} PackageFound=Encontrado o pacote: {0} EncryptedBundleFound=Lote criptografado encontrado: {0} Encrypted...
0
connect-domain.ps1
function connect-domain_X { BEGIN {$foregroundcolor= (get-host).ui.rawui.get_foregroundcolor() Write-Host ""; "---------------------------------" ; "Entering Nested Prompt for Quest connection to DOMAIN_X."; "Type `"Exit`" when finished."; "---------------------------------" ; "" ...
0
sample_48_82.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_29_0.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_26_43.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 = '75.1.0' # Supported PSEditi...
0
4142.ps1
Function Import-LGPO { Param([String]$LGPOName, [String]$LGPOLocation, [String]$GPOType) $Executable = $Global:RelativePath+"ImportRegPol.exe" If ($GPOType -eq "Machine") { $GPOType = "\DomainSysvol\GPO\Machine\registry.pol" } else { $GPOType = "\DomainSysvol\GPO\User\registry.pol" } $Parameters = "-m "...
0
Get Stock Quotes.ps1
function Get-StockQuote { param($symbols) process { $s = new-webserviceproxy -uri http://www.webservicex.net/stockquote.asmx foreach ($symbol in $symbols) { $result = [xml]$s.GetQuote($symbol) $result.StockQuotes.Stock } } } # Example: # Get-StockQuote VMW, EMC | select Symbol, Last
0
sample_31_60.ps1
# # Module manifest for module 'OCI.PSModules.Databasemigration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasemigration.dll' # Version number of this module. ModuleVersion = '75.1.0' # Support...
0
22.ps1
. $PSScriptRoot\Shared.ps1 Describe 'ParamsTabExpansion Tests' { Context 'Push Parameters TabExpansion Tests' { It 'Tab completes all long push parameters' { $result = & $module GitTabExpansionInternal 'git push --' $result -contains '--all' | Should Be $true $result -co...
0
sample_7_64.ps1
param( [string]$DataPath, [switch]$AcceptEula, [switch]$Logs, [switch]$Trace, [string]$StartAt, [string]$Duration, [switch]$Auth ) $version = "Sched-Collect (20231031)" <# Created by Gianni Bragante - gbrag@microsoft.com Updates: 2023-10-31 Marius Porcolean (maporcol@microsoft...
0
sample_32_59.ps1
<#################################################################################################################################################################################################################### ##############################| |#################################################################...
0
sample_53_49.ps1
# region Generated # ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obt...
0
sample_23_60.ps1
Хранилище сертификатов и ключей шифрования формата PKCS#12. Форматов файлов: `*.p12`, `*.pfx`. MIME-тип: `application/x-pkcs12`. -------------------- **Видимость:** @Глобально **Примеры:** ```xbsl метод ВычислитьПодпись(Данные: Байты, ХранилищаPkcs12: Байты) знч Криптопровайдер = Криптография.ПолучитьBouncyCa...
0
Use-Culture.ps1
#############################################################################\n##\n## Use-Culture\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\nInvoke a scrip...
0
sample_15_95.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 = '74.1.0' # Supported PSEdition...
0
sample_34_29.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_42_46.ps1
function Stop-AzDataProtectionBackupInstanceProtection { [OutputType('System.Boolean')] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('This operation will stop protection of a backup instance an...
0
sample_31_33.ps1
# # Module manifest for module 'OCI.PSModules.Monitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Monitoring.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions ...
0
sample_46_56.ps1
# Copyright (C) Intel Corporation,2021 All Rights Reserved. function Invoke-ConfigureTLSServerAuthentication { <# .Synopsis Configures AMT connection to TLS with server authentication. .Description This cmdlet configures the AMT connection to TLS with server authentication. The cmdlet adds the AM...
0
Out-DataTable_7.ps1
####################### function Get-Type { param($type) $types = @( 'System.Boolean', 'System.Byte[]', 'System.Byte', 'System.Char', 'System.Datetime', 'System.Decimal', 'System.Double', 'System.Guid', 'System.Int16', 'System.Int32', 'System.Int64', 'System.Single', 'System.UInt16', 'System.UIn...
0
sample_9_60.ps1
#************************************************ # TS_MCALite.ps1 # Version 1.0.1 # Date: 7/17/2012 # Author: tspring # Description: [Idea ID 4796] [Windows] MaxConcurrentApi Problem Detection Lite # Rule number: 4796 # Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.aspx?ID=4796 #**...
0
sample_24_83.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 = '73.1.0' # Supported...
0
Replace-InTextFile.ps1
# Replace-InTextFile.ps1 # Replace Strings in files param ( [string] $Path = "." , [string] $Filter # Select no files, by default.... , [string] $pattern = $(Read-Host "Please enter a pattern to match") , [string] $replace = $(Read-Host "Please enter a replacement string") ...
0
sample_65_33.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
e7cd2cb0-d32a-4631-a081-302f0685887c.ps1
$Mailboxes = Get-CASMailbox -Filter {HasActivesyncDevicePartnership -eq $true} $EASMailboxes = $Mailboxes | Select-Object PrimarySmtpAddress,@{N='DeviceID';E={Get-ActiveSyncDeviceStatistics -Mailbox $_.Identity | Select-Object –ExpandProperty DeviceID}} $EASMailboxes | foreach {Set-CASMailbox $_.PrimarySmtpAddres...
0
sample_61_38.ps1
<unk> 0 <s> 0 </s> 0 _t -0 _th -1 _a -2 in -3 er -4 _s -5 ou -6 _w -7 on -8 at -9 _the -10 re -11 an -12 or -13 en -14 _c -15 is -16 _m -17 it -18 ing -19 _f -20 _h -21 _b -22 _I -23 _to -24 es -25 ll -26 _p -27 _d -28 _y -29 nd -30 _o -31 _you -32 ar -33 _l -34 _in -35 _n -36 ed...
0
Install-Solarized.ps1
param($Path = "~\\AppData\\Roaming\\Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\\TaskBar\\Windows PowerShell.lnk" ) # SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB # --------- ------- ---- ------- ----------- ---------- ----------- ----------- # base03 #002b36 8/4 brblack ...
0
140.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
3602.ps1
function Get-AzureRmJitNetworkAccessPolicy-SubscriptionScope { Set-AzureRmJitNetworkAccessPolicy-ResourceGroupLevelResource $jitNetworkAccessPolicies = Get-AzJitNetworkAccessPolicy Validate-JitNetworkAccessPolicies $jitNetworkAccessPolicies } function Get-AzureRmJitNetworkAccessPolicy-ResourceGr...
0
2730.ps1
function GetBase64GzippedStream { Param( [Parameter(Mandatory=$True,Position=0)] [System.IO.FileInfo]$File ) $memFile = New-Object System.IO.MemoryStream (,[System.IO.File]::ReadAllBytes($File)) $memStrm = New-Object System.IO.MemoryStream $gzStrm = New-Object Syste...
0
sample_35_30.ps1
# # Module manifest for module 'OCI.PSModules.Recovery' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Recovery.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Comp...
0
sample_53_73.ps1
# # Module manifest for module 'OCI.PSModules.Blockchain' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Blockchain.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions ...
0
Format-Column 0.3.ps1
function global:Format-Column { ################################################################ #.Synopsis # Formats incoming data to columns. #.Description # It works similarly as Format-Wide but it works vertically. Format-Wide outputs # the data row by row, but Format-Columns outputs them column by column....
0
sample_41_71.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_27_44.ps1
# # Module manifest for module 'OCI.PSModules.Fusionapps' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Fusionapps.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions ...
0
sample_37_86.ps1
# # Module manifest for module 'OCI.PSModules.Opsi' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opsi.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions CompatiblePS...
0
sample_18_97.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Advisor.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Advisor.internal.psm1' if(Test-Path $internalModulePath) { $nul...
0
442.ps1
Register-PSFConfigValidation -Name "consolecolor" -ScriptBlock { Param ( $Value ) $Result = New-Object PSObject -Property @{ Success = $True Value = $null Message = "" } try { [System.ConsoleColor]$color = $Value } catch { $Result.Message = "Not a console color: $Value" $Result.Success = $False...
0
sample_33_63.ps1
# # Module manifest for module 'OCI.PSModules.Appmgmtcontrol' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Appmgmtcontrol.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSE...
0
Lead Systems Engineer.ps1
<# Author: Matt Schmitt Date: 11/28/12 Version: 1.0 From: USA Email: ithink2020@gmail.com Website: http://about.me/schmittmatt Twitter: @MatthewASchmitt Description A script for forwarding and unforwarding email for users in Office 365. #> Import-Module ActiveD...
0
sample_38_20.ps1
# # Module manifest for module 'Az.Automanage' # # Generated by: Microsoft Corporation # # Generated on: 23/04/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.Automanage.psm1' # Version number of this module. ModuleVersion = '1.0.1' # Supported PSEditi...
0
86.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_6_60.ps1
# DC_RunSqlDiagScripts.ps1 # This script has dependencies on utils_CTS and utils_DSD # param( [Object[]] $instances, [switch]$CollectSqlDiag, [switch]$CollectAlwaysOnInfo ) #_# SQLDIAG script name for SQL Server 2014 New-Variable SQL_SCRIPT_SQLDIAG_2014 -Value "sp_sqldiag12.sql" -Option ReadOnly #...
0
1003.ps1
$myEndpoint = "<your-endpoint-URL>" $myResourceGroup = "<resource-group-name>" $nsgName = "<your-nsg-name>" New-AzResourceGroup -Name $myResourceGroup -Location westus2 New-AzNetworkSecurityGroup -Name $nsgName -ResourceGroupName $myResourceGroup -Location westus2 $resourceId = (Get-AzResource -ResourceNam...
0
2760.ps1
function Get-LogonSession { param ( [Parameter(Mandatory = $true)] [UInt32] $LogonId ) $LogonMap = @{} Get-WmiObject Win32_LoggedOnUser | %{ $Identity = $_.Antecedent | Select-String 'Domain="(.*)",Name="(.*)"' $LogonSession = $_.Dependent | Sele...
0
sample_33_89.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Find-Ast { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding(PositionalBinding=$false, DefaultParameterSetName='FilterScript')] param( [Parameter(Position=0, ParameterSe...
0
New-XVM_6.ps1
#Examples <# New-XVM -Name "WS2012-TestServer01" -SwitchName "Switch(192.168.2.0/24)" -VhdType NoVHD New-XVM -Name "WS2012-TestServer02" -SwitchName "Switch(192.168.2.0/24)" -VhdType ExistingVHD -VhdPath 'D:\\vhds\\WS2012-TestServer02.vhdx' New-XVM -Name "WS2012-TestServer03" -SwitchName "Switch(192.168.2.0/24)" ...
0
sample_36_0.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
1968.ps1
Describe 'ConvertFrom-Markdown tests' -Tags 'CI' { BeforeAll { $esc = [char]0x1b $hostSupportsVT100 = $Host.UI.SupportsVirtualTerminal function GetExpectedString { [CmdletBinding()] param( [ValidateSet( "Header1", "Header2", "...
0
572.ps1
function Add-SPOChoicesToField { [CmdletBinding()] param ( [Parameter(Mandatory=$true, Position=1)] [string[]] $choices, [Parameter(Mandatory=$true, Position=2)] [string] $fieldName, [Parameter(Mandatory=$true, Position=3)] [string] $listTitle ) Write-Host "Adding choices to field $fieldName...
0
sample_21_61.ps1
Import-LocalizedData -BindingVariable lpTxt -FileName AzStackHci.Ports.Strings.psd1 class HealthModel { # Attributes for Azure Monitor schema [string]$Name #Name of the individual test/rule/alert that was executed. Unique, not exposed to the customer. [string]$Title #User-facing name; one or more sen...
0
Start-Demo 3.3.3.ps1
## Start-Demo.ps1 ################################################################################################## ## This is an overhaul of Jeffrey Snover's original Start-Demo script by Joel "Jaykul" Bennett ## ## I've switched it to using ReadKey instead of ReadLine (you don't have to hit Enter each time) ## ...
0
ISE-Lines_2.ps1
#requires -version 2.0 ## ISE-Lines module v 1.2 ############################################################################################################## ## Provides Line cmdlets for working with ISE ## Duplicate-Line - Duplicates current line ## Conflate-Line - Conflates current and next line ## MoveUp-Lin...
0
Update-AdminPassword.ps1
<# .SYNOPSIS Local administrator password update .DESCRIPTION This script changes the local administrator password. .PARAMETER ADSPath The ActiveDirectory namespace to search for computers .PARAMETER AdminAccount The username of the administrator account .PAR...
0
sample_31_11.ps1
# Instructions: select the entire file and hit F8 to # load the extensions. To see the list of registered # extensions and run them, hit Ctrl+Shift+P, type 'addi' # and run the "Show additional commands from PowerShell modules" # command. A quick pick list will appear with all 3 # extensions registered. Selecti...
0
sample_6_68.ps1
#************************************************ # DC_ServerManagerLogs.ps1 # Version 1.0.1 # Date: 01-04-2011 # Author: Andre Teixeira - andret@microsoft.com # Description: This script can be used to obtain server manager related logs #************************************************ PARAM($MachineName=$Comp...
0
811.ps1
class MyClass { [String] $Name; [Int32] $Number; } [bool]$scriptBool = $false $scriptInt = 42 function Test-Variables { $strVar = "Hello" [string]$strVar2 = "Hello2" $arrVar = @(1, 2, $strVar, $objVar) $assocArrVar = @{ firstChild = "Child"; secondChild = 42 } $classVar = [MyClass]::new(); $classVar.Name = "...
0
sample_30_81.ps1
# Initialize variables if they aren't already defined. # These may be defined as parameters of the importing script, or set after importing this script. # CI mode - set to true on CI server for PR validation build or official build. [bool]$ci = if (Test-Path variable:ci) { $ci } else { $false } # Build configuration....
0
sample_7_44.ps1
# # Module manifest for module 'OCI.PSModules.Jms' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Jms.dll' # Version number of this module. ModuleVersion = '92.1.0' # Supported PSEditions CompatiblePSEd...
0
PowerShell Template_3.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="genemagerr@hotmail.com" } $comment=@(); while($s = (Read-Host "Comment").Trim()){$comment+="$s`r`n#"} ...
0
3577.ps1
$global:createRolloutTemplate = ".\ScenarioTests\CreateRollout.json" $global:failureCreateRolloutTemplate = ".\ScenarioTests\CreateRollout_FailureRollout.json" $global:parametersFileName = "Storage.Parameters.json" $global:invalidParametersFileName = "Storage_Invalid.Parameters.json" $global:templateFileName = "Storag...
0
779.ps1
$peekBuf = $null $currentLineNum = 0 $logEntryIndex = 0 function Parse-PsesLog { param( [Parameter(Mandatory=$true, Position=0)] [Alias("PSPath")] [ValidateNotNullOrEmpty()] [string] $Path, [Parameter()] [switch] $OldLogFormat, ...
0
300.ps1
function Stop-PSFFunction { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] [CmdletBinding(DefaultParameterSetName = 'Message', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Stop-PSFFunction')] param ( [Parameter(Mandatory = $true, Par...
0
ConvertFrom-CliXml_2.ps1
function ConvertFrom-CliXml { param( [Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)] [ValidateNotNullOrEmpty()] [String[]]$InputObject ) begin { $OFS = "`n" [String]$xmlString = "" } process { $xmlString += $Input...
0
sample_22_28.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ActionGroup.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActionGroup.Module]::Instance # Export nothing to clear imp...
0
sample_23_87.ps1
<############################################################## # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # ##############################################################>...
0
VM Disk Report_1.ps1
$VMs = get-vm $Results = @() foreach ($VM in $VMs) { $Result = new-object PSObject $Result | add-member -membertype NoteProperty -name "Name" -value $VM.Name $Result | add-member -membertype NoteProperty -name "Description" -value $VM.Notes $VMDiskCount = 1 get-harddisk $VM | foreach { ...
0
sample_45_45.ps1
# # Module manifest for module 'OCI.PSModules.Redis' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Redis.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions Compatible...
0
1253.ps1
function Get-CCertificateStore { [CmdletBinding(DefaultParameterSetName='ByStoreName')] param( [Parameter(Mandatory=$true)] [Security.Cryptography.X509Certificates.StoreLocation] $StoreLocation, [Parameter(Mandatory=$true,ParameterSetName='ByStoreName')] ...
0
1438.ps1
function Clear-CTrustedHost { [CmdletBinding(SupportsShouldProcess=$true)] param( ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState if( $pscmdlet.ShouldProcess( 'trusted hosts', 'clear' ) ) { Set-Item $Trust...
0
sudo for Powershell_2.ps1
# sudo.ps1 # # Authors: pezhore, mrigns, This guy: http://tsukasa.jidder.de/blog/2008/03/15/scripting-sudo-with-powershell # Other powershell peoples. # # Sources: # http://tsukasa.jidder.de/blog/2008/03/15/scripting-sudo-with-powershell # http://www.ainotenshi.org/%E2%80%98sudo%E2%80%99-for...
0
Highlight-Syntax _3.0.ps1
#requires -version 2.0 # Highlight-Syntax.ps1 # version 2.0 # by Jeff Hillman # # this script uses the System.Management.Automation.PsParser class # to highlight PowerShell syntax with HTML. param( [string] $code, [switch] $LineNumbers ) if ( Test-Path $code -ErrorAction SilentlyContinue ) { $code =...
0
Get-ADGroupMembers_2.ps1
Function Get-ADGroupMembers { <# .SYNOPSIS Return a collection of users in an ActiveDirectory group. .DESCRIPTION This function returns an object that contains all the properties of a user object. This function works for small groups as well as groups in ex...
0
sample_33_4.ps1
# # Module manifest for module 'OCI.PSModules.Disasterrecovery' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Disasterrecovery.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported...
0
app memory deltas.ps1
## Use ps to measure Application Memory Deltas ## Run '.\\ws_diff [Interval in Seconds] [Process Name] or ## to log all processes continually every 10 seconds -- 'while (1) {.\\WS_diff.ps1 10 cmd >> ps_out.txt }' # Create args as Variables or Objects $sleep_time = $args[0] #$sleep_time = 10 # Create or defin...
0
1252.ps1
function Remove-CGroupMember { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $Name, [Parameter(Mandatory=$true)] [string[]] [Alias('Members')] $Member ) Set-StrictMode -Version...
0
sample_39_13.ps1
@{ GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @('MSFT_MpPerformanceRecording.psm1') FormatsToProcess = @(...
0
sample_6_33.ps1
#************************************************ # DC_KBInstallLogs.ps1 # Version 1.0.1 # Date: 8-29-2012 # Author: Kate Wang (v-kaw) # Description: This script would collect %windir%\kb*.log when running on a Windows Server 2003 and XP to a compressed file named $ComputerName_KBInstallLogs.zip #***************...
0
sample_0_14.ps1
#************************************************ # TS_DetectRootSize.ps1 # Version 1.0.1 # Date: 1/15/2013 # Author: Tspring # Description: [Idea ID 6816] [Windows] Detect Certificate Root Store Size Problems # Rule number: 6816 # Rule URL: "http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.aspx?...
0