filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
ConvertTo-PseudoType_1.ps1 | function ConvertTo-PseudoType {
<#
.Synopsis
Converts objects to custom PSObjects with robust type support
.Parameter TypeName
The name(s) of the PseudoType(s) to be inserted into the objects for the sake of formatting
.Parameter Mapping
A Hashtable of property names to types (or conversion scripts)
.P... | 0 |
sample_12_37.ps1 | #
# Module manifest for module 'OCI.PSModules.Ospgateway'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ospgateway.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
... | 0 |
sample_52_75.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Get-AMTIDER {
<#
.Synopsis
Lists the Intel Active Management Technology IDE redirection sessions
.Description
This CmdLet lists the Intel Active Management Technology (AMT) IDE redirection (IDER) sessions.
.Notes
S... | 0 |
2378.ps1 |
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline,
ValueFromPipelineByPropertyName)]
[string]$Computername = 'localhost'
)
begin {
Set-StrictMode -Version Latest
}
process {
try {
$WmiResult = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $ComputerName
$LastBoot = $WmiResult.ConvertToDateTi... | 0 |
Deleted-ObjectsAD_2.ps1 | param(
$Domen,
[string[]]$ObjectsDeleted
)
function Ping ($Name){
$ping = new-object System.Net.NetworkInformation.Ping
if ($ping.send($Name).Status -eq "Success") {$True}
else {$False}
trap {Write-Verbose "Error Ping"; $False; continue}
}
[string[]]$ObjectPath
[string[]]$Disks
[string[]]... | 0 |
sample_60_25.ps1 | #
# Module manifest for module 'Az.Functions'
#
# Generated by: Microsoft Corporation
#
# Generated on: 7/4/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.Functions.psm1'
# Version number of this module.
ModuleVersion = '4.1.0'
# Supported PSEditions
... | 0 |
sample_57_58.ps1 | <#
.SYNOPSIS
Data collection tool for printing-related troubleshooting by Marius Porcolean (maporcol).
.DESCRIPTION
The Print-Collect.ps1 script simplifies the collection of Printing related troubleshooting
data, making action plans easier. The tool is compliant with company policies, is signed &
pu... | 0 |
3235.ps1 |
class ApprovalConfiguration {
[int]$ExpireMinutes
[System.Collections.ArrayList]$Commands
ApprovalConfiguration() {
$this.ExpireMinutes = 30
$this.Commands = New-Object -TypeName System.Collections.ArrayList
}
[hashtable]ToHash() {
$hash = @{
ExpireMinutes = $t... | 0 |
3242.ps1 |
class PluginException : Exception {
PluginException() {}
PluginException([string]$Message) : base($Message) {}
}
class PluginNotFoundException : PluginException {
PluginNotFoundException() {}
PluginNotFoundException([string]$Message) : base($Message) {}
}
class PluginDisabled : PluginException {
... | 0 |
Get-Installed.ps1 | function Get-Installed
{
<#
.SYNOPSIS
This function lists data found in the registry associated with installed programs.
.DESCRIPTION
Describe the function in more detail
Author: Stan Miller
.EXAMPLE
Get all apps whose display names start with a specific string and display all valuenam... | 0 |
2308.ps1 |
[CmdletBinding()]
param (
[string[]]$OrderNumber,
[string]$SpSiteUrl = 'https://sharepointsite.domain.local',
[ValidateScript({
if (Test-Connection -ComputerName $_ -Quiet -Count 2) {
throw "The Sharepoint server '$SpServer' appears offline"
} else {
$true
}
})]
[string]$SpServer = 'spserver.domain.lo... | 0 |
Export-PSCredential_5.ps1 | # Author: Hal Rottenberg <hal@halr9000.com>
# Url: http://halr9000.com/article/tag/lib-authentication.ps1
# Purpose: These functions allow one to easily save network credentials to disk in a relatively
# secure manner. The resulting on-disk credential file can only [1] be decrypted
# by the same user account... | 0 |
1281.ps1 |
function Test-CGroupMember
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[string]
$GroupName,
[Parameter(Mandatory=$true)]
[string]
$Member
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdl... | 0 |
3431.ps1 | [CmdletBinding()]
Param(
[Parameter(Mandatory=$True, Position=0)]
[String]$Version,
[Parameter(Mandatory=$False, Position=1)]
[String]$Folder
)
function SetCommandsCommonVersion([string]$FilePath, [string]$Version)
{
$powershellCs = Join-Path $FilePath "Common\Commands.Common\AzurePowerShell.cs"
Write-Output ... | 0 |
LocalAdminGUI.ps1 | Add-Type -AssemblyName PresentationCore
Add-Type -AssemblyName PresentationFramework
[xml]$XAML = @'
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="316" MinWidth="316" MaxWidth="316"
Title="Local Admins To... | 0 |
sample_13_81.ps1 | $FileToCollect = Join-Path $Env:windir "system32\catroot2\dberr.txt"
$SectionDescription = "Catalog registration files"
$FileDescription = "SP Catalog Logging file"
Import-LocalizedData -BindingVariable DCStrings
Write-DiagProgress -activity $DCStrings.ID_DBErrCollecting -status $DCStrings.ID_DBErrCollectingDes... | 0 |
sample_4_31.ps1 | #************************************************
# DC_CollectSqllogs.ps1
# Version 1.0.0
# Date: 10-2011
#
# Description:
# Collects SQL Server errorlogs and SQL Server Agent logs for all installed instances passed to script via the $Instances parameter
# Can operate in "offline" mode where errorlog files ... | 0 |
sample_18_12.ps1 | Add-AppxPackage
exit
cd C:\Users\sampler-win_10_x64\Desktop\
Get-AppxPackage >apps.tx
cd C:\Users\sampler-win_10_x64\Desktop\
Get-AppxPackage -allusers | Select Name, PackageFullName > apps_v2.txt
Get-AppxPackage | Select Name, PackageFullName > apps_v2.txt
Get-AppxPackage
Get-AppxPackage -Online
Get-AppxPacka... | 0 |
1074.ps1 |
& (Join-Path -Path $PSScriptRoot 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'Read-File' {
$file = ''
function Lock-File
{
param(
$Seconds
)
Start-Job -ScriptBlock {
$file = [IO.File]::Open($using:file, 'Open', 'Read'... | 0 |
1339.ps1 |
function Write-IisVerbose
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,Position=0)]
[string]
$SiteName,
[string]
$VirtualPath = '',
[Parameter(Position=1)]
[string]
$Name,
[Parameter(Position=2)]
[stri... | 0 |
sample_14_15.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Microsoft.PowerShell.Utility\Import-LocalizedData -BindingVariable Strings -FileName Strings -ErrorAction Ignore
Microsoft.PowerShell.Management\Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 | ForEach-Object {
. $PSItem.FullName
}
... | 0 |
26.ps1 | . $PSScriptRoot\Shared.ps1
function GetMacOSAdjustedTempPath($Path) {
if (($PSVersionTable.PSVersion.Major -ge 6) -and $IsMacOS) {
return "/private${Path}"
}
$Path
}
Describe 'Get-GitDiretory Tests' {
Context "Test normal repository" {
BeforeAll {
[System.Diagnost... | 0 |
3032.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Should -FileContentMatchMultiline" {
Context "when testing file contents" {
Setup -File "test.txt" "this is line 1$([System.Environment]::NewLine)this is line 2$([System.Environment]::NewLine)Pester is awesome"
It "retu... | 0 |
Get-DefragAnalysis_1.ps1 | # defrag_analysis.ps1
#
# Displays Defrag Analysis Info for a remote server.
#
# Author: tojo2000@tojo2000.com
Set-PSDebug -Strict`
trap [Exception] {
continue
}
function GenerateForm {
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null
[reflection.assembly]::loadwithpartialname(... | 0 |
sample_55_42.ps1 | """
Microsoft IIS site management via WebAdministration powershell module
:maintainer: Shane Lee <slee@saltstack.com>, Robert Booth <rbooth@saltstack.com>
:platform: Windows
:depends: PowerShell
:depends: WebAdministration module (PowerShell) (IIS)
.. versionadded:: 2016.3.0
"""
import decimal
im... | 0 |
ConvertTo-JaggedObjects.ps1 | function ConvertTo-JaggedObjects {
###################################################################################################
# .Synopsis
# Convert a hashtable full of arrays into formattable objects
# .Description
# When you have multiple arrays that you need to somehow group together for output, C... | 0 |
sample_10_25.ps1 | ConvertFrom-StringData @'
id_bpastarting=Starting Best Practices Analyzer
id_bparunning=Running Best Practices Analyzer
id_bpagenerating=Generating BPA Output
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8... | 0 |
sample_3_56.ps1 | ConvertFrom-StringData @'
id_surfacepro3detectfirmwareversions=Detect Surface Pro 3 Firmware Versions
id_surfacepro3detectfirmwareversionsdesc=Detected Surface Pro 3 Firmware Versions Update Needed
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEE... | 0 |
1819.ps1 |
Import-Module (Join-Path -Path $PSScriptRoot '..\Microsoft.PowerShell.Security\certificateCommon.psm1')
Describe "Set/New/Remove-Service cmdlet tests" -Tags "Feature", "RequireAdminOnWindows" {
BeforeAll {
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
if ( -not $IsWindows ) ... | 0 |
Get Twitter RSS Feed_7.ps1 | param ([String] $ScreenName)
$client = New-Object System.Net.WebClient
$idUrl = "https://api.twitter.com/1/users/show.json?screen_name=$ScreenName"
$data = $client.DownloadString($idUrl)
$start = 0
$findStr = '"id":'
do {
$start = $data.IndexOf($findStr, $start + 1)
if ($start -gt 0) {
$s... | 0 |
sample_35_32.ps1 | #
# Add-AppxDevPackage.ps1 is a PowerShell script designed to install app
# packages created by Visual Studio for developers. To run this script from
# Explorer, right-click on its icon and choose "Run with PowerShell".
#
# Visual Studio supplies this script in the folder generated with its
# "Prepare Package" c... | 0 |
sample_18_74.ps1 | #
# Module manifest for module 'OCI.PSModules.Waf'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waf.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
4439.ps1 | function Download-Package
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]
$FastPackageReference,
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]
$Location
)
Write-Debug ($L... | 0 |
NTFS ACLs Folder Tree.ps1 | #######################################
# TITLE: listACL.ps1 #
# AUTHOR: Santiago Fernandez Mu±oz #
# #
# DESC: This script generate a HTML #
# report show all ACLs asociated with #
# a Folder tree structure starting in #
# root specified by the user #
#######... | 0 |
sample_27_27.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.1.0'
# Suppo... | 0 |
ScheduleGPOBackups_2.ps1 | Import-Module grouppolicy
#region ConfigBlock
# What domain are we going to backup GPOs for?
$domain = "mydomain.com"
# Where are we going to store the backups?
$gpoBackupRootDir = "c:\\gpoBackups"
# As I plan to do a new backup set each month I'll setup the directory names to reflect
# the year and month in a n... | 0 |
sample_6_52.ps1 | #************************************************
# TS_ClusterXsigoDriverNetworkCheck.ps1
# Version 1.0.1
# Date: 6/5/2012
# Author: v-kaw
# Description: [Idea ID 2169] [Windows] Xsigo network host driver can cause Cluster disconnects
# Rule number: 2169
# Rule URL: http://sharepoint/sites/rules/Rule Submissi... | 0 |
ConvertTo-CliXml.ps1 | function ConvertTo-CliXml {
param(
[parameter(position=0,mandatory=$true,valuefrompipeline=$true)]
[validatenotnull()]
[psobject]$object
)
begin {
$type = [type]::gettype("System.Management.Automation.Serializer")
$ctor = $type.getconstructor("instance,nonpubl... | 0 |
1389.ps1 |
function Test-CPermission
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$Path,
[Parameter(Mandatory=$true)]
[string]
$Identity,
[Parameter(Mandatory=$true)]
[string[]]
$P... | 0 |
Brushes_1.ps1 | $frmMain_OnLoad= {
$m_BrushSize = New-Object Drawing.Rectangle(0, 0, $picDemo.Width, $picDemo.Height)
$wm = [Drawing.Drawing2D.WrapMode]
$cboWraM.Items.AddRange(@($wm::Clamp, $wm::Tile, $wm::TileFlipX, $wm::TileFlipY, $wm::TileFlipXY))
$cboWraM.SelectedIndex = 0
[int]$maxHatchStyle = 53
for ($i ... | 0 |
sample_58_40.ps1 | param(
[Parameter(Mandatory = $true)][string] $InputPath, # Full path to directory where NuGet packages to be checked are stored
[Parameter(Mandatory = $true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation
[Parameter(Mandatory = $true)][string] $DotnetSymbol... | 0 |
sample_46_24.ps1 | #
# Module manifest for module 'OCI.PSModules.Osmanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osmanagement.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditi... | 0 |
OpsMgr.psd1.ps1 | <#
#Run the following code to create OpsMgr module
#To Use run import-module OpsMgr; Start-OperationsManagerClientShell -ManagementServerName: "" -PersistConnection: $true -Interactive: $true;
if (-not (test-path $home\\Documents\\WindowsPowerShell\\Modules\\OpsMgr))
{new-item $home\\Documents\\WindowsPowerShell\... | 0 |
4131.ps1 |
[CmdletBinding()]
param
(
[switch]$ActiveDirectory,
[switch]$NetworkShare,
[string]$NetworkSharePath,
[switch]$SCCMBitlockerPassword,
[switch]$SCCMReporting
)
Import-Module ActiveDirectory
Function Get-BitLockerRecoveryKeyId {
[cmdletBinding()]
Param (
[Parameter(Mandatory = $false, ValueFromPipeLine... | 0 |
466.ps1 |
$TypeAliasTable = @{
PSFComputer = "PSFramework.Parameter.ComputerParameter"
PSFComputerParameter = "PSFramework.Parameter.ComputerParameter"
PSFDateTime = "PSFramework.Parameter.DateTimeParameter"
PSFDateTimeParameter = "PSFramework.Parameter.DateTimeParameter"
PSFEncoding = "PSFramework.Parame... | 0 |
sample_21_54.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_58_19.ps1 | #
# Module manifest for module 'OCI.PSModules.Jms'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jms.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
Find-AmazonBook.ps1 | ## Requires HttpRest http://poshcode.org/691
## Add-Module HttpRest ##Or:## . HttpRest.ps1
## YOU MUST Provide an Amazon Web Services key (AWSKey) and a $Book title
####################################################################################################
Set-HttpDefaultUrl "http://ecs.amazonaws.com/onca/... | 0 |
sample_6_99.ps1 | # Script: tss_ExportVPNProfiles.ps1
#region ::::: Script Input PARAMETERS :::::
#$ScriptVer="1.01" #Date: 2024-03-21
[CmdletBinding()]param(
[Parameter(Mandatory=$true, Position=0)] [String] $PrefixTime,
[Parameter(Mandatory=$true, Position=1)] [string] $TssPhase
)
function CollectNET_VpnProfiles {
# Get VPN... | 0 |
sample_42_17.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 = '79.0.0'
# Supported P... | 0 |
2149.ps1 |
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
using namespace System.Collections
using namespace System.Collections.Generic
class CompletionTestResult
{
[string]$CompletionText
[string]$ListItemText
[CompletionResultType]$ResultType
[string]$Too... | 0 |
sample_3_26.ps1 | ConvertFrom-StringData @'
id_citrixappsensecheck=Checking the presence of Citrix AppSense
id_citrixappsensecheckdesc=Checking if Citrix AppSense is installed on machine
id_citrixappsensecheckrs=Appsense application with EM 8.1 was detected in conjunction with Citrix Servers. This may cause logoff and disconnect issu... | 0 |
New-XVM_12.ps1 | #Example
#New-XVM -ComputerName HYPERVSVR02 -Name "TLG-INET2" -SwitchName "External(192.168.1.0/24)" -VhdType Differencing -ParentVhdPath 'D:\\vhds\\Windows #Server 2012 RC Base.vhdx'
Function New-XVM
{
[cmdletbinding()]
Param
(
[Parameter(Mandatory=$false,Position=1)]
[string]$Co... | 0 |
sample_3_71.ps1 | #$debug = $false
# Load Common Library:
. ./utils_cts.ps1
# Load DSD Common Function Library
. ./utils_DSD.ps1
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo... | 0 |
sample_47_89.ps1 | #
# Module manifest for module 'OCI.PSModules.Aianomalydetection'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aianomalydetection.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Suppo... | 0 |
sample_56_78.ps1 | #
# Module manifest for module 'Az.Relay'
#
# Generated by: Microsoft Corporation
#
# Generated on: 23/04/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.Relay.psm1'
# Version number of this module.
ModuleVersion = '2.0.1'
# Supported PSEditions
Compa... | 0 |
sample_67_54.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmtraces'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmtraces.dll'
# Version number of this module.
ModuleVersion = '90.0.0'
# Supported PSEditions
Co... | 0 |
1831.ps1 |
Describe "Tests for New-PSDrive cmdlet." -Tag "CI","RequireAdminOnWindows" {
Context "Validate New-PSDrive Cmdlet with -Persist switch." {
BeforeEach {
$UsedDrives = Get-PSDrive | Select-Object -ExpandProperty Name
$PSDriveName = 'D'..'Z' | Where-Object -FilterScript {$_ -notin $... | 0 |
447.ps1 | Register-PSFConfigValidation -Name "credential" -ScriptBlock {
param (
$Value
)
$Result = New-Object PSObject -Property @{
Success = $True
Value = $null
Message = ""
}
try
{
if ($Value.GetType().FullName -ne "System.Management.Automation.PSCredential")
{
$Result.Message = "Not a credential: $Va... | 0 |
sample_25_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubsubscription.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported... | 0 |
sample_25_34.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydataplane.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Support... | 0 |
sample_67_10.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 |
2629.ps1 | function Copy-SQLAgentJob{
param([string]$Source
,[string[]]$Targets
,[string]$JobName)
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null
$smosource = New-Object Microsoft.SqlServer.Management.Smo.Server $Source
$JobScript = $smosource.JobServer.... | 0 |
1884.ps1 |
Describe "ConvertFrom-StringData DRT Unit Tests" -Tags "CI" {
It "Should able to throw error when convert invalid line" {
$str =@"
abc
def=content of def
"@
{ ConvertFrom-StringData $str } | Should -Throw -ErrorId "InvalidOperation,Microsoft.PowerShell.Commands.ConvertFromStringDataCommand"
... | 0 |
Invoke-MoveRequest.ps1 | ###########################################################################
#
# NAME: Invoke-MoveRequest.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jer@powershell.no
#
# COMMENT: Script to use when migrating mailboxes to Microsoft Exchange Server 2010 Cross-Forest. Prepares user objects already
# moved to... | 0 |
3313.ps1 |
function Enable-Plugin {
[PoshBot.BotCommand(
Aliases = 'enableplugin',
Permissions = 'manage-plugins'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string]$Name,
[parameter(Position = 1)]
... | 0 |
558.ps1 |
function Join-SPOParts
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$false, Position=1)]
$Parts = $null,
[Parameter(Mandatory=$false, Position=2)]
$Separator = ''
)
$returnValue = (($Parts | ? { $_ } | % { ([string]$_).trim($Separator) } | ? { $_ } ) -join $Separator)
... | 0 |
Convert-BounceToX_8.ps1 | # $Id: Convert-BounceToX500.ps1 610 2010-11-16 00:39:19Z jon $
# $Revision: 610 $
#.Synopsis
# Convert Bounce to X500
#.Description
# Convert URL Encoded address in a Bounce message to an X500 address
# that can be added as an alias to the mail-enabled object
#.Parameter bounceAddress
# URL Encoded bounce... | 0 |
sample_57_83.ps1 | #
# Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker'
#
# Generated by: Microsoft Corporation
#
# Generated on: 19/01/2022
#
@{
# Script module or binary module file associated with this manifest.
RootModule = ''
# Version number of this module.
ModuleVersion = '1.2100.26... | 0 |
sample_19_0.ps1 | # Copyright ?2010, 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 |
2164.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Specify which Store to search within")]
[ValidateNotNullOrEmpty()]
[ValidateSet("iTunes","GooglePlay")]
[string]$Store,
[parameter(Mandatory=$true, HelpMessage="Specify the app name to search for within the... | 0 |
sample_29_73.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 = '80.0.0'
# Supported PSE... | 0 |
sample_59_5.ps1 | #
# Module manifest for module 'OCI.PSModules.Sch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Sch.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
3850.ps1 |
function Test-StorageAccount
{
$rgname = Get-StorageManagementTestResourceName;
try
{
$stoname = 'sto' + $rgname;
$stotype = 'Standard_GRS';
$loc = Get-ProviderLocation ResourceManagement;
$kind = 'BlobStorage'
$accessTier = 'Cool'
... | 0 |
sample_51_41.ps1 | # Localized 06/28/2023 07:58 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Solución de problemas
Troubleshoot_DetectDVDDevice=Comprobando dispositivo de DVD...
Troubleshoot_DetectDVDvideoDecoder=Comprobando descodificador de vídeo para la reproducción de DVD... | 0 |
1097.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldFindExistingSection
{
Assert-True (Test-IisConfigurationSection -SectionPath 'system.webServer/cgi')
}
function Test-ShouldNotFindMissingSection
{
$error.Clear()
Ass... | 0 |
4474.ps1 |
$script:dscResourceFriendlyName = 'PSModule'
$script:dcsResourceName = "MSFT_$($script:dscResourceFriendlyName)"
$configurationFile = Join-Path -Path $PSScriptRoot -ChildPath "$($script:dcsResourceName).config.ps1"
. $configurationFile
Describe "$($script:dcsResourceName)_Integration" {
$configurationName = "$... | 0 |
Delete-LocalAccount.ps1 | <#
.SYNOPSIS
A script that removes a local user account
.DESCRIPTION
This script searches ActiveDirectory for computer accounts, for each
computer account it removes the specified user account.
.PARAMETER ADSPath
The ActiveDirectory namespace to search for computers
... | 0 |
sample_62_42.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.Synopsis
Group Policy tools use administrative template files (.admx, .adml) to populate policy settings in the user interface.
This allows administrators to manage registry-based policy settings.
This script installes Powe... | 0 |
sample_66_67.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_0_3.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 = '92.1.0'
# Supported PSEditions
Compatible... | 0 |
Short PS Prompt.ps1 | <#
.Synopsis
Dynamically shortens the prompt based upon window size
.Notes
I got really annoyed by having my PowerShell prompt extend across 2/3 of my window when in a deeply-nested directory structure.
This shortens the prompt to roughly 1/3 of the window width, at a minimum showing the first and last piece of... | 0 |
664.ps1 |
Describe "Set-RsDatsSetReference" {
Context "Set-RsDatsSetReference with minimun parameters"{
$folderName = 'SutSetRsDataSetReferenceMinParameters' + [guid]::NewGuid()
New-RsFolder -Path / -FolderName $folderName
$folderPath = '/' + $folderName
$localResourcesPath = (Get-Item -... | 0 |
sample_36_15.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'https://aka... | 0 |
sample_56_75.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
function Unpublish-ServiceFab... | 0 |
sample_56_68.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 = '87.0.0'
# Supported PSEditions
Comp... | 0 |
2758.ps1 |
Update-TypeData -TypeName System.Diagnostics.Process -SerializationDepth 3 -Force
Get-Process | 0 |
sample_55_95.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydomains'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydomains.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported P... | 0 |
2976.ps1 | Set-StrictMode -Version Latest
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$manifestPath = (Join-Path $here 'Pester.psd1')
$changeLogPath = (Join-Path $here 'CHANGELOG.md')
Describe -Tags 'VersionChecks' "Pester manifest and changelog" {
$script:manifest = $null
$script:tagVersion = $null
$s... | 0 |
sample_21_88.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 |
3456.ps1 |
function Test-Dataset
{
$dfname = Get-DataFactoryName
$rgname = Get-ResourceGroupName
$rglocation = Get-ProviderLocation ResourceManagement
$dflocation = Get-ProviderLocation DataFactoryManagement
New-AzResourceGroup -Name $rgname -Location $rglocation -Force
try
{
... | 0 |
Invoke-PoshCode.ps1 | # .Summary
# Download and execute a script block from PoshCode.org
# .Description
# Download the code for a PoshCode script based on search of by specific index.
# Execute the code as a script block, passing arguments to it.
#
# Note: this is scary, and you should only use it if you really know what you're doing ... | 0 |
sample_40_31.ps1 | #
# Module manifest for module 'OCI.PSModules.Dns'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dns.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
Restore-Database.ps1 | param($sqlserver, $filepath)
#Note: Uses Changeset 59378 or higher of SQLPSX SQLServer module http://sqlpsx.codeplex.com/SourceControl/changeset/view/58378#564810
#Added FileListOnly option to Invoke-SqlRestore. The option will be included in releases after 2.3.1
import-module sqlserver -force
$server = get... | 0 |
sample_19_69.ps1 | ConvertFrom-StringData @'
id_sccm_checksqlconfig=Checking SQL Database Configuration
id_sccm_checksqlvalue=Checking the Value of
id_sccm_checksqlconfigdesc=Trying to connect to the SQL Database
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGs... | 0 |
sample_66_0.ps1 | #
# Module manifest for module 'OCI.PSModules.Operatoraccesscontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Operatoraccesscontrol.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
#... | 0 |
sample_31_16.ps1 | #
# Module manifest for module 'OCI.PSModules.Managementdashboard'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Managementdashboard.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Sup... | 0 |
3522.ps1 |
function Test-AzDtlVMsPerLabPolicy
{
$policy = Set-AzDtlVMsPerLabPolicy -MaxVMs 5 -LabName $labName -ResourceGroupName $rgname
$readBack = Get-AzDtlVMsPerLabPolicy -LabName $labName -ResourceGroupName $rgname
Invoke-For-Both $policy $readBack `
{
Param($x)
Assert-Are... | 0 |
547.ps1 |
function Add-SPOCurrencyFieldtoList
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string] $listTitle,
[Parameter(Mandatory=$true, Position=2)]
[string] $fieldName
)
$newField = "<Field Type='Currency' DisplayName='$fieldName' Name='$fieldName' required='FALSE'/>"
Add-... | 0 |
sample_54_56.ps1 | @{
GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
NestedModules="Microsoft.PowerShell.Commands.Management.dll"
HelpInfoURI = 'https://aka... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.