filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
sample_48_10.ps1 | $script:THIS_PATH = $myinvocation.mycommand.path
$script:BASE_DIR = Split-Path (Resolve-Path "$THIS_PATH/..") -Parent
function global:deactivate([switch] $NonDestructive) {
if (Test-Path variable:_OLD_VIRTUAL_PATH) {
$env:PATH = $variable:_OLD_VIRTUAL_PATH
Remove-Variable "_OLD_VIRTUAL_PATH" -Scope... | 0 |
sample_27_56.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 |
236.ps1 | function Get-SCCMClientCacheInformation
{
PARAM(
[string[]]$ComputerName=".",
[Alias('RunAs')]
[System.Management.Automation.Credential()]
[pscredential]
$Credential = [System.Management.Automation.PSCredential]::Empty
)
FOREACH ($Computer in $ComputerName)
{
... | 0 |
2623.ps1 |
param([string]$DName
)
configuration LabDC_DHCP{
param(
[string[]] $ComputerName = 'localhost'
,[string] $DomainName
)
Import-DscResource -Module xDHCPServer
xDhcpServerScope DHCPScope
{
Ensure = 'Present'
IPStartRange = '10.10.10.1... | 0 |
sample_13_98.ps1 | ConvertFrom-StringData @'
id_ctstcpip=TCPIP
id_ctstcpipdescription=Collects information about TCPIP.
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlA... | 0 |
3603.ps1 |
function Get-AzureRmSecurityWorkspaceSetting-SubscriptionScope
{
Set-AzureRmSecurityWorkspaceSetting-SubscriptionLevelResource
$workspaceSettings = Get-AzSecurityWorkspaceSetting
Validate-WorkspaceSettings $workspaceSettings
}
function Get-AzureRmSecurityWorkspaceSetting-SubscriptionLevelResourc... | 0 |
sample_29_17.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 = '80.0.0'
# Supported PSEditions
... | 0 |
SharpSsh Functions_3.ps1 | ## USING the binaries from:
## http://downloads.sourceforge.net/sharpssh/SharpSSH-1.1.1.13.bin.zip
[void][reflection.assembly]::LoadFrom( (Resolve-Path "~\\Documents\\WindowsPowerShell\\Libraries\\Tamir.SharpSSH.dll") )
## NOTE: These are bare minimum functions, and only cover ssh, not scp or sftp
## also, ... | 0 |
sample_33_97.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Test-ScriptExtent {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[OutputType([bool], ParameterSetName='__AllParameterSets')]
[OutputType([System.Management.Automation.Language.IScriptExten... | 0 |
1018.ps1 |
param
(
[Parameter(Mandatory=$true, HelpMessage="The name of the DevTest Lab to update")]
[string] $DevTestLabName,
[Parameter(Mandatory=$true, HelpMessage="The array of Marketplace Image names to enable")]
[Array] $ImagesToAdd
)
function Get-Lab
{
$lab = Find-AzResource -ResourceType 'Microsoft.... | 0 |
sample_62_0.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 = '86.0.0'
# Supported P... | 0 |
2543.ps1 |
param(
$Client = 'GTE'
, $TrnSourcePath = '\\psqlrpt24\e$\MSSQL10.MSSQLSERVER\MSSQL\TRN\'
, $TrnDestPath = '\\pcon310\Relateprod\FTP sites\'
)
cls
$a = get-date
$b = $a.AddMinutes(-15)
$ClientSrcPath = $TrnSourcePath + '\DMart_' + $Client + 'CDC_Data\'
if (!(Test-Path -Path $ClientSrcPath)){
Write-Host ... | 0 |
2359.ps1 | param (
[Parameter(Mandatory, ValueFromPipelineByPropertyname)]
[ValidateNotNullOrEmpty()]
[string]$FirstName,
[Parameter(Mandatory, ValueFromPipelineByPropertyname)]
[ValidateNotNullOrEmpty()]
[string]$LastName,
[Parameter(Mandatory, ValueFromPipelineByPropertyname)]
[ValidateNotNullOrEmpty()]
[string]$Mi... | 0 |
sample_43_48.ps1 | #
# Module manifest for module 'OCI.PSModules.Datacatalog'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datacatalog.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEdition... | 0 |
sample_23_23.ps1 | #
# Module manifest for module 'OCI.PSModules.Waas'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waas.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
CompatiblePS... | 0 |
123.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 |
1134.ps1 |
$tempDir = $null
$identity = $null
$dirPath = $null
$filePath = $null
$tempKeyPath = $null
$keyPath = $null
$childKeyPath = $null
$privateKeyPath = Join-Path -Path $PSScriptRoot -ChildPath '..\Cryptography\CarbonTestPrivateKey.pfx' -Resolve
function Start-TestFixture
{
& (Join-Path -Path $TestDir -Chil... | 0 |
4429.ps1 | function Unregister-PSRepository {
[CmdletBinding(HelpUri = 'https://go.microsoft.com/fwlink/?LinkID=517130')]
Param
(
[Parameter(ValueFromPipelineByPropertyName = $true,
Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string[]]
$Name
)
Begin {
}... | 0 |
ffdb7026-570c-4644-8a9f-b2c8fcdabfd5.ps1 | # Code to auto update the Address policy, GAL, OAB and storage groups and mailbox databases of an Exchange 2007 server by John McLear
# This code is good for hosting providers or people who wish to use lots of storage groups and mailbox databases.
#
# Thanks to Joel Bennett (Jaykul) for general scripting help and t... | 0 |
3500.ps1 |
function Clean-ResourceGroup($rgname)
{
Remove-AzResourceGroup -Name $rgname -Force
} | 0 |
1033.ps1 |
$probename = "AppPortProbe6"
$rulename="AppPortLBRule6"
$RGname="mysftestclustergroup"
$port=8303
$subscriptionID = 'subscription ID'
Connect-AzAccount
Get-AzSubscription -SubscriptionId $subscriptionID | Select-AzSubscription
$resource = Get-AzResource | Where {$_.ResourceGroupName –eq $RGname -and $_.ResourceTy... | 0 |
sample_7_37.ps1 | ConvertFrom-StringData @'
id_netbasicinfo=Networking Information
id_netbasicinfoobtaining=Obtaining basic networking information
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBA... | 0 |
sample_64_72.ps1 | #
# Module manifest for module 'OCI.PSModules.Vbsinst'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vbsinst.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
# Supported PSEditions
Compat... | 0 |
sample_58_89.ps1 | Test-xDscResource..\DSCResources\DCPP_POSTBehavior
Test-xDscSchema..\DSCResources\DCPP_POSTBehavior\DCPP_POSTBehavior.schema.mof
# SIG # Begin signature block
# MIIutAYJKoZIhvcNAQcCoIIupTCCLqECAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBA... | 0 |
sample_13_44.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 = '74.1.0'
# Supported PSEditions
... | 0 |
sample_2_17.ps1 | [dynamic, provider("dcismprovider"),
Association, Description(
"DCIM_SystemDSensorevice is a derivation of "
"CIM_SystemDevice, and represents a System Device.")]
class DCIM_SystemSensorDevice : CIM_SystemDevice
{
[
Aggregate,
Description ("The parent system in the Associa... | 0 |
sample_52_22.ps1 | #
# Module manifest for module 'OCI.PSModules.Aianomalydetection'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aianomalydetection.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Suppo... | 0 |
sample_13_84.ps1 | @{
GUID="{Fb6cc51d-c096-4b38-b78d-0fed6277096a}"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
RootModule="Microsoft.Management.Infrastructure.CimCmdlets"
RequiredAssembli... | 0 |
TruncatePath_1.ps1 | ###
# TruncatePath
# Version 1.0.6 (05 Nov 2008)
# Description: Replaces long provider paths in the prompt with ellipses
# Notes: Place in your profile
#
# By Mike Hays, http://www.mike-hays.net
###
$maxPathLength = 40
$showFullPath = $false
Function Prompt
{
$currentPath = (Get-Location).Path
if ( ... | 0 |
134.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory = $true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checkin... | 0 |
sample_10_88.ps1 | #************************************************
# TS_4KDriveInfo.ps1
# Version 1.0.2
# Date: 03-21-2011
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script detects 4KB/ 512e drive informaiton
#************************************************
# 2023-02-20 WalterE mod Trap #we#
trap [Exce... | 0 |
chkhash_20.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_42_9.ps1 | #
# Module manifest for module 'OCI.PSModules.Fusionapps'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Fusionapps.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
... | 0 |
TabExpansion_6.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.
## Some features(relate to '$_' expansion) require the latest Get-PipelineObject.ps1 in a same diretory. (from http://poshcode.org/author/foo... | 0 |
861.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests', ''
. "$here\$sut"
$clusterName = $ENV:ClusterName
$httpUserPassword = $ENV:HttpPassword
$securePassword = ConvertTo-SecureString $httpUserPassword -AsPlainText -Force
$creds = New-Object -... | 0 |
lol.ps1 | function Set-ComputerName {
param( [switch]$help,
[string]$originalPCName=$(read-host "Please specify the current name of the computer"),
[string]$computerName=$(read-host "Please specify the new name of the computer"))
$usage = "set-ComputerName -originalPCname CurrentName -computername AnewName"
if (... | 0 |
Log4Net_1.xslt.ps1 | <?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://logging.apache.org/log4net/schemas/log4net-events-1.2"
version="1.0">
<xsl:output method="html" indent="yes" encoding="UTF-8"/>
<xsl:template match="events">... | 0 |
ConvertTo-PseudoType_2.ps1 | #function ConvertTo-PseudoType {
<#
.Synopsis
Convert an object to a custom PSObject wiith robust type information
.Parameter TypeName
The name(s) of the PseudoType(s) to be inserted into the objects for the sake of formatting
.Parameter Mapping
A Hashtable of property names to types (or conversion ... | 0 |
sample_53_23.ps1 | # Localized 04/01/2024 05:01 AM (GMT) 303:7.2.30118 CL_LocalizationData.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Troubleshooting
Troubleshoot_DetectNetworkCache=Checking Windows Media Player network cache ...
Resolution_Title=Resolution
Resolution_ResetConfiguration=Resetting all configuration ... | 0 |
Convert-BounceToX_7.ps1 | # $Id: Convert-BounceToX500.ps1 610 2010-11-16 00:39:19Z jon $
# $Revision: 610 $
#.Synopsis
# Convert Bounce to X500
#.Description
# Convert URL Encoded address in a Bounce message to an X500 address
# that can be added as an alias to the mail-enabled object
#.Parameter bounceAddress
# URL Encoded bounce... | 0 |
sample_66_70.ps1 | # Web Deploy: Powershell script which contains common functionality for other scripts to reference.
# Copyright (C) Microsoft Corp. 2010
#
# Requirements: IIS 7, Windows Server 2008 (or higher)
#
Import-LocalizedData -BindingVariable Resources -FileName Resources.psd1
#constants
$Global:ScriptError = 0
$Glo... | 0 |
sample_6_9.ps1 | ConvertFrom-StringData @'
id_appcompatdisabledcheck_st=Application Compatibility is currently disabled
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFl... | 0 |
sample_32_24.ps1 | # Localized 04/14/2024 08:54 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=はい(&Y)
PromptNoString=いいえ(&N)
BundleFound=見つかったバンドル: {0}
PackageFound=パッケージが見つかりました: {0}
EncryptedBundleFound=暗号化されたバンドルが見つかりました: {0}
EncryptedPackageFound=暗号化されたパッ... | 0 |
Get-ADGroupModifications_1.ps1 | ###########################################################################"
#
# NAME: Get-ADGroupModificationsReport.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jan.egil.ring@powershell.no
#
# COMMENT: Generates a HTML-report of Active Directory group membership modifications (addings and deletions).
# Sp... | 0 |
285.ps1 | function Set-PSFTaskEngineCache
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Set-PSFTaskEngineCache')]
Param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()... | 0 |
3052.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Should -Be" {
It "returns true if the 2 arguments are equal" {
1 | Should Be 1
1 | Should -Be 1
1 | Should -EQ 1
}
It "returns true if the 2 arguments are equal and have different case" {
... | 0 |
2736.ps1 |
[CmdletBinding()]
Param()
foreach($user in (Get-WmiObject win32_userprofile)) {
$userpath = $user.localpath
$usersid = $user.SID
Write-Verbose "`$userpath : $userpath"
Write-Verbose "`$usersid : $usersid"
$sb = {
Param(
[Parameter(Mandatory=$True,Position=0)]
[String]$u... | 0 |
Write-Log_2.ps1 | function Write-Log {
#region Parameters
[cmdletbinding()]
Param(
[Parameter(ValueFromPipeline=$true,Mandatory=$true)] [ValidateNotNullOrEmpty()]
[string] $Message,
[Parameter()] [ValidateSet(“Error”, “Warn”, “Info”)]
[string] $Level = “Info”,
[Parameter()]
[Switch] $NoConsole... | 0 |
sample_7_78.ps1 | // ===========================================================================================================================
// Class DCIM_LDAPService
// ===========================================================================================================================
[
Description ("Contains settings f... | 0 |
3759.ps1 |
function Test-CreateIntegrationAccountCertificate
{
$resourceGroup = TestSetup-CreateResourceGroup
$integrationAccountName = "IA-" + (getAssetname)
$integrationAccountCertificateName = getAssetname
$integrationAccount = TestSetup-CreateIntegrationAccount $resourceGroup.ResourceGroupName $integrat... | 0 |
sample_65_29.ps1 | #
# Module manifest for module 'OCI.PSModules.Keymanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Keymanagement.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEdi... | 0 |
Quickstats from VMware.ps1 | connect-VIServer yourserver
# Written by Alan Renouf - Check http://teckinfo.blogspot.com for more examples
# This can easily be changed to pass parameters or be used as a function
# Set the following 3 variables for your needs
# Example stats are:
# % CPU Usage - cpu.usage.average
# Mhz CPU Usage - cpu.usageMH... | 0 |
Get_Set Signature (CTP2).ps1 | #requires -version 2.0
CMDLET Set-AuthenticodeSignature -snapin Huddled.BetterDefaults {
PARAM (
[Parameter(Position=1, Mandatory=$true, ValueFromPipelineByPropertyName=$true)]
[Alias("FullName")]
[ValidateScript({
if((resolve-path .\\breaking.ps1).Provider.Name -ne "FileSystem") {
thro... | 0 |
sample_60_74.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
Import-Module "NetworkControllerRESTWrappers.psm... | 0 |
sample_59_98.ps1 | @{
GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @('MSFT_MpPerformanceRecording.psm1')
FormatsToProcess = @(... | 0 |
ConvertTo-Hex_6.ps1 | # Ported from C# technique found here: http://forums.asp.net/p/1298956/2529558.aspx
param ( [string]$SidString )
# Create SID .NET object using SID string provided
$sid = New-Object system.Security.Principal.SecurityIdentifier $sidstring
# Create a byte array of the proper length
$sidBytes = New-Object byte[] ... | 0 |
sample_14_41.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | 0 |
sample_66_65.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="E:\艺施胡\alova-devtools\node_modules\.pnpm\typescript@5.5.3\node_modules\typescript\bin\node_modules;E:\艺施胡\alova-devtools\node_modules\.pnpm\typescript@5.5.3\node_modules... | 0 |
Get-PendingUpdates.ps1 | Function Get-PendingUpdates {
<#
.SYNOPSIS
Retrieves the updates waiting to be installed from WSUS
.DESCRIPTION
Retrieves the updates waiting to be installed from WSUS
.PARAMETER Computer
Computer or computers to find updates for.
.EXAMPLE
Get-PendingUpdates
... | 0 |
sample_39_16.ps1 | #
# Module manifest for module 'OCI.PSModules.Managementagent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Managementagent.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported P... | 0 |
sample_38_14.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 |
3872.ps1 |
function Test-GetWebApp
{
$rgname = Get-ResourceGroupName
$wname = Get-WebsiteName
$wname2 = Get-WebsiteName
$location = Get-WebLocation
$whpName = Get-WebHostPlanName
$tier = "Shared"
$apiversion = "2015-08-01"
$resourceType = "Microsoft.Web/sites"
try
{
New-AzResourceGroup -Name $rgna... | 0 |
1842.ps1 |
return
$cmdletName = "Import-Counter"
. "$PSScriptRoot/CounterTestHelperFunctions.ps1"
$SkipTests = SkipCounterTests
if ( ! $SkipTests )
{
$counterPaths = @(
(TranslateCounterPath "\Memory\Available Bytes")
(TranslateCounterPath "\processor(*)\% Processor time")
(TranslateCount... | 0 |
sample_54_75.ps1 | #
# Module manifest for module 'OCI.PSModules.Onesubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported P... | 0 |
sample_24_81.ps1 | #
# Module manifest for module 'OCI.PSModules.Managementdashboard'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Managementdashboard.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Sup... | 0 |
3116.ps1 |
function Add-TrustedHost
{
[CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact="High")]
param(
[Parameter(
Position=0,
Mandatory=$true)]
[String[]]$TrustedHost
)
Begin{
if(-not([Security.Principal.WindowsPrincipal][Security.Principal.Windo... | 0 |
sample_4_78.ps1 | ConvertFrom-StringData @'
id_servicingcorruptioncheck_activity=Running Dism tool to check for servicing corruption
id_servicingcorruptioncheck_status=Running Dism /online /Cleanup-image /checkhealth
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgE... | 0 |
sample_18_44.ps1 | <#
.SYNOPSIS
Install Device Admin Agent.
.DESCRIPTION
This script job is install admin agent.
Script will be called by logon.ps1. It check device has admin agent installed or not.
#>
# run script in strict mode
Set-StrictMode -Version Latest
# script variables
$basePa... | 0 |
sample_45_15.ps1 | #
# Module manifest for module 'OCI.PSModules.Devops'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Devops.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Compatib... | 0 |
2239.ps1 |
Begin {
if ([int](Get-WmiObject -Class Win32_OperatingSystem).BuildNumber -lt 14393) {
Write-Warning -Message "Unsupported build of Windows 10 detected, exiting" ; exit 1
}
try {
$TSEnvironment = New-Object -ComObject Microsoft.SMS.TSEnvironment -ErrorAction Stop
}
catch ... | 0 |
Hash Checker.ps1 | #.Synopsis
# Test the HMAC hash(es) of a file
#.Description
# Takes the HMAC hash of a file using specified algorithm, and optionally, compare it to a baseline hash
#.Example
# Test-Hash npp.5.3.1.Installer.exe -HashFile npp.5.3.1.release.md5
#
# Searches the provided hash file for a line matching the "... | 0 |
sample_14_0.ps1 | #
# Module manifest for module 'Microsoft.Online.SharePoint.PowerShell'
#
# Generated by: Microsoft Corportation
#
# Generated on: 8/29/2011
#
@{
# Script module or binary module file associated with this manifest
ModuleToProcess = 'Microsoft.Online.SharePoint.PowerShell.dll'
# Version number of this modu... | 0 |
44.ps1 |
[CmdletBinding(DefaultParameterSetName="NormalRun")]
Param(
[parameter(Mandatory=$true,ParameterSetName="NormalRun")]
[alias("sa")]
[ValidateScript({
if ($_ -match ".\\."){
$True
}
else {
Throw "Please use the format Domain\Username for the NDES Service Account variable."
}
... | 0 |
sample_59_48.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
#
# ModifyProxySettings.ps1 - To be used by the installer - Mo... | 0 |
sample_40_94.ps1 | ##########################################################################################
# <copyright file="Startup.ps1" company="Microsoft">
# Copyright (c) Microsoft Corporation. All rights reserved.
# </copyright>
# <summary>Startup.ps1 script.</summary>
##################################################... | 0 |
Deploy VM with Static IP_2.ps1 | # 1. Create a simple customizations spec:
$custSpec = New-OSCustomizationSpec -Type NonPersistent -OSType Windows `
-OrgName “My Organization” -FullName “MyVM” -Domain “MyDomain” `
–DomainAdminUsername “user” –DomainAdminPassword “password”
# 2. Modify the default network customization settings:
$custSpe... | 0 |
Export-SPListToSQL.ps1 | #Change these settings as needed
#MS Access 2007 Data Components required
$connString = 'Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=2;RetrieveIds=Yes; DATABASE=http://sharepoint.acme.com/;LIST={96801432-2d03-42b8-82b0-ac96ca9fea8a};'
#See http://chadwickmiller.spaces.live.com/blog/cns!EA42395138308430!275.entry for ... | 0 |
sample_7_85.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_8_39.ps1 | ConvertFrom-StringData @'
id_scheduletasks=Schedule Tasks Information
id_scheduletasksobtaining=Obtaining information about schedule tasks
id_scheduletaskssection=Schedule Tasks Information
id_scheduletasksoutput=Schedule Tasks List
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBgl... | 0 |
ESXiMgmt module sample 3.ps1 | #######################################################################################################################
# File: ESXiMgmt_machines_poweroff_sample.ps1 #
# Author: Alexander Petrovskiy ... | 0 |
sample_57_17.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.2.0'
# Supported PSEditions
Compatible... | 0 |
1307.ps1 |
function Invoke-CPowerShell
{
[CmdletBinding(DefaultParameterSetName='ScriptBlock')]
param(
[Parameter(Mandatory=$true,ParameterSetName='ScriptBlock')]
[ScriptBlock]
$ScriptBlock,
[Parameter(Mandatory=$true,ParameterSetName='Command')]
[object]
... | 0 |
TabExpansion_12.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>
## $a = New-Object "Int32[,]" 2,3; $b = "PowerShell","Pow... | 0 |
sample_14_13.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 |
sample_40_96.ps1 |
function Get-AzDataProtectionPolicyTemplate {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBackupPolicy')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Gets default policy template for a selected datasourc... | 0 |
sample_8_40.ps1 | #************************************************
# DC_ClusterEventLogs.ps1
# Version 2.0.2
# Date: 11-30-2009
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script calls TS_GetEvents.ps1 to export cluster-related event logs
#************************************************
if($debug -eq $... | 0 |
Set-LocalPassword_1.ps1 | param(
[switch]$Help
, [string] $User
, [string] $Password
, [string[]] $ComputerNames = @()
)
$usage = @'
Get-OUComputerNames
usage : [computerName1,computerName2,... | ] ./Set-LocalPassword.ps1 [-user] <userName> [-password] <password> [[-computers] computerName1,computerName2,...]
returns : Sets lo... | 0 |
sample_13_66.ps1 | # Localized 05/07/2022 03:02 AM (GMT) 303:7.0.30723 MsmqBpa.psd1
#
# Only add new (name,value) pairs to the end of this table
# Do not remove, insert or re-arrange entries
#
ConvertFrom-StringData @'
###PSLOC start localizing
#
# Install on non-DC servers
#
InstallOnNonDC_Title=MSMQ should b... | 0 |
Performance Monitoring.ps1 | <#
.SYNOPSIS
Multiple functions to build a config file and to use file to launch PerfMon background jobs.
.DESCRIPTION
Multiple functions to build a config file and to use file to launch PerfMon background jobs.
.NOTES
Name: WinPerfv2.PS1
Author: Boe Prox
DateCreated: 28June2010
... | 0 |
Error handling PowerCLI.ps1 | $vmPath = "[Storage1] MyVM/MyVM.vmx"
$vm = New-VM –VMHost "192.168.1.10" –VMFilePath $vmPath -Name MyVM
# Check if there is an error and if so – handle it
if (!$?) {
if ($error[0].Exception –is [VMware.VimAutomation.ViCore.Types.V1.ErrorHandling.DuplicateName]) {
# A VM with the same name already exists. Ch... | 0 |
3729.ps1 |
function Test-GetActionRulesFilteredByParameters
{
$severityFilter = "Sev3"
$monitorService = "Platform"
$actionRules = Get-AzActionRule -Severity $severityFilter -MonitorService $monitorService
Assert-NotNull $actionRules.Count
}
function Test-CreateUpdateAndDeleteSuppressionRule
{
try
{
$reso... | 0 |
sample_31_66.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 = '79.0.0'
# Suppo... | 0 |
4325.ps1 | function Send-EnvironmentChangeMessage
{
if($Script:IsWindows)
{
if (-not ('Microsoft.PowerShell.Commands.PowerShellGet.Win32.NativeMethods' -as [type]))
{
Add-Type -Namespace Microsoft.PowerShell.Commands.PowerShellGet.Win32 `
-Name NativeMethods `
... | 0 |
2266.ps1 | Begin {
try {
Add-Type -AssemblyName "System.Drawing" -ErrorAction Stop
Add-Type -AssemblyName "System.Windows.Forms" -ErrorAction Stop
$ModulePath = Join-Path -Path "$($env:SystemDrive)\Program Files (x86)\Microsoft Intune Mobile Application Management\Android\App Wrappin... | 0 |
DHCP Backup_2.ps1 | param (
[Parameter(Position=1)]
$searchBase = "cn=configuration,dc=domain,dc=com",
[Parameter(Position=2)]
$backupDestRoot = "\\\\network\\share\\"
)
Import-Module ActiveDirectory
function Get-OnlineDhcpServers {
param (
[Parameter(Mandatory=$true,Position=1)]
$dhcpSear... | 0 |
SearchZIP_2.psm1 .ps1 | function SearchZIPfiles {
<#
.SYNOPSIS
Search for (filename) strings inside compressed ZIP or RAR files (V2.2).
.DESCRIPTION
In any directory containing a large number of ZIP/RAR compressed Web Page files
this procedure will search each individual file name for simple text strings,
listing both the source RAR... | 0 |
sample_43_62.ps1 | #
# Module manifest for module 'Az.HealthcareApis'
#
# Generated by: Microsoft Corporation
#
# Generated on: 23/04/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.HealthcareApis.psm1'
# Version number of this module.
ModuleVersion = '2.0.1'
# Supported... | 0 |
sample_32_21.ps1 | #
# Module manifest for module 'OCI.PSModules.Fusionapps'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Fusionapps.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
... | 0 |
Basic DNSBL Check for IP.ps1 | Function CheckDNSBL {
<#
.NOTES
AUTHOR: Sunny Chakraborty(sunnyc7@gmail.com)
WEBSITE: http://tekout.wordpress.com
VERSION: 0.1
CREATED: 16th July, 2012
LASTEDIT: 16th July, 2012
Requires: PowerShell v2 or better
.DESCRIPTION
Basic Proof of Concept DNSBL Check Script
You can add your own DN... | 0 |
sample_47_25.ps1 | ###############################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# MBAM Client Deployment
#
# Version: 2.5.1
#
# Purpose: Configure BitLocker drive encryption.
# Record recovery keys with MBAM Server.
#
# Usage: Invoke... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.