filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
sample_60_94.ps1 | #
# Module manifest for module 'GCArcService'
#
# Generated by: Microsoft
#
# Generated on: 08/09/2020
#
@{
# Script module or binary module file associated with this manifest.
ModuleToProcess = 'GCArcService.psm1'
# Version number of this module.
ModuleVersion = '1.0'
# ID used to uniquely identify... | 0 |
2542.ps1 | $a = "XSQLUTIL18", "XSQLUTIL19"
$a | % `
{
$ServerName = $_;
cd sqlserver:\
cd sql\$ServerName\default\databases
$DBs = dir;
$DBs | % `
{
$LastBackupDate = $_.LastBackupDate;
$LastLogBackupDate = $_.LastLogBackupDate;
$LastDiffBackupDate = $_.LastDifferentialBackupDate;
invoke-sqlcmd -ServerInstance ... | 0 |
597.ps1 |
function Backup-AllSQLDBs{
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[String]
$Server = $env:COMPUTERNAME,
[Parameter(Mandatory=$true)]
[String]
$Instance,
[Parameter(Mandatory=$true)]
[String]
$Path
)
if((Get-PSSnapin "SqlServerCmdletSnapin100" -ErrorAction Si... | 0 |
3948.ps1 |
function Check-CmdletReturnType
{
param($cmdletName, $cmdletReturn)
$cmdletData = Get-Command $cmdletName;
Assert-NotNull $cmdletData;
[array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") ... | 0 |
2912.ps1 | Framework "2.0"
task default -depends MsBuild
task MsBuild {
if ( $IsMacOS -OR $IsLinux ) {
$output = &dotnet build -version -nologo 2>&1
Assert ($output -NotLike "15.3") '$output should contain 15.3'
}
}
| 0 |
sample_51_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicemesh'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicemesh.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEdition... | 0 |
sample_34_88.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplacepublisher'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplacepublisher.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# S... | 0 |
vmware guests subnet.ps1 | $snapins = "vmware.vimautomation.core"
foreach ($snapin in $snapins){if (!(Get-PSSnapin $snapin -ErrorAction SilentlyContinue)){Add-PSSnapin $snapin}}
$vserver = "vmware vCenter Server"
$vNetwork = "General_Services"
$logfile = "d:\\Scripts\\log\\vm.log"
$subnet = "255.255.255.128"
connect-viserver -Server $v... | 0 |
sample_45_79.ps1 | #
# Script module for module 'Az.IotHub' that is executed when 'Az.IotHub' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 05/16/2024 06:33:07
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
i... | 0 |
0ddea161-baf2-439c-b797-afb5c636692f.ps1 | #Variables
$Date = Get-Date
$TempReport = $env:TEMP + "\\temp.csv"
$FinalReport = $env:USERPROFILE + "\\" + $Date.Year + "_" + $Date.Month + "_" + $Date.Day + "_" + $Date.Hour + ":" + $Date.Minute + "_Scheduled_Task_Report.csv"
$title = Write-Host "Scheduled Task Reporter" -ForegroundColor green
$message = Write... | 0 |
1459.ps1 |
function Set-CDotNetAppSetting
{
[CmdletBinding(SupportsShouldProcess=$true, DefaultParameterSetName='All')]
param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[Parameter(Mandatory=$true)]
[string]
$Value,
[Switch]
... | 0 |
sample_32_83.ps1 | # Get the version of the Torizon IDE Extension from package.json
$env:TEST_EXTENSION_VERSION = ((Get-Content "package.json" -Raw) | ConvertFrom-Json).version
$env:TEST_VSCODE_CLEANUP = $true
# Start the tests from a clean environment, unless explictly setting to false
# the env variable
if ($env:TEST_VSCODE_CLEANUP -E... | 0 |
sample_48_79.ps1 | if (
(Test-Path .web\bufferSource.ts) -and
(Test-Path .web\fetchSource.ts) -and
(Test-Path .web\extension.ts) -and
(Test-Path .web\package-lock.json) -and
(Test-Path .web\package.json) -and
(Test-Path .web\.vscode\extensions.json) -and
(Test-Path .web\.vscode\launch.json) -and
(Test-Path... | 0 |
ErrorLogstoHTML.ps1 | $a="<style>"
$a=$a+"BODY{background-color :#FFFFF}"
$a=$a+"TABLE{Border-width:thin;border-style: solid;border-color:Black;border-collapse: collapse;}"
$a=$a+"TH{border-width: 0px;padding: 0px;border-style: solid;border-color: black;background-color: ThreeDShadow}"
$a=$a+"TD{border-width: 1px;padding: 0px;border-sty... | 0 |
1914.ps1 |
Describe "Get-Culture" -Tags "CI" {
It "Should return a type of CultureInfo for Get-Culture cmdlet" {
$culture = Get-Culture
$culture | Should -BeOfType [CultureInfo]
($culture).EnglishName | Should -BeExactly $host.CurrentCulture.EnglishName
Get-Culture -NoUserOverrides | Shou... | 0 |
IP Scan_Local User admin.ps1 | # The trigger
$obj = New-Object system.Net.NetworkInformation.Ping
100..200 | % { $ip = "10.1.1.$_"
$ping = $obj.send($ip,100)
write-host "." -noNewLine
if ($ping.status -eq "Success"){
C:\\Powershell\\Finduser.ps1 $ping.address.ipaddresstostring
}}
#--------------------------------
# Finduser.ps1
para... | 0 |
299.ps1 | function Unregister-PSFCallback
{
[CmdletBinding(DefaultParameterSetName = 'Name')]
param (
[Parameter(Mandatory = $true, ParameterSetName = 'Name')]
[string[]]
$Name,
[Parameter(ValueFromPipeline = $true, ParameterSetName = 'Object', Mandatory = $true)]
[PSFramework.FlowControl.Callback[]]
$Callback
... | 0 |
4182.ps1 |
[CmdletBinding()]
param ()
function Get-RelativePath {
[CmdletBinding()][OutputType([string])]
param ()
$Path = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent) + "\"
Return $Path
}
$RelativePath = Get-RelativePath
$InstalledVersion = [string]((Get-WmiObject Win32_BIOS).SMBIOSBIOSVersion)
$Model = ((... | 0 |
sample_28_29.ps1 |
function New-AzDataProtectionRestoreConfigurationClientObject{
[OutputType('PSObject')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates new restore configuration object')]
param(
[Parameter(Mandatory, HelpMessage='Datasource... | 0 |
sample_31_69.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 |
Find Local Group Members_10.ps1 | # Author: Hal Rottenberg
# Purpose: Find matching members in a local group
# Used tip from RichS here: http://powershellcommunity.org/Forums/tabid/54/view/topic/postid/1528/Default.aspx
# Change these two to suit your needs
$ChildGroups = "Domain Admins", "Group Two"
$LocalGroup = "Administrators"
$MemberName... | 0 |
556.ps1 |
function Add-SPOPrincipalToGroup
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$username,
[Parameter(Mandatory=$true, Position=1)]
[string]$groupname
)
process
{
Write-Host "Adding principal with username $username to group $groupname" -foregroundcolor black -back... | 0 |
sample_56_10.ps1 | parameters:
- name: federatedServiceConnection
type: string
- name: outputVariableName
type: string
# Resource to get a token for. Common values include:
# - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps
# - 'https://storage.azure.com/' for storage
# Defaults to Azure DevOps
- name: resource
type: strin... | 0 |
sample_47_53.ps1 | # dot-source all function files
Get-ChildItem -Path $PSScriptRoot | Unblock-File
Get-ChildItem -Path $PSScriptRoot\*.ps1 -Exclude ServiceFabricSDK.ps1 | Foreach-Object{ . $_.FullName }
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI... | 0 |
f5a3c50b-0ede-4fca-ae08-d97b3e9694f1.ps1 |
function Start-ISE ()
{
<#
.synopsis
Load some file into ISE
.Description
Load some file into ISE
.Parameter fileObjOrFileName
file to be loaded
.ReturnValue
$null
.Notes
Author: bernd kriszio
e-mail: bkriszio@googlemail.com
... | 0 |
sample_29_68.ps1 | {
"Vitest Describe": {
"prefix": "videscribe",
"body": [
"describe('${1:name}', () => {",
"\t${0}",
"})"
],
"description": "Vitest Describe"
},
"Vitest Describe - Concurrent": {
"prefix": "videscribe-concurrent",
"body": [
"describe.concurrent('${1:name}', () => {",... | 0 |
SynchronizationScript.ps.ps1 | #------- Get-SPServiceContext
function Get-SPServiceContext([Microsoft.SharePoint.Administration.SPServiceApplication]$profileApp)
{
if($profileApp -eq $null)
{
#----- Get first User Profile Service Application
$profileApp = @(Get-SPServiceApplication | ? { $_.TypeName -eq "User Profile ... | 0 |
sample_35_75.ps1 | (self.webpackChunkshell_app=self.webpackChunkshell_app||[]).push([[179,429],{4174:(W,F,d)=>{"use strict";d.d(F,{X:()=>f});var u=d(8714);let f=(()=>{class s{static themeStorageKey="msft.sme.shell-assetManager-theme";static defaultTheme="light";static darkTheme="dark";static assets;static get theme(){const c=MsftSme.Loca... | 0 |
3669.ps1 |
function Test-GetServerServiceObjective
{
$rg = Create-ResourceGroupForTest
$rg | Out-String | Write-Output
$server = Create-ServerForTest $rg
$server | Out-String | Write-Output
$requestedSlo = "GP_Gen5_2"
$requestedSloFilter = "GP_Gen*_2"
try
{
$o = Get-AzSqlServerServiceObjective $rg... | 0 |
2280.ps1 | [CmdLetBinding()]
param(
[parameter(Mandatory=$true, HelpMessage="Name of the Site server with the SMS Provider")]
[ValidateNotNullOrEmpty()]
[string]$SiteServer,
[parameter(Mandatory=$true, HelpMessage="Name of the device that will be checked for warranty")]
[ValidateNotNullOrEmpty()]
[string]$... | 0 |
sample_7_99.ps1 | #************************************************
# TS_IntersiteMessagingStateCheck.ps1
# Version 1.0.1
# Date: 6/6/2012
# Author: v-kaw
# Description: [Idea ID 2882] [Windows] The stop of Intersite Messaging service on ISTG causes DFSN cannot calculate site costs
# Rule number: 2882
# Rule URL: http://sharep... | 0 |
sample_2_67.ps1 | #************************************************
# TS_HPPrinterDriverVersionCheck.ps1
# Version 1.0.1
# Date: 07/23/2013
# Author: v-alyao
# Description: [KSE Rule] [ Windows V3] HKCU\Software\Hewlett-Packard registry hive increases in size on Citrix servers
# Rule number: ca320e17-1fa3-4740-9f81-c97f299741b0
... | 0 |
353.ps1 | function Register-PSFLoggingProvider
{
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFLoggingProvider')]
Param (
[Parameter(Mandatory = $true)]
[string]
$Name,
[switch]
$Enabled,
[System.Management.Automation.ScriptBlock]
$RegistrationEvent,
... | 0 |
3334.ps1 |
function Get-MyCommands {
[PoshBot.BotCommand(
Aliases = ('mycommands')
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot
)
$myCommands = $Bot.PluginManager.Commands.GetEnumerator().ForEach({
if ($_.Value.IsAuthorized($global:PoshBotContext.From, $Bot... | 0 |
2796.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
FullName,
LastWriteTimeUtc,
PSComputerName
FROM
*PrefetchListing.tsv
ORDER BY
LastWriteTimeUtc Desc
"@
& logparser -stats:off -i:csv -fixedsep:on -dtlines:0 -rtp:-1 $lpquery
} else {
$ScriptName = ... | 0 |
1935.ps1 |
Describe "Compare-Object" -Tags "CI" {
BeforeAll {
$nl = [Environment]::NewLine
$content1 = "line 1" + $nl + "line 2"
$content2 = "line 1" + $nl + "line 2.1"
$content3 = "line 1" + $nl + "line 2" + $nl + "line 3"
$content4 = "line 1" + $nl + "line 2.1" + $nl + "Line 3"
$file1 = Join-Path -Path $TestDri... | 0 |
sample_20_32.ps1 | #************************************************
# DC_DiskInfo.ps1
# Version 1.0
# Date: 09-05-2023
# Author: Edmund Spatariu
# Updated:
# Description: This script obtains Disk Info and associate a drive letter with corresponding LUN, saving output to a
# file named $ComputerName_DC_DiskInfo.txt
... | 0 |
327.ps1 | function Get-PSFScriptblock
{
[OutputType([PSFramework.Utility.ScriptBlockItem], ParameterSetName = 'List')]
[OutputType([System.Management.Automation.ScriptBlock], ParameterSetName = 'Name')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidDefaultValueForMandatoryParameter", "")]
[CmdletBinding(Default... | 0 |
sample_66_13.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerinstances'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerinstances.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Suppo... | 0 |
chkhash_19.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... | 0 |
sample_35_57.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 = '74.1.0'
# Supported P... | 0 |
sample_31_88.ps1 | # WARNING: this need to be set by the getExtVersion
$env:TEST_EXTENSION_VERSION = "2.4.2"
# get the local path
$myPath = Split-Path -parent $MyInvocation.MyCommand.Path
$env:TEST_LOCAL_PATH="$myPath"
if (-not [Environment]::GetEnvironmentVariable('TEST_EXTENSIONS_PATH')) {
$env:TEST_EXTENSIONS_PATH = $(Join-Path ... | 0 |
sample_42_75.ps1 | param()
if (Get-Module posh-vcpkg) { return }
if ($PSVersionTable.PSVersion.Major -lt 5) {
Write-Warning ("posh-vcpkg does not support PowerShell versions before 5.0.")
return
}
if (Test-Path Function:\TabExpansion) {
Rename-Item Function:\TabExpansion VcpkgTabExpansionBackup
}
function Tab... | 0 |
3324.ps1 |
function Get-ScheduledCommand {
[PoshBot.BotCommand(
Aliases = ('getschedule', 'get-schedule'),
Permissions = 'manage-schedules'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[string]$Id
)
$fields = @(
'Id',
@{l='Command'... | 0 |
1560.ps1 | function New-MrScriptModule {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]$Name,
[ValidateScript({
If (Test-Path -Path $_ -PathType Container) {
$true
}
else {
Throw "'$_' is not a valid directory."
... | 0 |
sample_65_74.ps1 | #
# Copyright 2018-2024 HP Development Company, L.P.
# All Rights Reserved.
#
# NOTICE: All information contained herein is, and remains the property of HP Development Company, L.P.
#
# The intellectual and technical concepts contained herein are proprietary to HP Development Company, L.P
# and may be cove... | 0 |
sample_36_18.ps1 | #
# Module manifest for module 'Az.DesktopVirtualization'
#
# Generated by: Microsoft Corporation
#
# Generated on: 23/04/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.DesktopVirtualization.psm1'
# Version number of this module.
ModuleVersion = '4.3.1'
... | 0 |
sample_66_49.ps1 | <#
.SYNOPSIS
Scenario module for collecting Microsoft Remote Assistance and Quick Assist / RemoteHelp related data
.DESCRIPTION
Collect Remote Assistance related troubleshooting data
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
... | 0 |
3647.ps1 |
function Test-ElasticPoolRecommendation
{
$response = Get-AzSqlElasticPoolRecommendation -ResourceGroupName TestRg -ServerName test-srv-v1
Assert-NotNull $response
Assert-AreEqual 2 $response.Count
Assert-AreEqual "ElasticPool2" $response[1].Name
Assert-AreEqual "Standard" $response[... | 0 |
3943.ps1 |
function Test-AzureFirewallPolicyCRUD {
$rgname = Get-ResourceGroupName
$azureFirewallPolicyName = Get-ResourceName
$azureFirewallPolicyAsJobName = Get-ResourceName
$resourceTypeParent = "Microsoft.Network/FirewallPolicies"
$location = "westcentralus"
$ruleGroupName = Get-Re... | 0 |
sample_45_66.ps1 | #Copyright (C) 2020,2023 VMware, Inc. All rights reserved.
. ".\utils.ps1"
$versionstart="VERSIONSTART"
$versionend="VERSIONEND"
function getRegPropValue {
param($key, $regKey, $name)
$errorMessage = $null
try {
$value=""
if (Test-Path $regKey) {
$exp = "(Get... | 0 |
ShowUI Clock 5.ps1 | New-UIWidget {
Grid {
$shadow = DropShadowEffect -ShadowDepth 0 -BlurRadius 5 -Direction 0
Ellipse -Name Hour -Fill Transparent -Stroke Black -StrokeThickness 100 -Width 350 -Height 350 -StrokeDashArray 7.85,7.85 -RenderTransformOrigin "0.5,0.5" -RenderTransform { RotateTransform -Angle -90 }
... | 0 |
sample_9_48.ps1 | #************************************************
# TS_HyperVKB2263829Check.ps1
#************************************************
Import-LocalizedData -BindingVariable RegKeyCheck
Write-DiagProgress -Activity $RegKeyCheck.ID_HyperVKB2263829Check -Status $RegKeyCheck.ID_HyperVKB2263829CheckDesc
$RootCauseDetect... | 0 |
2078.ps1 |
Add-Type -WarningAction Ignore @'
public class Base
{
private int data;
protected Base()
{
data = 10;
}
protected Base(int i)
{
data = i;
}
protected int Field;
protected int Property { get; set; }
public int Property1 { get; protected set; }
public int ... | 0 |
3663.ps1 |
function Test-CreateDatabase
{
Test-CreateDatabaseInternal "Southeast Asia"
}
function Test-CreateDatabaseInternal ($location = "westcentralus")
{
$rg = Create-ResourceGroupForTest
$server = Create-ServerForTest $rg $location
try
{
$databaseName = Get-DatabaseName
$job1 = New-AzSqlDataba... | 0 |
finddupe_16.ps1 | function Get-MD5([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.MD5CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.OpenRead();
$hashByteArray = $hashA... | 0 |
sample_38_3.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 |
Coloring text in RichTex.ps1 | #code showing in RichTextBox
$code = @'
using System;
using System.Linq;
using System.Reflection;
using System.Diagnostics;
[assembly: AssemblyVersion("3.5.0.0")]
namespace ProcessesSortedWithStartTime {
internal sealed class Program {
static DateTime Started(Process p) {
try {
return... | 0 |
sample_51_10.ps1 | param($installPath, $toolsPath, $package, $project)
Import-Module (Join-Path $toolsPath common.psm1) -Force
try {
# Indicates if current project is a VB project
$IsVbProject = ($project.CodeModel.Language -eq [EnvDTE.CodeModelLanguageConstants]::vsCMLanguageVB)
if ($IsVbProject) {
... | 0 |
sample_11_88.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... | 0 |
789.ps1 |
function Set-ScriptExtent {
[CmdletBinding(PositionalBinding=$false, DefaultParameterSetName='__AllParameterSets')]
param(
[Parameter(Position=0, Mandatory)]
[psobject]
$Text,
[Parameter(Mandatory, ParameterSetName='AsString')]
[switch]
$AsString,
... | 0 |
2204.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed.")]
[ValidateNotNullOrEmpty()]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[string]$SiteServer,
[parameter(Mandatory=$true, HelpMess... | 0 |
sample_41_81.ps1 | . "$PSScriptRoot/../project/api.ps1"
. "$PSScriptRoot/../php/api.ps1"
. "$PSScriptRoot/../database/helpers.ps1"
. "$PSScriptRoot/helpers.ps1"
function Php-Console {
param (
$Command,
$php=(Get-Php)
)
Set-Location (Get-Project-Root)
return & $php "-d" 'auto_prepend_file=""' "-d" "allow... | 0 |
2459.ps1 | function Show-Menu
{
param (
[string]$Title = 'My Menu'
)
Clear-Host
Write-Host "================ $Title ================"
Write-Host "1: Press '1' for this option."
Write-Host "2: Press '2' for this option."
Write-Host "3: Press '3' for this option."
Write-Host "Q: Press 'Q' to quit."
}
do
{
Show-Menu
$... | 0 |
chkhash_14.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... | 0 |
3914.ps1 |
function Test-ListMarketplaces
{
$marketplaces = Get-AzConsumptionMarketplace -Top 10
Assert-NotNull $marketplaces
Assert-AreEqual 10 $marketplaces.Count
Foreach($mkp in $marketplaces)
{
Assert-NotNull $mkp.BillingPeriodId
Assert-NotNull $mkp.ConsumedQuantity
Assert-NotNull $mkp.Cu... | 0 |
sample_10_5.ps1 | ConvertFrom-StringData @'
id_fileacl=Determining file ACL's
'@
# SIG # Begin signature block
# MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA6VsPfmmzM00am
# qvD0ITk80rX9ws5... | 0 |
sample_53_81.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_51_89.ps1 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apa... | 0 |
sample_27_57.ps1 | #
# Module manifest for module 'OCI.PSModules.Opensearch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Opensearch.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
... | 0 |
sample_62_80.ps1 | function Run-AlTests
(
[string] $TestSuite = $script:DefaultTestSuite,
[string] $TestCodeunitsRange = "",
[string] $TestProcedureRange = "",
[string] $ExtensionId = "",
[ValidateSet("Disabled", "Codeunit")]
[string] $TestIsolation = "Codeunit",
[ValidateSet('Windows','NavUserPassword... | 0 |
sample_7_46.ps1 | #************************************************
# DC_DSMisc.ps1
# Version 1.0.1
# Date: 07-10-2009
# VBScript by Craig Landis (clandis@microsoft.com)
# PS1 by Andret Teixeira
#************************************************
Import-LocalizedData -BindingVariable DSMiscStrings -FileName DC_DSMisc -UICulture e... | 0 |
2742.ps1 |
function Get-AddrPort {
Param(
[Parameter(Mandatory=$True,Position=0)]
[String]$AddrPort
)
Write-Verbose "Entering $($MyInvocation.MyCommand)"
Write-Verbose "Processing $AddrPort"
if ($AddrPort -match '[0-9a-f]*:[0-9a-f]*:[0-9a-f%]*\]:[0-9]+') {
$Addr, $Port = $AddrPort -split "]:"
... | 0 |
Set-UserCannotChangePass_1.ps1 | #########1#########2#########3#########4#########5#########6#########7#########8#########9#########1
#########0#########0#########0#########0#########0#########0#########0#########0#########0#########0
#
# Author: Erik McCarty
#
# Description: Set the "user Cannot Change Password" property on an active
# director... | 0 |
1685.ps1 |
function Get-MADObject {
param (
[string]$name,
[string]$description,
[string]$searchroot,
[ValidateSet($null,'user','group','computer')]
$type
)
if (!$name -and !$description -and !$searchroot -and !$type) {
Throw 'Please provide a type, search ter... | 0 |
Get-WordOutline_1.ps1 | function Get-WordOutline ( $Path, [int]$MaxDepth = 9 ) {
if ( $Path -is [System.IO.FileInfo] ) { $Path = $_.FullName }
$word = New-Object -comObject word.application
$document = $word.documents.open( $path )
$outline = $document.paragraphs | Where-Object {
$_.outlineLevel -le $MaxDepth
} | ForEach-Object {... | 0 |
1912.ps1 |
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
$originalWarningPreference = $WarningPreference
$WarningPreference = "SilentlyContinue"
$skipTest = ! ($IsWindows -and $IsCoreCLR -and (Test-IsElevated))
$PSDefaultParameterValues["it:skip"] = $skipTest
try
{
Describe "Implicit remoting and CI... | 0 |
1859.ps1 |
function New-ModuleFromLayout
{
param(
[Parameter(Mandatory=$true)]
[hashtable]
$Layout,
[Parameter(Mandatory=$true)]
[string]
$BaseDir
)
if (-not (Test-Path $BaseDir))
{
$null = New-Item -Path $BaseDir -ItemType Directory
}
forea... | 0 |
3640.ps1 |
function Test-CreateJobCredential
{
$a1 = Create-ElasticJobAgentTestEnvironment
try
{
Test-CreateJobCredentialWithDefaultParam $a1
Test-CreateJobCredentialWithParentObject $a1
Test-CreateJobCredentialWithParentResourceId $a1
Test-CreateJobCredentialWithPiping $a1
}
finally
{
Remove-Resou... | 0 |
Get-Codecs.ps1 | [string[]]$key = "SOFTWARE\\Classes\\CLSID\\{083863F1-70DE-11d0-BD40-00A0C911CE86}\\Instance",
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32"
function ModuleInfo([string]$path) {
$item.SubItems.Add((gci $path).VersionInfo.CompanyName)
$item.SubItems.Add((gci $path).VersionInfo.F... | 0 |
sample_48_2.ps1 | function Invoke-RunTests {
Param(
[Parameter(Mandatory = $true)]
$ContainerName,
[Parameter(Mandatory = $false)]
$Tenant,
[Parameter(Mandatory = $true)]
$CompanyName,
[Parameter(Mandatory = $false)]
[pscredential]$Credential,
[Paramet... | 0 |
Xml Module _1.6.ps1 | #requires -version 2.0
# Improves over the built-in Select-XML by leveraging Remove-XmlNamespace http`://poshcode.org/1492
# to provide a -RemoveNamespace parameter -- if it's supplied, all of the namespace declarations
# and prefixes are removed from all XML nodes (by an XSL transform) before searching.
# IMP... | 0 |
sample_44_72.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydataplane.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Support... | 0 |
sample_13_0.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmcontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmcontrolplane.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported P... | 0 |
2706.ps1 | function Get-LibSymbols
{
[CmdletBinding()] Param (
[Parameter(Position = 0, Mandatory = $True, ValueFromPipelineByPropertyName = $True)]
[ValidateScript({ Test-Path $_ })]
[Alias('FullName')]
[String[]]
$Path
)
BEGIN
{
$Code = @'
using System;
... | 0 |
sample_37_15.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | 0 |
ce50f222-81f6-4509-90ad-8904f9331d7c.ps1 | # Detect 32 or 64 bits Windows – regardless of WoW64 – with the PowerShell OSArchitecture function
# By Vincent Hoogendoorn
@@# See http://vincenth.net/blog/archive/2009/11/02/detect-32-or-64-bits-windows-regardless-of-wow64-with-the-powershell-osarchitecture-function.aspx for details.
@@# For the used InvokeCSharp ... | 0 |
sample_24_78.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 = '75.1.0'
# Supported PSEditions
... | 0 |
Find-GeoCode_1.ps1 | $mappoint = New-WebServiceProxy http://staging.mappoint.net/standard-30/mappoint.wsdl -Namespace MapPoint
$FindService = new-object MapPoint.FindServiceSoap
# You need an account, sign up here: https://mappoint-css.live.com/mwssignup
$FindService.Credentials = Get-Credential
function Find-ReverseGeoCode( [double... | 0 |
sample_61_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Visualbuilder'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Visualbuilder.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEdi... | 0 |
973.ps1 |
$SubscriptionId = ''
$resourceGroupName = "myResourceGroup-$(Get-Random)"
$location = "westus2"
$vNetName = "myVnet-$(Get-Random)"
$vNetAddressPrefix = "10.0.0.0/16"
$defaultSubnetName = "myDefaultSubnet-$(Get-Random)"
$defaultSubnetAddressPrefix = "10.0.0.0/24"
$miSubnetName = "myMISubnet-$(Get-Random)"
$miSubnetA... | 0 |
sample_16_63.ps1 | #
# Module manifest for module 'OCI.PSModules.Email'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Email.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Compatible... | 0 |
sample_29_94.ps1 | #
# Module manifest for module 'OCI.PSModules.Ocvp'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ocvp.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
CompatiblePS... | 0 |
sample_13_65.ps1 | ConvertFrom-StringData @'
id_filever=Collecting critical file versions
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC5Phm1j+58Cc4T
# lUIb... | 0 |
2991.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "New-PesterState" {
Context "TestNameFilter parameter is set" {
$p = new-pesterstate -TestNameFilter "filter"
it "sets the TestNameFilter property" {
$p.TestNameFilter | should -be "filter"
}... | 0 |
sample_25_41.ps1 | #
# Module manifest for module 'OCI.PSModules.Common'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Common.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Compatib... | 0 |
sample_45_82.ps1 | #
# Module manifest for module 'OCI.PSModules.Apigateway'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apigateway.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
... | 0 |
1384.ps1 |
function Uninstall-CCertificate
{
[CmdletBinding(SupportsShouldProcess=$true,DefaultParameterSetName='ByThumbprint')]
param(
[Parameter(Mandatory=$true,ParameterSetName='ByThumbprint',ValueFromPipelineByPropertyName=$true,ValueFromPipeline=$true)]
[Parameter(Mandatory=$true,ParameterSetNam... | 0 |
604.ps1 |
function Send-PPErrorReport{
param(
[Parameter(Mandatory=$true)]
[String]
$FileName,
[Parameter(Mandatory=$true)]
[String]
$ScriptName,
[switch]
$ClearErrorVariable
)
if($Error){
$Error
$Body = ""
$Error | foreach{$Body += $_.ToString() + $_.InvocationIn... | 0 |
sample_4_74.ps1 | #
# Module manifest for module 'OCI.PSModules.Visualbuilder'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Visualbuilder.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported PSEdi... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.