filename
stringlengths
5
142
content
stringlengths
2
26M
label
int64
0
1
PowerShell Talk Chickens_1.ps1
#The PowerShell Talk #Virtualization Congress 2009 # #The Chicken Counter Script #Get our cretendials #More on credential stores: http://professionalvmware.com/2009/04/09/posh-article-of-the-week-secure-credential-storage/ $credentials = Get-VICredentialStoreItem -File "c:\\scripts\\really_secure_file.xml" ...
0
Start-Encryption_1.ps1
## Start-Encryption ################################################################################################## ## Rijndael symmetric key encryption ... with no passes on the key. Very lazy. ## USAGE: ## $encrypted = Encrypt-String "Oisin Grehan is a genius" "P@ssw0rd" ## Decrypt-String $encrypted "P@ssw0rd...
0
sample_45_48.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
sample_4_30.ps1
ConvertFrom-StringData @' id_ctscertificates=Certificates id_ctscertificatesdescription=Collects information about Certificates. id_ctscertificatesmachinestore=Certificates id_ctscertificatesmachinestoredescription=Collecting information about certificates in the machine store. id_ctscertificatesuserstore=Certific...
0
2102.ps1
Describe "NativeLinuxCommands" -tags "CI" { BeforeAll { $originalDefaultParams = $PSDefaultParameterValues.Clone() $PSDefaultParameterValues["It:Skip"] = $IsWindows $originalPath = $env:PATH $env:PATH += [IO.Path]::PathSeparator + $TestDrive } AfterAll { $global:PS...
0
sample_14_31.ps1
# # Module manifest for module 'OCI.PSModules.Cloudmigrations' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Cloudmigrations.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported P...
0
sample_2_58.ps1
#************************************************ # TS_DFSRRootCausesCheck.ps1 # Version 1.0.5 # Date: 08-21-2014 # Author: David Fisher # Description: DFSR Root causes troubleshooter #************************************************ Import-LocalizedData -BindingVariable DFSRCheck Write-DiagProgress -Activit...
0
3319.ps1
function Approve-PendingCommand { [PoshBot.BotCommand( Aliases = ('ack', 'approve', 'approvecommand') )] [cmdletbinding()] param( [parameter(Mandatory)] $Bot, [parameter(Mandatory, Position = 0)] [string]$Id ) $context = $Bot.DeferredCommandExecuti...
0
sample_60_87.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
sample_20_93.ps1
$waitForTimeSyncScript = "$PSScriptRoot\WaitForTimeSyncBeforeDSC.ps1" if (Test-Path $waitForTimeSyncScript) { # Wait for time on this machine to syncrhonize before we begin the boot-time DSC process. # This ensures that our transcript times don't get messed up by clock changes during this time. & $wait...
0
sample_21_96.ps1
function Add-WACLGUserToLocalGroups { <# .SYNOPSIS Adds a local or domain user to one or more local groups. .DESCRIPTION Adds a local or domain user to one or more local groups. The supported Operating Systems are Window Server 2012, Windows Server 2012R2, Windows Server 2016. .ROLE Administrators #> ...
0
1737.ps1
param ( [string] $location = $env:BUILD_REPOSITORY_LOCALPATH, [Parameter(Mandatory, ParameterSetName = 'Build')] [string] $destination = '/mnt', [Parameter(Mandatory, ParameterSetName = 'Build')] [ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")] [ValidateNotNullOrEmpty()] ...
0
User Obj ProxyAddresses.ps1
Function Get-Proxy() { Process { $objDomain = New-Object System.DirectoryServices.DirectoryEntry $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objDomain $objSearcher.PageSize = 1000 $objSearcher.Filter = "(cn=$_)" $objSearcher.SearchScope = "Subtree" $objUser ...
0
COE_IMAGE.ps1
function Set-ComputerName { param( [switch]$help, [string]$originalPCName=$(read-host "Please specify the current name of the computer"), [string]$computerName=$(read-host "Please specify the new name of the computer")) $usage = "set-ComputerName -originalPCname CurrentName -computername AnewName" if (...
0
sample_54_90.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 = '86.0.0' # Supported PSEditions Compatib...
0
2848.ps1
function SelectObjectWithDefault { [CmdletBinding()] param( [Parameter(ValueFromPipeline=$true)] [PSObject] $InputObject, [string] $Name, $Value ) process { if ($_ -eq $null) { $Value } elseif ($_ | Get-Member -Name $Name) { $_.$...
0
sample_17_57.ps1
#************************************************ # TS_StoreAppsFailureForDCOMErrorCheck.ps1 # Version 1.0.1 # Date: 3/13/2013 # Author: V-maam # Description: [Idea ID 7544] [Windows] WinStore - Apps do not launch, because "ALL APPLICATIONS PACKAGES" removed from DCOM ACL # Rule number: 7544 # Rule URL: http:...
0
sample_24_52.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_3_67.ps1
#************************************************ # TS_ServerManagerRefreshIssue.ps1 # Version 1.0.1 # Date: 7/19/2013 # Author: v-kaw # Description: [KSE Rule] [ Windows V3] Server Manager refresh issues and SDP changes reqd for MMC Snapin Issues in 2008, 2008 R2 # Rule number: b7d69da3-d4b7-4754-ad3c-49133b0d...
0
1709.ps1
Function Remove-ServiceNowAttachment { [System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidUsingConvertToSecureStringWithPlainText','')] [System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidGlobalVars','')] [CmdletBinding(DefaultParameterSetName,SupportsShouldProcess=$true)] Param( ...
0
sample_37_14.ps1
<# .SYNOPSIS Sets a secret in one vault to be the same as another. Temporary workaround for issues in secret layout. Assumes that the Keyvaults are in the same subscription and that the current context is set to that subscription. .PARAMETER SourceVaultName Vault where the source secret is located .PARAMETER SourceSe...
0
sample_64_8.ps1
function CheckResourceGraphModuleDependency { [Microsoft.Azure.PowerShell.Cmdlets.Migrate.DoNotExportAttribute()] param() process { $module = Get-Module -ListAvailable | Where-Object { $_.Name -eq "Az.ResourceGraph" } if ($null -eq $module) { $message = "Az.ResourceGraph...
0
sample_58_49.ps1
#!/usr/bin/env pwsh $PlaywrightFileName = Join-Path $PSScriptRoot "Microsoft.Playwright.dll" [Reflection.Assembly]::LoadFile($PlaywrightFileName) | Out-Null exit [Microsoft.Playwright.Program]::Main($args) # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3Ag...
0
746.ps1
param( [Parameter(Position=0, Mandatory)] [ValidateNotNullOrEmpty()] [string] $ScriptPath, [Parameter()] [string] $TestName, [Parameter()] [ValidatePattern('\d*')] [string] $LineNumber, [Parameter()] [switch] $All ) $pesterModule = ...
0
Get-Application 2.1.ps1
function Find-Application { [CmdletBinding()] param( [string]$Name ) begin { [String[]]$Path = (Get-Content Env:Path).Split(";") | ForEach-Object { if($_ -match "%.*?%"){ $expansion = Get-Content ($_ -replace '.*%(.*?)%.*','Env:$1') ...
0
sample_17_2.ps1
# # Module manifest for module 'OCI.PSModules.Waa' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Waa.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions CompatiblePSEd...
0
1157.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldCheckIfLocalAccountExists { $localUserAccounts = @(Get-WmiObject -Query "select * from win32_useraccount where Domain='$($env:ComputerName)'" -Computer .) Asse...
0
3984.ps1
function ServiceBusSubscriptionTests { $location = Get-Location $resourceGroupName = getAssetName "RGName-" $namespaceName = getAssetName "Namespace-" $nameTopic = getAssetName "Topic-" $subName = getAssetName "Subscription-" Write-Debug "Create resource group" New-...
0
sample_54_3.ps1
# # Module manifest for module 'OCI.PSModules.Monitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Monitoring.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions ...
0
1576.ps1
function ConvertTo-MrHashTable { [CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipeline)] [PSObject[]]$Object ) PROCESS { foreach ($o in $Object) { $hashtable = @{} foreach ($p in Get-Member -InputObject $o -Membe...
0
sample_57_96.ps1
# # Module manifest for module 'OCI.PSModules.Cloudmigrations' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Cloudmigrations.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported P...
0
sample_21_69.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
Get-DatastoreMostFree.ps1
#Parameter- Name of the VMware cluster the VM will be assigned to function Get-DatastoreMostFree ($Cluster, [switch] $Second) { <# .SYNOPSIS Return the datastore in the cluster with the most unprovisioned disk space. This takes thin provisioning into account. .DESCRIPTION Queries all the datastores in the clu...
0
Add-SharePointLibraryFil.ps1
Add-SharePointLibraryFile { param ( [System.IO.FileInfo] $File, [System.Uri] $DocumentLibraryUrl = $(throw "Parameter -DocumentLibraryUrl [System.Uri] is required.") ) Begin { } Process { if($_) { $File = [System.IO.FileInfo] $_ } if (!$File.Exists) { Write-Error ($...
0
Test-Prompt_2.ps1
$choices = [System.Management.Automation.Host.ChoiceDescription[]]( (New-Object System.Management.Automation.Host.ChoiceDescription "&Yes","Choose me!"), (New-Object System.Management.Automation.Host.ChoiceDescription "&No","Pick me!")) $Answer = $host.ui.PromptForChoice('Caption',"Message",$choices,(1)) Write-...
0
ScriptTransforms module_3.ps1
function New-ParameterTransform { #.Synopsis # Generates Parameter Transformation Attributes in simple PowerShell syntax #.Description # New-ParameterTransform allows the creation of .Net Attribute classes which can be applied to PowerShell parameters to transform or manipulate data as it's being passed in. #.Exam...
0
ASPX Mailbox (1 of 6).ps1
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="mailboxTasks.aspx.cs" Inherits="mailboxTasks" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>...
0
sample_55_28.ps1
Y表“%{oii_IMBITableName/}”的列“%{oii_IMBIColumnName/}”中包含空白值,这对于多对一关系中的一方上的列或用作表的主键的列而言是不允许的。=表未处于可查询状态,因为基础增量表“%{oii_deltaTableName/}”中的数据已更改。请查看更改并刷新数据集。ă无法将值“%{ccon_value/}”转换为 Direct Lake 表列“%{oii_tableName/}”[“%{oii_columnName/}”] 的类型“%{semanticType/}”、基础 parquet 逻辑类型“%{logicalType/}”和物理类型“%{physicalType/}”。请将列的数据类型转...
0
sample_30_5.ps1
########################################################################################## # <copyright file="Microsoft.EnterpriseManagement.Shell.Functions.ps1" company="Microsoft"> # Copyright (c) Microsoft Corporation. All rights reserved. # </copyright> # <summary>Microsoft.EnterpriseManagement.OperationsM...
0
Search Files by Date_1.ps1
<# Author: Matt Schmitt Date: 11/30/12 Version: 1.0 From: USA Email: ithink2020@gmail.com Website: http://about.me/schmittmatt Twitter: @MatthewASchmitt Description A script for finding files in a directory by Last Accessed Date. #> Write-Host "Enter Root Direc...
0
sample_52_30.ps1
# # Module manifest for module 'OCI.PSModules.Goldengate' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Goldengate.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions ...
0
sample_4_98.ps1
ConvertFrom-StringData @' id_veritasvxiobadconfigflags_sd=VXIO device has a bad state flag and this may cause shadown copies of Veritas volumes to fail. '@ # SIG # Begin signature block # MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE...
0
sample_15_52.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
0
sample_34_71.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> Import-Module $PSScriptRoot\Tracer.psm1 <# ....
0
sample_38_18.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_25_5.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 = '73.1.0' # Supported PSEditions Compatib...
0
sample_63_35.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 = '86.2.0' # Supported PSEditions CompatiblePSEd...
0
sample_49_73.ps1
# This file is a temporary workaround for internal builds to be able to restore from private AzDO feeds. # This file should be removed as part of this issue: https://github.com/dotnet/arcade/issues/4080 # # What the script does is iterate over all package sources in the pointed NuGet.config and add a credential entry #...
0
1922.ps1
Describe "Get-TraceSource" -Tags "Feature" { It "Should output data sorted by name" { $expected = (Get-TraceSource | Sort-Object Name) Get-TraceSource | Should -Be $expected } }
0
4285.ps1
$scriptblock = { param ($Payload) $PipeName = "PoshMSDaisy" $p = [System.IO.Directory]::GetFiles("\\.\\pipe\\") $start = $true foreach ($i in $p) { if ($i -like "*PoshMSDaisy") { $start = $false } } while ($start) { add-Type -assembly "System.Core" ...
0
1807.ps1
Describe "Get-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { BeforeAll { $defaultParamValues = $PSdefaultParameterValues.Clone() $PSDefaultParameterValues["it:skip"] = !$IsWindows -or $IsCoreCLR } AfterAll { $global:PSDefaultParameterValues = $defaultParamValues ...
0
3446.ps1
function Test-Table { $dfname = Get-DataFactoryName $rgname = Get-ResourceGroupName $rglocation = Get-ProviderLocation ResourceManagement $dflocation = Get-ProviderLocation DataFactoryManagement New-AzResourceGroup -Name $rgname -Location $rglocation -Force try { ...
0
New-XVM_9.ps1
Function New-OSCVM { [cmdletbinding()] Param ( [Parameter(Mandatory=$false,Position=1)] [string]$ComputerName=$env:COMPUTERNAME, [Parameter(Mandatory=$true,Position=2)] [string]$Name, [Parameter(Mandatory=$true,Position=3)] [string]$SwitchNam...
0
4223.ps1
function Get-Netstat { [OutputType('System.Management.Automation.PSObject')] [CmdletBinding()] param( [Parameter(Position=0)] [System.String]$ProcessName='*', [Parameter(Position=1)] [System.String]$Address='*', [Parameter(Position=2)] $Port='*', [Parameter(Position=3, ...
0
sample_60_67.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 = '86.2.0' # Supported P...
0
Memory helper functions.ps1
Function Add-SessionVariable() { param ([string[]]$VariableName=$null) [string[]]$VariableNames = [AppDomain]::CurrentDomain.GetData('Variable') $VariableNames += $VariableName if ($input) { $VariableNames += $input } #To Not Waste Space, Remove Duplicates $VariableNames = $VariableNames | ...
0
2120.ps1
Describe 'Basic debugger command tests' -tag 'CI' { BeforeAll { Register-DebuggerHandler } AfterAll { Unregister-DebuggerHandler } Context 'Help (?, h) command should display the debugger help message' { BeforeAll { $testScript = { try { ...
0
3842.ps1
function Get-RandomRegistryName { return 'reg' + (getAssetName) } function Get-RandomResourceGroupName { return 'rg' + (getAssetName) } function Get-RandomReplicationName { return 'rep' + (getAssetName) } function Get-RandomWebhookName { return 'wh' + (getAssetName) } function Get-Provi...
0
sample_60_45.ps1
parameters: configuration: 'Debug' # Optional: condition for the job to run condition: '' # Optional: 'true' if future jobs should run even if this job fails continueOnError: false # Optional: dependencies of the job dependsOn: '' # Optional: Include PublishBuildArtifacts task enablePublishBuildAr...
0
720.ps1
function Get-RsItemDataSource { [cmdletbinding()] param ( [Alias('ItemPath', 'DataSourcePath', 'Path')] [Parameter(Mandatory = $True, ValueFromPipeline = $true)] [string] $RsItem, [string] $ReportServerUri, [Alias('ReportServ...
0
sample_13_24.ps1
# # Module manifest for module 'OCI.PSModules.Apmcontrolplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apmcontrolplane.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported P...
0
3444.ps1
[CmdletBinding()] Param( [Parameter()] [Switch]$ValidateMarkdownHelp, [Parameter()] [Switch]$GenerateMamlHelp, [Parameter()] [string]$BuildConfig, [Parameter()] [string]$FilteredModules ) $ResourceManagerFolders = Get-ChildItem -Directory -Path "$PSScriptRoot\..\src" | Where-Object { $...
0
4147.ps1
Function Set-ConsoleTitle { Param ([String]$Title) $host.ui.RawUI.WindowTitle = $Title } Function Get-Architecture { Set-Variable -Name Architecture -Scope Local -Force $Architecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture $Architecture = $Global:Architecture.OSArchitectu...
0
190.ps1
function Get-SCSMIncidentRequestComment { PARAM ( [Parameter(ParameterSetName = 'General', Mandatory = $true)] $DateTime = $((Get-Date).AddHours(-24)), [Parameter(ParameterSetName = 'GUID')] $GUID ) BEGIN { $AssignedUserClassRelation = Ge...
0
sample_24_94.ps1
# # Module manifest for module 'OCI.PSModules.Loadbalancer' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loadbalancer.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditi...
0
sample_49_16.ps1
<Configuration> <ViewDefinitions> <View> <Name>PSReadLine-KeyBindings</Name> <ViewSelectedBy> <TypeName>Microsoft.PowerShell.KeyHandler</TypeName> </ViewSelectedBy> <GroupBy> <PropertyName>Group</PropertyName> <CustomControl> <CustomEntries> ...
0
sample_40_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 = '82.0.0' # Supported PSEditions CompatiblePSEd...
0
sample_2_10.ps1
#************************************************ # utils_load20072010powershell.ps1 # Version 2.0.1 # Date: 04-12-2013 # Author: Brian Prince - brianpr@microsoft.com # Description: Utility functions specific to Exchange 2007 2010 #************************************************ # For backward compatability ...
0
708.ps1
function Remove-RsRestCatalogItem { [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High')] param( [Parameter(Mandatory = $True)] [string] $RsItem, [string] $ReportPortalUri, [Alias('ApiVersion')] [ValidateSet("v2.0")] [st...
0
sample_11_5.ps1
<# .SYNOPSIS NewSelfSignedCertificate.ps1 script file This is a place-holder file only for agent patch build purposes #> Write-Host "This file functionality is deprecated and is place-holder only" # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # ...
0
2666.ps1
Set-PSReadlineOption -Color @{ "Command" = [ConsoleColor]::Green "Parameter" = [ConsoleColor]::Gray "Operator" = [ConsoleColor]::Magenta "Variable" = [ConsoleColor]::White "String" = [ConsoleColor]::Yellow "Number" = [ConsoleColor]::Blue "Type" = [ConsoleColor]::Cyan "Comment" = [Consol...
0
Query-VeeamBackupDB.ps1
$dbServer = "servername\\instance" $db = "VeeamBackup" $veeamJob = "VeeamJobName" $Query = "SELECT [job_name],CONVERT(char(10),[creation_time], 101) AS start_date ` ,CONVERT(varchar, [creation_time], 108) AS job_start,CONVERT(char(10), [end_time], 101) AS end_date ` ,CONVERT(varchar, [end_time], 108) AS job_end, `...
0
Add new smtp_set prmary_1.ps1
#alias,addnewemailaddress import-csv .\\source.csv | foreach { $user = Get-Mailbox $_.alias $user.emailAddresses+= $_.addnewemailaddress $user.primarysmtpaddress = $_.addnewemailaddress Set-Mailbox $user -emailAddresses $user.emailAddresses set-Mailbox $user -PrimarySmtpAddress $user.primarysmtpaddress }
0
sample_0_18.ps1
#************************************************ # TS_2K3PoolUsageMaximum.ps1 # Version 1.0.1 # Date: 5/8/2012 # Author: v-kaw # Description: [Idea ID 2446] [Windows] Determining the trimming threshold set by the Memory Manager # Rule number: 2446 # Rule URL: //sharepoint/sites/rules/Rule%20Submissions/Forms...
0
1081.ps1
$connectionStringName = "TEST_CONNECTION_STRING_NAME" $connectionStringValue = "TEST_CONNECTION_STRING_VALUE" $connectionStringNewValue = "TEST_CONNECTION_STRING_NEW_VALUE" $providerName = 'Carbon.Set-DotNetConnectionString' function Start-TestFixture { & (Join-Path -Path $PSScriptRoot '..\Initialize-Ca...
0
sample_41_9.ps1
# # Module manifest for module 'OCI.PSModules.Servicemesh' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicemesh.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEdition...
0
sample_30_60.ps1
# <copyright> # INTEL CONFIDENTIAL # # Copyright 2021 Intel Corporation # # This software and the related documents are Intel copyrighted materials, and your use of # them is governed by the express license under which they were provided to you ("License"). # Unless the License provides otherwise, you may not us...
0
sample_6_50.ps1
// =========================================================================================================================== // Class DCIM_AccountService // =========================================================================================================================== [ Description ("DCIM_rfsensor...
0
1855.ps1
Describe "Set-PSDebug" -Tags "CI" { Context "Tracing can be used" { AfterEach { Set-PSDebug -Off } It "Should be able to go through the tracing options" { { Set-PSDebug -Trace 0 } | Should -Not -Throw { Set-PSDebug -Trace 1 } | Should -Not -Throw ...
0
736.ps1
function New-RsScheduleXml { [cmdletbinding(SupportsShouldProcess=$true, ConfirmImpact='Low', DefaultParameterSetName='Once')] [OutputType(‘System.String’)] param ( [Parameter(ParameterSetName='Minute')] [Switch] $Minute, [Parameter(ParameterSetNam...
0
4098.ps1
Set-Variable -Name Command -Scope Global -Force Set-Variable -Name Computer -Scope Global -Force Set-Variable -Name Computers -Scope Global -Force Set-Variable -Name i -Scope Global -Value 1 -Force Set-Variable -Name Output -Scope Global -Force Set-Variable -Name RelativePath -Scope Global -Force Set-Variable ...
0
sample_31_4.ps1
# # Module manifest for module 'OCI.PSModules.Datascience' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datascience.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEdition...
0
4230.ps1
function Get-GPPPassword { [CmdletBinding()] Param ( [ValidateNotNullOrEmpty()] [String] $Server = $Env:USERDNSDOMAIN ) Set-StrictMode -Version 2 [System.Reflection.Assembly]::LoadWithPartialName("System.Core") |Out-Null function Get-Decry...
0
sample_52_77.ps1
# # Module manifest for module 'OCI.PSModules.Clusterplacementgroups' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Clusterplacementgroups.dll' # Version number of this module. ModuleVersion = '82.0.0' ...
0
sample_54_41.ps1
#requires -Version 5.0 enum BcArtifactSource { OnPrem Sandbox Insider } #Import-Module (Join-Path $PSScriptRoot ClientContext\ClientContext.psd1) #Import-Module (Join-Path $PSScriptRoot ClientContext\ClientContext.psm1) #. "$PSScriptRoot\ClientContext\ClientContextLibLoader.ps1" -BcLibVersion (G...
0
1857.ps1
Describe "Out-Default Tests" -tag CI { BeforeAll { $powershell = "$PSHOME/pwsh" } It "'Out-Default -Transcript' shows up in transcript, but not host" { $script = @" `$null = Start-Transcript -Path "$testdrive\transcript.txt"; 'hello' | Mi...
0
4075.ps1
Function Get-ComputerName { Set-Variable -Name ComputerName -Scope Local -Force $ComputerName = Read-Host "Enter the computer name" Return $ComputerName Remove-Variable -Name ComputerName -Scope Local -Force } Function Get-BitlockeredRecoveryKey { param ([String]$ComputerName) ...
0
16ca876b7bb7ac8c2f362b52.ps1
#.Synopsis # Test the HMAC hash(es) of a file #.Description # Takes the HMAC hash of a file using specified algorithm, and optionally, compare it to a baseline hash #.Example # Test-Hash npp.5.3.1.Installer.exe -HashFile npp.5.3.1.release.md5 # # Searches the provided hash file for a line matching the "...
0
3857.ps1
function NewExchangeConnectionV4V6($facilityId, $v4, $v6) { Write-Debug "Creating Connection at $facilityId" $md5 = getHash $md5 = $md5.ToString() Write-Debug "Created Hash $md5" $offset = Get-Random -Maximum 20 -Minimum 3 $sessionv4 = changeIp "$v4/32" $false $offset $false $sessionv6 = changeIp...
0
sample_40_74.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function ConvertFrom-ScriptExtent { <# .EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml #> [CmdletBinding()] [OutputType([Microsoft.PowerShell.EditorServices.Extensions.IFileRange, Microsoft.PowerShell.Edito...
0
sample_6_45.ps1
ConvertFrom-StringData @' id_classreg=Class Registration id_classdesc=Determining if critical Windows Update dll's are registered '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIB...
0
sample_54_57.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 = '83...
0
955.ps1
$uniqueId=$(-join ((97..122) + (48..57) | Get-Random -Count 15 | % {[char]$_})) $apiVersion = "2015-04-08" $location = "West US 2" $resourceGroupName = "myResourceGroup" $accountName = "mycosmosaccount-$uniqueId" $resourceType = "Microsoft.DocumentDb/databaseAccounts" $locations = @( @{ "locationName"="West U...
0
sample_40_24.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
4260.ps1
Function Test-ADCredential { Param($username, $password, $domain) Add-Type -AssemblyName System.DirectoryServices.AccountManagement $ct = [System.DirectoryServices.AccountManagement.ContextType]::Domain $pc = New-Object System.DirectoryServices.AccountManagement.PrincipalContext($ct, $domain) $object = New-...
0
cd command with history.ps1
######################################################## # Custom 'cd' command to maintain directory history # # Usage: # cd no args means cd $home # cd <name> changes to the directory specified by <name> # cd -l list your directory history # cd -# change to the history entry specified...
0
1651.ps1
c: cd\ Get-ChildItem -Path $PSScriptRoot\*.ps1 | ? name -NotMatch 'Microsoft.PowerShell_profile' | Foreach-Object { . $_.FullName } $env:path = @( $env:path 'C:\Program Files (x86)\Notepad++\' 'C:\Users\admin\AppData\Local\GitHub\PortableGit_c7e0cbde92ba565cb218a521411d0e854079a28c\cmd' 'C:\Users\...
0
sample_23_2.ps1
# # Module manifest for module 'OCI.PSModules.Datasafe' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datasafe.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions Comp...
0
sample_32_62.ps1
# # Module manifest for module 'OCI.PSModules.Onesubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported P...
0
sample_34_14.ps1
function Get-Project-Definition { try { $projectRoot = Get-Project-Root $projectJsonFile = Join-Path -Path $projectRoot -ChildPath "Custom/devops/project.json" return Get-Content $projectJsonFile -ErrorAction Stop | Out-String | ConvertFrom-Json } catch { return @{} } } func...
0