filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
sample_8_70.ps1 | ###########################################################################
# DC_Get-Network
# Version 1.0
# Date: 09-26-2012
# Author: mifannin
# Description: Creates Autotuning.txt, Firewall.txt, Netsh.txt, Winsock.txt,
# Bitsadmin.txt, WPAD & PAC File Collection
##############################################... | 0 |
sample_30_69.ps1 | #
# Module manifest for module 'OCI.PSModules.Aispeech'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aispeech.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
Comp... | 0 |
sample_65_34.ps1 | #
# Module manifest for module 'OCI.PSModules.Vnmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vnmonitoring.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEditi... | 0 |
4200.ps1 |
Set-Variable -Name Errors -Value $null -Scope Global -Force
Set-Variable -Name LogFile -Value "c:\windows\waller\Logs\BuildLogs\AdobeFlashPlayer.log" -Scope Global -Force
Set-Variable -Name RelativePath -Scope Global -Force
Function ConsoleTitle ($Title){
$host.ui.RawUI.WindowTitle = $Title
}
Function GetRelative... | 0 |
296.ps1 | function Get-PSFUserChoice
{
[OutputType([System.Int32])]
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[object[]]
$Options,
[string]
$Caption,
[string]
$Message,
[int]
$DefaultChoice = 0
)
begin
{
Write-PSFMessage -Level InternalComment -Message "Bound parameters: $($PS... | 0 |
sample_53_69.ps1 | #
# Module manifest for module 'OCI.PSModules.Licensemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSE... | 0 |
sample_39_68.ps1 | #
# Module manifest for module 'OCI.PSModules.Desktops'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Desktops.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Comp... | 0 |
1962.ps1 |
using namespace System.Diagnostics
function Invoke-AppleScript
{
param(
[string]$Script,
[switch]$PassThru
)
Write-Verbose "running applescript: $Script"
$result = $Script | osascript
if($PassThru.IsPresent)
{
return $result
}
}
function Get-WindowCountMacOS {
... | 0 |
sample_3_95.ps1 | # Name: tss_update-script.ps1 for TSS (former TSSv2)
<#
.SYNOPSIS
Script to [auto-]update TSS to latest version or download latest zip from CesdiagTools/GitHub.
.DESCRIPTION
Script will search on "https://microsoft.githubenterprise.com/css-windows/WindowsCSSToolsDevRep/releases/tag" for latest TSS version
... | 0 |
sample_49_40.ps1 | #
# Module manifest for module 'OCI.PSModules.Osmanagementhub'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osmanagementhub.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported P... | 0 |
sample_37_59.ps1 | #
# Module manifest for module 'OCI.PSModules.Optimizer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Optimizer.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Co... | 0 |
sample_30_8.ps1 | #
# Module manifest for module 'OCI.PSModules.Keymanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Keymanagement.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEdi... | 0 |
2683.ps1 |
$cred = Get-Credential -UserName '<User>@<Tenant>.onmicrosoft.com' -Message "Enter SPO credentials"
Connect-SPOService -Url 'https://<Tenant>-admin.sharepoint.com' -Credential $cred
New-SPOSite -Url 'https://<Tenant>.sharepoint.com/sites/demo' -Title 'Tech Talk Demo' -Template 'STS
Connect-SPOnline -Url 'https... | 0 |
sample_22_82.ps1 | @{
GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Start-Transcript", "Stop-Transcript"
AliasesTo... | 0 |
sample_29_44.ps1 | ConvertFrom-StringData @'
IPAddressDisplayNameFormat=IP 주소: {0}
NetworkNameDisplayNameFormat=이름: {0}
NetworkNameOfflineDisplayNameFormat=IP 주소: "{0}"의 주소
CreateClusterProgressValidationStart=장애 조치(failover) 클러스터에 대한 서버 적합성을 확인하는 중입니다.
CreateClusterProgressValidationEnd=장애 조치(failover) 클러스터에 대한 서버 적합성을 확인했습니다.
Cre... | 0 |
41.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 |
Security group monitor.ps1 | #Get group membership for a list of security
#groups and export to an XML for comparison
#against baseline.
#
$script:WorkingDirectory = split-path $myinvocation.Mycommand.Definition -parent
Function Re-Baseline
{
#First, declare array and hashtable.
$securitygroups = @()
$table = @{}
#Import Security... | 0 |
sample_3_86.ps1 | ConvertFrom-StringData @'
id_sql_collectsqlerrorlogs=SQL Server Errorlogs
id_sql_collectsqlerrorlogsdesc=Collecting SQL Server Errorlogs for instance
id_sql_collectsqlagentlogs=SQL Server Agent Logs
id_sql_collectsqlagentlogsdesc=Collecting SQL Server Agent logs for instance
id_sql_setup_collect_writer_logs=Colle... | 0 |
sample_20_6.ps1 | # VK_ICD_FILENAMES environment variable is not used when running with
# elevated privileges. Add a key to the registry instead.
$hkey_path = "HKLM:\SOFTWARE\Khronos\Vulkan\Drivers\"
$hkey_name = Join-Path -Path $pwd -ChildPath "_install\share\vulkan\icd.d\dzn_icd.x86_64.json"
New-Item -Path $hkey_path -force
New-ItemPr... | 0 |
sample_43_36.ps1 | <#
.SYNOPSIS
Flips the flow of a preview/rc between public flow and internal flow. Internal subscriptions and default channel must exist (see create-preview-flow.ps1)
.PARAMETER RuntimeChannel
Public runtime channel
.PARAMETER SdkChannel
Public sdk channel
.PARAMETER InternalRuntimeChannel
Internal runtime channel
... | 0 |
sample_10_77.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_40_47.ps1 | param (
[switch] $Full = $false,
[string] $Output = "$($env:TEMP)\telemetry",
[string] $XLabel = "0"
)
# mappings of WMI class
$topic_class = @{
system = 'win32_computersystem'
cpu = 'win32_processor'
os = 'win32_operatingsystem'
disk = 'win32_logical... | 0 |
3164.ps1 |
if (-not (Get-Module -Name Microsoft.Lync.Model))
{
try
{
Import-Module -Name (Join-Path -Path ${env:ProgramFiles(x86)} -ChildPath "Microsoft Office 2013\LyncSDK\Assemblies\Desktop\Microsoft.Lync.Model.dll") -ErrorAction Stop
}
catch
{
Write-Warning "Mi... | 0 |
sample_58_45.ps1 | #########################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Localized PackageManagement.Resources.psd1
#
#########################################################################################
ConvertFrom-StringDa... | 0 |
sample_2_81.ps1 | #
# Module manifest for module 'OCI.PSModules.Networkfirewall'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Networkfirewall.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported P... | 0 |
2331.ps1 | describe 'Get-DhcpLease' {
mock 'Get-DhcpServerv4Scope' {
[pscustomobject]@{ 'ScopeId' = '10.10.10.0' }
}
mock 'Get-DhcpServerv4Lease' {
return $null
}
mock 'Get-DhcpServerInDc' {
@(
[pscustomobject]@{ 'DNSName' = 'SRV1' }
[pscustomobject]@{ 'DNSName' = 'SRV2' }
)
}
it 'queries all DHCP ser... | 0 |
sample_9_13.ps1 | ##########################################
# Set Variables
##########################################
$ComputerName = $ENV:COMPUTERNAME
$windir = $Env:windir
$ProgFiles64 = $ENV:ProgramFiles
$ProgFiles86 = ${Env:ProgramFiles(x86)}
$system32 = $windir + "\system32"
$SystemRoot = $Env:SystemRoot
$OS = Get... | 0 |
1420.ps1 |
function Expand-CItem
{
[OutputType([IO.DirectoryInfo])]
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]
$Path,
[string]
$OutDirectory,
[Switch]
$Force
)
Set-StrictMo... | 0 |
Get-ExchangeDBSizes_2.ps1 | <#
.SYNOPSIS
Get-ExchangeDBSizes - Gather data on Exchange 2007 / 2010 Mailbox Databases.
.DESCRIPTION
Gathers data from Exchange mailbox servers.
These data include:
Server\\StorageGroup\\Database (2007) or Database (2010),
Total Size (in GB) of the disk,
Size of the .edb file (in GB),
... | 0 |
sample_66_81.ps1 | #
# Module manifest for module 'OCI.PSModules.Vnmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vnmonitoring.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditi... | 0 |
Get-PasswordExpiredUser_1.ps1 | Param($ou)
if($ou){$root = [ADSI]"LDAP://$ou"}else{$root=[adsi]""}
$filter = "(&(objectCategory=user)(userAccountControl:1.2.840.113556.1.4.803:=65536))"
$ds = new-object directoryservices.directorysearcher($root,$filter)
$users = $ds.findall()
$users | format-table @{l="User";e={$_.properties.item('cn')}},
... | 0 |
2650.ps1 | Import-Module SQLPS -DisableNameChecking
$AGName = 'TestAG1'
$PrimaryNode = 'SQLNODE1'
$FailoverNode = 'SQLNODE2'
$IPs = @('10.152.18.25/255.255.255.0','10.152.19.160/255.255.255.0','10.152.20.119/255.255.255.0')
$replicas = @()
$cname = (Get-Cluster -name $PrimaryNode).name
$nodes = (get-clusternode -Cluster $cname... | 0 |
Thin provisioning with P.ps1 | function ConvertVMDiskToThin($vm, $datastore) {
$vmView = Get-View $vm
$dsView = Get-View $datastore
$relocateSpec = New-Object VMware.Vim.VirtualMachineRelocateSpec
$relocateSpec.Datastore = $dsView.MoRef
$relocateSpec.Transform = "sparse"
$vmView.RelocateVM($relocateSpec, $null)
}
| 0 |
298.ps1 | function Register-PSFCallback
{
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[string]
$Name,
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
[string]
$ModuleName,
[Parameter(Mandatory = $true, ValueFromPipelineByProperty... | 0 |
1417.ps1 |
function Get-CIisHttpHeader
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$SiteName,
[Alias('Path')]
[string]
$VirtualPath = '',
[string]
$Name = '*'
)
Set-StrictMode -V... | 0 |
sample_61_31.ps1 | #
# Module manifest for module 'OCI.PSModules.Licensemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSE... | 0 |
sample_49_34.ps1 | #
# Module manifest for module 'PowerShellEditorServices'
#
# Generated by: daviwil
#
# Generated on: 5/12/2016
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'PowerShellEditorServices.Commands.psm1'
# Version number of this module.
ModuleVersion = '0.2.0'
# I... | 0 |
630.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
[switch]$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://psget.net/GetPsGet.ps1"
ConditionExclusion = "(Get-Module -ListAvailable | where{`$_.Name -eq `"PsGet`"})"
}
$Configs | ForEach-Object{
try{
$_.Result = $null
i... | 0 |
sample_43_8.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_57_77.ps1 | [cmdletbinding()]
param([string]$targetBinary, [string]$installedDir, [string]$tlogFile, [string]$copiedFilesLog)
$g_searched = @{}
# Note: installedDir is actually the bin\ directory.
$g_install_root = Split-Path $installedDir -parent
$g_is_debug = (Split-Path $g_install_root -leaf) -eq 'debug'
# Ensure we create th... | 0 |
59.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 |
sample_10_44.ps1 | #
# Module manifest for module 'OCI.PSModules.Objectstorage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Objectstorage.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEdi... | 0 |
3900.ps1 |
function Test-GetNonExistingBatchAccount
{
Assert-Throws { Get-AzBatchAccount -Name "accountthatdoesnotexist" }
}
function Test-BatchAccountEndToEnd
{
$accountName = Get-BatchAccountName
$resourceGroup = Get-ResourceGroupName
try
{
$location = Get-BatchAccountProvider... | 0 |
sample_42_93.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 |
3704.ps1 |
function Get-AzAdvisorRecommendationNoParameter
{
$propertiesCount = 14
$shortDescriptionPropertiesCount = 2
$cmdletReturnType = "Microsoft.Azure.Commands.Advisor.Cmdlets.Models.PsAzureAdvisorResourceRecommendationBase"
$queryResult = Get-AzAdvisorRecommendation
Assert-NotNull $queryResult
fo... | 0 |
sample_8_30.ps1 | #************************************************
# DC_GroupPolicyClient-Component.ps1
# Version 1.0
# Date: 2009
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about the Group Policy client.
# Called from: Main Networking Diag
#*************************************************... | 0 |
4424.ps1 | function Publish-Module {
[CmdletBinding(SupportsShouldProcess = $true,
PositionalBinding = $false,
HelpUri = 'https://go.microsoft.com/fwlink/?LinkID=398575',
DefaultParameterSetName = "ModuleNameParameterSet")]
Param
(
[Parameter(Mandatory = $true,
Paramete... | 0 |
4aea4469-64f1-4f01-9c7f-054ecd61a063.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_21_64.ps1 | Signature-Version: 1.0
SHA-256-Digest-Manifest-Main-Attributes: 6O7HmBCrTSNxX243vN9FnfZPeGnR4
HdagZa0WCFVhWg=
SHA-256-Digest-Manifest: faE7vVn76wTlHYQe073PzMLkMDJfC0DiL3NplDbVdAM=
Created-By: 1.8.0_112 (Oracle Corporation)
Name: com/microsoft/azure/toolkit/lib/appservice/deploy/FlexFunctionDe
ployHandler.html... | 0 |
sample_12_64.ps1 | ConvertFrom-StringData @'
id_adapterkb980486check=Checking 6to4 and physical adapters
id_adapterkb980486checkdesc=Checking the number of 6to4 and physical adapters (KB 980486)
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3Ag... | 0 |
3044.ps1 | function Should-BeTrue($ActualValue, [switch] $Negate, [string] $Because) {
if ($Negate) {
return Should-BeFalse -ActualValue $ActualValue -Negate:$false -Because $Because
}
if (-not $ActualValue) {
$failureMessage = "Expected `$true,$(Format-Because $Because) but got $(Format-Nicely $... | 0 |
4170.ps1 |
param
(
[switch]$ListQueries,
[string]$Query,
[string]$SCCMServer,
[string]$SCCMServerDrive
)
function Get-ListOfQueries {
[CmdletBinding()]
param ()
Set-Location $SCCMServerDrive
$Queries = Get-CMQuery
Set-Location $env:SystemDrive
$QueryArray = @()
foreach ($Query in $Queries) {
$QueryArray += $Qu... | 0 |
sample_55_4.ps1 | import{T as s}from"./index-DktkJoV1.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d)
* Released under the MIT license
* https://github.com/microsoft/monaco-edit... | 0 |
sample_43_61.ps1 | @{
IncludeRules = @(
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
'PSUseConsistentWhitespace',
'PSUseConsistentIndentation',
'PSAlignAssignmentStatement',
'PSUseCorrectCasing'
)
Rules = @{
PSPlaceOpenBrace = @{
Enable ... | 0 |
sample_8_6.ps1 | ConvertFrom-StringData @'
id_ctssmbclient=SMB Client Component
id_ctssmbclientdescription=Collects information about the SMB Client component.
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
#... | 0 |
sample_9_12.ps1 | #************************************************
# RS_BPAinfo.ps1
# 2023-02-20 WalterE mod Trap #we#
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumb... | 0 |
sample_30_78.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 |
265.ps1 | function Get-LocalGroupMember
{
[CmdletBinding()]
PARAM (
[Parameter(ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true)]
[System.String[]]$ComputerName = $env:COMPUTERNAME,
[System.String]$GroupName = "Administrators"
)
BEGIN
{
TRY
{
Add-Type -AssemblyName System.DirectoryServ... | 0 |
sample_33_52.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Test-ScriptExtent {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[OutputType([bool], ParameterSetName='__AllParameterSets')]
[OutputType([System.Management.Automation.Language.IScriptExten... | 0 |
1772.ps1 |
Describe "Acl cmdlets are available and operate properly" -Tag CI {
It "Get-Acl returns an ACL object" -pending:(!$IsWindows) {
$ACL = get-acl $TESTDRIVE
$ACL | Should -BeOfType "System.Security.AccessControl.DirectorySecurity"
}
It "Set-Acl can set the ACL of a directory" -pending {
... | 0 |
sample_58_99.ps1 | #
# Module manifest for module 'OCI.PSModules.Disasterrecovery'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Disasterrecovery.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported... | 0 |
1211.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Get-ExpectedIPAddress
{
[Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces() |
Where-Object { $_.OperationalStatus -eq 'Up' -and $_.NetworkInterfaceT... | 0 |
Enable_Configure SNMP_2.ps1 | #Powershell Script To Install SNMP Services (SNMP Service, SNMP WMI Provider)
#Variables :)
$pmanagers = "ADD YOUR MANAGER(s)"
$commstring = "ADD YOUR COMM STRING"
#Import ServerManger Module
Import-Module ServerManager
#Check If SNMP Services Are Already Installed
$check = Get-WindowsFeature | Where-Objec... | 0 |
Import-UniqueModule.ps1 | ## WARNING: I take no responsibility for how weird this is.
function Import-UniqueModule {
param([Parameter(Mandatory=$true)][String]$ModuleName)
$unique = [guid]::NewGuid().Guid -replace "-"
Import-Module $ModuleName -Prefix $unique
Get-Command -Module $ModuleName |
New-Alias -Name {$_.Name -replace $un... | 0 |
sample_31_9.ps1 | #
# Module manifest for module 'OCI.PSModules.Announcementsservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Announcementsservice.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# S... | 0 |
2319.ps1 | param (
$OmnifocusTaskFile = 'C:\Users\Adam Bertram\Dropbox\OmniFocus.csv'
)
$script:DefaultWeekdayTimeAvail = @{
'Monday' = 10
'Tuesday' = 10
'Wednesday' = 10
'Thursday' = 10
'Friday' = 9
'Saturday' = 6
'Sunday' = 3
}
$TotalReportWeeksOut = 8
$script:Today = Get-Date
function Get-WeeklyWorkTime([switch]... | 0 |
3339.ps1 |
function Add-GroupRole {
[PoshBot.BotCommand(
Permissions = 'manage-groups'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string]$Group,
[parameter(Mandatory, Position = 1)]
[string]$Role
... | 0 |
sample_9_58.ps1 | # 2023-02-24 WalterE mod Trap #we#
$startTime_AutoAdd = Get-Date
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_"
}
Write-Host -Background... | 0 |
2091.ps1 |
Describe "Tests for parameter binding" -Tags "CI" {
Context 'Test of Mandatory parameters' {
BeforeAll {
$f = "function get-foo { param([Parameter(mandatory=`$true)] `$a) `$a };"
}
It 'Mandatory parameters used in non-interactive host' {
$rs = [system.management.au... | 0 |
sample_53_43.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
#
# Azure File Sync: List per item sync errors
#
# Version 2.4... | 0 |
Get-Tail_1.ps1 | # Name: Get-Tail.ps1
# Author: William Stacey
# Created: 02/22/2007
# Description: Gets the last N lines of a file. Does scan from end-of-file so works on large files. Also has a loop flag that prompts for refresh.
function Get-Tail([string]$path = $(throw "Path name must be specified."), [int]$count = 10, [bool... | 0 |
sample_40_29.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 = '81.0.0'
# Supported PSEditi... | 0 |
sample_24_31.ps1 | let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl();
let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/aspire.eventHandlers.js"];
let currentScriptElement = document.querySelector("script[src='Scripts/aspire.plugin.js']");
if (currentScriptElement !== null) {
scrip... | 0 |
sample_51_46.ps1 | #
# Module manifest for module 'OCI.PSModules.Analytics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Analytics.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Co... | 0 |
2847.ps1 | function GetCurrentConfigurationOrDefault() {
if ($psake.context.count -gt 0) {
return $psake.context.peek().config
} else {
return $psake.config_default
}
}
| 0 |
2857.ps1 | function Assert {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
$conditionToCheck,
[Parameter(Mandatory = $true)]
[string]$failureMessage
)
if (-not $conditionToCheck) {
throw ('Assert: {0}' -f $failureMessage)
}
}
| 0 |
sample_67_32.ps1 | # Name tss_GetLockoutEvents.ps1
<#
.SYNOPSIS
Script to find Account Lockout: PowerShell script collects Security events from all DCs related with Bad Password attempts
.DESCRIPTION
PowerShell script sample to assist in troubleshooting account lockout issues. It can be used to collect Security Events from al... | 0 |
sample_3_5.ps1 | #************************************************
# DC_RDSPowerInfo.ps1
# Version 1.0.1
# Date: 21-01-2012
# Author: Daniel Grund - dgrund@microsoft.com
# Description:
# This script gets the RDP config and
# checks vital signs to inform user.
# 1.0.0 Beta release
#*******************************************... | 0 |
sample_51_45.ps1 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apa... | 0 |
sample_10_99.ps1 | #************************************************
# TS_2628581_HPUPDUpgrade.ps1
# Version 1.0.1
# TemplateVersion 1.2
# Date: 04/17/2012 08:02:35
# Author: jasonf
# Description: Checks the registry for an HP UPD upgrade from 5.2 to 5.3 which is known to cause issues
#********************************************... | 0 |
4135.ps1 |
Set-Variable -Name AdminPassword -Scope Global -Force
Set-Variable -Name AdminUsername -Scope Global -Force
Set-Variable -Name DestinationComputer -Scope Global -Force
Set-Variable -Name DestinationProfile -Scope Global -Force
Set-Variable -Name RelativePath -Scope Global -Force
Set-Variable -Name SourceComputer -S... | 0 |
sample_53_95.ps1 | #
# Module manifest for module 'OCI.PSModules.Emwarehouse'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Emwarehouse.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEdition... | 0 |
sample_32_3.ps1 | #
# Module manifest for module 'OCI.PSModules.Filestorage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Filestorage.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEdition... | 0 |
238.ps1 | function Get-SCSMWorkItemRequestOffering
{
PARAM (
[Parameter(ValueFromPipeline)]
$SMObject
)
BEGIN { Import-Module -Name SMLets -ErrorAction Stop }
PROCESS
{
foreach ($Item in $SMObject)
{
(Get-SCSMRelationshipObject -BySource $Item | Where-Object { $_.RelationshipID -eq "2730587f-3d88-a4e4-42d8-08cf... | 0 |
sample_29_81.ps1 | #
# Module manifest for module 'OCI.PSModules.Capacitymanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Capacitymanagement.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Suppo... | 0 |
sample_15_8.ps1 | <#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
function Stop-Process2 {
[CmdletBinding(SupportsShouldProcess = $true)]
[Alias()]
[OutputType([int])]
param(
# Param1 help description
... | 0 |
sample_50_50.ps1 | #===========================================================================
#DVInstaller.ps1
#----------------------------------------------------------------------------
#Copyright (C) 2021 Intel Corporation
#SPDX-License-Identifier: MIT
#--------------------------------------------------------------------------*/
#... | 0 |
Vim25 Crazy Magic.ps1 | cls
[void][Reflection.Assembly]::LoadWithPartialName("VMware.Vim");
# generate the proxy
$ws = New-WebServiceProxy -Uri "http://172.16.0.33/sdk/vimService?wsdl" ;
$ws.Url = "http://172.16.0.33/sdk/vimService";
$ws.UserAgent = "VMware VI Client/4.0.0";
# I modded the host to accept HTTP requests (too big o... | 0 |
sample_35_47.ps1 | // <auto-generated />
namespace IronJS.Tests.UnitTests.IE9.chapter15._15_2._15_2_3
{
using System;
using NUnit.Framework;
[TestFixture]
public class _15_2_3_5_Tests : IE9TestFixture
{
public _15_2_3_5_Tests() : base(@"chapter15\15.2\15.2.3\15.2.3.5") { }
[Test(Descriptio... | 0 |
ConvertFrom-CliXml_1.ps1 |
function ConvertFrom-CliXml {
param(
[Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]
[ValidateNotNullOrEmpty()]
[String[]]$InputObject
)
begin
{
$OFS = "`n"
[String]$xmlString = ""
}
process
{
$xmlString += $InputObje... | 0 |
3380.ps1 |
[CmdletBinding(DefaultParameterSetName="CurrentDirectory")]
Param
(
[Parameter(ParameterSetName="AzurePowerShell", Mandatory=$true)]
[switch]$AzurePowerShell,
[Parameter(ParameterSetName="MsiInstall", Mandatory=$true)]
[switch]$MsiInstall,
[Parameter(ParameterSetName="GalleryInstall", Mandatory=$tr... | 0 |
sample_4_88.ps1 | #************************************************
# TS_PrintingHPTCPMonCheck.ps1
# Version 1.0.1
# Date: 1-19-2012
# Author: v-anecho
# Description: One or more network stored PST files were detected on this machine
#************************************************
Import-LocalizedData -BindingVariable Script... | 0 |
sample_40_57.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 |
dc580007-f61d-477a-a409-395481ffb01a.ps1 | CREATE LOGIN [vCenter_Owner] WITH PASSWORD=N'KVx$!|mhQ^', CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
--Modify Drive and size to match your environment
CREATE DATABASE [vCenter] ON PRIMARY
( NAME = N'vCenter', FILENAME = N'S:\\Data\\vCenter.mdf' , SIZE = 100MB , MAXSIZE = UNLIMITED, FILEGROWTH = 10%)
LOG ON
(... | 0 |
sample_47_95.ps1 | #
# Module manifest for module 'OCI.PSModules.Announcementsservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Announcementsservice.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# S... | 0 |
sample_28_81.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 = '79.0.0'
# Supported PSEditions
Comp... | 0 |
sample_13_54.ps1 | #************************************************
# TS_PrintCSRBloatingCheck.ps1
# Version 1.0.1
# Date: 6/26/2012
# Author: v-maam
# Description: [Idea ID 2374] [Windows] Spooler service hangs since CSR exhausts the 512 threads in thread pool
# Rule number: 2374
# Rule URL: http://sharepoint/sites/rules/Rule... | 0 |
sample_45_49.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Get-Token {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding()]
[OutputType([System.Management.Automation.Language.Token])]
[System.Diagnostics.CodeAnalysis.SuppressMessage... | 0 |
sample_37_78.ps1 | @{
GUID="c61d6278-02a3-4618-ae37-a524d40a7f44 "
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
ModuleToProcess="PSDiagnostics.psm1"
Func... | 0 |
sample_58_78.ps1 | #requires -Version 5.0
using namespace Microsoft.Dynamics.Framework.UI.Client
using namespace Microsoft.Dynamics.Framework.UI.Client.Interactions
class ClientContext {
$events = @()
$clientSession = $null
$culture = ""
$caughtForm = $null
$IgnoreErrors = $true
ClientContext([strin... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.