filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
sample_21_43.ps1 | ConvertFrom-StringData @'
id_sccm_activity_collectconfigmgrlogs=Obtaining Configuration Manager Logs
id_sccm_ccm_collectconfigmgrlogs=Copying CCM Logs...
id_sccm_sms_collectconfigmgrlogs=Copying SMS Logs...
id_sccm_crashdumps_collectconfigmgrlogs=Copying most recent copy of SMS CrashDumps...
id_sccm_adminui_collec... | 0 |
sample_11_80.ps1 | ConvertFrom-StringData @'
id_netframeworkngenfiles_title=.Net Framework nGen files
id_netframeworkngenfiles_status=Collecting .Net Framework nGen files
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE... | 0 |
460.ps1 | Set-PSFConfig -Module 'PSFramework' -Name 'ComputerManagement.PSSession.IdleTimeout' -Value (New-TimeSpan -Minutes 15) -Initialize -Validation 'timespan' -Handler { [PSFramework.ComputerManagement.ComputerManagementHost]::PSSessionIdleTimeout = $args[0] } -Description "The idle timeout for cached pssessions. When using... | 0 |
sample_58_92.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 |
1950.ps1 |
Describe "ConvertTo-Html Tests" -Tags "CI" {
BeforeAll {
$customObject = [pscustomobject]@{"Name" = "John Doe"; "Age" = 42; "Friends" = ("Jack", "Jill")}
$newLine = "`r`n"
}
function normalizeLineEnds([string]$text)
{
$text -replace "`r`n?|`n", "`r`n"
}
It "Test Conv... | 0 |
Logger.psm1 0.5.ps1 | <#
Name : Universal NLog Logging Module (NLog.psm1)
Version : 0.5
Author : Joel Bennett (MVP)
Site : http://www.HuddledMasses.org/
Version History:
0.5 - Port to NLog from Log4Net ( http://nlog-project.org )
Include support for Growl plugin for NLog, but left out the rotat... | 0 |
sample_18_7.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_40_68.ps1 | ##############################################################################
# PREVIEW VERSION OF PSAKE SCRIPT FOR MODULE BUILD & PUBLISH TO THE PSGALLERY
##############################################################################
#
# We are hoping to add support for publishing modules to the PowerShell galler... | 0 |
Test-Prompt_3.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 |
1456.ps1 |
function Test-CWindowsFeature
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[Switch]
$Installed
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet... | 0 |
1165.ps1 |
$iniPath = $null
Describe 'Test-RemoveIniEntry' {
BeforeAll {
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
}
BeforeEach {
$iniPath = Join-Path ([IO.Path]::GetTempPath()) ([IO.Path]::GetRandomFileName())
$null = New-Item $iniPath ... | 0 |
sample_63_30.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="E:\艺施胡\alova-devtools\node_modules\.pnpm\typescript@5.4.5\node_modules\typescript\bin\node_modules;E:\艺施胡\alova-devtools\node_modules\.pnpm\typescript@5.4.5\node_modules... | 0 |
Hash Checker On One Line.ps1 | # to make it readable, I've wrapped the lines, but you can remove all the line breaks:
&{
PARAM($FileName,$HashFileName)
((Get-Content $HashFileName) -match $FileName)[0].split(" ")[0] -eq
[string]::Join("", (
[Security.Cryptography.HashAlgorithm]::Create(
([IO.Path]::GetExtension($HashFileName... | 0 |
SearchZIP.psm1 Module Fi.ps1 | function SearchZIPfiles {
<#
.SYNOPSIS
Search for (filename) strings inside compressed ZIP or RAR files.
.DESCRIPTION
In any directory containing a large number of ZIP/RAR compressed Web Page files
this procedure will search each individual file name for simple text strings,
listing both the source RAR/ZIP fi... | 0 |
710.ps1 |
function New-RsRestCredentialsByUserObject
{
[CmdletBinding()]
param(
[Alias('DisplayText')]
[string]
$PromptMessage,
[Alias('UseAsWindowsCredentials')]
[switch]
$WindowsCredentials
)
Process
{
return @{
"DisplayText" = $Pr... | 0 |
1112.ps1 |
$siteName = 'Anonymous Authentication'
$sitePort = 4387
$webConfigPath = Join-Path $TestDir web.config
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
Uninstall-IisWebsite $siteName
Install-IisWebsite -Na... | 0 |
sample_2_32.ps1 | ConvertFrom-StringData @'
id_2k3clsiduseraclcheck_st=Permissions for local Users group was removed from registry key HKCR\\CLSID
'@
# SIG # Begin signature block
# MIIoVAYJKoZIhvcNAQcCoIIoRTCCKEECAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAA... | 0 |
sample_26_87.ps1 | #
# Module manifest for module 'OCI.PSModules.Osuborganizationsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll'
# Version number of this module.
ModuleVersion... | 0 |
sample_61_61.ps1 | #
# Module manifest for module 'OCI.PSModules.Emaildataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Emaildataplane.dll'
# Version number of this module.
ModuleVersion = '88.1.0'
# Supported PSE... | 0 |
1909.ps1 |
Describe "Group-Object DRT Unit Tests" -Tags "CI" {
It "Test for CaseSensitive switch" {
$testObject = 'aA', 'aA', 'AA', 'AA'
$results = $testObject | Group-Object -CaseSensitive
$results.Count | Should -Be 2
$results.Name.Count | Should -Be 2
$results.Group.Count | Should ... | 0 |
sample_41_41.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 = if ($PSEdition -eq 'Core')
{
'bin/Core/Microsoft.PowerShell.EditorServices.Hosting.dll'
}... | 0 |
714.ps1 |
function Set-RsRestItemDataSource
{
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')]
param(
[Parameter(Mandatory = $True)]
[Alias('ItemPath','Path')]
[string]
$RsItem,
[Parameter(Mandatory = $True)]
[ValidateSet("PowerBIReport", "... | 0 |
sample_62_5.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
param (
[Parameter(Manda... | 0 |
Get-Parameter 2.4.ps1 | #Requires -version 2.0
#.Synopsis
# Enumerates the parameters of one or more commands
#.Notes
# With many thanks to Hal Rottenberg, Oisin Grehan and Shay Levy
# Version 0.80 - April 2008 - By Hal Rottenberg http://poshcode.org/186
# Version 0.81 - May 2008 - By Hal Rottenberg http://poshcode.org/255
# Ver... | 0 |
sample_5_4.ps1 | <#
.SYNOPSIS
Biztalk Integration module for collecting traces
.DESCRIPTION
Define ETW traces for Windows Biztalk Integration components
Add any custom tracing functinaliy for tracing Biztalk components
For Developers:
1. Component test: .\TSS.ps1 -Start -INT_TEST1
2. Scenario test: .\TSS.ps1 -start -Sc... | 0 |
3119.ps1 |
function Get-InstalledSoftware
{
[CmdletBinding()]
param(
[Parameter(
Position=0,
HelpMessage='Search for product name (You can use wildcards like "*ProductName*')]
[String]$Search,
[Parameter(
Position=1,
HelpMessage='ComputerName or IPv4-Address of the remote computer')]
[String]$Com... | 0 |
596.ps1 |
function Run-SQLServerAgentJob{
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[String]
$JobName,
[Parameter(Mandatory = $false)]
[String]
$Hostname = $env:COMPUTERNAME,
[Parameter(Mandatory=$false)]
[ScriptBlock]
$LogScriptBlock... | 0 |
sample_66_23.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
param
(
[Parameter(Mand... | 0 |
1364.ps1 |
function Read-CFile
{
[CmdletBinding()]
[OutputType([string])]
param(
[Parameter(Mandatory=$true)]
$Path,
[int]
$MaximumTries = 30,
[int]
$RetryDelayMilliseconds = 100,
[Switch]
$Raw
)
Set-S... | 0 |
Findup_1.ps1 | using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.IO;
namespace Findup
{
public class FileInfoExt
{
public FileInfo... | 0 |
ConvertTo-Hex_10.ps1 | # Ported from C# technique found here: http://forums.asp.net/p/1298956/2529558.aspx
param ( [string]$SidString )
# Create SID .NET object using SID string provided
$sid = New-Object system.Security.Principal.SecurityIdentifier $sidstring
# Create a byte array of the proper length
$sidBytes = New-Object byte[] ... | 0 |
3299.ps1 |
function Stop-Poshbot {
[cmdletbinding(SupportsShouldProcess, ConfirmImpact = 'high')]
param(
[parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[int[]]$Id,
[switch]$Force
)
begin {
$remove = @()
}
process {
foreach ($jobId... | 0 |
sample_30_13.ps1 | # Copyright (C) Intel Corporation, 2021 All Rights Reserved.
function Invoke-ConfigureTLSMutualAuthentication
{
<#
.Synopsis
Configures AMT connection to TLS with mutual authentication
.Description
This cmdlet configures the AMT connection to TLS with mutual authentication.
The cmdlet adds the AMT c... | 0 |
sample_61_70.ps1 | #
# Module manifest for module 'OCI.PSModules.Queue'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Queue.dll'
# Version number of this module.
ModuleVersion = '89.0.0'
# Supported PSEditions
Compatible... | 0 |
sample_59_85.ps1 | #
# Module manifest for module 'OCI.PSModules.Threatintelligence'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Threatintelligence.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Suppo... | 0 |
sample_45_98.ps1 | <Viewbox Width="16" Height="16" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup ClipGeometry="M0,0 V512 H512 V0 H0 Z">
<DrawingGroup Opacity="1">
... | 0 |
sample_7_69.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 |
sample_33_0.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 = '83.1.0'
# Supported PSEditions
Comp... | 0 |
3837.ps1 |
function TopicTests {
$location = Get-LocationForEventGrid
$topicName = Get-TopicName
$topicName2 = Get-TopicName
$topicName3 = Get-TopicName
$topicName4 = Get-TopicName
$resourceGroupName = Get-ResourceGroupName
$secondResourceGroup = Get-ResourceGroupName
$subscript... | 0 |
sample_47_43.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Register-EditorCommand `
-Name 'PowerShellEditorServices.OpenEditorProfile' `
-DisplayName 'Open Editor Profile' `
-SuppressOutput `
-ScriptBlock {
param([Microsoft.PowerShell.EditorServices.Extensions.EditorContex... | 0 |
sample_25_38.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 = '81.0.0'
# Supported PSEdition... | 0 |
4090.ps1 |
[CmdletBinding()]
param ()
cls
$LocalPassword = ((manage-bde -protectors -get ($env:ProgramFiles).split('\')[0] -id ((Get-WmiObject -Namespace 'Root\cimv2\Security\MicrosoftVolumeEncryption' -Class 'Win32_EncryptableVolume').GetKeyProtectors(3).volumeKeyprotectorID)).trim() | Where-Object { $_.Trim() -ne '' })[-1]
$... | 0 |
52.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 |
BufferBox _1.6.ps1 | ####################################################################################################
## This script is just a demonstration of some of the things you can do with the buffer
## in the default PowerShell host... it serves as a reminder of how much work remains on
## PoshConsole, and as an inspiration t... | 0 |
sample_47_39.ps1 | #
# Module manifest for module 'Az.DnsResolver'
#
# Generated by: Microsoft Corporation
#
# Generated on: 5/16/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.DnsResolver.psm1'
# Version number of this module.
ModuleVersion = '1.0.0'
# Supported PSEdit... | 0 |
sample_40_76.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Advisor.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.Advisor.Module]::Instance
# Export nothing to clear implicit exports
... | 0 |
1803.ps1 |
$stopTesthook = "TestStopComputer"
$stopTesthookResultName = "TestStopComputerResults"
$DefaultResultValue = 0
try
{
$PSDefaultParameterValues["it:skip"] = ! $IsWindows
Enable-Testhook -testhookName $stopTesthook
Describe "Stop-Computer" -Tag Feature {
BeforeEach {
i... | 0 |
1801.ps1 |
Describe "Unimplemented Management Cmdlet Tests" -Tags "CI" {
$Commands = @(
"Get-Service",
"Stop-Service",
"Start-Service",
"Suspend-Service",
"Resume-Service",
"Restart-Service",
"Set-Service",
"New-Service",
"Restart-Computer",
"... | 0 |
1798.ps1 |
Describe "Get-ChildItem" -Tags "CI" {
Context 'FileSystem provider' {
BeforeAll {
$item_a = "a3fe710a-31af-4834-bc29-d0b584589838"
$item_B = "B1B691A9-B7B1-4584-AED7-5259511BEEC4"
$item_c = "c283d143-2116-4809-bf11-4f7d61613f92"
$item_D = "D39... | 0 |
Get Active Sync devices _1.ps1 | <#
.SYNOPSIS
Get-InactiveActiveSyncDevices pulls all user mailboxes with an Active Sync partnership and then selects the Active Sync devices that haven't synced in the specified period. These devices are sorted in ascending order and placed in a HTML table which is emailed to the specified user using a specified repl... | 0 |
sample_42_44.ps1 | #
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
<#
.SYNOPSIS
Installs dotnet cli
.DESCRIPTION
Installs dotnet cli. If dotnet installation already exists in the given directory
it ... | 0 |
3645.ps1 |
function Get-SqlAuditingTestEnvironmentParameters ($testSuffix)
{
return @{ rgname = "sql-audit-cmdlet-test-rg" +$testSuffix;
serverName = "sql-audit-cmdlet-server" +$testSuffix;
databaseName = "sql-audit-cmdlet-db" + $testSuffix;
storageAccount = "auditcmdlets" +$testSuffix
}
}
funct... | 0 |
sample_55_90.ps1 | <#
.SYNOPSIS
Creates and throws an invalid argument exception.
.PARAMETER Message
The message explaining why this error is being thrown.
.PARAMETER ArgumentName
The name of the invalid argument that is causing this error to be thrown.
#>
function New-InvalidArgumentExcept... | 0 |
sample_36_59.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.apach... | 0 |
4126.ps1 |
param
(
[string]$WindowsRepository,
[string]$BIOSPassword,
[switch]$BIOS,
[switch]$Drivers,
[switch]$Applications,
[string]$WinPERepository
)
function Get-Architecture {
[CmdletBinding()][OutputType([string])]
param ()
$OSArchitecture = (Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArch... | 0 |
sample_65_79.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Suppor... | 0 |
280.ps1 |
$groupId = " FILL ME IN "
$newGatewayId = " FILL ME IN "
$datasetId = " FILL ME IN "
$clientId = " FILL ME IN "
function GetAuthToken
{
if(-not (Get-Module AzureRm.Profile)) {
Import-Module AzureRm.Profile
}
$redirectUri = "urn:ietf:wg:oauth:2.... | 0 |
Server Inventory.ps1 | #This script requires:
#Windows Powershell 1.0 = http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx
#PowerGui = http://www.powergui.org/downloads.jspa
#Quest ActiveRoles Management Shell for Active Directory = http://www.quest.com/powershell/activeroles-server.aspx
#VMware I... | 0 |
2829.ps1 |
$psake.run_by_psake_build_tester = $true
$buildFiles = Get-ChildItem $PSScriptRoot/../../specs/*.ps1
$testResults = @()
describe 'PSake specs' {
BeforeAll {
$oldPSPath = $env:PSModulePath
$env:PSModulePath += "$([IO.Path]::PathSeparator)$PSScriptRoot/../../specs/SharedTaskModules"
}
... | 0 |
3567.ps1 |
function Test-NewSubscription
{
$accounts = @(@{ ObjectId = "cdf813b6-bdc2-4df5-b150-00ccfd7580e2" })
Assert-True { $accounts.Count -gt 0 }
$myNewSubName = GetAssetName
$newSub = New-AzSubscription -EnrollmentAccountObjectId $accounts[0].ObjectId -Name $myNewSubName -Offe... | 0 |
PS+ImgBurn burn all ISOs.ps1 | function burn()
{
#get the files and ship them to burn-file
dir -recurse -include *.iso -path c:\\,d:\\,e:\\ | foreach { burn-file $_.FullName }
}
function burn-file($filename)
{
#call img burn with the nessessary arguments
. "c:\\Program Files\\ImgBurn\\ImgBurn.exe" /mode ISOWRITE /WAITFORMEDIA /start /close... | 0 |
sample_48_88.ps1 |
@{
GUID = '3af1699d-cc54-4e54-81cf-28d2df5cce0a'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="© Microsoft Corporation. All rights reserved."
HelpInfoUri="https://aka.ms/winsvr-2022-pshelp"
NestedModules = @('SmbShare.cdxml',
'SmbSes... | 0 |
9.ps1 |
function Get-GitDirectory {
$pathInfo = Microsoft.PowerShell.Management\Get-Location
if (!$pathInfo -or ($pathInfo.Provider.Name -ne 'FileSystem')) {
$null
}
elseif ($Env:GIT_DIR) {
$Env:GIT_DIR -replace '\\|/', [System.IO.Path]::DirectorySeparatorChar
}
else {
$curre... | 0 |
968.ps1 |
Connect-AzAccount
Set-AzContext -SubscriptionId "subscription ID"
$location = "westus2"
$resourcegroup = "MyRG"
New-AzResourceGroup -Name $resourcegroup -Location $location
$vaultname = "MyKeyVault"
New-AzKeyVault -VaultName $vaultname -ResourceGroupName $resourcegroup -Location $location -EnableSoftD... | 0 |
1636.ps1 |
$a1 = New-Object System.Collections.ArrayList
$a2 = New-Object System.Collections.ArrayList
$a3 = New-Object System.Collections.ArrayList
$a4 = New-Object System.Collections.ArrayList
1..100 | % {
$null = $a1.Add($(Measure-Command {
$ArrayList = New-Object System.Collections.ArrayList
1..1000 | %... | 0 |
4234.ps1 | $idletime = $null
Function Get-IdleTime {
if ($idletime -ne "TRUE") {
$script:idletime = "TRUE"
echo "Loading Assembly"
$PS = "TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQRQAATAED... | 0 |
4225.ps1 |
function Get-PassNotExp
{
$strFilter = '(&(objectCategory=User)(userAccountControl:1.2.840.113556.1.4.803:=65536))'
$objDomain = New-Object System.DirectoryServices.DirectoryEntry
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.PageSize = 1000
$obj... | 0 |
sample_21_60.ps1 | # Localized 12/03/2020 06:20 PM (GMT) 303:4.80.0411 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=是(&Y)
PromptNoString=否(&N)
BundleFound=找到下列資源存放區: {0}
PackageFound=找到封裝: {0}
EncryptedBundleFound=找到加密的套件組合: {0}
EncryptedPackageFound=找到加密的套件: {0}
CertificateFou... | 0 |
Get-ObjectIdentifier.ps1 | #####################################################################
# Get-ObjectIdentifier.ps1
# Version 1.0
#
# Resolves OID value to a Friendly Name and vice versa.
#
# Vadims Podans (c) 2010
# http://en-us.sysadmins.lv/
#####################################################################
#requires -Versi... | 0 |
sample_65_35.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
param (
[Parameter(Manda... | 0 |
2939.ps1 | task default -depends Test
task Test -depends Compile, Clean -PreAction {"Pre-Test"} -Action {
Assert $false "This fails."
} -PostAction {"Post-Test"}
task Compile -depends Clean {
"Compile"
}
task Clean {
"Clean"
}
| 0 |
Get-PrinterInfo.ps1 | $strComputer = "PrinterName"
$Ports = get-wmiobject -class "win32_tcpipprinterport" -namespace "root\\CIMV2" -computername $strComputer
$Printers = get-wmiobject -class "Win32_Printer" -namespace "root\\CIMV2" -computername $strComputer
$ports | Select-Object Name,Hostaddress | Set-Variable port
$Printers | Select-... | 0 |
sample_58_3.ps1 | ConvertFrom-StringData @'
###PSLOC
ProcessorCount = Hostname {0} processor count: {1}
NicCount = Hostname {0} Network Adapter count: {1}
TotalMemory = Hostname {0} total memory capacity is {1} GB in {2} modules
TestMemory = Testing memory module {0}
MemoryCapacity = Total memory for '{0}' is '{1}', expected at le... | 0 |
Veeam backup to OVF.ps1 | # This script runs a different OVF conversion depending on the Day of the week.
$VeeamJob = "JobName"
$server1 = 'ServerName'
asnp VMware.VimAutomation.Core -ErrorAction SilentlyContinue
asnp VeeamPSSnapin -ErrorAction SilentlyContinue
$Dest1 = "R:\\VMWARE\\OVF\\$Server1\\"
$OVFFile1 = "$($Dest1)$($Server1)... | 0 |
sample_42_74.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 |
3338.ps1 |
function Remove-Group {
[PoshBot.BotCommand(
Aliases = ('rg', 'removegroup'),
Permissions = 'manage-groups'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string[]]$Name
)
$removed = @()
$... | 0 |
sample_6_66.ps1 | $debug = $false
$vmmskey = "HKLM:\SYSTEM\CurrentControlSet\Services\vmms"
if (Test-Path $vmmskey) {
Import-LocalizedData -BindingVariable HyperVNetStrings
#Hyper-V Networking info
Write-DiagProgress -Activity $HyperVNetStrings.ID_HyperVNet -Status $HyperVNetStrings.ID_HyperVNetObtaining
... | 0 |
sample_54_92.ps1 | <#
.SYNOPSIS
Scenario module for collecting Microsoft Remote Desktop Profiles related data
.DESCRIPTION
Collect Profiles related troubleshooting data (incl. FSLogix, OneDrive)
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedb... | 0 |
sample_25_21.ps1 | #
# PowerConsole profile
#
<#
.SYNOPSIS
Clear the host content.
.DESCRIPTION
This function replaces the standard Clear-Host and is aliased by "cls".
#>
function Clear-Host
{
$host.PrivateData.ClearHost()
}
<#
.SYNOPSIS
Simple path completion function for PowerConsole.
#>
funct... | 0 |
sample_16_14.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicemanagerproxy'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicemanagerproxy.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Sup... | 0 |
WriteFileName_2.ps1 | # functions to print overwriting multi-line messages. Test script will accept a file/filespec/dir and iterate through all files in all subdirs printing a test message + file name to demostrate.
# e.g. PS>.\\writefilename.ps1 c:\\
# call WriteFileName [string]
# after done writing series of overwriting messages, cal... | 0 |
sample_55_44.ps1 | Get-Module | ForEach-Object { Remove-Module -Name $_.Name -Force }
$PSModuleAutoloadingPreference = 'none'
Import-Module Microsoft.PowerShell.Utility
#Enforcing default PSModulePath to avoid getting unexpected modules to run instead of built-in modules
$env:PSModulePath = "C:\Program Files\WindowsPowerShell\Modules... | 0 |
sample_33_3.ps1 | #
# Module manifest for module 'OCI.PSModules.Osuborganizationsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll'
# Version number of this module.
ModuleVersion... | 0 |
sample_7_96.ps1 | [dynamic, provider("dcismprovider")]
class DCIM_TimeService : CIM_TimeService
{
[
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 class, this property allows all instances of ... | 0 |
2798.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(FullName) as CT,
FullName
FROM
*PrefetchListing.tsv
GROUP BY
FullName
ORDER BY
ct
"@
& logparser -stats:off -i:csv -fixedsep:on -dtlines:0 -rtp:-1 $lpquery
} else {
$ScriptName = [System.... | 0 |
7511f2db-9f71-4daf-8971-f1ab6eb2a6af.ps1 | <#
.SYNOPSIS
Send mail to BCC using PowerShell
.DESCRIPTION
This script is a re-developed MSDN Sample using PowerShell. It creates
an email message then sends it with a BCC.
.NOTES
File Name : Send-BCCMail.ps1
Author : Thomas Lee - tfl@psp.co.uk
Requires : PowerShell V2 CTP3
.LINK
O... | 0 |
1146.ps1 |
$cert = $null
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
$cert = Install-Certificate (Join-Path $TestDir CarbonTestCertificate.cer -Resolve) -StoreLocation LocalMachine -StoreName My
}
function Stop-Tes... | 0 |
sample_50_76.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmconfig'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmconfig.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Co... | 0 |
Run-Query (SharePoint)_1.ps1 | function Run-Query($siteUrl, $queryText)
{
[reflection.assembly]::loadwithpartialname("microsoft.sharePOint") | out-null
[reflection.assembly]::loadwithpartialname("microsoft.office.server") | out-null
[reflection.assembly]::loadwithpartialname("microsoft.office.server.search") | out-null
$s = [microsoft.share... | 0 |
Get-Netstat 1,3.ps1 | $null, $null, $null, $null, $netstat = netstat -a -n -o
$ps = Get-Process
[regex]$regexTCP = '(?<Protocol>\\S+)\\s+(?<LAddress>\\S+):(?<LPort>\\S+)\\s+(?<RAddress>\\S+):(?<RPort>\\S+)\\s+(?<State>\\S+)\\s+(?<PID>\\S+)'
[regex]$regexUDP = '(?<Protocol>\\S+)\\s+(?<LAddress>\\S+):(?<LPort>\\S+)\\s+(?<RAddress>\\S+):(?<... | 0 |
3901.ps1 |
function Test-RemoveComputeNodes
{
param([string]$poolId)
$context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext
$deallocationOption = ([Microsoft.Azure.Batch.Common.ComputeNodeRebootOption]::Terminate)
$resizeTimeout = ([TimeSpan]::FromMinutes(8))
... | 0 |
sample_31_18.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 = '73.1.0'
# Supported PSEdition... | 0 |
1dee8949-c4c9-4c6b-8530-45a36de22fdd.ps1 | # For TabExpansion.ps1
# this requires latest TabExpansion.ps1
function Get-PipeLineObject {
$i = -2
$property = $null
do {
$str = $line.Split("|")
# extract the command name from the string
# first split the string into statements and pipeline elements
# This do... | 0 |
541.ps1 |
function Get-SPOGroup
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$name
)
$web = $clientContext.Web
if ($web -ne $null)
{
$groups = $web.SiteGroups
$clientContext.Load($groups)
$clientContext.ExecuteQuery()
$group = $groups | where {$_.Title -eq $name}
return $... | 0 |
Send-HTMLFormattedEmail_5.ps1 | ##################################################
# cmdlets
##################################################
#-------------------------------------------------
# Send-HTMLFormattedEmail
#-------------------------------------------------
# Usage: Send-HTMLFormattedEmail -?
#------------------------------------... | 0 |
3906.ps1 |
function Test-UploadApplicationPackage
{
param([string] $applicationName, [string] $applicationVersion, [string]$filePath)
$context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext
$addAppPack = New-AzBatchApplicationPackage -ResourceGroupName $context... | 0 |
get-DiskVolumeInfo.ps1 | function get-DiskVolumeInfo
{
<#
.SYNOPSIS
Returns information about disk volumes including freespace
.DESCRIPTION
Returns information about disk volumes including freespace
.EXAMPLE
show-InnerException ExceptionObject
Shows the in... | 0 |
sample_11_96.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
param (
[Parameter(Manda... | 0 |
sample_27_71.ps1 | @{
IncludeRules=@('PSProvideCommentHelp',
'PSAvoidUsingWriteHost')
}
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDhIygaFe... | 0 |
sample_58_83.ps1 | "use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { t... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.