filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
1402.ps1 |
function Set-CTrustedHost
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string[]]
[Alias("Entries")]
$Entry
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.Sessio... | 0 |
sample_19_85.ps1 |
account-finish-account-setup = 完成账户设置
account-disconnected2 = 账户已断开连接
account-send-to-all-devices = 发送到所有设备
account-manage-devices = 管理设备…
account-reconnect = 重新绑定 { $email }
account-verify = 确认 { $email }
account-send-to-all-devices-titlecase = 发送到所有设备
account-manage-devices-titlecase = 管理设备…
account-send-tab-t... | 0 |
1128.ps1 |
$CategoryName = 'Carbon-PerformanceCounters'
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Stop-Test
{
Uninstall-PerformanceCounterCategory -CategoryName $CategoryName
Assert-False (Test-PerformanceCounterCategory -... | 0 |
2289.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, ParameterSetName="AllObjectTypes", HelpMessage="Specify the features to delegate permissions for")]
[parameter(Mandatory=$true, ParameterSetName="SpecificObjectTypes")]
[ValidateNotNullOrEmpty()]
[ValidateSet("PasswordWrite... | 0 |
sample_28_31.ps1 | @{
IncludeRules = @(
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
'PSUseConsistentWhitespace',
'PSUseConsistentIndentation',
'PSAlignAssignmentStatement',
'PSUseCorrectCasing'
)
Rules = @{
PSPlaceOpenBrace = @{
Enable ... | 0 |
150.ps1 | function Remove-PSObjectProperty
{
PARAM (
$PSObject,
[String[]]$Property)
PROCESS
{
Foreach ($item in $Property)
{
$PSObject.psobject.Properties.Remove("$item")
}
}
} | 0 |
4293.ps1 | function Out-DataTable
{
[CmdletBinding()]
[OutputType([System.Data.DataTable])]
param(
[Parameter( Position=0,
Mandatory=$true,
ValueFromPipeline = $true)]
[PSObject[]]$InputObject,
[string[]]$NonNullable = @()
)
Begin
{
... | 0 |
Set-VMBuildCSVDeploy.ps1 | #######################################################################
#
# Purpose: Build VMs from CSV file built by SET-VMBUILDCSV.ps1
# Author: David Chung
# Docs: N/A
#
# v.1 - 02/10/2012
#
# Instruction: ./set-vmbuildcsvdeploy.ps1 viserver csvfilename
#
#########################################... | 0 |
3656.ps1 |
function Test-VulnerabilityAssessmentServerSettingsTest
{
$testSuffix = getAssetName
Create-VulnerabilityAssessmentTestEnvironment $testSuffix
$params = Get-SqlVulnerabilityAssessmentTestEnvironmentParameters $testSuffix
$serverLogin = "testusername"
$serverPassword = "t357ingP@s5w0rd!Sec"
$cr... | 0 |
3660.ps1 |
function Test-ListDatabaseRestorePoints
{
$location = "Southeast Asia"
$serverVersion = "12.0";
$rg = Create-ResourceGroupForTest
try
{
$server = Create-ServerForTest $rg $location
$databaseName = Get-DatabaseName
$dwdb = New-AzSqlDatabase -ResourceGroupName $rg.ResourceGroupName -Serve... | 0 |
3377.ps1 | [CmdletBinding()]
Param(
[Parameter(Mandatory = $True, Position = 0)]
[string]$ReleaseDate,
[Parameter(Mandatory = $True, Position = 1)]
[string]$ReleaseVersion,
[Parameter(Mandatory = $False, Position = 2)]
[string]$PathToRepo
)
function UpdateCurrentDoc([string]$PathToCurrentDoc, [string]$... | 0 |
3517.ps1 |
function Test-ZoneCrud
{
$zoneName = Get-RandomZoneName
$resourceGroup = TestSetup-CreateResourceGroup
$createdZone = New-AzPrivateDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName -Tag @{tag1="value1"}
Assert-NotNull $createdZone
Assert-NotNull $createdZone.Etag
Asse... | 0 |
sample_41_85.ps1 | ###########################################################
# #
# Copyright (C) Microsoft. All rights reserved. #
# #
###########################################################
Write-Host "T... | 0 |
1943.ps1 |
Describe "Format-Wide" -Tags "CI" {
BeforeAll {
1..2 | ForEach-Object { New-Item -Path ("TestDrive:\Testdir{0:00}" -f $_) -ItemType Directory }
1..2 | ForEach-Object { New-Item -Path ("TestDrive:\TestFile{0:00}.txt" -f $_) -ItemType File }
$pathList = Get-ChildItem $TestDrive
}
It... | 0 |
3722.ps1 |
function Test-DataLakeStoreTrustedIdProvider
{
param
(
$location
)
if ([string]::IsNullOrEmpty($location))
{
$location = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US";
}
try
{
$resourceGroupName = Ge... | 0 |
sample_17_80.ps1 | $FileToCollect = Join-Path $Env:windir "system32\catroot2\dberr.txt"
$SectionDescription = "Catalog registration files"
$FileDescription = "SP Catalog Logging file"
Import-LocalizedData -BindingVariable DCStrings
Write-DiagProgress -activity $DCStrings.ID_DBErrCollecting -status $DCStrings.ID_DBErrCollectingDes... | 0 |
sample_17_90.ps1 | #!powershell
# -*- coding: utf-8 -*-
# (c) 2022, John McCall (@lowlydba)
# (c) 2021, Sudhir Koduri (@kodurisudhir)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#AnsibleRequires -CSharpUtil Ansible.Basic
#AnsibleRequires -PowerShell ansible_collections.lowlydba.sqlserver... | 0 |
3516.ps1 |
function Test-LinkCrud
{
$createdLink = Create-VirtualNetworkLink $false
Assert-NotNull $createdLink
Assert-NotNull $createdLink.Etag
Assert-NotNull $createdLink.Name
Assert-NotNull $createdLink.ZoneName
Assert-NotNull $createdLink.ResourceGroupName
Assert-AreEqual 1 $createdLink.Tags.Count
Assert... | 0 |
Update-vSwitchSecurity.ps1 | #requires -version 2.0
# Author: Glenn Sizemore 12/19/2009
# Source: http://get-admin.com/blog/?p=239
#
# v1.0 : It works
Cmdlet Update-vSwitchSecurity -SupportsShouldProcess {
param (
[Parameter(position=0,Mandatory=$TRUE,HelpMessage="Name of the vSwitch to modify")]
[string]
$vSwitch,
[Parameter(po... | 0 |
Open-Solution.ps1 | function Open-Solution([string]$path = ".") {
$sln_files = Get-ChildItem $path -Include *.sln -Recurse
if($sln_files -eq $null) {
Write-Host "No Solution file found"
return
}
if($sln_files.Count) { # There is more than one
do {
Write-Host "Please select file (or Ctrl+C to quit)"
... | 0 |
sample_60_63.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'https://aka... | 0 |
sample_6_22.ps1 | #************************************************
# DC_COMCollect.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 [Except... | 0 |
sample_46_96.ps1 | #
# Module manifest for module 'OCI.PSModules.Waa'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waa.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
init_repoclones.ps1 | <#
.SYNOPSIS
Makes a local copy of one or more remote svn repositories.
.DESCRIPTION
Makes a local copy of one or more remote svn repositories.
.INPUTS
None
You cannot pipe objects to init-repoclones.ps1
.OUTPUTS
None
.EXAMPLE
#>
param (
[string[]] $Repos = @('protobuf', 'mb-unit', 'opennod... | 0 |
Get-BogonList_3.ps1 | function Get-BogonList {
<#
.SYNOPSIS
Gets the bogon list.
.DESCRIPTION
The Get-BogonList function retrieves the bogon prefix list maintained by Team Cymru.
A bogon prefix is a route that should never appear in the Internet routing table.
A packet routed over the public Internet (not including over ... | 0 |
sample_30_92.ps1 | # Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
$ociTopLevelCommands = @()
$ociSubcommands = @{}
$ociCommandsToLongParams = @{}
$ociCommandsToShortParams = @{}
$PSScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
$slash = [IO.Path]::DirectorySeparatorChar
$FolderP... | 0 |
2716.ps1 |
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=0)]
[String]$File
)
function GetBase64GzippedStream {
Param(
[Parameter(Mandatory=$True,Position=0)]
[System.IO.FileInfo]$File
)
$memFile = New-Object System.IO.MemoryStream (,[System.IO.File]::ReadAllBytes($File))
... | 0 |
1704.ps1 |
[cmdletbinding()]
param (
$Task = 'Default',
[ValidateSet('Build','Minor','Major')]
$StepVersionBy = 'Build'
)
Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null
$Modules = @("Psake", "PSDeploy","BuildHelpers","PSScriptAnalyzer", "Pester")
ForEach ($Module in $Modules) {
If (-not (Get-Mod... | 0 |
sample_1_66.ps1 | [dynamic, provider("dcismprovider"),
Description(
"DCIM_AlertIndication is a derivation of "
"CIM_ProcessIndication.")]
class DCIM_AlertIndication : CIM_AlertIndication
{
[Description ("The time at which indication is generated")]
datetime IndicationTime;
[Description ("Description... | 0 |
sample_15_36.ps1 | #########################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Localized PSGet.Resource.psd1
#
#########################################################################################
ConvertFrom-StringData @'
###PSL... | 0 |
sample_48_29.ps1 | #
# Module manifest for module 'OCI.PSModules.Databasetools'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Databasetools.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEdi... | 0 |
sample_32_73.ps1 | #
# Module manifest for module 'OCI.PSModules.Certificates'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Certificates.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditi... | 0 |
119.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 |
4089.ps1 |
[CmdletBinding()]
param
(
[switch]$Logging,
[string]$LogLocation
)
function Get-Architecture {
[CmdletBinding()][OutputType([string])]
param ()
$OSArchitecture = (Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture).OSArchitecture
Return $OSArchitecture
}
function Get-DellCommandUpd... | 0 |
sample_8_50.ps1 | #************************************************
# DC_Certificates-Component.ps1
# Version 1.1: Added the -silent switch. 11/2012
# Version 1.2: Added table of contents to output
# Version 1.3.08.22.14: The overview heading was missing from output file _Certificates-userstore.TXT. Corrected by moving $OutputFile d... | 0 |
Import-GalPhoto.ps1 | <#
.Synopsis
Import Exchange 2010 Gal photo for one or more users.
.DESCRIPTION
This function invokes the Import-RecipientDataProperty cmdldet to import a picture into the thumbnailPhoto attribute of an Exchange mailbox.
It assumes you have a directory containing all images to import, with the file names... | 0 |
sample_63_32.ps1 | #
# Module manifest for module 'OCI.PSModules.Usageapi'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Usageapi.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditions
Comp... | 0 |
1503.ps1 |
function Assert-NotNull
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
[object]
$InputObject,
[Parameter(Position=1)]
[string]
$Message
)
Set-StrictMode -Version 'Latest'
if( $InputObject -eq $null )
... | 0 |
sample_35_80.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 |
sample_46_45.ps1 | "File","Version","SHA256Hash"
"Analyze-SpaceDump.ps1","23.11.21.1852","FCE0E32C7B90FE056230CF08F5E22288936BA7237C79C82EA43A10E02D412B00"
"Check-SharingStatus.ps1","23.12.05.1815","18D3CA66E396C0D1248E1AC0B0F96F31322A42EFE6A27F7553796FC173FD95F3"
"Clear-MailboxPermission.ps1","23.01.13.1832","1B9CF3500EA27C5594A02F43... | 0 |
574.ps1 |
function Get-SPOPrincipal
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$username
)
$principal = $clientContext.Web.EnsureUser($username)
$clientContext.Load($principal)
$clientContext.ExecuteQuery()
return $principal
}
| 0 |
sample_23_3.ps1 | @{
IncludeRules=@('PSUseApprovedVerbs',
'PSReservedCmdletChar',
'PSReservedParams',
'PSShouldProcess',
'PSUseShouldProcessForStateChangingFunctions',
'PSUseSingularNouns',
'PSMissingModuleManifestField'... | 0 |
sample_36_72.ps1 | #
# Module manifest for module 'OCI.PSModules.Psql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Psql.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
CompatiblePS... | 0 |
sample_52_50.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 = '77.0.0'
# Suppo... | 0 |
2998.ps1 | function In {
[CmdletBinding()]
param(
$path,
[ScriptBlock] $execute
)
Assert-DescribeInProgress -CommandName In
$old_pwd = $pwd
& $SafeCommands['Push-Location'] $path
$pwd = $path
try {
Write-ScriptBlockInvocationHint -Hint "In" -ScriptBlock $execute
... | 0 |
3668.ps1 |
function GetResourceNames()
{
return @{ `
"Location" = "Australia East"
"ResourceGroupName" = "WIRunnersProd"; `
"ServerName" = "wi-runner-australia-east"; `
"DatabaseName" = "WIRunner"; `
"ElasticPoolName" = "WIRunnerPool"; `
}
}
function Test-ListServ... | 0 |
sample_51_96.ps1 | ConvertFrom-StringData @'
###PSLOC
ArcMachineAlreadyExistsInResourceGroupError = Arc machine(s) with names: {0} already exists in the Resource Group {1}. Use a different Resource group for registration or specify a different Arc for Servers Resource Group.
ArcMachineNotFound = No Arc machine(s) were found with the s... | 0 |
Search cmdlet help.ps1 | function Search-Help($term) {
Get-Command | Where { Get-Help -full -ea SilentlyContinue $_ |
Out-String | Select-String $term }
}
| 0 |
sample_19_25.ps1 | var state = command.getTrait("state");
var manipData = services.manipulators.getManipulatorData("CameraManipulator");
var mode = manipData.getTrait("CameraManipulationMode");
var tool = new Object();
tool.activate = function () {
state.value = 2;
mode.value = 2; // Orbit mode
}
tool.deactivate = fun... | 0 |
1028.ps1 | Login-AzAccount
Get-AzSubscription
Set-AzContext -SubscriptionId "<yourSubscriptionID>"
$certpwd="Password
$certfolder="c:\mycertificates\"
$adminuser="vmadmin"
$adminpwd="Password
$clusterloc="SouthCentralUS"
$clustername = "mysftestcluster"
$groupname="mysfclustergroup"
$vmsku = "Standard_D1_v2"
$subname... | 0 |
3911.ps1 |
function Test-GetNodeFileContentByTask
{
param([string]$jobId, [string]$taskId, [string]$nodeFilePath, [string]$fileContent)
$context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext
$stream = New-Object System.IO.MemoryStream
try
{
$nodeFi... | 0 |
sample_44_30.ps1 | ## DEVELOPERS NOTES & CONVENTIONS
##
## 1. All text displayed to the user except for Write-Debug (or $PSCmdlet.WriteDebug()) text must be added to the
## string tables in:
## en-US\Plaster.psd1
## Plaster.psm1
## 2. If a new manifest element is added, it must be added to the Schema\PlasterManifest... | 0 |
1869.ps1 |
Describe "Get-PSHostProcessInfo tests" -Tag CI {
BeforeAll {
$si = [System.Diagnostics.ProcessStartInfo]::new()
$si.FileName = "pwsh"
$si.Arguments = "-noexit"
$si.RedirectStandardInput = $true
$si.RedirectStandardOutput = $true
$si.RedirectStandardError = $true
... | 0 |
scriptable telnet client_2.ps1 | function read-stream ([Parameter(Position=0,Mandatory=$true)][validatenotnull()]
[System.Net.Sockets.NetworkStream]$stream,
[String]$expect = "")
{
$buffer = new-object system.byte[] 1024
$enc = new-object system.text.asciiEncoding
## Read all the data available from the stream, writing it to the
## s... | 0 |
3225.ps1 |
InModuleScope PoshBot {
describe 'Set-PoshBotStatefulData' {
BeforeAll {
$PSDefaultParameterValues = @{
'Set-PoshBotStatefulData:Verbose' = $false
}
$global:PoshBotContext = [pscustomobject]@{
Plugin = 'TestPl... | 0 |
sample_18_79.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 |
2595.ps1 | 
param(
$ServerList = "E:\Dexma\Servers.txt"
, $ReportFileName = "E:\Dexma\FreeSpace.htm"
, $EmailTo = "mmessano@primealliancesolutions.com"
, $EmailFrom = "mmessano@primealliancesolutions.com"
, $EmailSubject = "Disk Space Report for $Domain"
, $SMTPServer = "10.0.5.199"
)
clear
$Domain = [System.Direct... | 0 |
Convert-SchemaGUID.ps1 | # List of Guids not properly defined in AD but used
# Used to initialize GuidCache.
New-Variable -Name GuidCache -Force -Option AllScope -Scope Script -Description "Cached GUIDs from AD. :: [redtoo]"
$Script:GuidCache = @{
"a05b8cc2-17bc-4802-a710-e7c15ab866a2" = "Autoenroll"
"00000000-0000-0000-0000-00... | 0 |
sample_14_96.ps1 | #
# Module manifest for module 'OCI.PSModules.Usage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Usage.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
Compatible... | 0 |
vibackup-lx1.ps1 | Param (
$viServer,
$bakVM,
$lxDest
)
#region check
if (!$viServer) { $viServer = Read-Host -Prompt "VI Server " }
if (!$bakVM) { $bakVM = Read-Host -Prompt "VM to Backup " }
if (!$lxDest) { $lxDest = Read-Host -Prompt "Backup Path (ex. /srv/backup) " }
#endregion
#region globalvars
$encoding = "OEM"
... | 0 |
Object ProxyAddress Scan.ps1 | Param (
[Parameter(Mandatory=$true,
Position=0,
ValueFromPipeline=$true,
HelpMessage="Enter SMTP address to search for in Active-Directory."
)]
[string]$objSMTP
)
Function Get-ProxyAddresses ([string]$Address){
$objAD = $null
$objAD = Get-QADObject -LdapFilter "(proxyAddre... | 0 |
sample_17_7.ps1 | ConvertFrom-StringData @'
id_fileacl=Determining file ACL's
'@
# SIG # Begin signature block
# MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA6VsPfmmzM00am
# qvD0ITk80rX9ws5... | 0 |
sample_8_7.ps1 | @{
GUID="A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Get-Acl", "Set-Acl", "Get-PfxCertific... | 0 |
3596.ps1 |
function Get-AzureRmSecurityTask-SubscriptionScope
{
$tasks = Get-AzSecurityTask
Validate-Tasks $tasks
}
function Get-AzureRmSecurityTask-ResourceGroupScope
{
$rgName = Get-TestResourceGroupName
$tasks = Get-AzSecurityTask -ResourceGroupName $rgName
Validate-Tasks $tasks
}
function Get-Az... | 0 |
powershell ise config_3.ps1 | <configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>
<runtime>
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>
| 0 |
Citrix License Info.ps1 | ###########################################
# Licence Checking Script for Citrix #
# Virtu-Al - http://teckinfo.blogspot.com/
###########################################
param( [string] $sendmailsched )
Function Sendemail ($LicTypeText, $InstalledLicNum, $InUseNum, $PercentageNum)
{
#Email options for automa... | 0 |
3642.ps1 |
function Test-ThreatDetectionGetDefaultPolicy
{
$testSuffix = getAssetName
Create-ThreatDetectionTestEnvironment $testSuffix
$params = Get-SqlThreatDetectionTestEnvironmentParameters $testSuffix
try
{
$policy = Get-AzSqlDatabaseAdvancedThreatProtectionSetting -ResourceGroupName $params.rgna... | 0 |
785.ps1 |
function Find-Ast {
[CmdletBinding(PositionalBinding=$false, DefaultParameterSetName='FilterScript')]
param(
[Parameter(Position=0, ParameterSetName='FilterScript')]
[ValidateNotNullOrEmpty()]
[scriptblock]
$FilterScript = { $true },
[Parameter(ValueFromPipelin... | 0 |
Get-MIX10Video_1.ps1 | #requires -version 2.0
PARAM (
[Parameter(Position=1, Mandatory=$true)]
[ValidateSet("wmv","wmvhigh","pptx", "mp4")]
[String]$MediaType,
[string]$Destination = $PWD
)
if( ([System.Environment]::OSVersion.Version.Major -gt 5) -and -not ( # Vista and ...
new-object Security.Principal.WindowsPrinc... | 0 |
Check-ClusterPatches.ps1 |
## Check-ClusterPatches.ps1
param($ClusterNode=$Env:ComputerName)
$Patches = @{}
$PatchList = $Null
$PatchListComplete = $Null
$Results = @()
Write-Host "Getting Nodes via WMI..." -foregroundcolor Green
$Nodes = Get-WmiObject -computerName $ClusterNode -namespace ROOT\\MSCluster -class MSCluster_Node | S... | 0 |
chkhash_22.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 |
4366.ps1 | function Set-PSGetSettingsVariable
{
[CmdletBinding()]
param([switch]$Force)
if(-not $script:PSGetSettings -or $Force)
{
if(Microsoft.PowerShell.Management\Test-Path -Path $script:PSGetSettingsFilePath)
{
$script:PSGetSettings = DeSerialize-PSObject -Path $script:PSGetSettin... | 0 |
3614.ps1 |
function Test-GetAzureRmLogProfile
{
try
{
$actual = Get-AzLogProfile -Name default
Assert-AreEqual /subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/providers/microsoft.insights/logprofiles/default $actual.Id "Resource Ids not equal"
Assert-AreEqual default ... | 0 |
sample_48_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Computeinstanceagent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Computeinstanceagent.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# S... | 0 |
sample_2_30.ps1 | ConvertFrom-StringData @'
id_virtualization=Virtualization Information
id_virtualizationobtaining=Obtaining Information about Virtualization Environment
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLC... | 0 |
764.ps1 |
function Stop-Process2 {
[CmdletBinding(SupportsShouldProcess = $true)]
[Alias()]
[OutputType([int])]
param(
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
Position=0)]
$Name
)
process {
if ($PSCmdlet.ShouldProcess("")) {
$processes = Get-Process -Name $Name
fore... | 0 |
sample_6_61.ps1 | #************************************************
# TS_HPWMICheck.ps1
# Version 1
# Date: 5-6-15
# Author: jasonf
# Description: check to see if HP WMI provider causes autorecover regkey corruption
#************************************************
Import-LocalizedData -BindingVariable ScriptStrings
$RuleAp... | 0 |
sample_19_16.ps1 | ConvertFrom-StringData @'
id_clusterinfo=Cluster Information
id_clusterinfoobtaining=Obtaining cluster basic information
id_clustername=Cluster Name
id_clusterdomain=Cluster Domain
id_clustercsv=Shared Volumes
id_clustercsvroot=Shared Volumes Root
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHj... | 0 |
sample_27_65.ps1 | /*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
define("vs/languages/typescript/participants/nlsParticipant.nls.keys",[],{vs_languages_typescript_participants_nlsParticipant:{path:"vs... | 0 |
Find-GeoCode.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 |
2256.ps1 | $TSEnvironment = New-Object -ComObject Microsoft.SMS.TSEnvironment
$Variables = $TSEnvironment.GetVariables()
$Variables | ForEach-Object {
Add-Content -Path "$($env:SystemDrive)\Windows\Temp\OSDVariables.log" -Value "
Add-Content -Path "$($env:SystemDrive)\Windows\Temp\OSDVariables.log" -Value $TSEnvironment.V... | 0 |
sample_18_46.ps1 | [CmdletBinding(PositionalBinding=$false)]
Param(
[string] $configuration = 'Debug',
[string] $task,
[string] $verbosity = 'minimal',
[string] $msbuildEngine = $null,
[switch] $restore,
[switch] $prepareMachine,
[switch] $help,
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)
$ci = ... | 0 |
2993.ps1 | Set-StrictMode -Version Latest
function FunctionUnderTest {
[CmdletBinding()]
param (
[Parameter(Mandatory = $false)]
[string]
$param1
)
return "I am a real world test"
}
function FunctionUnderTestWithoutParams([string]$param1) {
return "I am a real world test with no para... | 0 |
Send-Growl _2.0.ps1 | ## This is the first version of a Growl module (just dot-source to use in PowerShell 1.0)
## v 1.0 supports a very simple notice, and no callbacks
## v 2.0 supports registering multiple message types
## supports callbacks
## v 2.1 redesigned to be a module used from apps, rather than it's own "PowerGrowler" a... | 0 |
Get-ScriptDirectory.ps1 | function Get-ScriptDirectory {
$invocation = (Get-Variable MyInvocation -Scope 1).Value
$script = [IO.FileInfo] $invocation.MyCommand.Path
if ([IO.File]::Exists($script)) {
Return (Split-Path $script.Fullname)
} else {
return $null
}
}
| 0 |
3600.ps1 |
function Test-AzSecurityAdvancedThreatProtection-ResourceId
{
$testPrefix = "psstorage"
$testParams = Get-AdvancedThreatProtectionTestEnvironmentParameters $testPrefix
$resourceId = "/subscriptions/" + $testParams.subscriptionId + "/resourceGroups/" + $testParams.rgName + "/providers/Microsoft.Stora... | 0 |
Dell Order Status.ps1 | # Version: 0.1
# Author: Stefan Stranger
# Description: Retrieve Dell Order Status
# Start Page Order Status USA: https://support.dell.com/support/order/status.aspx?c=us&cs=19&l=en&s=dhs&~ck=pn
# Start Page Order Status EMEA(nl): http://support.euro.dell.com/support/index.aspx?c=nl&l=nl&s=gen&~ck=bt
# Example Dell... | 0 |
Get-User_11.ps1 | function Get-User($user)
{
# this function should be passed the CN of the user to be returned
$dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
$root = [ADSI] "LDAP://$($dom.Name)"
$searcher = New-Object System.DirectoryServices.DirectorySearcher $root
$searcher.filter = "(&(objec... | 0 |
602.ps1 |
function Get-SPLists{
param(
[Parameter(Mandatory=$false)]
$SPWeb,
[Parameter(Mandatory=$false)]
[string]$FilterListName,
[switch]$OnlyDocumentLibraries,
[switch]$Recursive
)
if ((Get-PSSnapin “Microsoft.SharePoint.PowerShell” -ErrorAction SilentlyContinue) ... | 0 |
PowerShell Template.ps1 | Function New-Script
{
$strName = $env:username
$date = get-date -format d
$name = Read-Host "Filename"
if ($name -eq "") { $name="NewTemplate" }
$email = Read-Host "eMail Address"
if ($email -eq "") { $email="youremail@yourhost.com" }
$file = New-Item -type file "$name.ps1" -force
$template=@"
###############... | 0 |
Get-NaNfsExport_1.ps1 | # Glenn Sizemore ~ www . Get-Admin . Com
# Example Powershell function to get the NFS Exports from a NetApp Filer
# First you'll need to download the OnTap SDK 3.5 : http://communities.netapp.com/docs/DOC-1365
# within the download your interested in .\\manage-ontap-sdk-3.5\\lib\\DotNet\\ManageOntap.dll
# Next... | 0 |
1552.ps1 |
function Get-MSPSUGMeetingDate {
[CmdletBinding()]
param (
[ValidateNotNullOrEmpty()]
[string[]]$Month = (1..12),
[Parameter(ValueFromPipeline)]
[ValidateRange(2013,9999)]
[Int[]]$Year = (Get-Date).Year
)
PROCESS {
foreach ($y in $Year) {
fo... | 0 |
sample_18_52.ps1 | ConvertFrom-StringData @'
id_sccm_activity_cm07serverinfo=Gathering Site Server Information
id_sccm_cmserverinfo_boundary=Obtaining Boundaries
id_sccm_cmserverinfo_cloud=Obtaining Cloud Services information
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# Bg... | 0 |
sample_63_27.ps1 | <#
.SYNOPSIS
Scenario module for collecting Microsoft AVD on Azure Stack HCI related data
.DESCRIPTION
Collect Azure Stack HCI related troubleshooting data
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedback : https://aka.... | 0 |
New-Choice.ps1 | function New-Choice {
<#
.SYNOPSIS
The New-Choice function is used to provide extended control to a script author who writing code
that will prompt a user for information.
.PARAMETER Choices
An Array of Choices, ie Yes, No and Maybe
.PARAMETER Caption
Caption to present to end ... | 0 |
sample_48_33.ps1 |
///////////////////////////////////////////////////////////////////////////////
// Helper to set a designer prop
///////////////////////////////////////////////////////////////////////////////
function setDesignerProp(tname, ttype, tvalue) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)... | 0 |
sample_31_14.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 = '80.0.0'
# Supported PSEditions
Comp... | 0 |
sample_16_23.ps1 | #************************************************
# TS_HyperVEvent106Check.ps1
# Version 1.0.08.26.14: Created Rule.
# Version 1.1.09.04.14: Configured the detection logic to flag events for only the last 7 days.
# Author: bbenson, tode
# Description: Check for Hyper-V Event 106
#*********************************... | 0 |
New-DynamicVariable.ps1 | ##############################################################################\n##\n## New-DynamicVariable\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\nCrea... | 0 |
3815.ps1 |
function Test-SimpleNewVmss
{
$vmssname = Get-ResourceName
try
{
$lbName = $vmssname + "LoadBalancer"
$username = "admin01"
$password = Get-PasswordForVM | ConvertTo-SecureString -AsPlainText -Force
$cred = new-object -typename System.Management.Automatio... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.