filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
3465.ps1 |
function Get-ResourceGroupName
{
return getAssetName
}
function Get-DataBoxJobName
{
return getAssetName
}
function Get-StorageAccountName
{
return getAssetName
}
function Get-ProviderLocation($provider)
{
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.A... | 0 |
sample_45_89.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_55_68.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al... | 0 |
Hack ESXi_2.ps1 | $screen = " You see here a virtual switch. ------------ ------
#...........| |....|
--------------- ###------------ |...(|
|..%...........|########## ###-@...|
... | 0 |
473.ps1 |
function Start-PPScript{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[String]
$Name,
[Parameter(Mandatory=$false)]
[String]
$Arguments
)
$ScriptShortcut = Get-PPScript -Name $Name -Shortcut
$(if( -not $ScriptShortcut){
Get-PP... | 0 |
Set-Computername_8.ps1 | function Set-ComputerName {
param( [switch]$help,
[string]$computerName=$(read-host "Please specify the new name of the computer"))
$usage = "set-ComputerName -computername AnewName"
if ($help) {Write-Host $usage;break}
$computer = Get-WmiObject Win32_ComputerSystem
$computer.Rename($computerName)
... | 0 |
4351.ps1 | function Publish-PSArtifactUtility {
[CmdletBinding(PositionalBinding = $false)]
Param
(
[Parameter(Mandatory = $true, ParameterSetName = 'PublishModule')]
[ValidateNotNullOrEmpty()]
[PSModuleInfo]
$PSModuleInfo,
[Parameter(Mandatory = $true, ParameterSetName = 'Publ... | 0 |
sample_28_47.ps1 | #
# Module manifest for module 'OCI.PSModules.Visualbuilder'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Visualbuilder.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEdi... | 0 |
Ping-Host.ps1 | function Ping-Host {param( [string]$HostName,
[int32]$Requests = 3)
for ($i = 1; $i -le $Requests; $i++) {
$Result = Get-WmiObject -Class Win32_PingStatus -ComputerName . -Filter "Address='$HostName'"
Start-Sleep -Seconds 1
if ($Result.StatusCode -ne 0) {return $FALSE}
}
return $TRUE
}
| 0 |
1397.ps1 |
function Grant-CComPermission
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$Identity,
[Parameter(Mandatory=$true,ParameterSetName='DefaultAccessPermissionAllow')]
[Parameter(Mandatory=$true,ParameterSetName='MachineAccessRestrict... | 0 |
sample_36_20.ps1 | #
# Module manifest for module 'OCI.PSModules.Ocvp'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ocvp.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
CompatiblePS... | 0 |
Deploy VM with Static IP.ps1 | # 1. Create a simple customizations spec:
$custSpec = New-OSCustomizationSpec -Type NonPersistent -OSType Windows -OrgName “My Organization” -FullName “MyVM” -Domain “MyDomain” –DomainAdminUsername “user” –DomainAdminPassword “password”
# 2. Modify the default network customization settings:
$custSpec | Get-OSCustom... | 0 |
sample_42_6.ps1 | #
# This private script adds $InterfaceType members to $psObject which invokes on $wrappedObject
#
Param(
$psObject,
$wrappedObject,
[Type]$InterfaceType
)
function GetInvoker
{
Param(
$Target,
$Method
)
if ($Method.IsGenericMethodDefinition) {
return {... | 0 |
SharePoint build script.ps1 | #BASEPATH variable should be explicitly set in every
#build script. It represents the "root"
#of the project folder, underneath which all tools, source, config settings,
#and deployment folder lie.
$global:basepath = (resolve-path ..).path
function Set-BasePath([string]$path)
{
$global:basepath = $path
}
... | 0 |
sample_61_88.ps1 | #
# Module manifest for module 'OCI.PSModules.Jmsjavadownloads'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jmsjavadownloads.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
# Supported... | 0 |
sample_2_36.ps1 | #************************************************
# TS_BackupSystemStateKB2182466.ps1
# Version 1.0.1
# Date: 5/30/2012
# Author: v-kaw
# Description: [Idea ID 1922] [Windows] On Windows 2008 R2 and Windows 7 System state backup fails with event id 5 and error 2155347997
# Rule number: 1922
# Rule URL: //shar... | 0 |
sample_22_54.ps1 | 15KnownLimitations15.1ExperimentalFeaturesSomeOracleVMVirtualBoxfeaturesarelabeledasexperimental.Suchfeaturesareprovidedonan“as-is”basisandarenotformallysupported.However,feedbackandsuggestionsaboutsuchfeaturesarewelcome.Acomprehensivelistofexperimentalfeaturesisasfollows:Hardware3DaccelerationsupportforWindows,Linux,... | 0 |
1678.ps1 |
return
$srcRoot = "C:\temp\news"
$dstRoot = "C:\temp\new"
$logDir = "C:\temp\log"
if (!(Test-Path $srcRoot)) {
throw "Source path '$srcRoot' does not exist!"
}
if (!(Test-Path $logDir)) {
Write-Warning "Path '$logDir' does not exist! Creating..."
try {
md $logDir | Out-Null
} catch {... | 0 |
Email-ExpiringADAccounts.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_36_24.ps1 | #
# Module manifest for module 'Az.DevCenter'
#
# Generated by: Microsoft Corporation
#
# Generated on: 23/04/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.DevCenter.psm1'
# Version number of this module.
ModuleVersion = '1.1.1'
# Supported PSEdition... | 0 |
sample_29_3.ps1 | description = 'reactive-streams-tck'
dependencies {
api group: 'org.testng', name: 'testng', version:'7.3.0'
api project(':reactive-streams')
implementation project(':reactive-streams-examples')
}
jar {
bnd ('Bundle-Name': 'reactive-streams-jvm',
'Bundle-Vendor': 'Reactive Streams SIG',
... | 0 |
sample_52_95.ps1 | function Disable-WACAFFeatures {
<#
.SYNOPSIS
Disables all features that are not already disabled in the selected list.
.DESCRIPTION
Disables all features that are not already disabled in the selected list.
.ROLE
Administrators
#>
Param([object[]] $Features)
Set-StrictMode -Version 5.0;
$Succes... | 0 |
Simplest animation.ps1 | [int]$x = 0
[int]$y = 0
[int]$cX = 200
[int]$cY = 200
[int]$rad = 100
[int]$grad = 0
[float]$kfc = 0.5
$tabPag1_OnPaint= {
$tmrTim2.Enabled = $false
$g = $tabPag1.CreateGraphics()
$pen = New-Object Drawing.Pen([Drawing.Brushes]::Red)
$g.DrawRectangle($pen, [Convert]::ToInt32($cX - 100), [Convert]... | 0 |
sample_64_85.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
#
# ModifyProxySettings.ps1 - To be used by the installer - Mo... | 0 |
18.ps1 | . $PSScriptRoot\Shared.ps1
Describe 'TabExpansion function test' {
BeforeAll {
if ($PSVersionTable.PSVersion.Major -gt 5) {
$PSDefaultParameterValues["it:skip"] = $true
}
}
It 'Windows PowerShell v5 exports a TabExpansion function' {
$module.ExportedFunctions.Keys -conta... | 0 |
sample_15_46.ps1 | # Copyright ?2008, Microsoft Corporation. All rights reserved.
# You may use this code and information and create derivative works of it,
# provided that the following conditions are met:
# 1. This code and information and any derivative works may only be used for
# troubleshooting a) Windows and b) products for ... | 0 |
sample_8_71.ps1 | #************************************************
# DC_ChkSym_DPM.ps1
# Version 1.0.0
# Date: 12-07-2010
# Author: Patrick Lewis - patlewis@microsoft.com
# Description: This script calls chksym to get file version information from DPM files and other files
#************************************************
PARAM(... | 0 |
SVMotion-VM_2.ps1 | # author: Hal Rottenberg
# Website/OpenID: http://halr9000.com
# purpose: does "real" SVMotion of a VM
# usage: get-vm | SVMotion-VM -destination (get-datastore foo)
function SVMotion-VM {
param(
[VMware.VimAutomation.Client20.DatastoreImpl]$destination
)
Begin {
$datastoreView = Get-View -VIObject $d... | 0 |
New-NamedPipe.ps1 | # .NET 3.5 is required to use the System.IO.Pipes namespace
[reflection.Assembly]::LoadWithPartialName("system.core") | Out-Null
$pipeName = "pipename"
$pipeDir = [System.IO.Pipes.PipeDirection]::InOut
$pipe = New-Object system.IO.Pipes.NamedPipeServerStream( $pipeName, $pipeDir )
| 0 |
Read Gmail POP .ps1 | <#
.AUTHOR
Will Steele (wlsteele@gmail.com)
.DEPENDENCIES
Powershell v2 (for Out-Gridview cmdlet)
.DESCRIPTION
This script is a proof of concept. Further work needs to be done. It
requires the user to enter a valid username and password for a gmail.com
account. It then attempts to form an S... | 0 |
1767.ps1 |
try
{
$defaultParamValues = $PSDefaultParameterValues.Clone()
$PSDefaultParameterValues["it:Skip"] = !$IsWindows
Describe "AMSI scan should detect suspicious content" -Tags 'Feature','RequireAdminOnWindows' {
BeforeAll {
[System.Management.Automation.Internal.InternalTestHooks]::Set... | 0 |
9db524e2-1659-493b-ad36-3624e7796a76.ps1 | ## Simplest RSS Reader\n####################################################################################################\n## Save this file as Start-RssReader.ps1\n## Run it like:\n## .\\Start-RssReader "http://feeds.feedburner.com/powerscripting", "http://HuddledMasses.org/feed"\n## And then:\n## Get-RSS ... | 0 |
Get-DellWarranty_3.ps1 | function Get-DellWarranty {
<#
.Synopsis
Provides warranty information for one or more Dell service tags.
.Description
Queries the Dell Website for a list of service tags and returns the warranty information as a custom object.
If a service tag has multiple warranties, they are... | 0 |
2278.ps1 | [CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Specify the Primary Site server")]
[ValidateNotNullOrEmpty()]
[string]$SiteServer
)
Begin {
try {
$SiteCodeObjects = Get-WmiObject -Namespace "root\SMS" -Class SMS_ProviderLocation -ComputerName $Si... | 0 |
sample_9_97.ps1 | ConvertFrom-StringData @'
id_rsop=Resultant Set of Policy (RSoP)
id_rsopobtaining=Obtaining Resultant Set of Policy (RSoP) via gpresult.exe utility
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JN... | 0 |
Add-Identity.ps1 | param(
[Parameter(Position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$true)]
[alias("Name","ComputerName")] $Computer = @($env:computername),
[string] $NTDomain = ($env:UserDomain),
[string[]] $LocalGroups = @("Administrators"),
[string[]] $Identities, # can be domain user or group
[switch] $Outpu... | 0 |
82.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aad... | 0 |
3728.ps1 |
function Test-AlertChangeState
{
$alerts = Get-AzAlert -State "New" -TimeRange 1h
$alert = $alerts[0]
$oldState = $alert.State
$newState = "Closed"
$updatedAlert = Update-AzAlertState -AlertId $alert.Id -State $newState
Assert-AreEqual $newState $updatedAlert.State
$alert = Update-AzAlertSta... | 0 |
2119.ps1 |
Describe 'Basic debugger tests' -tag 'CI' {
BeforeAll {
Register-DebuggerHandler
}
AfterAll {
Unregister-DebuggerHandler
}
Context 'The value of $? should be preserved when exiting the debugger' {
BeforeAll {
$testScript = {
function Test-Dol... | 0 |
635.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://cdn02.foxitsoftware.com/pub/foxit/reader/desktop/win/7.x/7.0/en_us/FoxitReader703.0916_prom_enu_Setup.exe"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs... | 0 |
1765.ps1 |
Import-Module HelpersSecurity
$defaultParamValues = $PSDefaultParameterValues.Clone()
$PSDefaultParameterValues["it:Skip"] = !$IsWindows
try
{
Describe "Export-ModuleMember should not work across language boundaries" -Tags 'Feature','RequireAdminOnWindows' {
BeforeAll {
$script ... | 0 |
61.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 |
394.ps1 | param (
$TestGeneral = $true,
$TestFunctions = $true,
[ValidateSet('None', 'Default', 'Passed', 'Failed', 'Pending', 'Skipped', 'Inconclusive', 'Describe', 'Context', 'Summary', 'Header', 'Fails', 'All')]
$Show = "None",
$Include = "*",
$Exclude = ""
)
Write-Host "Starting Tests"
Write-Host "Importing M... | 0 |
sample_42_10.ps1 | #
# Module manifest for module 'OCI.PSModules.Artifacts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Artifacts.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
Co... | 0 |
1457.ps1 |
function Test-CDotNet
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,ParameterSetName='v2')]
[Switch]
$V2,
[Parameter(Mandatory=$true,ParameterSetName='v4Client')]
[Parameter(Mandatory=$true,ParameterSetName='v4Full')]
[Switch]
... | 0 |
sample_63_54.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplacepublisher'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplacepublisher.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# S... | 0 |
784.ps1 |
function Test-ScriptExtent {
[OutputType([bool], ParameterSetName='__AllParameterSets')]
[OutputType([System.Management.Automation.Language.IScriptExtent], ParameterSetName='PassThru')]
[CmdletBinding()]
param(
[Parameter(Position=0, ValueFromPipeline, ValueFromPipelineByPropertyName)]... | 0 |
3918.ps1 |
function Test-ListReservationSummariesMonthlyWithOrderId
{
$reservationSummaries = Get-AzConsumptionReservationSummary -Grain monthly -ReservationOrderId ca69259e-bd4f-45c3-bf28-3f353f9cce9b
Assert-NotNull $reservationSummaries
Foreach($reservationSummary in $reservationSummaries)
{
Asser... | 0 |
sample_29_5.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_67_91.ps1 | ConvertFrom-StringData @'
###PSLOC
NoADModule = ActiveDirectory module is not installed. Please install the module and try again.
ComputerAccountMissing = No computer account for {0} found in OU {1}. Recovery keys are not avialable in Active Directory
ComputerAccountExists = Computer account(s) {0} look up OU {1} w... | 0 |
ActiveDirectoryFunctions.ps1 | #.SYNOPSIS
# Gets a directory entry from ActiveDirectory based on the login user name
function Get-ADUser {
[CmdletBinding()]
param([string]$UserName=${Env:userName})
$ads = New-Object System.DirectoryServices.DirectorySearcher([ADSI]'')
$ads.filter = "(&(objectClass=Person)(samAccountName=$UserName))"
... | 0 |
Download DefragTools _1.ps1 | #requires -version 2.0
<#
.Synopsis
Downloads Channel 9 Defrag Tool Episode Video
.DESCRIPTION
Downloads Channel 9 Defrag Tool Episode Video in the format selected and to a given path.
.EXAMPLE
Downloads all shows in WMV format to the default Downloads Folder for the user.
Get-DefragToolsShow -All... | 0 |
sample_21_72.ps1 | # Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2
<#
.SYNOPSIS
VMware Tools script for managing the Salt minion on a Windows guest
.DESCRIPTION
This script manages the Salt minion on a Windows guest. The minion is a OneDir
build hosted on https://repo.saltproject.io/salt/py3/onedir/. You... | 0 |
sample_37_95.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerinstances'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerinstances.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Suppo... | 0 |
587.ps1 |
function Connect-FTP{
param (
[parameter(Mandatory=$true)]
[string[]]$Name,
[parameter(Mandatory=$false)]
[string]$User,
[parameter(Mandatory=$false)]
[int]$Port,
[switch]$Secure,
[parameter(Mandatory=$false)]
[string]$PrivatKey... | 0 |
2807.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(Value) as ct,
Value
FROM
*LogUserAssist.tsv
GROUP BY
Value
ORDER BY
ct ASC
"@
& logparser -stats:off -i:csv -dtlines:0 -fixedsep:on -rtp:-1 "$lpquery"
} else {
$ScriptName = [System.IO.Pa... | 0 |
Compare-Drive.ps1 | param($ComputerName1,$ComputerName2)
$a = gwmi win32_volume -filter "DriveType=3" -computername $ComputerName1 | where {@('Y:','Z:') -notcontains $_.DriveLetter} | select name, @{n='capacity'; e={[math]::truncate($_.Capacity/1GB)}}
$b = gwmi win32_volume -filter "DriveType=3" -computername $ComputerName2 | where ... | 0 |
d599ff7e-17c4-40a4-b3fc-8666dd953df5.ps1 | function Get-VCTime() {
return (Get-View "ServiceInstance-ServiceInstance").CurrentTime()
}
$lastCheckTime = Get-VCTime
while ($true)
{
$modifiedVMs = @()
$freshEventsStartTime = $lastCheckTime
$lastCheckTime = Get-VCTime
# Get all the VM network edit events
foreach ($event in Get... | 0 |
sample_1_59.ps1 | ConvertFrom-StringData @'
id_dpm_getsysinfo_activity=Gathering system information
id_dpm_status_getsysinfo=Running DC_GetSystemInfo.ps1
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQ... | 0 |
3251.ps1 |
class ParsedCommand {
[string]$CommandString
[string]$Plugin = $null
[string]$Command = $null
[string]$Version = $null
[hashtable]$NamedParameters = @{}
[System.Collections.ArrayList]$PositionalParameters = (New-Object System.Collections.ArrayList)
[datetime]$Time = (Get-Date).ToUniversalTi... | 0 |
sample_46_12.ps1 | $if$($operatingSystem$ == Linux)FROM mcr.microsoft.com/$dockerBaseImage$
COPY ./bin/release/linux-x64/publish /app
COPY ./bin/release/linux-x64/publish/Linux/CosmicCertificateInstaller .
COPY ./bin/release/linux-x64/publish/config/config.test.json .
ENTRYPOINT ["/app/$projectname$"]$endif$$if$ ($operatingSystem$|$t... | 0 |
4426.ps1 | function Find-Script {
[CmdletBinding(HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=619785')]
[outputtype("PSCustomObject[]")]
Param
(
[Parameter(ValueFromPipelineByPropertyName = $true,
Position = 0)]
[ValidateNotNullOrEmpty()]
[string[]]
$Name,
... | 0 |
2069.ps1 |
Import-Module HelpersCommon
$powershellCoreModules = @(
"CimCmdlets"
"Microsoft.PowerShell.Host"
"Microsoft.PowerShell.Core"
"Microsoft.PowerShell.Diagnostics"
"Microsoft.PowerShell.Management"
"Microsoft.PowerShell.Security"
"Microsoft.PowerShell.Utility"
"Microsoft.WsMa... | 0 |
1439.ps1 |
function Get-CCertificate
{
[CmdletBinding(DefaultParameterSetName='ByFriendlyName')]
[OutputType([Security.Cryptography.X509Certificates.X509Certificate2])]
param(
[Parameter(Mandatory=$true,ParameterSetName='ByPath')]
[string]
$Path,
[Parameter(Param... | 0 |
2509.ps1 | $computer = "localhost"
$chart = New-Object -ComObject msgraph.application
$chart.visible = $true
$chart.datasheet.cells.item(1,1) = "Time"
$chart.datasheet.cells.item(1,2) = "ReliabilityMetric"
$r = 2
Get-WmiObject -Class win32_reliabilityStabilityMetrics -computername $computer|
Select-Object -First 254 |
Fo... | 0 |
sample_1_7.ps1 | #************************************************
# DC_TaskListSvc.ps1
# Version 1.1
# Date: 2014,2019
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about running services
# Called from: Networking Diagnostics
#*******************************************************
Trap [E... | 0 |
4220.ps1 |
function Invoke-SqlQuery {
param (
[String]$ConnectionString,
[String]$Sqlserver,
[String]$Username,
[String]$Password,
[String]$Catalog,
[String]$Database,
[String]$Query
)
if (!$Database){
$Database = ";"
} else {
$Database = "$Database;"
}
if (!$Catalog){
$Catal... | 0 |
Get-MailboxesOverSizeLim.ps1 | # -------------------------------------------------------------------------------
# Script: Get-MailboxesOverSizeLimit.ps1
# Author: Chris Brown
# Date: 04/04/2011 10:41:00
# Keywords:
# comments:
#
# Versioning
# 04/04/2011 CJB Initial Script
#
# ------------------------------------------------------------... | 0 |
sample_7_81.ps1 | [dynamic, provider("dcismprovider")]
class DCIM_LocalRoleBasedAuthorizationService : CIM_RoleBasedAuthorizationService
{
[
Description ("CreationClassName indicates the name of the class or the subclass that is used in the creation of an instance. When used with the other key properties of this clas... | 0 |
sample_41_4.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 |
sample_13_76.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_4_18.ps1 | #************************************************
# TS_ServicingPendingXml.ps1
# Version 1.0.1
# Date: 6/6/2012
# Author: v-alyao
# Description: [Idea ID 3472] [Windows] Pending Transactions Rule Idea - Pending.xml
# Rule number: 3472
# Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.a... | 0 |
PowerSmug - Sync Smugmug.ps1 | # PowerSmug photo sync script v1.0
# This PowerShell script will syncronize a folder of images with a users SmugMug account
# Please set the appropriate variables in the User Defined Variables region
# For more information visit
#
# Images are uploaded to a gallery with the same name as the folder they are contai... | 0 |
sample_14_12.ps1 | # Copyright (C) 2020,2023 VMware, Inc. All rights reserved.
. ".\utils.ps1"
try {
# IIS 7 and above
$applicationHostConfigPath = Join-Path $env:windir "system32\inetsrv\config\applicationHost.config"
if (Test-Path $applicationHostConfigPath) {
$result = ((Get-Content $applicationHostCon... | 0 |
TabExpansion_10.ps1 | ## Tab-Completion
#################
## Please dot souce this script file.
## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list.
##
## What this can do is:
##
## [datetime]::n<tab>
## [datetime]::now.d<tab>
## $a = New-Object "Int32[,]" 2,3; $b = "PowerShell","Pow... | 0 |
Get-GroupMembership_1.ps1 | ## Get-DistinguishedName -- look up a DN from a user's (login) name
function Get-DistinguishedName {
Param($UserName)
$ads = New-Object System.DirectoryServices.DirectorySearcher([ADSI]'')
$ads.filter = "(&(objectClass=Person)(samAccountName=$UserName))"
$s = $ads.FindOne()
return $s.GetDirectoryEnt... | 0 |
sample_33_58.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicecatalog'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicecatalog.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSE... | 0 |
New-ElevatedTask.ps1 | #requires -version 2.0
####################################################################################################
## Version History
## 2.0 - First version with shortcut support
## - Still weak on documentation of the arguments, sorry ...
## 2.5 - Improved defaults and documentation (run with -?)
##... | 0 |
sample_45_2.ps1 | parameters:
# Which publishing infra should be used. THIS SHOULD MATCH THE VERSION ON THE BUILD MANIFEST.
# Publishing V1 is no longer supported
# Publishing V2 is no longer supported
# Publishing V3 is the default
- name: publishingInfraVersion
displayName: Which version of publishing should be used to p... | 0 |
2352.ps1 | Import-Module ActiveDirectory
try {
$uap_docs = Import-Csv C:\scripts\All-Doc-2013-Password-Policy\all-docs-2013-password-policy.csv
$ad_pw_ages = @();
foreach ($user in $uap_docs) {
$ad_pw_ages += Get-AdUser $user.Username -Properties passwordlastset | % {"$($_.Givenname) $($_.Surname), $($_.Passwo... | 0 |
sample_58_70.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 |
3036.ps1 | function Should-Exist($ActualValue, [switch] $Negate, [string] $Because) {
[bool] $succeeded = & $SafeCommands['Test-Path'] $ActualValue
if ($Negate) {
$succeeded = -not $succeeded
}
$failureMessage = ''
if (-not $succeeded) {
if ($Negate) {
$failureMessage = "Exp... | 0 |
sample_57_69.ps1 | #
# Module manifest for module 'OCI.PSModules.Dts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dts.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
My Profile.ps1 | ## If your PC doesn't have this set already, someone could tamper with this script...
## but at least now, they can't tamper with any of the scripts that I auto-load!
Set-ExecutionPolicy AllSigned Process
## Set the profile directory first, so we can refer to it from now on.
Set-Variable ProfileDir (Split-Path $MyI... | 0 |
sample_18_48.ps1 | # Localized 06/28/2023 07:58 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Диагностика
Troubleshoot_DetectDVDDevice=Проверка устройства чтения и/или записи DVD-дисков...
Troubleshoot_DetectDVDvideoDecoder=Проверка видеодекодера для воспроизведения DVD-диска.... | 0 |
sample_48_32.ps1 | #
# Module manifest for module 'Az.DataBoxEdge'
#
# Generated by: Microsoft Corporation
#
# Generated on: 5/16/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.DataBoxEdge.psm1'
# Version number of this module.
ModuleVersion = '1.1.1'
# Supported PSEdit... | 0 |
sample_56_93.ps1 | param([int]$Count=50, [int]$DelayMilliseconds=200)
function Write-Item($itemCount) {
$i = 1
while ($i -le $itemCount) {
$str = "Output $i"
Write-Output $str
# In the gutter on the left, right click and select "Add Conditional Breakpoint"
# on the next line. Use the c... | 0 |
sample_40_51.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 |
Magister SOAP Webrequest.ps1 |
# Execute-MagisterSOAP.ps1
# We are reading a list of students from a Magister SOAP webrequest.
# 20120330
# Paul Wiegmans
Clear
Set-StrictMode -Version 2
$mijnpad = Split-Path -parent $MyInvocation.MyCommand.Definition
Echo "Mijn pad is: $mijnpad "
# This is the Magister webquery URL
$layout = "Basis"
$u... | 0 |
2153.ps1 |
$imageName = "remotetestimage"
Describe "Basic remoting test with docker" -tags @("Scenario","Slow"){
BeforeAll {
$Timeout = 600
$dockerimage = docker images --format "{{ .Repository }}" $imageName
if ( $dockerimage -ne $imageName ) {
$pending = $true
write-warning... | 0 |
100.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"... | 0 |
sample_45_16.ps1 | #
# Module manifest for module 'OCI.PSModules.Computeinstanceagent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Computeinstanceagent.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# S... | 0 |
sample_12_34.ps1 | #************************************************
# DC_WebClient-Component.ps1
# Version 1.0
# Date: 2009-2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about WebClient/WebDAV.
# Called from: Networking Diagnostics
#*******************************************************
... | 0 |
sample_59_45.ps1 | #
# Module manifest for module 'OCI.PSModules.Certificates'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Certificates.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
# Supported PSEditi... | 0 |
15.ps1 | try {
$poshgitPath = join-path (Get-ToolsLocation) 'poshgit'
$currentVersionPath = Get-ChildItem "$poshgitPath\*posh-git*\" | Sort-Object -Property LastWriteTime | Select-Object -Last 1
if(Test-Path $PROFILE) {
$oldProfile = @(Get-Content $PROFILE)
. $currentVersionPath\src\Utils.ps1
... | 0 |
sample_65_45.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_20_50.ps1 | # diag_uex.psm1
# Created by tdimli
# March 2020
#
# Diagnostic functions for UEX area
# version
$UEX_version = "1.0.240717.0"
# Area and Area/Component arrays
$UEX = @("xray_uex_wmi", "xray_uex_eventlog")
#Component/Diagnostic Function arrays
$xray_uex_wmi = @("uex_wmi_KB2020286")
$xray_uex_eventlog =... | 0 |
sample_53_92.ps1 | <# File tss_Perf-Collect.ps1 [Folderpath]
#>
param(
[string]$Folderpath = (Split-Path $MyInvocation.MyCommand.Path -Parent)
)
#region ::::: Configruation parameters ----------------------------------------------#
$VerDate = "2021.04.30.0"
#endregion ::::: Configruation parameters --------------------------... | 0 |
Set-FSMORoleOwner.ps1 | Function Set-FSMORoleOwner {
<#
.SYNOPSIS
Performs a transfer of a FSMO role to a specified Domain Controller.
.DESCRIPTION
Performs a transfer of a FSMO role to a specified Domain Controller.
.PARAMETER DomainController
Fully Qualified Domain Name of the Domain Controller to take a tr... | 0 |
sample_15_91.ps1 | # ---------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------------------------... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.