filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
UIAutomation 1.2.ps1 | # #
# Select-Window Notepad | Remove-Window -passthru #
# ## And later ... #
# Select-Wi... | 0 |
sample_21_12.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 |
2097.ps1 |
Describe 'Testing of MyInvocation' -Tags "CI" {
It 'MyInvocation works in Function' {
function myfunc
{
$MyInvocation.Line.IndexOf("myfunc") | Should -BeGreaterThan -1
}
{ . myfunc } | Should -Not -Throw
{& myfunc } | Should -Not -Throw
}
It 'MyInvoca... | 0 |
Set-dvSwitch.ps1 | Function Set-dvSwitch {
param($vmName,$dvPG) # the two parameters.
$nic = "Network adapter 1" # change this line if you want to change network adapter 2
# Find the NIC
$vm = Get-VM $vmName | Get-View
foreach($tempdev in $vm.Config.Hardware.Device){
if($tempdev.DeviceInfo.Label -eq $nic){
$tgtdev = ... | 0 |
1166.ps1 |
$tempDir = $null
$xmlFilePath = $null
$xdtFilePath = $null
$resultFilePath = $null
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
function Assert-XmlTransformed
{
$resultFilePath | Should -Exist
$newContext = Get-Content $resultFilePath
($newContex... | 0 |
sample_30_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Dts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dts.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
1771.ps1 |
Import-Module (Join-Path -Path $PSScriptRoot 'certificateCommon.psm1') -Force
Describe "CmsMessage cmdlets and Get-PfxCertificate basic tests" -Tags "CI" {
BeforeAll {
$certLocation = New-GoodCertificate
$certLocation | Should -Not -BeNullOrEmpty | Out-Null
$protectedCertLocation = New-... | 0 |
sample_21_66.ps1 | #
# Script module for module 'Az.PolicyInsights' that is executed when 'Az.PolicyInsights' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 03/27/2024 07:43:38
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
... | 0 |
sample_18_95.ps1 | ConvertFrom-StringData @'
id_bootinfo=Boot Information
id_bootinformation=Collecting Boot Information
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFl... | 0 |
108.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aad... | 0 |
1bcb760e-1da1-47f8-9433-4a6a544b6c98.ps1 | /*
* Schreiben sie ein Programm,dass ihnen fΓΌr eine bestimmte Stelle,
* die zugehΓΆrige Fibonacci Zahl ausgibt.
*/
package fibonacci;
/*
* @author Tobias GΓΌnther
*/
public class Fibonacci {
public static void main(String[] args) {
int fragestelle = 9; //Gefragte Stelle
... | 0 |
sample_2_78.ps1 | # <copyright>
# INTEL CONFIDENTIAL
#
# Copyright 2022 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you ("License").
# Unless the License provides otherwise, you may not us... | 0 |
839.ps1 | Param(
[parameter(Mandatory=$true)]
$CsvFilePath
)
$ErrorActionPreference = "Stop"
$scriptsPath = $PSScriptRoot
if ($PSScriptRoot -eq "") {
$scriptsPath = "."
}
. "$scriptsPath\asr_logger.ps1"
. "$scriptsPath\asr_common.ps1"
. "$scriptsPath\asr_csv_processor.ps1"
Function ProcessItemImpl($processor, $cs... | 0 |
84835da8-9f4e-46f7-84f6-64197c8d0f7b.ps1 | Hi,
I've tried your excellent -Append feature for export-csv and it works good. I've only have a short question.
Is it possible to make the append to new columns instead of rows? I'd like to combine two csv files as a part of an automation script and then I must get this to work.
Import-csv C:\\Visiolizer\... | 0 |
sample_8_21.ps1 | #************************************************
# DC_DhcpClient-Component.ps1
# Version 1.0
# Date: 2009
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about DHCP Client.
# Called from: Main Networking Diag
#*******************************************************
Trap [Exc... | 0 |
finddupe_19.ps1 | # new version has more error handling, "-delete" and "-noprompt" and "-recurse" options.
function Get-MD5([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.MD5CryptoServiceProvider];
$hashAlgorithm = new... | 0 |
sample_53_44.ps1 | #
# Module manifest for module 'OCI.PSModules.Events'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Events.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Compatib... | 0 |
2139.ps1 |
Describe "ParserTests (admin\monad\tests\monad\src\engine\core\ParserTests.cs)" -Tags "CI" {
BeforeAll {
$functionDefinitionFile = Join-Path -Path $TestDrive -ChildPath "functionDefinition.ps1"
$functionDefinition = @'
function testcmd-parserbvt {
[CmdletBinding()]
par... | 0 |
Get-DellWarranty.ps1 | function Get-DellWarranty {
<#
.Synopsis
Provides warranty information for one or more Dell service tags.
.Description
Queries the Dell Website for a list of service tags and returns the warranty information as a custom object.
If a service tag has multiple warranties, they are... | 0 |
1192.ps1 |
& (Join-Path -Path $PSScriptRoot 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'Uninstall-Junction' {
$JunctionPath = $null
$tempDir = Get-Item -Path 'TestDrive:'
BeforeEach {
$Global:Error.Clear()
$JunctionPath = Join-Path $tempDir ([IO.Path]::GetRandomFileName())
New... | 0 |
sample_12_59.ps1 | #Collect Event Logs for Slow Logon/ Slow Boot troubleshooter
$EventLogNames = "Setup"
Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription "Event Logs"
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorB... | 0 |
2862.ps1 |
function TaskTearDown {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[scriptblock]$teardown
)
$psake.context.Peek().taskTearDownScriptBlock = $teardown
}
| 0 |
Test-Port_1.ps1 | param ($ComputerName,$Port)
$sock = new-object System.Net.Sockets.Socket -ArgumentList $([System.Net.Sockets.AddressFamily]::InterNetwork),$([System.Net.Sockets.SocketType]::Stream),$([System.Net.Sockets.ProtocolType]::Tcp)
try {
$sock.Connect($ComputerName,$Port)
$sock.Connected
$sock.Close()
}... | 0 |
sample_14_2.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias'... | 0 |
sample_33_13.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubusage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubusage.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
Co... | 0 |
sample_50_93.ps1 | #
# Module manifest for module 'OCI.PSModules.Redis'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Redis.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Compatible... | 0 |
724.ps1 |
function Out-RsFolderContent
{
[CmdletBinding()]
param(
[switch]
$Recurse,
[Alias('ItemPath', 'Path')]
[Parameter(Mandatory = $True)]
[string]
$RsFolder,
[ValidateScript({ Test-Path $_ -PathType Container })]
[Parameter(M... | 0 |
4470.ps1 |
$script:DSCModuleName = 'DSC'
$script:DSCResourceName = 'MSFT_PSRepository'
$script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or `
(-not (Test-Path -Path (Join-Path -Path $script:moduleRoo... | 0 |
sample_67_27.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 = '89.0.0'
# Supported PSEditions
Comp... | 0 |
2475.ps1 |
function ConvertTo-AzureSize
{
[CmdletBinding()]
[OutputType('Selected.Microsoft.Azure.Commands.Compute.Models.PSVirtualMachineSize')]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$VmmHardwareProfile,
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]$AzureLocation = 'WestUS'... | 0 |
sample_51_86.ps1 | #
# Module manifest for module 'OCI.PSModules.Vault'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vault.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Compatible... | 0 |
sample_33_6.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\typescript@5.3.3\node_modules\typescript\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\typ... | 0 |
sample_4_48.ps1 | # Copyright ?2010, Microsoft Corporation. All rights reserved.
# You may use this code and information and create derivative works of it,
# provided that the following conditions are met:
# 1. This code and information and any derivative works may only be used for
# troubleshooting a) Windows and b) products for ... | 0 |
TabExpansion_3.ps1 | ## Tab-Completion
#################
## Please dot souce this script file.
## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list.
## What this can do is:
##
## [datetime]::n<tab>
## [datetime]::now.d<tab>
## $foo[0].<tab>
## $foo[0].n.b<tab>
## $function:a<tab>
##... | 0 |
_2.168.1.1.ps1 | function Set-IPAddress {
param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"),
[string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"),
[string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"),
[string]$gateway = $(read-host "Enter... | 0 |
4032.ps1 |
function Test-ResourceLockCRUD
{
$rgname = Get-ResourceGroupName
$rname = Get-ResourceName
$rglocation = Get-Location "Microsoft.Resources" "resourceGroups" "West US"
$apiversion = "2014-04-01"
$rg = New-AzResourceGroup -Name $rgname -Location $rglocation
$actual = New-AzResourceLock -LockName $... | 0 |
PowerShell_ISE Profile_1.ps1 | #--------------------------------------------------------------------------------------------------------------
#Convert Untitled1.ps1 to ASCII encoding
$psise.CurrentPowerShellTab.Files | % {
# set private field which holds default encoding to ASCII
$_.gettype().getfield("encoding","nonpublic,instance").... | 0 |
Get-NestedGroups_1.ps1 | <#
.SYNOPSIS
Enumerate all AD group memberships of an account (including nested membership).
.DESCRIPTION
This script will return all the AD groups an account is member of.
.PARAMETER UserName
The username whose group memberships to find.
.EXAMPLE
.\\Get-NestedGroups.ps1 'johndoe'
Name ... | 0 |
SharePoint build script_1.ps1 | #BASEPATH variable should be explicitly set in every
#build script. It represents the "root"
#of the project folder, underneath which all tools, source, config settings,
#and deployment folder lie.
$global:basepath = (resolve-path ..).path
function Set-BasePath([string]$path)
{
$global:basepath = $path
}
f... | 0 |
sample_45_63.ps1 | #
# Module manifest for module 'OCI.PSModules.Osuborganizationsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll'
# Version number of this module.
ModuleVersion... | 0 |
sample_2_89.ps1 | ConvertFrom-StringData @'
id_2k3clsiduseraclcheck_st=Permissions for local Users group was removed from registry key HKCR\\CLSID
'@
# SIG # Begin signature block
# MIIoVAYJKoZIhvcNAQcCoIIoRTCCKEECAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAA... | 0 |
sample_30_0.ps1 | data LocalizedData
{
# culture="en-US"
ConvertFrom-StringData @'
PathNotFoundError=The path '{0}' either does not exist or is not a valid file system path.
ExpandArchiveInValidDestinationPath=The path '{0}' is not a valid file system directory path.
InvalidZipFileExtensionError={0} is not a su... | 0 |
sample_44_40.ps1 | # These Pester tests are for the for parameter-* and ex-path* snippets.
# Take a look at the .vscode\tasks.json file to see how you can create
# and configure a test task runner that will run all the Pester tests
# in your workspace folder.
# To run these Pester tests, press Ctrl+Shift+T or press Ctrl+Shift+P,
#... | 0 |
sample_41_69.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 |
3622.ps1 |
function Test-GetAzureLogAllParameters
{
$correlation = '/subscriptions/a93fb07c-6c93-40be-bf3b-4f0deba10f4b/resourceGroups/Default-Web-EastUS/providers/microsoft.insights/alertrules/checkrule3-4b135401-a30c-4224-ae21-fa53a5bd253d/incidents/L3N1YnNjcmlwdGlvbnMvYTkzZmIwN2MtNmM5My00MGJlLWJmM2ItNGY... | 0 |
Download Free Reflector.ps1 | #Thanks http://27.am/posts/how-to-download-net-reflector-6-for-free
add-type @'
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Reflection;
namespace LookingGlass
{
μ ¨μ ¨public class RedGateDownloader
μ ¨μ ¨μ ¨μ ¨public static void Download()
μ ¨μ ¨μ ¨μ ¨{
μ ¨μ ¨μ ¨μ ¨μ ¨μ ¨QueryDownloadUrl("... | 0 |
sample_8_83.ps1 | ConvertFrom-StringData @'
id_printspooleroldsplshd_sd=Orphaned print jobs were detected in Spooler folder and this may affect printing performance
'@
# SIG # Begin signature block
# MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG... | 0 |
3043.ps1 | function Should-BeGreaterThan($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) {
if ($Negate) {
return Should-BeLessOrEqual -ActualValue $ActualValue -ExpectedValue $ExpectedValue -Negate:$false -Because $Because
}
if ($ActualValue -le $ExpectedValue) {
return New-Obj... | 0 |
VMware guest information.ps1 | # vminfo.ps1
#
# Give this a VMware guest and it will attempt to dump all the information available.
#
# Example: .\\vminfo.ps1 "guestname"
#
# This scripts assumes that you have already connected to a VirtualCenter server.
#
# This was developed and tested using VMware vSphere PowerCLI version 4.1.1.2816
# o... | 0 |
110.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_53_29.ps1 | Get-Module | ForEach-Object { Remove-Module -Name $_.Name -Force }
$PSModuleAutoloadingPreference = 'none'
Import-Module Microsoft.PowerShell.Utility
#Enforcing default PSModulePath to avoid getting unexpected modules to run instead of built-in modules
$env:PSModulePath = "C:\Program Files\WindowsPowerShell\Modules... | 0 |
3666.ps1 |
function Test-DatabaseDataMaskingPrivilegedUsersChanges
{
$testSuffix = getAssetName
Create-DataMaskingTestEnvironment $testSuffix
$params = Get-SqlDataMaskingTestEnvironmentParameters $testSuffix
try
{
$policy = Get-AzSqlDatabaseDataMaskingPolicy -ResourceGroupName $params.rgname -ServerNa... | 0 |
sample_50_81.ps1 | #
# Module manifest for module 'OCI.PSModules.Osuborganizationsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll'
# Version number of this module.
ModuleVersion... | 0 |
sample_17_31.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al... | 0 |
1714.ps1 | function Get-ServiceNowIncident{
[OutputType([System.Management.Automation.PSCustomObject])]
[CmdletBinding(DefaultParameterSetName, SupportsPaging)]
Param(
[Parameter(Mandatory = $false)]
[string]$OrderBy = 'opened_at',
[Parameter(Mandatory = $false)]
[Val... | 0 |
Compare-InstalledHotfix.ps1 | Function Compare-InstalledHotfix {
param (
[parameter(Mandatory=$true,Position=0)]
$server1,
[parameter(Mandatory=$true,Position=1)]
$server2,
[parameter(Mandatory=$true,Position=3)]
[Management.Automation.PSCredential]
$credential
)
$server1HotFix = get-hotfix -computer $server1 -Credential $credentia... | 0 |
sample_37_2.ps1 | ConvertFrom-StringData @'
EditorCommandExists=Editor command '{0}' already exists, skipping.
EditorCommandImporting=Importing editor command '{0}'.
MissingEditorContext=Unable to obtain editor context. Make sure PowerShell Editor Services is running and then try the command again.
'@
# SIG # Begin signature bloc... | 0 |
Test-VM.ps1 | Function Test-VM
{
[cmdletbinding()]
Param
(
[Parameter(Mandatory=$true,Position=1)]
[string[]]$Name,
[Parameter(Mandatory=$true,Position=2)]
[string[]]$ComputerName
)
Process
{
$results = @()
foreach ($cName in $ComputerName) {
... | 0 |
Send-Growl _1.1.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 |
TabExpansion for V2CTP_2.ps1 | ## Tab-Completion
#################
## For V2CTP3.
## This won't work on V1 and V2CTP and V2CTP2.
## Please dot souce this script file.
## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list.
##
## What this can do is:
##
## [datetime]::n<tab>
## [datetime]::now.d... | 0 |
sample_67_57.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 = '86.0.0'
# Supported PSEditions
... | 0 |
sample_30_94.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 = '74.1.0'
# Supported PSEditions
... | 0 |
3c9c5d54-adf5-44bb-bf12-ab18d089e443.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_14_42.ps1 | ConvertFrom-StringData @'
id_virtualization=Virtualization Information
id_virtualizationobtaining=Obtaining Information about Virtualization Environment
id_virtualizationoutput=Virtualization Information Output
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
... | 0 |
Get-ScriptPerformancePro.ps1 | #############################################################################\n##\n## Get-ScriptPerformanceProfile\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS... | 0 |
1825.ps1 |
Describe "Get-Content" -Tags "CI" {
$testString = "This is a test content for a file"
$nl = [Environment]::NewLine
$firstline = "Here's a first line "
$secondline = " here's a second line"
$thirdline = "more text"
$fourthline = "just to make sure"
$fifthline = "there's plenty to... | 0 |
2849.ps1 | function WriteColoredOutput {
param(
[string] $message,
[System.ConsoleColor] $foregroundcolor
)
$currentConfig = GetCurrentConfigurationOrDefault
if ($currentConfig.coloredOutput -eq $true) {
if (($null -ne $Host.UI) -and ($null -ne $Host.UI.RawUI) -and ($null -ne $Host.UI.RawU... | 0 |
Get-ADMapObject.ps1 | # Author: Steven Murawski http://www.mindofroot.com
# This script requires the Show-NetMap script from Doug Finke and the NetMap files
# These can be found at http://dougfinke.com/blog/?p=465
#
# Also required are the Quest AD Cmdlets.
#requires -pssnapin Quest.ActiveRoles.ADManagement
function Write-Help... | 0 |
Deleted-ObjectsAD.ps1 | param(
$Domen
)
function Ping ($Name){
$ping = new-object System.Net.NetworkInformation.Ping
if ($ping.send($Name).Status -eq "Success") {$True}
else {$False}
trap {Write-Verbose "Error Ping"; $False; continue}
}
[string[]]$ObjectPath
[string[]]$Disks
[string[]]$Info
[string[]]$Computers
... | 0 |
Autoload (beta 3).ps1 | #Requires -Version 2.0
## Version History
## beta 3 - 2010.05.10
## fix for signed scripts (strip signature)
## beta 2 - 2010.05.09
## implement module support
## beta 1 - 2010.04.14
## Initial Release
## Automatically load functions from scripts on-demand, instead of having to ... | 0 |
550.ps1 |
function Set-SPODocumentPermissions
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$groupname,
[Parameter(Mandatory=$true, Position=2)]
[string]$listname,
[Parameter(Mandatory=$true, Position=3)]
[string]$listItemName,
[Parameter(Mandatory=$true, Position... | 0 |
sample_7_24.ps1 | #
# Module manifest for module 'OCI.PSModules.Delegateaccesscontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Delegateaccesscontrol.dll'
# Version number of this module.
ModuleVersion = '92.1.0'
#... | 0 |
Set-IPAddress_3.ps1 | function Set-IPAddress {
param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"),
[string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"),
[string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"),
[string]$gateway = $(read-host "Enter... | 0 |
Exchange Services.ps1 | #Requires input from the user
$Server = read-host "Enter Exchange Server Name"
#Finds only the services that contain "Exchange"
$Status = (Get-Service -ComputerName $server |Where-object {$_.Displayname -like "*Exchange*"})
#Displays which Exchange Services are stopped
foreach ($Name in $status) {
IF (... | 0 |
sample_13_63.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 |
Exchange07 Mbox Report.ps1 | #This script is designed to grab mailbox statistics for every user and give a more detailed
#level of output about mailbox statistics in .html format
param(
[string] $SFileWDir
)
# If there is no optional argument then make a filename for it.
if (!$SFileWDir)
{
Write-Host "You didn't specify a filename w/... | 0 |
765.ps1 |
function Import-FileNoWildcard {
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true,
Position=0,
ParameterSetName="Path",
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
... | 0 |
New-ODataServiceProxy_1.ps1 | function New-ODataServiceProxy {
#.Synopsis
# Creates a proxy class for an odata web service
# YOU NEED TO BE VERY CAREFUL NOT TO OUTPUT THE PROXY OBJECT TO THE POWERSHELL HOST!
#.Description
# Uses the data service client utility (DataSvcUtil.exe) to generate a proxy class (and types for all objects) for an O... | 0 |
sample_34_33.ps1 | using module ..\..\Config.psm1
Param(
[Parameter(Mandatory=$False)]
[switch]$Launch=$false,
[Parameter(Mandatory=$False)]
[switch]$TestStatus=$false
)
Import-Module (Join-Path $PSScriptRoot "..\..\Events.psm1")
if ($TestStatus) {
return [string]([ApplyResult]::Success)
}
if (!$Launch) {
... | 0 |
SQLPSX SSIS Demo.ps1 | #Edit SSIS.psm1 and Comment/Uncomment 2005 or 2008 version of SSIS assembly
#add-type -AssemblyName "Microsoft.SqlServer.ManagedDTS, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
add-type -AssemblyName "Microsoft.SqlServer.ManagedDTS, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd80... | 0 |
Solarized (Dark) Theme.ps1 | <?xml version="1.0" encoding="utf-16"?>
<StorableColorTheme xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Keys>
<string>ErrorForegroundColor</string>
<string>ErrorBackgroundColor</string>
<string>WarningForegroundColor</string>
<string>Warni... | 0 |
2179.ps1 | param(
[parameter(Mandatory=$true)]
[IO.FileInfo]$Path,
[parameter(Mandatory=$true)]
[ValidateSet("ProductCode","ProductVersion","ProductName")]
[string]$Property
)
try {
$WindowsInstaller = New-Object -ComObject WindowsInstaller.Installer
$MSIDatabase = $WindowsInstaller.GetType().InvokeMember("OpenDatabase","... | 0 |
sample_51_64.ps1 | #
# Module manifest for module 'OCI.PSModules.Blockchain'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Blockchain.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
... | 0 |
sample_43_42.ps1 | #
# Module manifest for module 'OCI.PSModules.Operatoraccesscontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Operatoraccesscontrol.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
#... | 0 |
2207.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_59_86.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... | 0 |
LibraryChart_2.ps1 | # ---------------------------------------------------------------------------
### <Script>
### <Author>
### Chad Miller
### </Author>
### <Description>
### Defines functions for wokring with Microsoft Chart Control for .NET 3.5 Framework
### Pipe output of Powershell command to Out-Chart function and specify c... | 0 |
sample_3_88.ps1 | ConvertFrom-StringData @'
id_crmcollectactivity=Collecting System Information
id_crmformattingdata=Formatting Data
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADA... | 0 |
sample_27_68.ps1 | data LocalizedData
{
# culture="en-US"
ConvertFrom-StringData @'
PathNotFoundError=The path '{0}' either does not exist or is not a valid file system path.
ExpandArchiveInValidDestinationPath=The path '{0}' is not a valid file system directory path.
InvalidZipFileExtensionError={0} is not a su... | 0 |
sample_2_21.ps1 | // Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved.
// ==================================================================
// DCIM_IPMIAccountManagementService
// ==================================================================
[ dynamic, provider("dcismprovider"),
Description (
... | 0 |
sample_64_19.ps1 | ##########################################################################
# DELL PROPRIETARY INFORMATION
#
# This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this
# software to you under the terms of a license agreement,nondisclosure agreement or both.
# You may not copy, disclose, o... | 0 |
sample_20_53.ps1 |
function New-AzDataProtectionBackupInstance {
[OutputType('')]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Configures Backup for supported azure resources')]
param(
[Parameter(Mandatory=$false, Help... | 0 |
sample_58_44.ps1 | variables:
AZCOPY_GOLANG_VERSION: '1.22.4'
AZCOPY_GOLANG_VERSION_COVERAGE: '1.22.4'
trigger:
branches:
include:
- dev
- main
pr:
branches:
include:
- dev
- main
jobs:
- job: Build
timeoutInMinutes: 360
strategy:
matrix:
Ubuntu-20:
imageName: ... | 0 |
384.ps1 | Describe "Remove-PSFNull Unit Tests" -Tag "CI", "Pipeline", "Unit" {
It "Should have the designed for parameters & sets" {
(Get-Command Remove-PSFNull).ParameterSets.Name | Should -Be '__AllParameterSets'
foreach ($key in (Get-Command Remove-PSFNull).Parameters.Keys)
{
$key | Should -BeIn 'InputObject', 'Al... | 0 |
3476.ps1 |
function Get-Cluster-Location
{
return Get-Location "Microsoft.Kusto" "operations" "Central US"
}
function Get-RG-Location
{
Get-Location "Microsoft.Resources" "resourceGroups" "Central US"
}
function Get-RG-Name
{
return getAssetname
}
function Get-Cluster-Default-Capacity
{
return 2
}
functi... | 0 |
Send-RTMTask.ps1 | #ββββββββββββββββββββββββββ
# Func/Sub Name: Send-RTMTask
# Purpose: Sends a task to the Remember The Milk system via email.
# Arguments Supplied:
# Return Value:
# External Reference:
#ββββββββββββββββββββββββββ
function Send-RTMTask
{
param( [string]$TaskName=$(Throw "need TaskName"),
$Priority,
... | 0 |
Audit NTFS on Shares_1.ps1 | $Excel = New-Object -Com Excel.Application
$Excel.visible = $True
$Excel = $Excel.Workbooks.Add()
$wSheet = $Excel.Worksheets.Item(1)
$wSheet.Cells.item(1,1) = "Folder Path:"
$wSheet.Cells.Item(1,2) = "Users/Groups:"
$wSheet.Cells.Item(1,3) = "Permissions:"
$wSheet.Cells.Item(1,4) = "Permissions Inherited:"
... | 0 |
3397.ps1 |
function New-WADConfigFromTemplate ($inputPath, $outputPath, $storageAccountName)
{
(Get-Content $inputPath).replace('[StorageAccountName]', $storageAccountName) | Set-Content $outputPath;
}
function Test-DiagnosticsExtensionBasic
{
$rgname = Get-ComputeTestResourceName
$loc = Get-ComputeVM... | 0 |
TabExpansion_1.ps1 | ## Tab-Completion
#################
## Please dot souce this script file.
## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list.
## What this can do is:
##
## [datetime]::n<tab>
## [datetime]::now.d<tab>
## $foo[0].<tab>
## $foo[0].n.b<tab>
## $function:a<tab>
##... | 0 |
sample_10_58.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function ConvertFrom-ScriptExtent {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding()]
[OutputType([Microsoft.PowerShell.EditorServices.Extensions.IFileRange, Microsoft.PowerShell.Edito... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.