filename
stringlengths
5
142
content
stringlengths
2
26M
label
int64
0
1
sample_10_66.ps1
#************************************************ # TS_SDPHTTPTests.ps1 # Version 1.0.1 # Date: 01/18/2013 # Author: andret # Description: Test HTTP connectivity to URLs used in SDP Workflow #************************************************ Import-LocalizedData -BindingVariable ScriptStrings #Networking I...
0
3197.ps1
function Get-UACSetting { [CmdletBinding()] param( [Parameter( ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, ValueFromRemainingArguments=$false, Position=0 )][string[]]$ComputerName = $env:COMPUTERNAME, [switch]$RevertToDe...
0
sample_15_38.ps1
# # Module manifest for module 'OCI.PSModules.Databasemigration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasemigration.dll' # Version number of this module. ModuleVersion = '73.1.0' # Support...
0
sample_54_2.ps1
# # Module manifest for module 'OCI.PSModules.Loggingsearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loggingsearch.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported PSEdi...
0
Sith.ps1
' Script: Master_Audit_AD_Account_Management - 2008 v4 S1S2.vbs (Version 4 Section1 and Section2 combi script) ' Purpose: Parse a DC's security event log and generate account management events, log and e-mail for past 24hs ' Author: Paperclips (The Dark Lord) ' Email: magiconion_M@hotmail.com ' Date: ...
0
2987.ps1
Set-StrictMode -Version Latest Describe "Module scope separation" { Context "When users define variables with the same name as Pester parameters" { $test = "This is a test." It "does not hide user variables" { $test | Should -Be 'This is a test.' } } It "Does not expos...
0
3226.ps1
describe 'New-PoshBotFileUpload' { BeforeAll { $readme = Join-Path -Path $env:BHProjectPath -ChildPath 'README.md' } it 'Returns a [PoshBot.File.Upload] object' { $resp = New-PoshBotFileUpload -Path $readme $resp.PSObject.TypeNames[0] | should be 'PoshBot.File.Upload' } i...
0
sample_15_29.ps1
ConvertFrom-StringData @' id_ssas_collectssasregkeys=Analysis Services Registy Keys id_ssas_collectssasregkeysdesc=Collecting SQL Server Analysis Services registry keys '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYC...
0
sample_33_94.ps1
var state = command.getTrait("state"); var manipData = services.manipulators.getManipulatorData("CameraManipulator"); var mode = null; if (manipData != null) { mode = manipData.getTrait("CameraManipulationMode"); } var tool = new Object(); tool.activate = function () { state.value = 2; if...
0
1450.ps1
function Install-CPerformanceCounter { [CmdletBinding(SupportsShouldProcess=$true,DefaultParameterSetName='SimpleCounter')] param( [Parameter(Mandatory=$true)] [string] $CategoryName, [Parameter(Mandatory=$true)] [string] $Name, ...
0
NIC Performance.ps1
$cat = New-Object system.Diagnostics.PerformanceCounterCategory("Network Interface") $inst = $nic.GetInstanceNames() foreach ( $nic in $inst ) { $a = $nic.GetCounters( $nic ) $a | ft CounterName, { $_.NextValue() } -AutoSize }
0
Get-Entropy.ps1
function Get-Entropy { <# .SYNOPSIS Calculate the entropy of a byte array. Author: Matthew Graeber (@mattifestation) .PARAMETER ByteArray Specifies the byte array containing the data from which entropy will be calculated. .EXAMPLE C:\\PS> $RandArray = New-Object Byte[](10000) C...
0
2534.ps1
function BackupDatabase { Param([string]$servername, [string]$dbName, [string]$backupfiledir, [Microsoft.SqlServer.Management.Smo.BackupActionType]$actionType) $server = GetServer($servername) $backupfilepath = $backupfiledir + "\" + $dbName + "-" + $actionType.ToString() + ...
0
1813.ps1
Describe "Get-PSDrive" -Tags "CI" { It "Should not throw" { Get-PSDrive | Should -Not -BeNullOrEmpty } It "Should have a name and a length property" { (Get-PSDrive).Name | Should -Not -BeNullOrEmpty (Get-PSDrive).Root.Length | Should -Not -BeLessThan 1 } It "Should be able to be calle...
0
sample_7_8.ps1
$debug = $false $vmmskey = "HKLM:\SYSTEM\CurrentControlSet\Services\vmms" if (Test-Path $vmmskey) { Import-LocalizedData -BindingVariable HyperVNetStrings #Hyper-V Networking info Write-DiagProgress -Activity $HyperVNetStrings.ID_HyperVNet -Status $HyperVNetStrings.ID_HyperVNetObtaining ...
0
sample_49_61.ps1
# # Module manifest for module 'OCI.PSModules.Tenantmanagercontrolplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Tenantmanagercontrolplane.dll' # Version number of this module. ModuleVersion = '81...
0
sample_59_9.ps1
# ------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See License.txt in the repo root for license information. # ------------------------------------------------------------ [CmdletBinding(DefaultParamet...
0
sample_46_63.ps1
param( [parameter(Mandatory = $false)] $databaseName, [parameter(Mandatory = $false)] $databaseUserName, [parameter(Mandatory = $false)] $databaseUserPassword, [parameter(Mandatory = $true)] $databaseAdminUser, [parameter(Mandatory = $true)] $databaseAdminPasswo...
0
4118.ps1
[CmdletBinding()] param ( [ValidateNotNullOrEmpty()] [string]$Collection, [ValidateNotNullOrEmpty()] [string]$SQLServer, [ValidateNotNullOrEmpty()] [string]$SQLDatabase, [ValidateNotNullOrEmpty()] [string]$DeploymentName, [ValidateNotNullOrEmpty()] [int]$MaxDays ) function Initialize-Reboot { [CmdletBin...
0
sample_22_36.ps1
/////////////////////////////////////////////////////////////////////////////// // Helper to set a designer prop /////////////////////////////////////////////////////////////////////////////// function setDesignerProp(tname, ttype, tvalue) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)...
0
sample_67_41.ps1
# # Module manifest for module 'OCI.PSModules.Adm' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Adm.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported PSEditions CompatiblePSEd...
0
sample_65_87.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 = '83.3.0' # Supported PSEditions Co...
0
sample_61_0.ps1
$global:VerbosePreference = 'Continue' Function Write-Custom-Output { Param([string]$message) $date = Get-Date $newMessage = '[{0}] {1}' -f $date, $message Write-Output $newMessage } trap [Exception] { Write-Custom-Output "WARN: Terminating error encountered on line $($_.Invoc...
0
3016.ps1
Set-StrictMode -Version Latest Describe 'Testing Context' { It "Context throws a missing name error" { { Context { it "runs a test" { } } }| should -Throw 'Test fixture name has multiple lines and no test fixture is provided. (Have you provided a name f...
0
sample_12_24.ps1
# Copyright 2008, Microsoft Corporation. All rights reserved. PARAM([string]$MachineName = $ComputerName,[string]$Path= $null) if($debug -eq $true){[void]$shell.popup("Run DC_DeploymentLogsLogs.ps1")} Import-LocalizedData -BindingVariable DeploymentLogsStrings Write-DiagProgress -Activity $DeploymentLogsS...
0
sample_22_94.ps1
function trySetDesignerProp(tname, ttype, val) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = val; // services.debug.trace(tname + "=" + val); } if (command.getTrait("state").value == 0) { command.getTrait("state").value = 2; trySetDesignerProp("showEm...
0
704.ps1
function Connect-RsReportServer { [CmdletBinding()] param ( [AllowEmptyString()] [AllowNull()] [string] $ComputerName, [Alias('SqlServerInstance')] [string] $ReportServerInstance, [Alias('SqlServerVersion')] ...
0
900.ps1
$Random=(New-Guid).ToString().Substring(0,8) $ResourceGroup="MyResourceGroup$Random" $AppName="webappwithStorage$Random" $StorageName="webappstorage$Random" $Location="West US" New-AzResourceGroup -Name $ResourceGroup -Location $Location New-AzAppservicePlan -Name WebAppwithStoragePlan -ResourceGroupName $Resou...
0
sample_44_22.ps1
# # Module manifest for module 'OCI.PSModules.Rover' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Rover.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Compatible...
0
1422.ps1
function Install-CMsi { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [Alias('FullName')] [string[]] $Path, [Parameter(DontShow=$true)] [Switch...
0
sample_35_90.ps1
# # Module manifest for module 'OCI.PSModules.Oda' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Oda.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions CompatiblePSEd...
0
3278.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '', Scope='Class', Target='*')] class SlackBackend : Backend { [string[]]$MessageTypes = @( 'channel_rename' 'member_joined_channel' 'member_left_channel' 'message' ...
0
sample_17_49.ps1
ConvertFrom-StringData @' id_remotedesktoplserverkb2512845_sd=The version of Terminal Services Licensing installed on this computer is incompatible with Windows Server 2008 (or newer) Remote Desktop Services '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgE...
0
sample_47_29.ps1
Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,06836DC2794B1725 7jb9KmEbTz6f9Rml5H8XH3LtwowJdNaQ5jJmtmCsOPGA5F17QXqRbmkcmNGYVTuT KhM9CJLw+dT6Y9cpJj3Z9+Ze9OG7m3Ti82TOmzHeLKLzlz4KBUV0u896VhxiImvw JMXP+7MOqD/j4oz4U32HBeK7R1AoG/PlREzdZOzYcKEmZ/m/PvIInCHHzxm97rYn 2q78PQLZVXqaFdp+Xkeli4MzjnyZ9fYN2o2EdoxwGdNgOJ0ZXdScAPLH5x3dc...
0
sample_5_80.ps1
ConvertFrom-StringData @' id_dcpromologs=DCPromo id_dcpromologsobtaining=Obtaining DCPromo log files '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlA...
0
3118.ps1
function Set-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_37_24.ps1
<# .SYNOPSIS Demonstrates how to write a command that works with paths that allow wildards and must exist. .DESCRIPTION This command also demonstrates how you need to supply a LiteralPath parameter when your Path parameter accepts wildcards. This is in order to handle paths like foo[1].txt. ...
0
sample_6_91.ps1
#************************************************ # DC_RDSRDWeb.ps1 # Version 1.0.1 # Date: 21-01-2012 # Author: Daniel Grund - dgrund@microsoft.com # Description: # This script gets the IIS config # 1.0.0 Beta release # 1.0.1 Release # TODO get windows\web\rdweb dir #****************************************...
0
sample_22_50.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> function Set-WmiHandlesPerHostLimit { [Cm...
0
3827.ps1
function TestAzureRmRelayNameTests { $location = "West US" $namespaceName = getAssetName "Relay-NS" $namespaceName2 = getAssetName "Relay-NS" $resourceGroupName = getAssetName $secondResourceGroup = getAssetName Write-Debug "Create resource group" Write-Debug "ResourceGroup name : $resourceGr...
0
sample_11_93.ps1
#Requires -RunAsAdministrator ##------------------------------------------------------------------ ## <copyright file="Uninstall-ObservabilityExtension.ps1" company="Microsoft"> ## Copyright (C) Microsoft. All rights reserved. ## </copyright> ##---------------------------------------------------------------...
0
Copy-File (Safely).ps1
function Copy-File { #.Synopsis # Copies all files and folders in $source folder to $destination folder, but with .copy inserted before the extension if the file already exists param($source,$destination) # create destination if it's not there ... mkdir $destination -force -erroraction SilentlyContinue foreac...
0
3627.ps1
function Test-CreateManagedDatabase { $rg = Create-ResourceGroupForTest $vnetName = "cl_initial" $subnetName = "Cool" $virtualNetwork1 = CreateAndGetVirtualNetworkForManagedInstance $vnetName $subnetName $rg.Location $subnetId = $virtualNetwork1.Subnets.where({ $_.Name -eq $subnetName })[0].Id ...
0
sample_25_31.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_42_22.ps1
function trySetDesignerProp(tname, ttype, val) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = val; // services.debug.trace(tname + "=" + val); } if (command.getTrait("state").value == 0) { command.getTrait("state").value = 2; trySetDesignerProp("snap",...
0
sample_34_25.ps1
# # Script module for module 'Az.Attestation' that is executed when 'Az.Attestation' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 04/23/2024 13:01:39 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try { ...
0
sample_8_11.ps1
# diag_api.psm1 # by tdimli # March 2020 # API/helper functions # errors reported by these diagnostics won't be shown on screen to user # only saved to xray_ISSUES-FOUND_*.txt report file $Global:BETA_DIAGS = " net_802dot1x_KB4556307, net_firewall_KB4561854, net_wlan_KB4557342, net_dnscli_KB4562541, net_da...
0
2548.ps1
function Import-Excel { [CmdletBinding()] Param([Parameter(Mandatory=$true,ValueFromPipeline=$true)][string]$Path, [Parameter(Mandatory=$false)][switch]$NoHeaders ) $Path = if([IO.Path]::IsPathRooted($Path)){$Path}else{Join-Path -Path (Get-Location) -ChildPath $Path} if(!(T...
0
Easy Snapshot Tool.ps1
#Generated Form Function function GenerateForm { ######################################################################## # Code Generated By: Richard Yaw # Generated On: 19/04/2012 # # Easy Snapshot Tool for VMware # - GUI based tool # - Centralised view of all snapshots in a vCenter server # - Create and del...
0
Get-Exchange-Mail_1.ps1
[Reflection.Assembly]::LoadFile("C:\\Program Files\\Microsoft\\Exchange\\Web Services\\1.1\\Microsoft.Exchange.WebServices.dll") | Out-Null $s = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2007_SP1) $s.Credentials = New-Object Net.Netwo...
0
sample_16_17.ps1
# Localized 02/17/2024 04:13 AM (GMT) 303:7.2.30118 CL_LocalizationData.psd1 ConvertFrom-StringData @' ###PSLOC Troubleshoot_Title=Troubleshooting Troubleshoot_DetectDVDDevice=Checking DVD device ... Troubleshoot_DetectDVDvideoDecoder=Checking video decoder for DVD playback ... Troubleshoot_DetectDVDAudioDecoder...
0
8014f3e2-68e3-4145-bd77-badc10360e30.ps1
param([Parameter(Mandatory=$true)][string]$Path,[Parameter(Mandatory=$true)][string]$Destination) Get-ChildItem -Path $Path | Where-Object { !$_.PSIsContainer } | foreach { $Target = Join-Path -Path $Destination -ChildPath (Split-Path -Leaf $_) if ( Test-Path -Path $Target -PathType Leaf ) { Rename-Item -Path...
0
sample_23_94.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> function Register-EditorCommand { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$Name, ...
0
sample_15_74.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_34_82.ps1
# # Module manifest for module 'OCI.PSModules.Identitydomains' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Identitydomains.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported P...
0
1820.ps1
Describe "Hierarchical paths" -Tags "CI" { BeforeAll { $data = "Hello World" Setup -File testFile.txt -Content $data } It "should work with Join-Path " { $testPath = Join-Path $TestDrive testFile.txt Get-Content $testPath | Should -BeExactly $data } It "should wor...
0
896.ps1
$Random=(New-Guid).ToString().Substring(0,8) $ResourceGroupName="myResourceGroup$Random" $AppName="AppServiceMonitor$Random" $Location="WestUS" New-AzResourceGroup -Name $ResourceGroupName -Location $Location New-AzAppservicePlan -Name AppServiceMonitorPlan -ResourceGroupName $ResourceGroupName -Location $Locat...
0
Hex2Dec_5.ps1
<!DOCTYPE html> <html> <head> <title>He2Dec</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script language="javascript" type="text/javascript"> var num = { hex2dec : function(n) { return Number(n) ? Number(n) : 'Wrong data type'; }, ...
0
sample_22_12.ps1
function Get-WACMOCounters { <# .SYNOPSIS Gets all the Counters for a particular Object for Performance Monitor tool. .DESCRIPTION Gets all the Counters for a particular Object for Performance Monitor tool. .ROLE Readers #> param( [Parameter(Mandatory = $true)] [String] $ObjectName ) ...
0
3797.ps1
Configuration DummyConfig { Import-DscResource -ModuleName PSDesiredStateConfiguration Script dummyscript { SetScript = 'Write-Verbose -Verbose "Testing Dummy script!!"' GetScript = "Test dummyscript" TestScript = {$false} } }
0
sample_2_74.ps1
ConvertFrom-StringData @' id_ctsnlb=Network Load Balancing (NLB) id_ctsnlbdescription=Collects information about Network Load Balancing (NLB). '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG #...
0
3699.ps1
function Test-GetAgreementTerms { $PublisherId = "microsoft-ads" $ProductId = "windows-data-science-vm" $PlanId = "windows2016" $agreementTerms = Get-AzMarketplaceTerms -Publisher $PublisherId -Product $ProductId -Name $PlanId Assert-NotNull $agreementTerms Assert-NotNull $agreementTerms.Licens...
0
sample_59_22.ps1
# # Module manifest for module 'OCI.PSModules.Osuborganizationsubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll' # Version number of this module. ModuleVersion...
0
4016.ps1
Param( [int[]] $nums ) Write-Output "Starting process" $sum = ($nums | Measure-Object -Sum).Sum Write-Output "Process completed" Write-Output $sum
0
2176.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Specify the Primary Site server")] [ValidateScript({Test-Connection -ComputerName $_ -Count 2})] [string]$SiteServer = "$($env:COMPUTERNAME)", [parameter(Mandatory=$true, HelpMessage="Specify the name of a Dist...
0
sample_37_65.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> Import-Module -Name $PSScriptRoot\Helpers.psm1 -...
0
sample_61_8.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
Get-BogonList_2.ps1
function Get-BogonList { <# .SYNOPSIS Gets the bogon list. .DESCRIPTION The Get-BogonList function retrieves the bogon prefix list maintained by Team Cymru. A bogon prefix is a route that should never appear in the Internet routing table. A packet routed over the public Internet (not including over ...
0
3294.ps1
function Start-PoshBot { [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope='Function', Target='*')] [cmdletbinding(DefaultParameterSetName = 'bot')] param( [parameter(Mandatory, ValueFromPipeline, ParameterSetName = 'bot')] [Ali...
0
Office 365 - get email .ps1
$Content = '$script:showWindowAsync = Add-Type –memberDefinition @”','[DllImport("user32.dll")]','public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);','“@ -name “Win32ShowWindowAsync” -namespace Win32Functions –passThru','function Show-PowerShell() {','$null = $showWindowAsync::ShowWindowAsync((Get-Pr...
0
1623.ps1
function Get-LogonStatus ($computer = $env:COMPUTERNAME) { $hash = @{ Computer = $computer Name = '-' User = '-' Status = '-' } $obj = gwmi win32_computersystem -ComputerName $computer -ea 0 $hash.User = $obj.username $hash.Name = $obj.name try { epsr ...
0
4413.ps1
function Save-Script { [CmdletBinding(DefaultParameterSetName = 'NameAndPathParameterSet', HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=619786', SupportsShouldProcess = $true)] Param ( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ...
0
sample_38_58.ps1
# # Module manifest for module 'OCI.PSModules.Ons' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ons.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions CompatiblePSEd...
0
Wake-OrphanedVMHost.ps1
#requires -pssnapin VMware.VimAutomation.Core # http://get-admin.com/blog/?p=342 #Get any cluster that has DPM Enabled $Clusters = @() $Clusters += Get-Cluster -verbose:$false | Where-Object { (Get-View -VIObject $_ -verbose:$false).ConfigurationEx.DpmConfigInfo.Enabled } Write-Verbose "$(get-date -uformat %T) Fo...
0
sample_34_55.ps1
<#################################################################################################################################################################################################################### ##############################| |#################################################################...
0
sample_38_29.ps1
const lang = Object.freeze({ "displayName": "CUE", "fileTypes": ["cue"], "name": "cue", "patterns": [{ "include": "#whitespace" }, { "include": "#comment" }, { "captures": { "1": { "name": "keyword.other.package" }, "2": { "name": "entity.name.namespace" } }, "match": "(?<![\\p{L}\\p{Nd}_\\$\\#])(package)[ \\t]+([\\p{L...
0
bb6a122a-f80d-4233-b795-beee3a70c3c0.ps1
#################################################################################################### ## Script Name: N++CR FuncGuard Module ## Created On: 12/19/2009 ## Author: Thell Fowler ## File: FuncGuard.psm1 ## Usage: ## Version: 0.0.1 ## Purpose: Pro...
0
Monitor-FileSize_3.ps1
function Monitor-FileSize { <# .Synopsis Checks the file size of a given file until it reaches the specified size .Description Checks the file size of a given file until it reaches the specified size. AT that point, it alerts the user as to what the original file-size-boundry was and what it currentl...
0
3149.ps1
[CmdletBinding()] param( [Parameter( Position=0, HelpMessage='Maximum number of threads at the same time (Default=100)')] [Int32]$Threads=100 ) Begin{ } Process{ [System.Management.Automation.ScriptBlock]$ScriptBlock = { Param( $Parameter1, $Parameter2 ) ...
0
Get-UnityLicense.ps1
# # get-unitylicense.ps1 # # Returns license information for a Cisco Unity environment # Usage: get-unitylicense <server> # # Author: Robbie Foust (rfoust@duke.edu) # function global:get-unitylicense ([string]$server = $(throw "Please provide a server name!")) { $webContent = new-object net.webclient ...
0
sample_13_12.ps1
# # Module manifest for module 'OCI.PSModules.Bastion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Bastion.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditions Compat...
0
sample_47_38.ps1
"use strict"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. Object.defineProperty(exports, "__esModule", { value: true }); exports.Force = void 0; const switch_1 = require("../switch"); class Force extends switch_1.Switch { switch = 'force'; } exports.Force = Force; //# sourceMappingURL...
0
1616.ps1
function Get-ShaHash { param ( [Parameter(ValueFromPipeline=$true)] [string]$file, [ValidateSet(1, 256, 384, 512)] [int]$bit = 512 ) begin { function Resolve-FullPath ([string]$Path) { if ( -not ([IO.Path]::IsPathRooted($Path)) ) { $Path = Join-Pa...
0
SearchZIP.psm1 .ps1
function SearchZIPfiles { <# .SYNOPSIS Search for (filename) strings inside compressed ZIP or RAR files. .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/ZIP fi...
0
1799.ps1
Describe "Clear-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { BeforeAll { $defaultParamValues = $PSdefaultParameterValues.Clone() $PSDefaultParameterValues["it:skip"] = !$IsWindows -or $IsCoreCLR } AfterAll { $global:PSDefaultParameterValues = $defaultParamValue...
0
2270.ps1
function Load-Form { $Form.Controls.Add($TabControl) $TabControl.Controls.AddRange(@( $TabPageGeneral, $TabPageCAS, $TabPagePrimary, $TabPageSecondary, $TabPageSiteRoles, $TabPageOther )) $TabPageGeneral.Controls.AddRange(@( $OutputBox...
0
2211.ps1
param( [parameter(Mandatory=$true)] $SiteServer, [parameter(Mandatory=$true)] $SiteCode, [parameter(Mandatory=$true)] $ApplicationName ) if (Get-WmiObject -Namespace "root\sms\site_$($SiteCode)" -Class "SMS_Application" -ComputerName $SiteServer -ErrorAction SilentlyContinue | Where-Object { $_.LocalizedDisplayN...
0
3756.ps1
function Test-CreateGetRemoveMLCommitmentPlan { $planDeleted = $false $actualTest = { param([string] $location) try { $resourceGroupName = Get-ResourceGroupName $commitmentPlanName = Get-CommitmentPlanName LogOutput "Creating resourc...
0
sample_36_77.ps1
# # Module manifest for module 'OCI.PSModules.Rover' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Rover.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions Compatible...
0
Get-Scope_3.ps1
function Get-Scope { #.Synopsis # Determine the scope of execution (are you in a module? how many scope layers deep are you?) #.Parameter Invocation # In order to correctly determine the scope, this function requires that you pass in the $MyInvocation variable when you call it. #.Parameter ToHost # If you jus...
0
sample_0_73.ps1
ConvertFrom-StringData @' id_clusterinfo=Cluster Information id_clusterinforesquery=Processing Resources: %ResourceName% (%Current% of %top%) id_clusterinfoquery=Cluster Group %GroupName% - Querying resources '@ # SIG # Begin signature block # MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # ...
0
1679.ps1
if (gcm Set-Clipboard -ea 0) { return } function Set-Clipboard { [cmdletbinding()] param ( [parameter(Position=0,Mandatory=$true,ValueFromPipeline=$true)]$InputObject, [switch] $File ) ...
0
ping check using dotNet _1.ps1
function dnsref ($computername) { $ErrorActionPreference = "SilentlyContinue" $testrun=$Null trap { Write-Host "ERROR: $computername does not exist in DNS" -fore Yellow Throw $_ } $testrun=[net.dns]::GetHostByName($computername) if ($testrun -eq $Null){ Write-Host "No DNS Record" } else { foreach ($ali...
0
sample_6_37.ps1
#************************************************ # DC_RDG-Component.ps1 # Version 1.0 # Date: 2009 # Author: Boyd Benson (bbenson@microsoft.com) # Description: Collects information about RDG. # Called from: Main Networking Diag #******************************************************* Trap [Exception] { ...
0
sample_66_4.ps1
# # Module manifest for module 'OCI.PSModules.Dashboardservice' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dashboardservice.dll' # Version number of this module. ModuleVersion = '86.2.0' # Supported...
0
2085.ps1
Describe 'Break statements with classes' -Tags "CI" { function Get-Errors([string]$sourceCode) { $tokens = $null $errors = $null $ast = [System.Management.Automation.Language.Parser]::ParseInput($sourceCode, [ref] $tokens, [ref] $errors) return $errors } Context 'break is...
0
WriteFileName_3.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_6_20.ps1
ConvertFrom-StringData @' id_windowssearchlenovorapidbootcheck_st=The Windows Search service is stopped and the HyperW7Svc64.exe service was detected '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63J...
0
1077.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldDetectIfOSIs64Bit { $is64Bit = (Test-Path env:"ProgramFiles(x86)") Assert-Equal $is64Bit (Test-OSIs64Bit) }
0
sample_48_97.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