filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
MailChimp GetDistributio.ps1 | #Author: Tozzi June 2012
#OriginalAuthor: Ant B 2012
#Purpose: Batch feed recipients to MailChimp
$ie = new-object -com "InternetExplorer.Application"
# Vars for building the URL
$apikey = "api-key-from-mailchimp"
$listid = "list-id-from-mailchimp"
# Important is to use correct MailChimp data centre. In th... | 0 |
sample_40_8.ps1 | #
# Module manifest for module 'OCI.PSModules.Usageapi'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Usageapi.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Comp... | 0 |
4394.ps1 | function New-SoftwareIdentityFromPSGetItemInfo
{
param
(
[Parameter(Mandatory=$true)]
$PSGetItemInfo
)
$SourceLocation = $psgetItemInfo.RepositorySourceLocation
if(Get-Member -InputObject $PSGetItemInfo -Name $script:PSArtifactType)
{
$artifactType = $psgetItemInfo.Type... | 0 |
Set-Domain.ps1 | function Set-Domain {
param( [switch]$help,
[string]$domain=$(read-host "Please specify the domain to join"),
[System.Management.Automation.PSCredential]$credential = $(Get-Credential)
)
$usage = "`$cred = get-credential `n"
$usage += "Set-AvaDomain -domain corp.avanade.org -credential `$cred`n"... | 0 |
Logger_1.psm1 0.2.ps1 | <#
Name : Universal Log4Net Logging Module (Logger.psm1)
Version : 0.3
Author : Joel Bennett (MVP)
Site : http://www.HuddledMasses.org/
Version History:
0.3 - Cleanupable release.
Added Udp, Email, Xml and RollingXml, as well as a "Chainsaw":http`://logging.apache.org/log... | 0 |
sample_4_72.ps1 | ConvertFrom-StringData @'
id_ctskerberos=Kerberos
id_ctskerberosdescription=Collects information about Kerberos using the KList utility.
'@
# SIG # Begin signature block
# MIIoQgYJKoZIhvcNAQcCoIIoMzCCKC8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zU... | 0 |
sample_38_69.ps1 | #
# Module manifest for module 'OCI.PSModules.Accessgovernancecp'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Accessgovernancecp.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Suppo... | 0 |
2853.ps1 | function Invoke-psake {
[CmdletBinding()]
param(
[Parameter(Position = 0, Mandatory = $false)]
[string]$buildFile,
[Parameter(Position = 1, Mandatory = $false)]
[string[]]$taskList = @(),
[Parameter(Position = 2, Mandatory = $false)]
[string]$framework,
... | 0 |
sample_55_22.ps1 | #
# Module manifest for module 'OCI.PSModules.Datacatalog'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datacatalog.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEdition... | 0 |
Paint board.ps1 | function frmMain_Show {
Add-Type -AssemblyName PresentationFramework
$win = New-Object Windows.Window
$ink = New-Object Windows.Controls.InkCanvas
#
#ink
#
$ink.MinWidth = $ink.MinHeight = 450
#
#win
#
$win.Content = $ink
$win.SizeToContent = "WidthAndHeight"
$win.Title = "Paint... | 0 |
sample_50_35.ps1 | $url = $args[0]
Write-Host "Downloading Microsoft Edge Beta"
$wc = New-Object net.webclient
$msiInstaller = "$env:temp\microsoft-edge-beta.msi"
$wc.Downloadfile($url, $msiInstaller)
Write-Host "Installing Microsoft Edge Beta"
$arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $argument... | 0 |
Product key_1.ps1 | from System import Array, Char, Console
from System.Collections import ArrayList
from Microsoft.Win32 import Registry
def DecodeProductKey(digitalProductID):
map = ("BCDFGHJKMPQRTVWXY2346789").ToCharArray()
key = Array.CreateInstance(Char, 29)
raw = ArrayList()
i = 52
while i < 67:
raw... | 0 |
ESXi Config Backup Scrip.ps1 | ###ESXi Configuration Backup Script
#DESCRIPION: This Script takes a CSV file with the hostname, username, and password of a list of ESXi servers, and backs up their configurations to a specified Destination
#USAGE: This script is meant to be run as a regular scheduled task or a pre-script for a backup job. There is ... | 0 |
List AD Attributes_1.ps1 | $forest = [DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
$Schema = $forest.schema
$Properties = $Schema.FindAllProperties()
foreach($property in $Properties)
{
"#################################"
"Name: {0}" -f $property.Name
"Link: {0}" -f $property.link
"LinkID: {0}" -f $prope... | 0 |
sample_7_73.ps1 | ConvertFrom-StringData @'
id_kb2475761title=Checking Event Logs
id_kb2475761description=Checking event logs for known issues.
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIB... | 0 |
sample_52_49.ps1 | <!--xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PowerShell/PowerShell/master/src/Schemas/Format.xsd"?-->
<Configuration>
<ViewDefinitions>
<View>
<Name>default</Name>
<ViewSelectedBy>
<TypeName>PoshSvn.SvnInfoOutp... | 0 |
sample_34_60.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Get-AMTPowerState {
<#
.Synopsis
Returns the system power state
.Description
This Cmdlet returns the system power state from clients that have Intel Active Management Technology(AMT) firmware version 3.2 or higher.
.Note... | 0 |
775.ps1 |
param($FailIfNotSigned = $true)
$releasePath = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\release")
$finalPackagePath = [System.IO.Path]::GetFullPath("$releasePath\FinalPackages")
$binariesToSignPath = [System.IO.Path]::GetFullPath("$releasePath\BinariesToSign")
$unpackedPackagesPath = [System.IO.Path]::GetFu... | 0 |
sample_12_93.ps1 | #
# Module manifest for module 'OCI.PSModules.Vault'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vault.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Compatible... | 0 |
sample_23_7.ps1 | #
# Module manifest for module 'OCI.PSModules.Healthchecks'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditi... | 0 |
sample_46_22.ps1 | #
# Module manifest for module 'OCI.PSModules.Workrequests'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Workrequests.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditi... | 0 |
sample_61_59.ps1 | $waitForTimeSyncScript = "$PSScriptRoot\WaitForTimeSyncBeforeDSC.ps1"
if (Test-Path $waitForTimeSyncScript)
{
# Wait for time on this machine to syncrhonize before we begin the boot-time DSC process.
# This ensures that our transcript times don't get messed up by clock changes during this time.
& $wait... | 0 |
sample_43_67.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 |
3081.ps1 | Given "this feature and scenario" { }
When "(it|the scenario) is executed" { }
Then "the feature name is displayed in the test report" { }
Given "this is a '(?<Outcome>(Passed|Failed(?:Early|Later)))' scenario" {
param($Outcome)
if ($Outcome -eq 'FailedEarly') {
throw "We fail for test by intention in ... | 0 |
3045.ps1 | function Should-Contain($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) {
[bool] $succeeded = $ActualValue -contains $ExpectedValue
if ($Negate) {
$succeeded = -not $succeeded
}
if (-not $succeeded) {
if ($Negate) {
return New-Object psobject -Propert... | 0 |
sample_27_94.ps1 | ConvertFrom-StringData @'
###PSLOC
TestMgmtSubnetPass = Start IP '{0}' and End IP '{1}' on the same subnet
TestMgmtSubnetFail = Start IP '{0}' and End IP '{1}' not on the same subnet
TestMgmtRangeSizePass = IP range within minmum '{0}' and maximum '{1}'
TestMgmtRangeSizeFail = IP range not within minmum '{0}' and ... | 0 |
New-PInvoke.ps1 | function New-PInvoke
{
<#
.Synopsis
Generate a powershell function alias to a Win32|C api function
.Description
Creates C# code to access a C function, and exposes it via a powershell function
.Example
New-PInvoke -Library User32.dll -Signature "int GetSystemMetrics(uint ... | 0 |
sample_58_98.ps1 | @{
GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
FunctionsToExport = @()
CmdletsToExport = "Get-Credential", "Get-ExecutionP... | 0 |
sample_8_35.ps1 | ConvertFrom-StringData @'
id_servicingpendingxml_st=Pending.xml file detected on WinSxS folder
'@
# SIG # Begin signature block
# MIIoLAYJKoZIhvcNAQcCoIIoHTCCKBkCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUA... | 0 |
2720.ps1 |
$ErrorActionPreference = "Continue"
Try {
Push-Location
Set-Location Cert:
ls -r * | Select-Object PSParentPath,FriendlyName,NotAfter,NotBefore,SerialNumber,Thumbprint,Issuer,Subject
} Catch {
("Caught exception: {0}." -f $_)
} Finally {
Pop-Location
} | 0 |
2803.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(Account) as ct,
Account
FROM
*LocalAdmins.tsv
GROUP BY
Account
ORDER BY
ct ASC
"@
& logparser -stats:off -i:csv -dtlines:0 -fixedsep:on -rtp:-1 "$lpquery"
} else {
$ScriptName = [System.I... | 0 |
sample_2_66.ps1 |
PARAM($Format="html")
Import-LocalizedData -BindingVariable AutoRunsString
Write-DiagProgress -Activity $AutoRunsString.ID_AutoRuns -Status $AutoRunsString.ID_AutoRunsObtaining
$OutputFile = $ComputerName + "_Autoruns.*"
$CommandLineToExecute = "cscript.exe Autoruns.VBS /format:$format"
RunCmD -commandToR... | 0 |
SCOM-RunRemoteExecutable.ps1 | # ==============================================================================================
#
# Microsoft PowerShell Source File Ś Created with SAPIEN Technologies PrimalScript 2007
#
# NAME: SCOM-RunRemoteExecutable.ps1
#
# AUTHOR: Jeremy D. Pavleck , Pavleck.NET
# DATE : 9/13/2008
#
# COMMENT: This is ... | 0 |
3046.ps1 | function Should-BeIn($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) {
[bool] $succeeded = $ExpectedValue -contains $ActualValue
if ($Negate) {
$succeeded = -not $succeeded
}
if (-not $succeeded) {
if ($Negate) {
return New-Object psobject -Property @... | 0 |
3980.ps1 |
function Search-AzureRmGraph-Query
{
$queryResult = Search-AzGraph "project id, tags, properties | limit 2"
Assert-IsInstance $queryResult Object[]
Assert-AreEqual $queryResult.Count 2
Assert-IsInstance $queryResult[0] System.Management.Automation.PSCustomObject
Assert-IsInstance $queryResult[1] S... | 0 |
1118.ps1 |
$windowsAuthWasLocked = $false
$windowsAuthConfigPath = 'system.webServer/security/authentication/windowsAuthentication'
$cgiConfigPath = 'system.webServer/cgi'
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
$windowsAu... | 0 |
sample_19_23.ps1 | #************************************************
# DC_DSRegEntries.ps1
# Version 1.1
# Date: 2009-2019, 2022-10-14
# Author: + Walter Eder (waltere@microsoft.com)
# Description: Collects Directory Services Registry Entries
# Called from: TS_AutoAddCommands_DOM.ps1, TS_AutoAddCommands_NET.ps1
#******************... | 0 |
sample_21_0.ps1 | # Copyright Intel Corporation.
#
# This software and the related documents are Intel copyrighted materials,
# and your use of them is governed by the express license under which they
# were provided to you (License). Unless the License provides otherwise,
# you may not use, modify, copy, publish, distribute, discl... | 0 |
Get-SQLDatabaseFreespace.ps1 | ###########################################################################"
#
# NAME: Get-SQLDatabaseFreespace.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jan.egil.ring@powershell.no
#
# COMMENT: Requires SQL Server 2008 Management Studio Express. The script gets free space from the specified SQL Database
# ... | 0 |
sample_17_76.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 |
3102.ps1 |
param(
[Parameter(Mandatory=$true)]
[ValidateScript({ Test-Path $_ })]
[string]$sourceFolder
)
$savedProgressPreference = $global:ProgressPreference
$global:ProgressPreference = 'SilentlyContinue'
$tempDir = [System.IO.Path]::GetTempPath()
$panDocVersion = "2.7.3"
$pandocSourceURL = "https://github.... | 0 |
2311.ps1 |
$userName = 'adbertram@gmail.com'
$password = 'Ilikegmail.'
Add-Type -Path "C:\Program Files (x86)\Google\Google Data API SDK\Redist\Google.GData.Client.dll"
Add-Type -Path "C:\Program Files (x86)\Google\Google Data API SDK\Redist\Google.GData.Extensions.dll"
Add-Type -Path "C:\Program Fil... | 0 |
sample_31_90.ps1 | <#
.SYNOPSIS
Script that installs the Wix Toolset
.DESCRIPTION
This script installs the Wix Toolset and it's dependency .Net Framework 3.5
.EXAMPLE
install_wix.ps1
#>
param(
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD
)
#------------------... | 0 |
sample_34_77.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 = '79.0.0'
# Supported PSEdition... | 0 |
4432.ps1 | function Find-Module {
[CmdletBinding(HelpUri = 'https://go.microsoft.com/fwlink/?LinkID=398574')]
[outputtype("PSCustomObject[]")]
Param
(
[Parameter(ValueFromPipelineByPropertyName = $true,
Position = 0)]
[ValidateNotNullOrEmpty()]
[string[]]
$Name,
... | 0 |
sample_33_28.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 = '82.0.0'
# Supported P... | 0 |
Boots Hierarchical Bind.ps1 | ######## CSV DATA #############
# Save the following data to a csv.
City,Team
"Los Angeles","Lakers"
"Los Angeles","Clippers"
"New York","Knicks"
"New York","Liberty"
"Sacramento","Kings"
######## CODE #################
$teams = Import-Csv "C:\\testdata.csv"
[array]$cities = $teams | %{$_.City} ... | 0 |
Get-WarningsAndErrors.ps.ps1 | ##############################################################################\n##\n## Get-WarningsAndErrors\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nDe... | 0 |
sample_30_38.ps1 | #
# Module manifest for module 'OCI.PSModules.Healthchecks'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditi... | 0 |
Validate SPN Mappings.ps1 | ###########################################################################"
#
# NAME: SPNValidation.psm1
#
# AUTHOR: Jan Egil Ring
# BLOG: http://blog.crayon.no/blogs/janegil
#
# COMMENT: Script module for validating SPN mappings.
# For installation instructions and sample usage, see the following blo... | 0 |
1893.ps1 |
Describe "ConvertFrom-SddlString Tests" -Tags "CI", "RequireAdminOnWindows" {
BeforeAll {
if (-not $IsWindows) { return }
$sddl = (Get-Item -Path WSMan:\localhost\Service\RootSDDL).Value
$testCases = @(
@{ Type = "_UNSPECIFIED_" }
@{ Type = "FileSystemRights" }
... | 0 |
506.ps1 |
function Update-PPEventLog{
param(
)
Get-PPConfiguration $PSconfigs.EventLog.Filter | %{$_.Content.EventLog} | %{
$EventLog = Get-WmiObject win32_nteventlogfile -filter "filename='$($_.Name)'"
if(-not ($EventLog)){
Write-Host "Create event log: $($_.Name)"
New-EventLog -LogName... | 0 |
sample_0_4.ps1 | ConvertFrom-StringData @'
id_repadmin=RepAdmin Log Files
id_repadminobtaining=Running RepAdmin tool and obtaining output
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBA... | 0 |
997.ps1 | Param(
[parameter(Mandatory=$true)]
$CsvFilePath
)
$ErrorActionPreference = "Stop"
$scriptsPath = $PSScriptRoot
if ($PSScriptRoot -eq "") {
$scriptsPath = "."
}
. "$scriptsPath\asr_logger.ps1"
. "$scriptsPath\asr_common.ps1"
. "$scriptsPath\asr_csv_processor.ps1"
Function ProcessItemImpl($processor, $cs... | 0 |
sample_35_41.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 = '77.0.0'
# Supported... | 0 |
POC csharp expressions_1.ps1 | function run-csharpexpression([string] $expression )
{
$local:name = [system.guid]::NewGuid().tostring().replace('-','_').insert(0,"csharpexpr")
$local:template = @"
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
namespace ShellTools.DynamicCSharpExpression.N[[COUNTER]]
{... | 0 |
990.ps1 | Param(
[parameter(Mandatory=$true)]
$CsvFilePath
)
$ErrorActionPreference = "Stop"
$scriptsPath = $PSScriptRoot
if ($PSScriptRoot -eq "") {
$scriptsPath = "."
}
. "$scriptsPath\asr_logger.ps1"
. "$scriptsPath\asr_common.ps1"
. "$scriptsPath\asr_csv_processor.ps1"
Function CheckParameter($logger, [string... | 0 |
sample_19_73.ps1 | #
# Module manifest for module 'OCI.PSModules.Core'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Core.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
CompatiblePS... | 0 |
2778.ps1 |
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=0)]
[String]$FileNamePattern
)
function Get-Files {
Param(
[Parameter(Mandatory=$True,Position=0)]
[String]$FileNamePattern
)
Write-Verbose "Entering $($MyInvocation.MyCommand)"
Write-Verbose "Looking for files matching use... | 0 |
3679.ps1 |
$samplePrivateBlobNoPassword = "MIIJ+QIBAzCCCbUGCSqGSIb3DQEHAaCCCaYEggmiMIIJnjCCBhcGCSqGSIb3DQEHAaCCBggEggYEMIIGADCCBfwGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAgUeBd7F2KZUwICB9AEggTYSRi88/Xf0EZ9smyYDCr+jHa7a/510s19/5wjqGbLTT/CYBu2qSOhj+g9sNvjj5oWAcluaZ4XCl/oJhXlB+9q9ZYSC6pPhma7/Il+/zlZm8ZUMfg... | 0 |
sample_21_51.ps1 | #
# Module manifest for module 'OCI.PSModules.Fusionapps'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Fusionapps.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
... | 0 |
Update VM Tools.ps1 | ########################################################
#connect to VirtualCenter server (i.e. virtual-center-1)
if ($args[0] -eq $null)
{$hostName = Read-Host "What host do you want to connect to?"}
else
{$hostName = $args[0]}
#connect to selected Virtualcenter or host server
Connect-VIServer $hostName
... | 0 |
3330.ps1 |
function Get-PendingCommand {
[PoshBot.BotCommand(
Aliases = ('pending', 'pendingcommands')
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot
)
$contexts = $Bot.DeferredCommandExecutionContexts.Values
if ($contexts.Count -gt 0) {
$expireMinutes =... | 0 |
sample_39_63.ps1 | "use strict";(self.webpackChunk_ad_qx_lc_designer=self.webpackChunk_ad_qx_lc_designer||[]).push([[7319],{77319:function(w,i,n){n.r(i),n.d(i,{conf:function(){return y},language:function(){return k}});var l=n(90082);var d=Object.defineProperty,p=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,u=Object.protot... | 0 |
sample_47_21.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.SYNOPSIS
Starts the language and debug services from the PowerShellEditorServices module.
.DESCRIPTION
PowerShell Editor Services Bootstrapper Script
----------------------------------------------
This script contains... | 0 |
4328.ps1 | function Get-DynamicParameters
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[Uri]
$Location,
[Parameter(Mandatory=$true)]
[REF]
$PackageManagementProvider
)
$paramDictionary = New-Object System.Managemen... | 0 |
1945.ps1 |
Describe "Export-FormatData" -Tags "CI" {
BeforeAll {
$fd = Get-FormatData
$testOutput = Join-Path -Path $TestDrive -ChildPath "outputfile"
}
AfterEach {
Remove-Item $testOutput -Force -ErrorAction SilentlyContinue
}
It "Can export all types" {
try
{
... | 0 |
sample_5_30.ps1 | ConvertFrom-StringData @'
id_depdisabled4gbcheck=Checking if DEP settings
id_depdisabled4gbcheckdesc=Checking if Data Execution Protection is enabled
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63... | 0 |
Find-String_2.ps1 | <#
.Synopsis
Searches text files by pattern and displays the results.
.Description
Searches text files by pattern and displays the results.
.Notes
Based on versions from http://weblogs.asp.net/whaggard/archive/2007/03/23/powershell-script-to-find-strings-and-highlight-them-in-the-output.aspx and from http://pos... | 0 |
Get-ImageMetaData.ps1 | ## Get-ImageMetaData -- pull EXIF, XMP, and other data from images using the BitmapMetaData
## Usage: ls *.jpg | Get-ImageMetaData | ft Length, LastWriteTime, Name, "36867"
## Note that '36867' is the decimal value of (0x9003) the EXIF tag for DateTimeOriginal
## For more information see: http://owl.phy.queen... | 0 |
2524.ps1 |
function SQL-Query{
param([string]$Query,
[string]$SqlServer = $DEFAULT_SQL_SERVER,
[string]$DB = $DEFAULT_SQL_DB,
[string]$RecordSeparator = "`t")
$conn_options = ("Data Source=$SqlServer; Initial Catalog=$DB;" + "Integrated Security=SSPI")
$conn = New-Object System.Data.SqlClient.SqlConnection($... | 0 |
3956.ps1 |
function Check-CmdletReturnType
{
param($cmdletName, $cmdletReturn)
$cmdletData = Get-Command $cmdletName;
Assert-NotNull $cmdletData;
[array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") ... | 0 |
sample_6_0.ps1 | ConvertFrom-StringData @'
id_symantecipscheck=Symantec Intrusion Prevention System (IPS)
id_symantecipscheckdesc=Checking if Symantec Intrusion Prevention System (IPS) is installed
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEA... | 0 |
ConvertFrom-Property_3.ps1 | function ConvertFrom-PropertyString {
<#
.SYNOPSIS
Converts data from flat or single-level property files into PSObjects
.DESCRIPTION
Converts delimited string data such as .ini files, or the format-list output of PowerShell, into objects
.EXAMPLE
netsh http show sslcert | join-string "`n" |
Conver... | 0 |
sample_7_62.ps1 | # Load Common Library
# Load Reporting Utilities
#_#$debug = $false
. ./utils_cts.ps1
. ./TS_RemoteSetup.ps1
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.S... | 0 |
sample_4_11.ps1 | # Copyright ?2009, 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 |
Findup_21.ps1 | using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.IO;
using System.Text.RegularExpressions;
namespace Findup
{
public class FileLengthComparer : I... | 0 |
sample_4_21.ps1 | O연결 문자열에서 매시업 세그먼트를 찾을 수 없기 때문에 데이터 원본을 Power BI 형식에서 AS Engine 형식으로 변환하지 못했습니다.M연결 문자열에서 위치 세그먼트를 찾지 못했기 때문에 데이터 원본을 Power BI 형식에서 AS Engine 형식으로 변환하지 못했습니다.H압축을 해제한 후 패키지를 로드하지 못했기 때문에 데이터 원본을 Power BI 형식에서 AS 엔진 형식으로 변환하지 못했습니다.[압축을 해제한 후 패키지가 너무 커서 로드하지 못한 것으로 확인되었기 때문에 데이터 원본을 Power BI 형식에서 AS Engine 형식으로 변환하지 못했습... | 0 |
Get-FreeDiskSpace.ps1 | <#
.SYNOPSIS
Return free space on disk
.DESCRIPTION
This script works in conjunction with an Event Trigger on the System
event on our file servers. This script queries the System log for
EventID 2013, and returns the drive letter from the most recent
event.
... | 0 |
sample_11_84.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplace'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplace.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEdition... | 0 |
sample_58_77.ps1 | #
# Module manifest for module 'OCI.PSModules.Database'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Database.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEditions
Comp... | 0 |
3548.ps1 |
function Test-AzureVMGetJobs
{
$location = Get-ResourceGroupLocation
$resourceGroupName = Create-ResourceGroup $location
try
{
$vm1 = Create-VM $resourceGroupName $location 1
$vault = Create-RecoveryServicesVault $resourceGroupName $location
Enable-Protection $vault $vm1
$startDate1 ... | 0 |
Get-HtmlHelp_1.ps1 | Hello
I contact you a few weeks ago to inquire as to the possibility of sponsoring guest posts on your website: http://huddledmasses.org. I wanted to follow up again to see if there was any interest.
We will research and write quality unique content and pay to have it published to your readers. No spam, and no ... | 0 |
Lock close button.ps1 | $code = @'
using System;
using System.Runtime.InteropServices;
namespace CloseButtonToggle {
internal static class WinAPI {
[DllImport("kernel32.dll")]
internal static extern IntPtr GetConsoleWindow();
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static e... | 0 |
sample_56_8.ps1 | #
# Module manifest for module 'OCI.PSModules.Accessgovernancecp'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Accessgovernancecp.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Suppo... | 0 |
sample_51_18.ps1 | #
# Module manifest for diagnostics for network controller
#
# Copyright="© Microsoft Corporation. All rights reserved."
#
@{
# ID used to uniquely identify this module
GUID = 'd6df305a-d5c8-4ad6-9161-5ee6ba44b501'
# Author of this module
Author = 'Microsoft Corporation'
# Company or vendor of this mo... | 0 |
957.ps1 |
$apiVersion = "2015-04-08"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "database1"
$collectionName = "collection1"
$accountResourceName = $accountName + "/mongodb/"
$databaseResourceName = $accountName + "/mongodb/" + $databaseName
$databaseResourceType = "Microsoft.Documen... | 0 |
sample_38_42.ps1 | #
# Module manifest for module 'OCI.PSModules.Databasemanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Databasemanagement.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Suppo... | 0 |
Out-DataTable_1.ps1 | #######################
<#
.SYNOPSIS
Creates a DataTable for an object
.DESCRIPTION
Creates a DataTable based on an objects properties.
.INPUTS
Object
Any object can be piped to Out-DataTable
.OUTPUTS
System.Data.DataTable
.EXAMPLE
$dt = Get-Alias | Out-DataTable
This example creates a DataTable fro... | 0 |
1818.ps1 |
Describe "Split-Path" -Tags "CI" {
It "Should return a string object when invoked" {
$result = Split-Path .
$result | Should -BeOfType String
$result = Split-Path . -Leaf
$result | Should -BeOfType String
$result = Split-Path . -Resolve
$result | Should -BeOfType... | 0 |
sample_2_96.ps1 | @{
GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @('MSFT_MpPerformanceRecording.psm1')
FormatsToProcess = @(... | 0 |
sample_8_32.ps1 | ConvertFrom-StringData @'
id_fcinfo=Fibre Channel Information
id_fcinforunning=Running Fibre Channel Information Tool (FCInfo)
id_fcinfooutput=FCInfo Output
id_fcinfooutputdesc=Fibre Channel Information Tool (FCInfo) output
'@
# SIG # Begin signature block
# MIIoUAYJKoZIhvcNAQcCoIIoQTCCKD0CAQExDzANBglghkgBZQME... | 0 |
sample_37_45.ps1 | # Downloading specified vulkan sdk and vulkan runtime
# Touch this file needs update both WINDOWS_X64_BUILD_TAG WINDOWS_X64_TEST_TAG
# This file needs run in administrator mode
$env:VULKAN_SDK_VERSION="1.3.211.0"
$ProgressPreference = "SilentlyContinue"
# Save environment VULKAN_SDK_VERSION to system
[System.Environ... | 0 |
1496.ps1 |
function Assert-Equal
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
[object]
$Expected,
[Parameter(Position=1)]
[object]
$Actual,
[Parameter(Position=2)]
[string]
$Message,
[Sw... | 0 |
4327.ps1 | function Set-InstalledModulesVariable
{
$script:PSGetInstalledModules = [ordered]@{}
$modulePaths = @($script:ProgramFilesModulesPath, $script:MyDocumentsModulesPath)
foreach ($location in $modulePaths)
{
$GetChildItemParams = @{
Path = $location
Recurse =... | 0 |
1953.ps1 |
Describe "ConvertTo--SecureString" -Tags "CI" {
Context "Checking return types of ConvertTo--SecureString" {
It "Should return System.Security.SecureString after converting plaintext variable"{
$PesterTestConvert = (ConvertTo-SecureString "plaintextpester" -AsPlainText -force)
$PesterTestCo... | 0 |
1372.ps1 |
function Get-CIisAppPool
{
[CmdletBinding()]
[OutputType([Microsoft.Web.Administration.ApplicationPool])]
param(
[string]
$Name
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
$mgr = New-O... | 0 |
sample_9_41.ps1 | # Localized 10/16/2024 05:34 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=예(&Y)
PromptNoString=아니요(&N)
BundleFound=찾은 번들: {0}
PackageFound=찾은 패키지: {0}
EncryptedBundleFound=암호화된 번들 찾음: {0}
EncryptedPackageFound=암호화된 패키지 찾음: {0}
Certificat... | 0 |
sample_2_97.ps1 | ConvertFrom-StringData @'
id_printerkb2457866check=Checking for KB 2457866
id_printerkb2457866checkdesc=Checking for Event 602 on Microsoft-Windows-PrintService/Admin Event Log
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3A... | 0 |
sample_34_92.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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.