filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
Monitor-FileSize.ps1 | function Monitor-FileSize
{
<#
.Synopsis
Checks the file size of a given file until it reaches the specified size
.Description
Checks the file size of a given file until it reaches the specified size. AT that point, it alerts the user as to what the original file-size-boundry was and what it currentl... | 0 |
sample_24_97.ps1 | let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl();
let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/docker.webCore.eventHandlers.js"];
let currentScriptElement = document.querySelector("script[src='Scripts/docker.webCore.plugin.js']");
if (currentScriptElement !== nu... | 0 |
Get-CrawlHealth (MOSS)_2.ps1 | [reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server.Search") | out-null
@@#NOTE: I've set strict crawl freshness/crawl duration/success rati... | 0 |
2267.ps1 |
function Load-Form {
$Form.Controls.Add($TabControl)
$TabControl.Controls.AddRange(@(
$TabPageGeneral,
$TabPageCAS,
$TabPagePrimary,
$TabPageSecondary,
$TabPageSiteRoles,
$TabPageOther
))
$TabPageGeneral.Controls.AddRange(@(
$OutputB... | 0 |
sample_35_25.ps1 | #
# Module manifest for module 'OCI.PSModules.Dataflow'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dataflow.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Comp... | 0 |
670.ps1 |
Describe "Write-RsCatalogItem" {
Context "Write-RsCatalogItem with min parameters"{
$folderName = 'SutWriteRsCatalogItem_MinParameters' + [guid]::NewGuid()
New-RsFolder -Path / -FolderName $folderName
$folderPath = '/' + $folderName
$localPath = (Get-Item -Path ".\").FullName ... | 0 |
sample_21_74.ps1 | {{ $integrations := (index . "integrations") }}
{{ $scratch := newScratch }}
{{ range $name, $integration := $integrations }}
{{ $scratch.Set "tutorials" 0 }}
{{ if isset $integration "tutorials" }}
{{ $hosts := slice }}
{{ range $elem := index $integration "tutorials" }}
{{ $url := urls.Parse $elem ... | 0 |
Trim Working Set for PID_1.ps1 | ## Trim Working set
Function TrimWorkingSet {
param([int] $procid)
<#.NOTES
AUTHOR: Sunny Chakraborty(sunnyc7@gmail.com)
WEBSITE: http://tekout.wordpress.com
CREATED: 9/20/2012
This starts the Evil Monkey series of scripts.
.DESCRIPTION
MSDN - http://msdn.microsoft.com/en-us/library/windows/desktop/ms6862... | 0 |
Show-ADObject.ps1 | # Author: Steven Murawski http://www.mindofroot.com
# This script requires the modified Show-NetMap script (originally from Doug Finke)
# Show-NodeXLMap which can be found on http://poshcode.org/733
# and the NodeXL files
# These can be found at http://www.codeplex.com/NodeXL/Release/ProjectReleases.aspx?ReleaseId=... | 0 |
sample_51_24.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 = '73.1.0'
# Supported PSEditions
Comp... | 0 |
sample_28_17.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=此名称和类型的环境变量已存在。
EnvironmentErrorDoesNotExists=此名称和类型的环境变量不存在。
'@
# SIG # Begin signature block
# MIIoPQYJKoZIhvcNAQcCoIIoLjCCKCoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIB... | 0 |
get-uuid_allHVs_1.ps1 | #The PowerShell Talk
#Building a HyperVisor Independent Script
#
#This script will take a VM (or host) object from the pipline,
#and from that determine if you're connected to XenServer
#or VMware, and return the apropriate UUID.
Begin {
#VMware VM Host (ESX) UUID
$VMHost_UUID = @{
Name = "VMHo... | 0 |
sample_58_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Ocicontrolcenter'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ocicontrolcenter.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# Supported... | 0 |
2136.ps1 |
Describe "Range Operator" -Tags CI {
Context "Range integer operations" {
It "Range operator generates arrays of integers" {
$Range = 5..8
$Range.count | Should -Be 4
$Range[0] | Should -BeOfType [int]
$Range[1] | Should -BeOfType [int]
$Range[2]... | 0 |
sample_28_82.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Import-EditorCommand {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[OutputType([Microsoft.PowerShell.EditorServices.Extensions.EditorCommand, Microsoft.PowerShell.EditorServices])]
[Cmdle... | 0 |
Update VM Tools_3.ps1 | ########################################################
# Created by Brian English
# Brian.English@charlottefl.com
# eddiephoenix@gmail.com
#
# for Charlotte County Government
# No warranty suggested or implied
########################################################
# Purpose: Cycle through all VMs on a... | 0 |
1538.ps1 |
function New-MrFunction {
[CmdletBinding()]
[OutputType('System.IO.FileInfo')]
param (
[ValidateScript({
If ((Get-Verb -Verb ($_ -replace '-.*$')).Verb) {
$true
}
else {
Throw "'$_' does NOT use an approved Verb."
}
})]
... | 0 |
1dd696a1-0d97-40cd-9cdf-5cbe5b7fe4a4.ps1 | function Write-Host
{
<#
.SYNOPSIS
Replacement of Write-Host function to work around an issue where use of Write-Host can
cause an eventual problem with launching EXEs from within the same Powershell session.
.DESCRIPTION
This Write-Host replacement can act as a temporary wo... | 0 |
sample_63_74.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudbridge'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudbridge.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEdition... | 0 |
936.ps1 |
$uniqueId=$(-join ((97..122) + (48..57) | Get-Random -Count 15 | % {[char]$_}))
$apiVersion = "2015-04-08"
$location = "West US 2"
$resourceGroupName = "MyResourceGroup"
$accountName = "mycosmosaccount-$uniqueId"
$apiType = "EnableGremlin"
$accountResourceType = "Microsoft.DocumentDb/databaseAccounts"
$databaseN... | 0 |
613.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://winscp.net/download/files/20140928102737e06fdcc6e29eab780afd57975c84fa/winscp555setup.exe"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs | ForEach-Objec... | 0 |
push-module function v2 .ps1 | # v2.0
function Push-Module {
param(
[parameter(position=0, mandatory=$true)]
[validatenotnullorempty()]
[string]$ModuleName
)
# find out what this module exports (and therefore what it overwrites)
$metadata = new-module -ascustomobject {
param([string]$M... | 0 |
Invoke-ISPackage.ps1 | <#
.SYNOPSIS
Runs an SSIS package from an SQL package store.
.DESCRIPTION
Invoke-ISPackage.ps1 script is a wrapper around dtexec.exe to run an SSIS package.
.EXAMPLE
PowerShell.exe -File "C:\\Scripts\\Invoke-ISPackage.ps1" -PackagePath "SQLPSX\\sqlpsx1" -ServerInstance "Z001\\SQL1"
This example connects to SSIS ... | 0 |
sample_10_28.ps1 | #
# Module manifest for module 'OCI.PSModules.Fleetsoftwareupdate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Fleetsoftwareupdate.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Sup... | 0 |
finddupe_20.ps1 | 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.OpenRead();
$hashByteArray = $h... | 0 |
Findup_31.ps1 | using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.IO;
using System.Text.RegularExpressions;
namespace Findup
{
public class FileLengthComparer : I... | 0 |
3532.ps1 |
function Get-ResourceGroupLocation
{
$namespace = "Microsoft.RecoveryServices"
$type = "vaults"
$resourceProvider = Get-AzResourceProvider -ProviderNamespace $namespace | where {$_.ResourceTypes[0].ResourceTypeName -eq $type}
if ($resourceProvider -eq $null)
{
return "west... | 0 |
Set-OCSUser_1.ps1 | ###########################################################################"
#
# NAME: Set-OCSUser.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jan.egil.ring@powershell.no
#
# COMMENT: Requires Quest AD cmdlets. This script sets Active Directory user attributes for Microsoft Office Communications Server 2007.
# ... | 0 |
sample_43_35.ps1 | #
# Module manifest for module 'OCI.PSModules.Aidocument'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aidocument.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
... | 0 |
sample_45_84.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Bu adda ve türde bir ortam değişkeni zaten var.
EnvironmentErrorDoesNotExists=Bu adda ve türde bir ortam değişkeni yok.
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3Ag... | 0 |
sample_16_15.ps1 | trap [Exception]
{
WriteTo-ErrorDebugReport -ErrorRecord $_
continue
}
If (!$Is_SiteServer) {
TraceOut "ConfigMgr Site Server not detected. This script gathers data only from a Site Server. Exiting."
exit 0
}
TraceOut "Started"
Import-LocalizedData -BindingVariable ScriptStrings
$sectiondescription... | 0 |
sample_17_12.ps1 | ConvertFrom-StringData @'
id_mats_networkadapter=Network Adapter
id_mats_networkadaptertype=Type
id_mats_networkadapterspeed=Speed
id_mats_ipaddresses=IP Addresses
id_mats_defaultgateway=Default Gateway
id_mats_dnsservers=DNS Servers
id_mats_proxyenabled=Proxy Server
id_enabled=Enabled
id_mats_proxyserveradd=P... | 0 |
Run-Defrag_3.ps1 | # Run-Defrag
# Defragments the targeted hard drives.
#
# Args:
# $server: A target Server 2003 or 2008 system
# $drive: An optional drive letter. If this is blank then all
# drives are defragmented
# $force: If this switch is set then a defrag will be forced
# even if the drive is lo... | 0 |
Import-Certificate_6.ps1 | #requires -Version 2.0
function Import-Certificate
{
param
(
[IO.FileInfo] $CertFile = $(throw "Paramerter -CertFile [System.IO.FileInfo] is required."),
[string[]] $StoreNames = $(throw "Paramerter -StoreNames [System.String] is required."),
[switch] $LocalMachine,
[switch] $CurrentUser,
[string... | 0 |
Invoke-ExecuteTSQL .ps1 | #######################
<#
.SYNOPSIS
Execute T-SQL Statments and return messages from SQL Server (print).
.DESCRIPTION
Execute T-SQL Statments and return messages from SQL Server (print).
.INPUTS
None
You cannot pipe objects to Invoke-ExecuteTSQL
.OUTPUTS
PSObject :
Boolean Exitcode = $True or $False in... | 0 |
sample_23_34.ps1 | #
# Module manifest for module 'OCI.PSModules.Sch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Sch.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
play-note(s)_1.ps1 | function Play-Note([string]$note,[int] $duration = 5)
{
if (!($note -match '(\\d+)')) { $note+='4' };[void]($note -match '([A-G#]{1,2})(\\d+)')
[console]::Beep((440 * [math]::Pow([math]::pow(2,(1/12)),
(([int] $matches[2]) - 4)* 12 + $( switch($matches[1])
{ 'A' { 0 } 'A#' { 1 } 'Bb' { 1 } '... | 0 |
sample_60_83.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 = '89.0.0'
... | 0 |
sample_62_30.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Suppor... | 0 |
sample_65_88.ps1 | ]Ограничението PrintAllTranslations не може да се използва с ограничението IgnoreTranslations. Не можете да добавите изчислената колона „%{oii_column/}“ към хибридната таблица „%{oii_table/}“. Моля, премахнете изчислената колона.Не можете да добавяте колона „alternateOf“, използвана за агрегации, към хибридната табли... | 0 |
Get-Constructor_2.ps1 | function Get-Constructor {
PARAM( [Type]$type )
$type.GetConstructors() |
Format-Table @{
l="$($type.Name) Constructors"
e={ "New-Object $($type.FullName) $(($_.GetParameters() | ForEach { "[{0}] `${1}" -f $($_.ToString() -split " ") }) -Join ", ")" }
}
}
Set-Alias gctor Get-Constructor
| 0 |
2340.ps1 | function Get-ActiveDirectoryUserNameMatch($FirstName,$LastName,$MiddleInitial) {
if ($MiddleInitial) {
$Filter = { (initials -eq $MiddleInitial) -and (surname -eq $LastName) -and (givenname -eq $FirstName) }
$MatchType = 'FML'
} else {
$Filter = { (surname -eq $LastName) -and (givenname -eq $FirstName) }
$Mat... | 0 |
PS2WCF_5.ps1 | <#
.SYNOPSIS
Functions to call WCF Services With PowerShell.
.NOTES
Version 1.2 11.02.2012
Requires Powershell v2 and .NET 3.5
Original version by Christian Glessner
Blog: http://www.iLoveSharePoint.com
Twitter: http://twitter.com/cglessner
Codeplex: http://codeplex.com/iLoveSharePoint
PowerS... | 0 |
2881.ps1 | Framework '4.7.1'
task default -depends MsBuild
task MsBuild {
if ( $IsMacOS -OR $IsLinux ) {}
else {
$output = &msbuild /version /nologo 2>&1
Assert ($output -NotLike '15.0') '$output should contain 15.0'
}
}
| 0 |
sample_10_81.ps1 | #************************************************
# TS_NetworkDTCEnabled.ps1
# Version 1.0.0
# Date: 03-23-2012
# Author: Jeremy LaBorde - jlaborde
# Description: Checks to see if Network DTC
# is enabled
#
#************************************************
. .\DistSvcs_Utils.ps1
Import-LocalizedData -B... | 0 |
sample_32_26.ps1 | @{
# Script module or binary module file associated with this manifest
ModuleToProcess = 'nuget.psm1'
# Version number of this module.
ModuleVersion = '2.0.0.0'
# ID used to uniquely identify this module
GUID = '76e6f9c4-7045-44c0-a557-17fab0835c12'
# Author of this module
Author = 'NuGet Team'
# Com... | 0 |
sample_48_96.ps1 | # Copyright (C) Intel Corporation, 2021 All Rights Reserved.
function Invoke-GenerateKeyPair {
<#
.Synopsis
Generate Key Pair.
.Description
This cmdlet generates a KeyPair object and adds the new key to AMT.
.Notes
AMT Provisioning:
The vPro client AMT firmware must be provisione... | 0 |
Manage ASP.NET Providers.ps1 | # Manage_ASP_NET_Providers.ps1
# by Chistian Glessner
# http://iLoveSharePoint.com
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Web") # posh 2.0: Add-Type -Assembly "System.Web"
function global:Set-AppConfigPath($path=$(throw "-path is mandatory"))
{
[System.AppDomain]::CurrentDomain.Se... | 0 |
Convert-FspToUsername.ps1 | Function Convert-FspToUsername
{
<#
.SYNOPSIS
Convert a FSP to a sAMAccountName
.DESCRIPTION
This function converts FSP's to sAMAccountName's.
.PARAMETER UserSID
This is the SID of the FSP in the form of S-1-5-20. These can be found
in... | 0 |
2642.ps1 |
param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]
$ServerList,
[Parameter(Mandatory=$false)]
[string]
$OutputPath=([Environment]::GetFolderPath("MyDocuments")))
if((Test-Path $OutputPath) -eq $false)
{
throw "Invalid -OutputPath, please use a valid file path"
}
if(Test-Path $ServerLi... | 0 |
sample_36_56.ps1 | @{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.NetworkController.Powershell'
# Version number of this module.
ModuleVersion = '1.0.0.0'
# ID used to uniquely identify this module
GUID = '05718206-c147-47b6-83f5-92f52af61c6e'
# Author of this module
Author... | 0 |
sample_54_87.ps1 | . "$PSScriptRoot/../project/api.ps1"
. "$PSScriptRoot/helpers.ps1"
function Get-Php-From-Ini-File {
param (
$IniFilePath
)
$configIni = Get-IniContent($IniFilePath)
if ($configIni.phpCLI -and $configIni.phpCLI.phpRuntime) {
return $configIni.phpCLI.phpRuntime
}
return $null
}
... | 0 |
2411.ps1 | function Set-RegistryValueForAllUsers {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[hashtable[]]$RegistryInstance
)
try {
New-PSDrive -Name HKU -PSProvider Registry -Root Registry::HKEY_USERS | Out-Null
$LoggedOnSids = $(Get-ChildItem HKU: | W... | 0 |
sample_7_48.ps1 | #************************************************
# TS_ClusterCAUWMINamespaceCheck.ps1
# Version 1.0.1
# Date: 1/16/2013
# Author: v-kaw
# Description: [Idea ID 6519] [Windows] Invalid Class error on 2012 Clusters (SDP)
# Rule number: 6519
# Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispF... | 0 |
New-SqlConnectionString.ps1 | function New-SqlConnectionString {
#.Synopsis
# Create a new SQL ConnectionString
#.Description
# Builds a SQL ConnectionString using SQLConnectionStringBuilder with the supplied parameters
#.Example
# New-SqlConnectionString -Server DBServer12 -Database NorthWind -IntegratedSecurity -MaxPoolSize 4 -Pooling
#... | 0 |
sample_26_88.ps1 | <#
.SYNOPSIS
Demonstrates how to write a command that works with paths that do
not allow wildards but must exist.
.DESCRIPTION
This command does not require a LiteralPath parameter because the
Path parameter can handle paths that use wildcard characters. That's
because this command does not ... | 0 |
4026.ps1 |
function Test-RoleDefinitionCreateTests
{
$rdName = 'CustomRole Tests Role'
$inputFilePath = Join-Path -Path $TestOutputRoot -ChildPath Resources\NewRoleDefinition.json
New-AzRoleDefinitionWithId -InputFile $inputFilePath -RoleDefinitionId ee78fa8a-3cdd-418e-a4d8-949b57a33dcd
$rd ... | 0 |
1247.ps1 |
function Uninstall-CUser
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[ValidateLength(1,20)]
[string]
$Username
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.... | 0 |
665.ps1 |
Describe "Get-RsFolderContent" {
Context "Get folder with ReportServerUri parameter"{
$folderName = 'SutGetFolderReportServerUriParameter' + [guid]::NewGuid()
New-RsFolder -Path / -FolderName $folderName
$folderPath = '/' + $folderName
$reportServerUri = 'http://... | 0 |
sample_53_94.ps1 | #region ::::: Help :::::
<#
.SYNOPSIS
Script Name: GetLogs.ps1
Purpose: gather data from Windows Failover Cluster Nodes (default 3 Month back)
Version: 1.4
Last Update: 2nd June 2020
Author: Josef Holzer
Email-Alias: josefh
.DESCRIPTION
This script coll... | 0 |
1658.ps1 |
function Get-LogonHistory {
param (
[string]$Computer = $env:COMPUTERNAME,
[int]$Days = 1
)
$filterXml = "
<QueryList>
<Query Id='0' Path='System'>
<Select Path='System'>
*[System[
Provider[@Name = 'Microsoft-Windows-Winlogon']
... | 0 |
sample_6_11.ps1 | #pragma namespace("\\\\.\\Root\\CIMV2")
#pragma deleteinstance
("__Namespace.Name='dcim'", FAIL)
#pragma include("DCIM_iSMService.mof")
/* SIG # Begin signature block */
/* MIItDQYJKoZIhvcNAQcCoIIs/jCCLPoCAQExDzANBglghkgBZQMEAgEFADB5Bgor */
/* BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JN... | 0 |
sample_62_31.ps1 | #
# Module manifest for module 'OCI.PSModules.Audit'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Audit.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported PSEditions
Compatible... | 0 |
sample_66_51.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.Synopsis
Group Policy tools use administrative template files (.admx, .adml) to populate policy settings in the user interface.
This allows administrators to manage registry-based policy settings.
This script installes Powe... | 0 |
sample_17_91.ps1 | # Clear CI_COMMIT_MESSAGE and CI_COMMIT_DESCRIPTION for please meson
# when the commit message is complicated
$env:CI_COMMIT_MESSAGE=""
$env:CI_COMMIT_DESCRIPTION=""
# force the CA cert cache to be rebuilt, in case Meson tries to access anything
Write-Host "Refreshing Windows TLS CA cache"
(New-Object System.Net.WebCl... | 0 |
chkhash.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_58_12.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplaceprivateoffer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplaceprivateoffer.dll'
# Version number of this module.
ModuleVersion = '86.0.0... | 0 |
sample_44_65.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 = '74.1.0... | 0 |
sample_21_41.ps1 | #
# Module manifest for module 'OCI.PSModules.Ospgateway'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ospgateway.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
... | 0 |
sample_65_93.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 = '83.3.0'
# Supported P... | 0 |
sample_9_88.ps1 | param(
[string]$DataPath,
[switch]$AcceptEula,
[switch]$SkipLogs,
[switch]$Trace,
[switch]$Network,
[switch]$RPC,
[switch]$ProcMon,
[switch]$PSR
)
<#
COM-COLLECT
ALIAS : bpostaci, maporcol
Date : 15/11/2023
Updates:
v1.0 | Initial release
v1.1 | 2023... | 0 |
sample_11_89.ps1 | ConvertFrom-StringData @'
id_detectmtu1514_activity=Detect MTU of 1514
id_detectmtu1514_status=Checking network adapters for an MTU of 1514.
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# K... | 0 |
3916.ps1 |
function Get-BudgetName
{
return "Budget-" + (getAssetName)
}
function Get-NotificationKey
{
return "NotificationKey-" + (getAssetName)
}
function Get-ResourceGroupName
{
return "RG-" + (getAssetName)
}
function Test-BudgetAtSubscriptionLevel
{
$budgetName = Get-BudgetName
$n... | 0 |
sample_35_62.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
param(
[ValidateSet('Hang', 'Fail')]
$TestHook
)
$waitTimeoutSeconds = 300
switch ($TestHook) {
'Hang' {
$waitTimeoutSeconds = 10
$jobScript = { Start-Sleep -Seconds 600 }
}
'Fail' {
$jo... | 0 |
sample_35_27.ps1 | #
# Module manifest for module 'OCI.PSModules.Stackmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Stackmonitoring.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported P... | 0 |
Compare Table & DataRow_1.ps1 | function Compare-DataRow
{
param( $a, $b)
# @bernd_k http://pauerschell.blogspot.com/
$diff = ''
$a_columncount = $a.Table.columns.count
$b_columncount = $b.Table.columns.count
if ( $a_columncount -ne $b_columncount)
{
Write-host "Tables have different numbe... | 0 |
sample_37_34.ps1 | function PSConsoleHostReadLine
{
Microsoft.PowerShell.Core\Set-StrictMode -Off
[Microsoft.PowerShell.PSConsoleReadLine]::ReadLine($host.Runspace, $ExecutionContext)
}
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE... | 0 |
sample_62_96.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
# RemoveMDS.ps1
# Kill all Monitoring processes and clean up tra... | 0 |
sample_61_74.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 |
254.ps1 | function Remove-StringDiacritic
{
[CMdletBinding()]
PARAM
(
[ValidateNotNullOrEmpty()]
[Alias('Text')]
[System.String[]]$String,
[System.Text.NormalizationForm]$NormalizationForm = "FormD"
)
FOREACH ($StringValue in $String)
{
Write-Verbose -Message "$StringValue"
try
{
$Normalized = $Strin... | 0 |
Get-ChildItemRecurse_2.ps1 | function Get-ChildItemRecurse {
<#
.Synopsis
Does a recursive search through a PSDrive up to n levels.
.Description
Does a recursive directory search, allowing the user to specify the number of
levels to search.
.Parameter path
The starting path.
.Parameter fileglob
(optional) the search string for ... | 0 |
240.ps1 | function Get-SCSMObjectPrefix
{
[OutputType([psobject])]
param
(
[ValidateSet(
'DependentActivity',
'ManualActivity',
'ParallelActivity',
'ReviewActivity',
'RunbookAutomationActivity',
'SequentialActivity',
'IncidentRequest',
'ServiceRequest',
'Change',
... | 0 |
2437.ps1 |
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('^\w+\.\w+\.\w+$')]
[string]$Name,
[Parameter()]
[switch]$NetBiosFallback,
[Parameter()]
[ValidateNotNullOrEmpty()]
[ValidateRange(1, [int]::MaxValue)]
[int]$Timeout = 60,
[Parameter()]
[ValidateNotNullOrEmpt... | 0 |
Remove diacritics_1.ps1 | ### Grťgory Schiro, 2009
### <summary>
### Removes diacritics from string.
### </summary>
### <param name="String">String containing diacritics</param>
function Remove-Diacritics([string]$String)
{
$objD = $String.Normalize([Text.NormalizationForm]::FormD)
$sb = New-Object Text.StringBuilder
fo... | 0 |
Add -__ Get-Help -Full_1.ps1 | $executionContext.SessionState.InvokeCommand.PostCommandLookupAction = {
param($CommandName, $CommandLookupEventArgs)
# Only for interactive commands (and that doesn't include "prompt")
# I should exclude out-default so we don't handle it on every pipeline, but ...
if($CommandLookupEventArgs.Comma... | 0 |
1800.ps1 |
Describe "Pop-Location" -Tags "CI" {
$startDirectory = $(Get-Location).Path
BeforeEach { Set-Location $startDirectory }
It "Should be able to be called without error" {
{ Pop-Location } | Should -Not -Throw
}
It "Should not take a parameter" {
{ Pop-Location .. } | Should -Throw
}
It... | 0 |
sample_29_92.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 = '82.0.0'
# Support... | 0 |
sample_37_43.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module $PSScriptRoot\..\..\Common\Tracer... | 0 |
sample_4_1.ps1 | ConvertFrom-StringData @'
id_ctsdnsserver=DNS Server
id_ctsdnsserverdescription=Collects information about DNS Server.
'@
# SIG # Begin signature block
# MIIoOAYJKoZIhvcNAQcCoIIoKTCCKCUCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAI... | 0 |
109.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_8_24.ps1 | ConvertFrom-StringData @'
id_printdevmodes2countcheck_st=There are several printers listed under HKU\\.DEFAULT\\Printers\\DevModes2
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAA... | 0 |
chkhash_11.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 |
3922.ps1 |
function Test-ListEnrollmentAccounts
{
$enrollmentAccounts = Get-AzEnrollmentAccount
Assert-True {$enrollmentAccounts.Count -ge 1}
Assert-NotNull $enrollmentAccounts[0].ObjectId
Assert-NotNull $enrollmentAccounts[0].PrincipalName
}
function Test-GetEnrollmentAccountWithName
{
$enr... | 0 |
sample_41_31.ps1 | ###########################################################
#
# 'ServiceHelper' module
#
###########################################################
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
$global:GCServiceName = "GCService"
$script:GCServiceBinaryName = "gc_service.exe"
$script:GC... | 0 |
sample_63_26.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 = '84.0.0'
# Supported PSEditions
... | 0 |
2559.ps1 | param(
[String[]] $DatabaseList
)
"The number of parameters passed in DatabaseList is $($DatabaseList.Count)"
$i = 0
foreach ($arg in $DatabaseList) { echo "The $i parameter in DatabaseList is $arg"; $i++ }
| 0 |
sample_40_54.ps1 | ## Copyright (c) Microsoft Corporation. All rights reserved.
<#
.SYNOPSIS
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans.
.DESCRIPTION
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans. These performance recordings contain Microsoft-Antimal... | 0 |
sample_40_12.ps1 | #
# Module manifest for module 'OCI.PSModules.Aivision'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aivision.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
Comp... | 0 |
1184.ps1 |
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'Get-ProgramInstallInfo.when getting all programs' {
$programs = Get-ProgramInstallInfo
It 'should get all installed programs' {
$programs | Should -Not -BeNullOrEmp... | 0 |
Prompt _for ISE_.ps1 | # just to know which file is invoked by my profile
write-host "loaded . $($MyInvocation.MyCommand.Path)"
if(!$global:WindowTitlePrefix) {
# But if you're running "elevated" on vista, we want to show that ...
if( ([System.Environment]::OSVersion.Version.Major -gt 5) -and ( # Vista and ...
new-objec... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.