filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
sample_47_72.ps1 | #!/usr/bin/env pwsh
<#
.SYNOPSIS
Stub around Invoke-Pester command used by VSCode PowerShell extension.
.DESCRIPTION
The stub checks the version of Pester and if >= 4.6.0, invokes Pester
using the LineNumber parameter (if specified). Otherwise, it invokes
using the TestName parameter (if specif... | 0 |
Out-DataTable_2.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 |
1331.ps1 |
function Get-IdentityPrincipalContext
{
[CmdletBinding()]
[OutputType([DirectoryServices.AccountManagement.PrincipalContext])]
param(
[Parameter(Mandatory=$true)]
[Carbon.Identity]
$Identity
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $... | 0 |
sample_34_49.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... | 0 |
3176.ps1 | function Get-ScheduledTasks {
[cmdletbinding(
DefaultParameterSetName='COM'
)]
param(
[parameter(
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
ValueFromRemainingArguments=$false,
Position=0
)]
[Alias(... | 0 |
sample_54_96.ps1 | #
# Module manifest for module 'OCI.PSModules.Recovery'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Recovery.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEditions
Comp... | 0 |
Script permissions.ps1 | <#
.SYNOPSIS
Applies permissions and roles to vSphere vApps
.DESCRIPTION
Applies permissions and roles to vSphere vApps
-VIServer (Optional, defaults to Development) {FQDN of VCentre Server}
-AppName (Required) {VApp Label}
-ADGroup (Optional) {Domain\\Group_Object}
-Role (Optional) {vSphere Role, ReadO... | 0 |
sample_2_77.ps1 | // Copyright (c) 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
// ==================================================================
// DCIM_RollupStatusCollection
// ==================================================================
[dynamic, provider("dcismprovider"),
Description (
"A cla... | 0 |
sample_61_90.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 = '88.1.0'
# Supported PSEditi... | 0 |
Ping Alert Script_1.ps1 | #Email Alert Parameters
$to = "user@mydomain.com"
$from = "unreachable@mydomain.com"
$smtpserver = "my_exchange_server"
#Array of computers to test
$Computers = ("comp1" , "comp2" , "comp3" , "comp4")
#Variable to hold INT value 0
$zero = 0
Foreach ($Computer in $Computers)
{
if... | 0 |
sample_19_45.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 = '80.0.0'
# Supported PSEdi... | 0 |
sample_29_28.ps1 | $url = $args[0]
Write-Host "Downloading Microsoft Edge"
$wc = New-Object net.webclient
$msiInstaller = "$env:temp\microsoft-edge-stable.msi"
$wc.Downloadfile($url, $msiInstaller)
Write-Host "Installing Microsoft Edge"
$arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $arguments -Wait
... | 0 |
3039.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Should -BeTrue" {
Context "Basic functionality" {
It "given true it passes" {
$true | Should -BeTrue
}
It "given truthy it passes" {
1 | Should -BeTrue
}
... | 0 |
982.ps1 |
$SubscriptionId = ''
$primaryResourceGroupName = "myPrimaryResourceGroup-$(Get-Random)"
$primaryLocation = "westus2"
$secondaryResourceGroupName = "mySecondaryResourceGroup-$(Get-Random)"
$secondaryLocation = "eastus"
$adminSqlLogin = "SqlAdmin"
$password = "ChangeYourAdminPassword1"
$primaryServerName = "primary-... | 0 |
sample_39_7.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 = '80.0.0'
# Supported PSEdi... | 0 |
sample_12_51.ps1 | ConvertFrom-StringData @'
id_kb2475761title=Checking Event Logs
id_kb2475761description=Checking event logs for known issues.
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIB... | 0 |
247.ps1 | function Remove-StringSpecialCharacter
{
[CmdletBinding()]
param
(
[Parameter(ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[Alias('Text')]
[System.String[]]$String,
[Alias("Keep")]
[String[]]$SpecialCharacterToKeep
)
PROCESS
{
... | 0 |
sample_28_53.ps1 | // workaround for https://github.com/microsoft/fast/issues/5675
export function updateProxy(id) {
if (!id) {
return;
}
const element = document.getElementById(id);
if (element && element.form) {
if (element.form.id !== '') {
element.proxy.setAttribute("form", elemen... | 0 |
2157.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(
Mandatory = $true,
ParameterSetName = "Download",
HelpMessage = "Generate a download configuration file for Office."
)]
[ValidateNotNullOrEmpty()]
[switch]$DownloadFile,
[parameter(
Mandatory = $true,
... | 0 |
sample_22_79.ps1 | #
# Module manifest for module 'OCI.PSModules.Secrets'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Secrets.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Compat... | 0 |
DekiWiki Module 1.5.ps1 | ## DekiWiki Module 1.5
#require -version 2.0
## Depends on the HttpRest script-module:
## http :// huddledmasses.org/using-rest-apis-from-powershell-with-the-dream-sdk/
####################################################################################################
## The first of many script cmd... | 0 |
Balance-Datastores_1.ps1 | <# TODO
-Change number of DSTs to is selection of $DSTMostFree to be variable. Also add in logic to select DSTs with lower VMCounts.
Total DSTs Select DSTs
---------- -----------
<5 1
5-20 3
>20 5
-For $DSTLeastFree add in logic to select DSTs with higher VMCounts... | 0 |
1163.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-NewTempDir
{
$tmpDir = New-TempDir
try
{
Assert-DirectoryExists $tmpDir
}
finally
{
Uninstall-Directory -Path $tmpDir -Recurse
}
}
functi... | 0 |
1626.ps1 | < |