filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
sample_18_19.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 |
sample_4_15.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 = '93.0.0'
# Supported PSEditions
... | 0 |
470.ps1 |
param (
$ApiKey,
$WorkingDirectory = $env:SYSTEM_DEFAULTWORKINGDIRECTORY
)
Write-Host "Creating and populating publishing directory"
$publishDir = New-Item -Path $WorkingDirectory -Name publish -ItemType Directory
Copy-Item -Path "$($WorkingDirectory)\PSFramework" -Destination $publishDir.FullName -Recurse -Forc... | 0 |
sample_1_11.ps1 | [ dynamic, provider("dcismprovider"),
Association,
Description ("SystemComponent can be associated by a ComputerSystem."
"This relationship is made explicit by the SystemComponent association." )
]
class DCIM_SystemComponent : CIM_SystemComponent {
[
Aggregate,
Description ("The pa... | 0 |
sample_34_91.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Ilyen nevű és típusú környezeti változó már létezik.
EnvironmentErrorDoesNotExists=Ilyen nevű és típusú környezeti változó nem létezik.
'@
# SIG # Begin signature block
# MIIoPQYJKoZIhvcNAQcCoIIoLjCCKCoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaT... | 0 |
sample_31_54.ps1 | function Get-ServiceUrl {
param (
[Parameter(Mandatory = $false)]
[string]$Method,
[Parameter(Mandatory = $false)]
$LaunchConfig
)
[string]$ServiceUrl = (Get-ValueFromALTestRunnerConfig -KeyName 'testRunnerServiceUrl')
if ([String]::IsNullOrEmpty($ServiceUrl))... | 0 |
sample_35_33.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 = '73.1.0'
# Sup... | 0 |
Get-DirSize.ps1 | function Get-DirSize {
<#
.Synopsis
Gets a list of directories and sizes.
.Description
This function recursively walks the directory tree and returns the size of
each directory found.
.Parameter path
The path of the root folder to start scanning.
.Example
# Get the largest folder under the user pro... | 0 |
4162.ps1 |
$RebootThreshold = 14
$Today = Get-Date
$Architecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture
$Architecture = $Architecture.OSArchitecture
$LastReboot = get-winevent -filterhashtable @{ logname = 'system'; ID = 1074 } -maxevents 1 -ErrorAction SilentlyContinue
if ($Architecture... | 0 |
705.ps1 |
function New-RsConfigurationSettingObject
{
[cmdletbinding()]
param
(
[Alias('SqlServerInstance')]
[string]
$ReportServerInstance = ([Microsoft.ReportingServicesTools.ConnectionHost]::Instance),
[Alias('SqlServerVersion')]
[Microsoft.ReportingService... | 0 |
sample_65_68.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 = '84.0.0'
# Supported P... | 0 |
Windows Startup Script_2.ps1 | <#======================================================================================
File Name : Startup.ps1
Original Author : Kenneth C. Mazie
:
Description : This is a Windows startup script with pop-up notification and checks to
: assure things are no... | 0 |
2571.ps1 |
param(
$Environment
)
switch ($Environment)
{
PROD1 { $Server = 'PAPPBO20';
$BOService = 'BOE120SIAPAPPBO20';
$BOWebService = 'W3SVC';
$BODirectory = 'E:\Business Objects\BusinessObjects Enterprise 12.0\Data';
$BODirOld = 'E:\Business Objects\BusinessObjects Enterprise 12.0\Dat... | 0 |
1408.ps1 |
function Uninstall-CMsmqMessageQueue
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[Switch]
$Private
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSC... | 0 |
sample_15_70.ps1 | #
# Module manifest for module 'OCI.PSModules.Visualbuilder'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Visualbuilder.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEdi... | 0 |
2662.ps1 |
[CmdletBinding()]
Param (
[Parameter(Mandatory=$false)]
[ValidateSet('Install','Uninstall')]
[string]$DeploymentType = 'Install',
[Parameter(Mandatory=$false)]
[ValidateSet('Interactive','Silent','NonInteractive')]
[string]$DeployMode = 'Interactive',
[Parameter(Mandatory=$false)]
[switch]$AllowRebootPassThru ... | 0 |
JSON 1.2.ps1 | #requires -version 2.0
# Version History:
# v 0.5 - First Public version
# v 1.0 - Made ConvertFrom-Json work with arbitrary JSON
# - switched to xsl style sheets for ConvertTo-JSON
# v 1.1 - Changed ConvertFrom-Json to handle single item results
# v 1.2 - CodeSigned to make a fellow geek happy
# There i... | 0 |
sample_59_76.ps1 | $ServerCertificateName = "CN=ServiceFabricServerCert"
$ClientCertificateName = "CN=ServiceFabricClientCert"
function IsSecurityX509([string]$ClusterConfigFilePath)
{
$jsonConfig = Get-Content $ClusterConfigFilePath -Raw | ConvertFrom-Json
$properties = $jsonConfig.properties
if ($properties -ne $Nul... | 0 |
sample_25_72.ps1 | #
# Module manifest for module 'OCI.PSModules'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
# ID u... | 0 |
sample_40_64.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 |
1780.ps1 |
return
function RemoveTestGroups
{
param([string] $basename)
$results = Get-LocalGroup $basename*
foreach ($element in $results) {
Remove-LocalGroup -SID $element.SID
}
}
function VerifyFailingTest
{
param(
[scriptblock] $sb,
[string] $expectedFqeid
)
$backu... | 0 |
Appscanner v0.10.ps1 | #######################
#Appscanner V0.10
#Author Adam Liquorish
#Creation Date 08/11/11
#Change log:
# 14/11/11 Removed unrequired step
# 02/12/11 Created input choice for domain.local,cached rather than auto determine
# 02/12/11 Added all supported filetypes for applockers ".bat",".cmd",".... | 0 |
2387.ps1 | $Folder1Path = 'C:\Folder1'
$Folder2Path = 'C:\Folder2'
$Folder1Files = Get-ChildItem -Path $Folder1Path
$Folder2Files = Get-ChildItem -Path $Folder2Path
$FileDiffs = Compare-Object -ReferenceObject $Folder1Files -DifferenceObject $Folder2Files
$FileDiffs | foreach {
$removeParams = @{
'Path' = $_.InputObject.Ful... | 0 |
Get-ChilditemsRecursive.ps1 | function Get-ChildItem2 ($path)
{
# path can either be absolut or relative, I only tried filesystem
# perhaps to named Get-ChildItemsRecursive
$root = gi $path
$PathLength = $root.FullName.length
# it would be nice if Split-Path could do the trick, I didn't grok it
gci $path -rec | % {
... | 0 |
sample_44_62.ps1 | Set-Variable BACKGROUNDAPPUPDATE_TIMEOUT_SECONDS -option Constant -value 1800
Set-Variable PHASE2_TIMEOUT_SECONDS -option Constant -value 60
Set-Variable APPINSTALL_WINDOW_SECONDS -Option Constant -Value 60
Set-Variable SKYPE_PROCESS_NAME -option Constant -value "Microsoft.SkypeRoomSystem"
Set-Variable WATCHDOG_PRO... | 0 |
74.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 |
Get-Arguments.ps1 | ##############################################################################\n##\n## Get-Arguments\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nUses comma... | 0 |
sample_66_72.ps1 | #
# Module manifest for module 'OCI.PSModules.Osmanagementhub'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osmanagementhub.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
# Supported P... | 0 |
2019.ps1 |
Describe "SSH Remoting API Tests" -Tags "Feature" {
Context "SSHConnectionInfo Class Tests" {
BeforeAll {
$skipTest = @(Get-Command 'ssh' -CommandType Application -ErrorAction SilentlyContinue).Count -eq 0
}
AfterEach {
if ($null -ne $rs) {
... | 0 |
sample_28_94.ps1 | param($installPath, $toolsPath, $package, $project)
Import-Module (Join-Path $toolsPath common.psm1) -Force
try {
# Indicates if the current project is a VB project
if ([string]::IsNullOrEmpty($project.CodeModel.Language)) {
$IsVbProject = $project.FullName -like "*.vbproj"
}
else {... | 0 |
sample_14_94.ps1 | @(echo off) > $null
if #ftw NEQ '' goto :init
($true){ $Error.clear(); }
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# wrapper script for vcpkg
# this is intended to be dot-sourced and then you can use the vcpkg() function
# Workaround for $IsWindows not existing in Windows PowerShell
if... | 0 |
sample_43_2.ps1 | <#
Small portable lightweight/standalone functions that are required to be called as signed local modules
for the purpose of satisfying the Constraint Language Mode.
#>
function Get-SslCertificateChain
{
<#
.SYNOPSIS
Retrieve remote ssl certificate & chain from https endpoint for Deskt... | 0 |
WhileTimeout.ps1 | function WhileTimeout ( [int]$interval, [int]$maxTries, [scriptblock]$condition )
{
$i = 0
$startTime = Get-Date
while ( &$condition ) {
$i++
if ( $i -lt $maxTries ) {
Start-Sleep -seconds $interval
} else {
Throw "Operation exceeded timeout"
}
}
$endTime = Get-Date
$duration = ( $endTi... | 0 |
sample_60_77.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... | 0 |
Test-Port_6.ps1 | function Test-Port{
<#
.SYNOPSIS
Tests port on computer.
.DESCRIPTION
Tests port on computer.
.PARAMETER computer
Name of server to test the port connection on.
.PARAMETER port
Port to test
.PARAMETER tcp
Use tcp port
.PARAMETE... | 0 |
sample_56_83.ps1 | <Configuration>
<!-- ################ VIEW DEFINITIONS ################ -->
<ViewDefinitions>
<View>
<Name>Counter</Name>
<ViewSelectedBy>
<TypeName>Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet</TypeName>
</ViewSelectedBy>
<TableControl>
... | 0 |
sample_41_79.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 |
Add-ExcelAddins.ps1 | ###########################################################################"
#
# NAME: Add-ExcelAddins.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jan.egil.ring@powershell.no
#
# COMMENT: This script will check if the specified Microsoft Office Excel Addins are loaded, and if not load them.
# Tested with Po... | 0 |
sample_52_60.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 License... | 0 |
sample_19_47.ps1 | function Get-RoleAndCloudWatchS3Policy
{
<#
.SYNOPSIS
Creates a S3 Policy for GuardDuty based on specified bucket name, role ARN, and Kms ARN
.PARAMETER RoleArn
Specifies the Role ARN
.PARAMETER BucketName
Specifies the S3 Bucket
.PARAMETER KmsArn
Specifies the KMS ARN
... | 0 |
sample_15_54.ps1 | <#
.Synopsis
Activate a Python virtual environment for the current PowerShell session.
.Description
Pushes the python executable for a virtual environment to the front of the
$Env:PATH environment variable and sets the prompt to signify that you are
in a Python virtual environment. Makes use of the command line... | 0 |
2770.ps1 |
$svctrigs = & $env:windir\system32\sc.exe query | ForEach-Object {
$svc = $_
if ($svc -match "SERVICE_NAME:\s(.*)") {
& $env:windir\system32\sc qtriggerinfo $($matches[1])
}
}|?{$_.length -gt 1 -and $_ -notmatch "\[SC\] QueryServiceConfig2 SUCCESS|has not registered for any" }
function Get-LogPr... | 0 |
sample_15_12.ps1 | # Rule ID 4628
# ---------
# http://sharepoint/sites/rules/Rule%20Submissions/Dynamics-CRM_ehagen_2012-06-11-03-02-42.xml
#
# Description: This checks to see if the data types on each CRM registry key is correct.
#
# Related KB
#-----------
# Script Author: jrandall
#
PARAM($RegistryPath=$null)
#r... | 0 |
4115.ps1 |
param
(
[Parameter(Mandatory = $false)][string]$LogFile = 'ImagedSystems.log',
[Parameter(Mandatory = $true)][string]$MonitoringHost,
[Parameter(Mandatory = $true)][ValidateNotNullOrEmpty()][string]$EmailAddress,
[Parameter(Mandatory = $true)][ValidateNotNullOrEmpty()][string]$SMTPServer,
[Parameter(Mandatory = $... | 0 |
FTP ListDirectory.ps1 | $cred = Get-Credential
[System.Net.FtpWebRequest]$request = [System.Net.WebRequest]::Create("ftp://joelbennett.net")
$request.Method = [System.Net.WebRequestMethods+FTP]::ListDirectory #Details
$request.Credentials = $cred
$response = $request.GetResponse()
$list = Receive-Stream $response.GetResponseStream(... | 0 |
sample_15_55.ps1 | ConvertFrom-StringData @'
id_PoolMon=PoolMon information
id_PoolMonrunning=Gathering PoolMon information (PoolMon.exe)
id_PoolMonoutput=PoolMon Output
id_PoolMonoutputdesc=PoolMon Snaps information
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3Ag... | 0 |
3772.ps1 |
function Test-GetReservationOrder
{
$type = "Microsoft.Capacity/reservationOrders"
$reservationOrderId = "704aee8c-c906-47c7-bd22-781841fb48b5"
$reservation = Get-AzReservationOrder -ReservationOrderId $reservationOrderId
Assert-NotNull $reservation
Assert-True { $reservation.Etag... | 0 |
348.ps1 | function Register-PSFConfigSchema
{
[CmdletBinding()]
Param (
[string]
$Name,
[ScriptBlock]
$Schema
)
process
{
[PSFramework.Configuration.ConfigurationHost]::Schemata[$Name] = $Schema
}
} | 0 |
scriptable telnet client_1.ps1 | @@function read-stream ([Parameter(Posistion=0,Mandatory=$true)][validatenotnull()]
[System.Net.Sockets.NetworkStream]$stream,
[String]$expect = "")
{
$buffer = new-object system.byte[] 1024
$enc = new-object system.text.asciiEncoding
## Read all the data available from the stream, writing it to the
#... | 0 |
sample_23_43.ps1 | $ServerCertificateName = "CN=ServiceFabricServerCert"
$ClientCertificateName = "CN=ServiceFabricClientCert"
function IsSecurityX509([string]$ClusterConfigFilePath)
{
$jsonConfig = Get-Content $ClusterConfigFilePath -Raw | ConvertFrom-Json
$properties = $jsonConfig.properties
if ($properties -ne $Nul... | 0 |
sample_39_53.ps1 | ###########################################################
#
# 'ServiceHelper' module
#
###########################################################
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
$global:GCServiceName = "GCService"
$script:GCServiceBinaryName = "gc_service.exe"
$script:GC... | 0 |
sample_67_31.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 |
sample_62_57.ps1 | #
# Module manifest for module 'OCI.PSModules.Opensearch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Opensearch.dll'
# Version number of this module.
ModuleVersion = '90.0.0'
# Supported PSEditions
... | 0 |
sample_24_15.ps1 | #
# Module manifest for module 'OCI.PSModules.Dns'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dns.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
sample_33_69.ps1 | # TODO: Ensure scripts are run in admin mode
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true)]
[string] $VmName,
[Parameter(Mandatory=$false)]
[string] $VmMachineName = "RelativityDevVm",
[Parameter(Mandatory=$true)]
[string] $VmUsername,
[Parameter(Mandatory=$true)]
[str... | 0 |
1061.ps1 |
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$tempDir = $null
Describe 'Get-DscError' {
BeforeEach {
$tempDir = New-TempDirectory -Prefix $PSCommandPath
[Diagnostics.Eventing.Reader.EventLogSession]::GlobalSessi... | 0 |
sample_40_2.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 |
1746.ps1 |
param (
[ValidateSet("machine","user","process")]
[string[]]$PathScope="machine",
[switch]$RemoveAllOccurences
)
ForEach ($PathScopeItem in $PathScope)
{
$AssembledNewPath = $NewPath = ''
$pathstoremove = @([Environment]::GetEnvironmentVariable("PATH","$PathScopeItem").split(';') | Where { $_ -ilike ... | 0 |
Get-ADGroupMembers_3.ps1 | Function Get-ADGroupMembers
{
<#
.SYNOPSIS
Return a collection of users in an ActiveDirectory group.
.DESCRIPTION
This function returns an object that contains all the properties of a user object. This function
works for small groups as well as groups in ex... | 0 |
1355.ps1 |
function Set-CRegistryKeyValue
{
[CmdletBinding(SupportsShouldPRocess=$true,DefaultParameterSetName='String')]
param(
[Parameter(Mandatory=$true)]
[string]
$Path,
[Parameter(Mandatory=$true)]
[string]
$Name,
[Param... | 0 |
sample_2_70.ps1 | <#
.SYNOPSIS
DEV Components and Scenarios module for learning and demoing TSS Framework usage.
This is NOT related to any specific POD and not designed for learning and troubleshooting.
.DESCRIPTION
DEV Components and Scenarios module for learning and demoing TSS Framework usage.
This is NOT related... | 0 |
sample_53_60.ps1 | #
# Module manifest for module 'OCI.PSModules.Apigateway'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apigateway.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
... | 0 |
sample_35_50.ps1 | function trySetDesignerProp(tname, ttype, val) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0);
trait.value = val;
}
if (command.getTrait("state").value == 0) {
command.getTrait("state").value = 2;
trySetDesignerProp("embedMedia", "bool", true);
}
else {
command.get... | 0 |
chkhash_27.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 |
2472.ps1 |
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$AzureWebAppName,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$AzureResourceGroup,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$VirtualPath,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$PhysicalPa... | 0 |
sample_8_60.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 |
Shift Operators(Correct).ps1 | #requires -version 2.0
Add-Type @"
public class Shift {
public static int Right(int x, int count) { return x >> count; }
public static uint Right(uint x, int count) { return x >> count; }
public static long Right(long x, int count) { return x >> count; }
public static ulong Right(ulong x, int ... | 0 |
sample_16_93.ps1 | <#
.SYNOPSIS
Enables or disables the AllowInsecureGuestAuth Registry Key on the local machine.
If the Registry Key does not already exist, it is created with the provided value.
.PARAMETER NewValue
Represents the new value for the AllowInsecureGuestAuth Registry Key.
.EXAMPLE
.\Local-Enable-AllowInse... | 0 |
sample_25_74.ps1 | #
# Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker'
#
# Generated by: Microsoft Corporation
#
# Generated on: 19/01/2022
#
@{
# Script module or binary module file associated with this manifest.
RootModule = ''
# Version number of this module.
ModuleVersion = '1.2100.25... | 0 |
Import-ExcelToSQL.ps1 | #Change these settings as needed
$filepath = 'C:\\Users\\u00\\Documents\\backupset.xlsx'
#Comment/Uncomment connection string based on version
#Connection String for Excel 2007:
$connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=`"$filepath`";Extended Properties=`"Excel 12.0 Xml;HDR=YES`";"
#Connection S... | 0 |
Get-Dependency.ps1 | $BuiltInAliases = @{}
$BuiltInCmdlets = @{}
$BuiltInFunctions = @{}
$BuiltInVariables = @{}
##############################################################################
#.SYNOPSIS
# Gets a list of tokenized strings from the specified PowerShell code sample
# which can be used for dependency analysis or o... | 0 |
sample_28_46.ps1 | #
# Script module for module 'PSScriptAnalyzer'
#
Set-StrictMode -Version Latest
# Set up some helper variables to make it easier to work with the module
$PSModule = $ExecutionContext.SessionState.Module
$PSModuleRoot = $PSModule.ModuleBase
# Import the appropriate nested binary module based on the current PowerShell... | 0 |
UIAutomation.ps1 | # #
# Select-Window Notepad | Remove-Window -passthru #
# ## And later ... #
# Select-Wi... | 0 |
TabExpansion for V2CTP_7.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 |
3011.ps1 | if (($PSVersionTable.ContainsKey('PSEdition')) -and ($PSVersionTable.PSEdition -eq 'Core')) {
& $SafeCommands["Add-Type"] -Path "${Script:PesterRoot}/lib/Gherkin/core/Gherkin.dll"
}
else {
& $SafeCommands["Import-Module"] -Name "${Script:PesterRoot}/lib/Gherkin/legacy/Gherkin.dll"
}
$GherkinSteps = @{}
$Gherki... | 0 |
sample_38_81.ps1 | #
# Module manifest for module 'OCI.PSModules.Limits'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Limits.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Compatib... | 0 |
sample_26_12.ps1 | #
# Module manifest for module 'PowerShellProTools'
#
# Generated by: Ironman Software, LLC
#
# Generated on: 1/9/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'PowerShellProTools.psm1'
# Version number of this module.
ModuleVersion = '2023.12.0'
# Suppo... | 0 |
sample_4_94.ps1 | # *********************************************************************************************************************
# Version 1.0
# Date: 02-29-2012
# Author: Vinay Pamnani - vinpa@microsoft.com
# Description:
# Collects SQL Error Logs from the SQL Server hosting the ConfigMgr database. It creates a UNC Pat... | 0 |
sample_13_13.ps1 | @{
GUID="766204A6-330E-4263-A7AB-46C87AFC366C"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManC... | 0 |
3810.ps1 |
function Test-VirtualMachineGetRunCommand
{
$loc = Get-ComputeVMLocation;
$loc = $loc.Replace(" ", "")
$commandId = "RunPowerShellScript"
$result = Get-AzVMRunCommandDocument -Location $loc -CommandId $commandId
Assert-AreEqual $commandId $result.Id
Assert-AreEqual "Window... | 0 |
Get-InstalledProgram_v_1.ps1 | function Get-InstalledProgram() {
param (
[String[]]$Computer,
$User
)
if ($User -is [String]) {
$Connection = Get-Credential -Credential $User
}
if ($Connection -eq $null){
foreach ($Comp in $Computer){
$Install_soft = gwmi win32_product -ComputerName $Comp |
where {$_.vendor -notlike ... | 0 |
4000.ps1 |
$newAccountName='account-powershell-test'
$existingResourceGroup='PowerShellTest'
$location = "West Central US"
function CleanupExistingTestAccount
{
$check = Get-AzAutomationAccount -ResourceGroupName $existingResourceGroup -Name $newAccountName -ErrorAction SilentlyContinue
if ($null -ne $check)... | 0 |
sample_7_50.ps1 | function GetSuccessAsEnumType
{
param (
$result
)
if($null -eq $result) {
return [Microsoft.AzureStack.ArcHci.Ubercrud.Observability.Events.EventConstants+Status]::SKIPPED
}
elseif($true -eq $result) {
return [Microsoft.AzureStack.ArcHci.Ubercrud.Observability.Event... | 0 |
sample_29_79.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 = '77.0.0'
# Supported PSEdi... | 0 |
sample_21_70.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\@babel+parser@7.23.9\node_modules\@babel\parser\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.p... | 0 |
2355.ps1 |
function Get-EmptyGroup
{
[OutputType([pscustomobject])]
[CmdletBinding()]
param ()
begin
{
$ErrorActionPreference = 'Stop'
}
process
{
try
{
@(Get-ADGroup -Filter * -Properties isCriticalSystemObject,Members).where({ (-not $_.isCriticalSystemObject) -and ($_.Members.Count -eq 0) })
}
catch
{... | 0 |
2841.ps1 |
function ResolveError
{
[CmdletBinding()]
param(
[Parameter(ValueFromPipeline=$true)]
$ErrorRecord=$Error[0],
[Switch]
$Short
)
process {
if ($_ -eq $null) { $_ = $ErrorRecord }
$ex = $_.Exception
if (-not $Short) {
$error_message =... | 0 |
7f98fa6b-12e6-4938-a5e7-254d4d3ef2dd.ps1 | Import-Module : Process should have elevated status to access IIS configuration data.
At C:\\Users\\ca27573\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1:18 char:29
+ Get-Module -ListAvailable | Import-Module
+ ~~~~~~~~~~~~~
+ CategoryInfo : OperationStoppe... | 0 |
3141.ps1 |
for ($a=0; $a -le 100; $a++) {
Write-Host -NoNewLine "`r$a% complete"
Start-Sleep -Milliseconds 10
}
Write-Host "" | 0 |
2409.ps1 |
[CmdletBinding()]
[OutputType('Selected.Microsoft.Management.Infrastructure.CimInstance')]
param ()
process {
try {
Get-ScheduledTask | Select-Object TaskName,Author, @{ 'n' = 'CreationDate'; 'e' = { [datetime]$_.Date } }
} catch {
Write-Error "$($_.Exception.Message) - Line Number: $($_.InvocationInfo.ScriptL... | 0 |
FTP upload_3.ps1 | $File = "D:\\Dev\\somefilename.zip"
$ftp = "ftp://username:password@example.com/pub/incoming/somefilename.zip"
"ftp url: $ftp"
$webclient = New-Object System.Net.WebClient
$uri = New-Object System.Uri($ftp)
"Uploading $File..."
$webclient.UploadFile($uri, $File)
| 0 |
New-ADSubnet.ps1 |
param ($Subnet, $SiteName, $Location, [switch]$Help)
function Help
{
""
Write-Host "Usage: .\\New-ADSubnet.ps1 -Help" -foregroundcolor Yellow
Write-Host "Usage: .\\New-ADSubnet.ps1 <Subnet> <SiteName> <Location>" -foregroundcolor Yellow
Write-Host "Ex: .\\New-ADSubnet.ps1 10.150.0.0/16 Default-First-Site-Name... | 0 |
WPF PingMonitor for 1.0.ps1 | if(!(Get-Command New-BootsWindow -EA SilentlyContinue)) {
Add-PsSnapin PoshWpf
#Import-Module PowerBoots
#Add-BootsContentProperty 'DataPoints', 'Series'
[Void][Reflection.Assembly]::LoadFrom( (Convert-Path (Resolve-Path "~\\Documents\\WindowsPowershell\\Libraries\\WPFVisifire.Charts.dll")) )
#Add-B... | 0 |
3727.ps1 |
function Get-TestResourceGroupName($action)
{
return "pstestrg" + $action
}
function Get-TestActionRuleName($action)
{
return "pstestar" + $action
}
function Get-ProviderLocation($provider)
{
"eastus"
}
function CleanUp($rgname, $actionRuleName)
{
if ([Microsoft.Azure.Test.Http... | 0 |
1494.ps1 |
function Assert-Like
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
[string]
$Haystack,
[Parameter(Position=1)]
[string]
$Needle,
[Parameter(Position=2)]
[string]
$Message
)
Set-... | 0 |
sample_43_25.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 |
3422.ps1 |
function Test-AzureProviderFeature
{
$defaultProviderFeatures = Get-AzureRmProviderFeature
$allProviderFeatures = Get-AzureRmProviderFeature -ListAvailable
Assert-True { $allProviderFeatures.Length -gt $defaultProviderFeatures.Length }
$batchFeatures = Get-AzureRmProviderFeature -Provi... | 0 |
sample_60_18.ps1 | # Localized 05/01/2024 11:12 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Tak
PromptNoString=&Nie
BundleFound=Znaleziono pakiet: {0}
PackageFound=Znaleziono pakiet: {0}
EncryptedBundleFound=Znaleziono zaszyfrowany zbiór: {0}
EncryptedPac... | 0 |
1208.ps1 |
$iniPath = $null
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
$iniPath = Join-Path ([IO.Path]::GetTempPath()) ([IO.Path]::GetRandomFileName())
New-Item $iniPath -ItemType File
}
function Stop-Test
{
... | 0 |
2413.ps1 |
[CmdletBinding(DefaultParameterSetName = 'None')]
param (
[Parameter(ParameterSetName = 'Collection', Mandatory)]
[string]$CollectionName,
[Parameter(ParameterSetName = 'Computer', Mandatory)]
[string[]]$Computername,
[string]$ApplicationName,
[string]$SiteServer = 'MYSITESERVER',
[string]$SiteCode = 'CON'
)
b... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.