filename
stringlengths
5
142
content
stringlengths
2
26M
label
int64
0
1
sample_66_5.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
sample_31_80.ps1
# # Module manifest for module 'OCI.PSModules.Loganalytics' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loganalytics.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditi...
0
2574.ps1
$ErrorActionPreference = "silentlycontinue" $Excel = New-Object -ComObject Excel.Application $Excel.visible = $False $Excel.DisplayAlerts = $false $ExcelWorkbooks = $Excel.Workbooks.Add() $Sheet = $ExcelWorkbooks.Worksheets.Item(1) $date = ( get-date ).ToString('yyyy/MM/dd') $save = "E:\Dexma\Logs\DatabaseBackup_...
0
PowerCLI New-Farm.ps1
# Connect to vCenter Connect-VIServer vcenter.domain.com # root folder is used for datacenter location $rootfolder = Get-Folder -NoRecursion # datacenter $dc = New-Datacenter -Name "vFarm" -Location $rootfolder # Build hostname strings for ESX servers in format sssrrrnn (site/role/number) $esxname = 1..10 ...
0
200.ps1
function New-ScriptMessage { [CmdletBinding()] [OutputType([string])] param ( [String]$Message, [String]$Block, [String]$DateFormat = 'yyyy\/MM\/dd HH:mm:ss:ff', $FunctionScope = "1" ) PROCESS { $DateFormat = Get-Date -Format $DateFormat $MyCommand = (Get-Variable -Scope $FunctionScope -Name MyInv...
0
2243.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [ValidateSet("Save","Revert")] [string]$Mode ) Begin { try { $TSEnvironment = New-Object -ComObject Microsoft.SMS.TSEnvironment -ErrorAction Stop } catch [System.Excepti...
0
Get Twitter RSS Feed_6.ps1
param ([String] $ScreenName) $client = New-Object System.Net.WebClient $idUrl = "https://api.twitter.com/1/users/show.json?screen_name=$ScreenName" $data = $client.DownloadString($idUrl) $start = 0 $findStr = '"id":' do { $start = $data.IndexOf($findStr, $start + 1) if ($start -gt 0) { $s...
0
sample_5_0.ps1
. ./utils_cts.ps1 SkipSecondExecution if($debug -eq $true){[void]$shell.popup("Run RS_PrintInfo.ps1")} $PrintInfoAlertXMLFileName = $Computername + "_PrintInfoAlerts.XML" if (Test-Path $PrintInfoAlertXMLFileName) { if($debug -eq $true){[void]$shell.popup($PrintInfoAlertXMLFileName)} [xml] $XMLResu...
0
sample_64_78.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ function Publish-UpgradedServ...
0
demo-attributes.ps1
function demo-attributes { [System.Configuration.SettingsDescription({ @{something = 1; this = 'that'; array = (1,2,3); sub = @{ sub1 = 1 ; sub2 =2 } }})] [CmdletBinding(DefaultParameterSetName="noname")] param ( [Parameter(Position=1,mandatory = $true)] [string]$somethin...
0
483.ps1
function Add-PPScriptShortcut{ [CmdletBinding()] param( [Parameter(Mandatory=$true)] [String] $Name, [Parameter(Mandatory=$false)] [String] $ShortcutKey, [Parameter(Mandatory=$false)] [String] $ShortcutName ) if(-not $Sho...
0
sample_57_99.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> function Get-WinRMComputerName { <# ....
0
NPS Server Synchronize.ps1
###Network Policy Server Synchronization Script #This script copies the configuration from the NPS Master Server and imports it on this server. #The Account that this script runs under must have Local Administrator rights to the NPS Master. #This was designed to be run as a scheduled task on the NPS Secondary Server...
0
Findup_5.ps1
using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using Microsoft.Win32; using System.IO; namespace Findup { public class FileInfoExt { public FileInfoExt(FileInfo fi) ...
0
sample_27_60.ps1
/////////////////////////////////////////////////////////////////////////////// // Helper to set a designer prop /////////////////////////////////////////////////////////////////////////////// function setDesignerProp(tname, ttype, tvalue) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)...
0
sample_16_70.ps1
# # Module manifest for module 'OCI.PSModules.Databasetools' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasetools.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEdi...
0
WriteFileName.ps1
# functions to print overwriting multi-line messages. Test script will accept a file/filespec/dir and iterate through all files in all subdirs printing a test message + file name to demostrate. # e.g. PS>.\\writefilename.ps1 c:\\ # call WriteFileName [string] # after done writing series of overwriting messages, cal...
0
sample_23_22.ps1
param([string] $AgentInstallDir) #Get the agent updater module path using intallation directory details $AgentInstallDir=$AgentInstallDir.Trim() $AgentUpdaterModulePath=Join-Path -Path $AgentInstallDir -ChildPath "Kailani.Afs.Updater.Cmdlets.dll" Write-Host "Running the agent updater action from $AgentUpdaterModu...
0
sample_61_49.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # # Azure File Sync: List per item sync errors # # Version 2.4...
0
sample_59_90.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_13_1.ps1
#************************************************ # DC_ClusterResourcesProperties.ps1 # Version 1.1.1 # Date: 11-22-2011 # Author: Andre Teixeira - andret@microsoft.com # Description: This script writes cluster resources properties # on a text file called COMPUTERNAME_ClusterProperties.txt #*******...
0
Save-Credentials_2.ps1
<# .SYNOPSIS The script saves a username and password, encrypted with a custom key to to a file. .DESCRIPTION The script saves a username and password, encrypted with a custom key to to a file. The key is coded into the script but should be changed before use. The key allows the password to be decrypted ...
0
a83538ba-c3bf-4a64-9961-04a6b9a4f0a9.ps1
# This script supports being run with -WhatIf and -Confirm parameters. [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] param ( # Regex of the states that should be included in the process killing field. [string]$IncludeStates = '^(Disc)$', # Only DISCONNECTED sessions by default. #...
0
980.ps1
$SubscriptionId = '' $resourceGroupName = "myResourceGroup-$(Get-Random)" $location = "southcentralus" $adminSqlLogin = "SqlAdmin" $password = "ChangeYourAdminPassword1" $serverName = "server-$(Get-Random)" $databaseName = "mySampleDatabase" $startIp = "0.0.0.0" $endIp = "0.0.0.0" $storageAccountName = $("sql$(...
0
1699.ps1
[CmdletBinding()] Param( [Parameter(Mandatory = $true)] [ValidateNotNullorEmpty()] [PSCredential]$Credential ) If (-not $PSScriptRoot) {$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent} $Script:ThisCommand = $MyInvocation.MyCommand $ProjectRoot = Resolve-Path "$PSScriptRoot\.." $ModuleRoot ...
0
sample_2_3.ps1
#************************************************ # DC_Ex_ExBPAcmd.ps1 # Version 1.0.0 # Date: 04-27-2012 # Author: Brian Prince - brianpr@microsoft.com # Description: This script runs ExBPAcmd.exe to generate health check for Organization, Administrative Group and local Exchange 2007 or 2010 Server. #***********...
0
2560.ps1
param( $SQLServer = 'PSQLRPT24' , $Database = 'PA_DMart' , $StartDate = (Get-Date) , $EndDAte = (Get-Date) ) Import-Module SqlServer Import-Module Pscx $Queries = "sel_DMartComponentLogByClient ", "sel_DMartComponentLogByTaskName", "sel_DMartCDC_DataComponentLogByClient", "sel_DMartCDC_DataComponentLogByTa...
0
1549.ps1
function Test-Port{ [cmdletbinding( DefaultParameterSetName = '', ConfirmImpact = 'low' )] Param( [Parameter( Mandatory = $True, Position = 0, ParameterSetName = '', ValueFromPipeline = $True)] [array]$computer, ...
0
1894.ps1
Describe "Remove-Event" -Tags "CI" { BeforeEach { New-Event -sourceidentifier PesterTimer -sender Windows.timer -messagedata "PesterTestMessage" } AfterEach { Remove-Event -sourceidentifier PesterTimer -ErrorAction SilentlyContinue } Context "Check Remove-Event can validly remove events" { ...
0
3308.ps1
function New-PoshBotConfiguration { [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope='Function', Target='*')] [cmdletbinding()] param( [string]$Name = 'PoshBot', [string]$ConfigurationDirectory = $script:defaultPoshBotDir, ...
0
sample_50_65.ps1
## Copyright (c) Microsoft Corporation. All rights reserved. <# .SYNOPSIS This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. .DESCRIPTION This cmdlet collects a performance recording of Microsoft Defender Antivirus scans. These performance recordings contain Microsoft-Antimal...
0
3445.ps1
[CmdletBinding()] Param ( [Parameter()] [string]$FilesChanged ) $PathsToCheck = @("src") $PathStringsToIgnore = @( "Test", ".sln", "Nuget.config", ".psd1", "Netcore", "Stack" ) Write-Host "Files changed: $FilesChanged" $FilesChangedList = @() while ($true) { $Idx = $FilesChanged.In...
0
Email-ExpiringADAccounts_1.ps1
Function GetMsgBody { Write-Output @" <p>Dear $name,</p> Your ABC network account is about to expire.<br/> Please email helpdesk@abc.com or simply hit 'reply', and include the following details to have your account extended.<br/> <br/> Your name:<br/> The department you currently volunteer in:<br/> ...
0
sample_8_73.ps1
ConvertFrom-StringData @' id_wsftpsiexplorercrashcheck_st=Wsftpsi.dll version 12.3.0.1 was detected in this machine. This version is known to cause consistent Explorer crashes '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE...
0
497.ps1
function Get-AvailableDriveLetter { param( [parameter(Mandatory=$False)] [Switch] $ReturnFirstLetterOnly, [parameter(Mandatory=$False)] $FavoriteDriveLetter ) if($ReturnFirstLetterOnly -eq $true -and $FavoriteDriveLetter -ne $null){ throw "Only one parameter is possible for this function" exit } ...
0
1555.ps1
function Test-MrIpAddress { [CmdletBinding()] param ( [Parameter(Mandatory=$true, ValueFromPipeLine=$true)] [string[]]$IpAddress, [switch]$Detailed ) PROCESS { foreach ($Ip in $IpAddress) { try { $Results = $Ip -m...
0
sample_67_49.ps1
# # Module manifest for module 'OCI.PSModules.Common' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Common.dll' # Version number of this module. ModuleVersion = '84.0.0' # Supported PSEditions Compatib...
0
sample_50_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 = '75.1.0' # Supported P...
0
SetDefaultPrinter_2.ps1
<# .SYNOPSIS Sets the Default Printer for any user on any machine in active directory. .DESCRIPTION Search AD for Computername; Select User Account and Printer and make that printer the default printer for that user on that computer. .PARAMETER Hostnme This parameter is required and should reflect the ...
0
sample_64_14.ps1
# -------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All Rights Reserved. # Microsoft Corporation (or based on where you live, one of its affiliates) licenses this sample code for your internal testing purposes only. # Microsoft provides the following sample cod...
0
TimeSyn HyperV Settings.ps1
<#Time Synchronization Status#> Write-Host "Time Synchronization Status" -ForegroundColor Yellow Write-Host "_______________________________" -ForegroundColor Yellow Write-Host $VMhost = Get-ItemProperty "HKLM:\\SOFTWARE\\Microsoft\\Virtual Machine\\Guest\\Parameters" | select -ExpandProperty physicalhost...
0
sample_40_27.ps1
# # Module manifest for module 'OCI.PSModules.Integration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Integration.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEdition...
0
331.ps1
function Set-PSFScriptblock { [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] [CmdletBinding()] param ( [Parameter(Position = 0, Mandatory = $true)] [string] $Name, [Parameter(Position = 1, Mandatory = $true)] [System.Management.Automation.ScriptBl...
0
sample_51_11.ps1
# # Module manifest for module 'OCI.PSModules.Computecloudatcustomer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Computecloudatcustomer.dll' # Version number of this module. ModuleVersion = '73.1.0' ...
0
4302.ps1
. "$PSScriptRoot\PSGetFindModuleTests.Manifests.ps1" . "$PSScriptRoot\PSGetTests.Generators.ps1" function SuiteSetup { Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue $script:MyDocumentsModulesP...
0
sample_16_59.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
convert-vim2css.ps1
param( [string] $vimfile ) # some instructions we don't care for $ignorable = ( 'link', 'clear' ) $nrx = 'hi (?<n>\\w+)' $fgrx = 'guifg=(?<n>#\\w+)' $bgrx = 'guibg=(?<n>#\\w+)' $frx = 'gui=(?<n>\\S+)' (gc $vimfile) | ?{ ($_ -match $nrx) -and ($ignorable -notcontains $matches.n) } | %{ if ( $matche...
0
sample_54_48.ps1
# Import the helper functions Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [parameter(Mandatory = $true)] [System.String] $Category ) #Write-Verbose "Use this cmdlet t...
0
3426.ps1
function Test-PolicyDefinitionCRUD { $policyName = Get-ResourceName $policyName = "$($policyName)-plus-plus" $actual = New-AzureRMPolicyDefinition -Name $policyName -Policy SamplePolicyDefinition.json $retryForCreation = Retry-Function { return (Get-AzureRMPolicyDefinition -Name $policyName).Nam...
0
sample_41_49.ps1
# # Module manifest for module 'Microsoft.SME.AzureBackup' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.AzureBackup.psm1' # Version number of this module. ModuleVersion = '2.31.0' # Supported PSEditions # CompatiblePSEditions = @() # ID used t...
0
120.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
ConvertTo-GoogleChartNum.ps1
## Google Chart API extended value encoding function ######################################################################### #function ConvertTo-GoogleChartNum{ BEGIN { ## Google's odydecody is a 64 character array $ody = "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","...
0
sample_14_7.ps1
ConvertFrom-StringData @' id_wga=Collecting MGADiag id_wgastatus=Running MGADiag.exe '@ # SIG # Begin signature block # MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBtMYXMG...
0
sample_39_58.ps1
# # Module manifest for module 'OCI.PSModules.Streaming' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Streaming.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions Co...
0
sample_47_37.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 = '79.0.0' # Supported PSEditions CompatiblePS...
0
sample_38_44.ps1
[ "[QueryStringParams]" "[FormParams]" "[MultipartFormData]" "[Cookies]" "[Captures]" "[Asserts]" "[Options]" "[BasicAuth]" ] @attribute (comment) @comment [ (key_string) (json_key_string) ] @variable.other.member (value_string) @string (quoted_string) @string (json_string) @string (file_value) ...
0
1918.ps1
Function GetFileMock () { $objs = @( [pscustomobject]@{ Size=4533816; Mode="-a---l"; LastWriteTime="9/1/2015 11:15 PM"; Name="explorer.exe" }, [pscustomobject]@{ Size=994816; Mode="-a---l"; LastWriteTime="9/1/2015 11:13 PM"; Name="HelpPane.exe" }, [pscustomobject]@{ Size=316640; Mode="-a---l";...
0
sample_1_96.ps1
ConvertFrom-StringData @' progressbar_id_crm_unsupportedcustomapp_exists=Custom Applications Under CRMAppPool Check progressbar_id_crm_unsupportedcustomapp_existsdesc=Creating an IIS application inside the Microsoft Dynamics CRM Website for any VDir and specifically within the ISV folder is not supported. '@ # SI...
0
3719.ps1
function Test-RecordSetCrud { $zoneName = Get-RandomZoneName $recordName = getAssetname $resourceGroup = TestSetup-CreateResourceGroup $zone = New-AzDnsZone -Name $zoneName -ResourceGroupName $resourceGroup.ResourceGroupName $createdRecord = New-AzDnsRecordSet -Name $recordName -ZoneName $zoneNa...
0
sample_13_18.ps1
/*!--------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *----------------------------------------------------------*/ var ko = require("knockout"); var Path = require("path"); // Standarize current directoy to avoid diferent expectations depending ...
0
Get-CalendarWeek_2.ps1
# Get-CalendarWeek by Holger Adam # Simple function to retrieve the calendar week to a given or the current date. function Get-CalendarWeek { param( $Date = (Get-Date) ) # get current culture object $Culture = [System.Globalization.CultureInfo]::CurrentCulture # retrieve calendar week $Culture....
0
Form manipulation.ps1
$code = @' using System; using System.Runtime.InteropServices; namespace LibWrap { public class Animator { [DllImport("user32.dll")] public static extern bool AnimateWindow(IntPtr hWnd, uint dwTime, uint dwFlags); } } '@ function BuildAssembly { $cscp = New-Object Microsoft.CSharp.CShar...
0
sample_1_31.ps1
<# .SYNOPSIS Scenario module for collecting Microsoft AVD App Attach related data .DESCRIPTION Collect App Attach related troubleshooting data .NOTES Author : Robert Klemencz Requires : MSRD-Collect.ps1 Version : See MSRD-Collect.ps1 version Feedback : https://aka.ms/MSRD-Colle...
0
3344.ps1
function Set-ScheduledCommand { [PoshBot.BotCommand( Aliases = ('setschedule', 'set-schedule'), Permissions = 'manage-schedules' )] [cmdletbinding()] param( [parameter(Mandatory)] $Bot, [parameter(Mandatory, Position = 0)] [string]$Id, [par...
0
395.ps1
Import-PSFLocalizedString -Path "$script:ModuleRoot\en-us\*.psd1" -Module PSFramework -Language 'en-US' $script:strings = Get-PSFLocalizedString -Module PSFramework
0
sample_63_39.ps1
# # Module manifest for module 'OCI.PSModules.Sch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Sch.dll' # Version number of this module. ModuleVersion = '89.0.0' # Supported PSEditions CompatiblePSEd...
0
sample_47_45.ps1
ConvertFrom-StringData @' FailoverClustersModuleRequired=De vereiste PowerShell-module (FailoverClusters) is niet gevonden. Gebruik het hulpprogramma Functies en onderdelen om het volgende te installeren: Remote Server Administration Tools | Beheerprogramma's voor onderdelen | Hulpprogramma's voor failoverclustering |...
0
sample_65_50.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_9_36.ps1
#************************************************ # DC_HyperVReplica.ps1 # Version 1.0 - 7/24/14 # Author: jasonf #******************************************************* Trap [Exception] { $Script:ExceptionMessage = $_ "[info]: Exception occurred." | WriteTo-StdOut "[info]: Exception.Message $E...
0
sample_48_5.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ManagedServices.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ManagedServices.internal.psm1' if(Test-Path $internalModuleP...
0
3738.ps1
function Test-NewAzureRmMapsAccount { $rgname = Get-MapsManagementTestResourceName; try { $accountname = 'ps-' + $rgname; $skuname = 'S0'; $location = 'West US'; New-AzResourceGroup -Name $rgname -Location $location; $createdAccount = Ne...
0
finddupe_10.ps1
function Get-MD5([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.MD5CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.OpenRead(); $hashByteArray = $hashA...
0
sample_38_61.ps1
# # Module manifest for module 'OCI.PSModules.Resourcesearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Resourcesearch.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSE...
0
DEMO_ Trap Ctrl+C.ps1
function Trap-CtrlC { ## Stops Ctrl+C from exiting this function [console]::TreatControlCAsInput = $true ## And you have to check every keystroke to see if it's a Ctrl+C ## As far as I can tell, for CtrlC the VirtualKeyCode will be 67 and ## The ControlKeyState will include either "LeftCtrlPressed"...
0
sample_56_44.ps1
# # Module manifest for module 'OCI.PSModules.Usageapi' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Usageapi.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions Comp...
0
sample_37_80.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# .Synopsis Group Policy tools use administrative template files (.admx, .adml) to populate policy settings in the user interface. This allows administrators to manage registry-based policy settings. This script installes Powe...
0
sample_36_4.ps1
ConvertFrom-StringData @' IPAddressDisplayNameFormat=Alamat IP: {0} NetworkNameDisplayNameFormat=Nama: {0} NetworkNameOfflineDisplayNameFormat=Alamat IP: Alamat pada "{0}" CreateClusterProgressValidationStart=Memvalidasi kesesuaian server untuk kluster failover. CreateClusterProgressValidationEnd=Selesai memvalida...
0
SMS_1.psm1.ps1
<# .Synopsis Functions for managing SMS and SCCM. .Notes NAME: SMS.psm1 AUTHOR: Tim Johnson <tojo2000@tojo2000.com> #> #Requires -version 2.0 [string]$default_wmi_provider_server = 'myserver' [string]$default_site = 'S00' function Get-SmsWmi { <# .Synopsis A function for accessing the...
0
sample_45_91.ps1
# # Module manifest for module 'OCI.PSModules.Functions' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Functions.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions Co...
0
TabExpansion_4.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","PowerShe...
0
4318.ps1
Describe PowerShell.PSGet.UpdateModuleManifest -Tags 'BVT','InnerLoop' { BeforeAll { Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue $script:TempPath = Get-TempPath $scri...
0
sample_3_99.ps1
ConvertFrom-StringData @' id_netframeworkngenfiles_title=.Net Framework nGen files id_netframeworkngenfiles_status=Collecting .Net Framework nGen files '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE...
0
sample_24_25.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
Compare-DellUpdates_1.ps1
#Requires -version 2 #Author: Nathan Linley #Script: Computer-DellUpdates #Site: http://myitpath.blogspot.com #Date: 2/9/2012 param( [parameter(mandatory=$true)][ValidateScript({test-path $_ -pathtype 'leaf'})][string]$catalogpath, [parameter(mandatory=$true,ValueFromPipeline=$true)][string]$server ) fun...
0
Get-Netstat 1,1.ps1
$null, $null, $null, $null, $netstat = netstat -a -n -o [regex]$regexTCP = '(?<Protocol>\\S+)\\s+((?<LAddress>(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?))|(?<LAddress>\\[?[0-9a-fA-f]{0,4}(\\:([0-9a-fA-f]{0,4})){1,7}\\%?\\d?\\...
0
2076.ps1
Describe 'enums' -Tags "CI" { Context 'basic enums' { enum E1 { e0 e1 e2 } It "has correct value 0" { [E1]::e0 | Should -Be ([E1]0) } It "has correct value 1" { [E1]::e1 | Should -Be ([E1]1) } It "has correct value 2" { [E1]::e2...
0
sample_24_26.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 = '75.1.0' # Suppo...
0
1467.ps1
filter Out-HtmlString { $_ | Out-String -Width 9999 | ForEach-Object { $_.Trim() } | Where-Object { $_ } }
0
1093.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldEscapeADSpecialCharacters { $specialCharacters = "*()\`0/" $escapedCharacters = Format-ADSearchFilterValue -String $specialCharacters Assert-Equal '\2a\28\...
0
sample_12_52.ps1
param( [string]$DataPath, [switch]$AcceptEula ) $version = "Evt-Collect (20240604)" # by Gianni Bragante - gbrag@microsoft.com Function EvtLogDetails { param( [string] $LogName ) Write-Log ("Collecting the details for the " + $LogName + " log") $cmd = "wevtutil gl """ + $logname + """ >>""" + $g...
0
sample_25_80.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
0
1288.ps1
function Set-CIisWebsiteSslCertificate { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $SiteName, [Parameter(Mandatory=$true)] [string] $Thumbprint, [Parameter(Mandatory=$true)] ...
0
sample_48_50.ps1
# region Generated # ---------------------------------------------------------------------------------- # 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 obt...
0
sample_11_46.ps1
ConvertFrom-StringData @' id_adapterkb980486check=Checking 6to4 and physical adapters id_adapterkb980486checkdesc=Checking the number of 6to4 and physical adapters (KB 980486) '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3Ag...
0
sample_45_12.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 = '82.0.0' # Supported PSEditions Co...
0
sample_30_18.ps1
# # This script just calls the Add-AppDevPackage.ps1 script that lives next to it. # param( [switch]$Force = $false, [switch]$SkipLoggingTelemetry = $false ) $scriptArgs = "" if ($Force) { $scriptArgs = '-Force' } if ($SkipLoggingTelemetry) { if ($Force) { $scriptArgs +...
0
1999.ps1
Describe "PSVersionTable" -Tags "CI" { BeforeAll { $sma = Get-Item (Join-Path $PSHome "System.Management.Automation.dll") $formattedVersion = $sma.VersionInfo.ProductVersion $mainVersionPattern = "(\d+\.\d+\.\d+)(-.+)?" $fullVersionPattern = "^(\d+\.\d+\.\d+)(-.+)?-(\d+)-g(.+)$" ...
0
sample_48_15.ps1
# Localized 05/08/2024 05:10 AM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=&Ja PromptNoString=&Nein BundleFound=Bundle gefunden: {0} PackageFound=Paket gefunden: {0} EncryptedBundleFound=Verschlüsseltes Bundle gefunden: {0} EncryptedPackag...
0
Stored Credential Code_1.ps1
#STORED CREDENTIAL CODE $AdminName = Read-Host "Enter your Admin AD username" $CredsFile = "C:\\$AdminName-PowershellCreds.txt" $FileExists = Test-Path $CredsFile if ($FileExists -eq $false) { Write-Host 'Credential file not found. Enter your password:' -ForegroundColor Red Read-Host -AsSecureString | ConvertF...
0
2347.ps1
function Get-DisabledGpo { [OutputType([pscustomobject])] [CmdletBinding()] param () begin { $ErrorActionPreference = 'Stop' } process { try { @(Get-GPO -All).where({ $_.GpoStatus -like '*Disabled' }).foreach({ [pscustomobject]@{ Name = $_.DisplayName DisabledSettingsCategory = ([s...
0