filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
sample_5_65.ps1 | #
# Module manifest for module 'OCI.PSModules.Computeinstanceagent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Computeinstanceagent.dll'
# Version number of this module.
ModuleVersion = '92.1.0'
# S... | 0 |
Get-RecurseMember.ps1 | function Get-RecurseMember {
<#
.Synopsis
Does a recursive search for unique users that are members of an AD group.
.Description
Recursively gets a list of unique users that are members of the specified
group, expanding any groups that are members out into their member users.
Note: Requires the Ques... | 0 |
Select-Grid.ps1 | #requires -version 2.0
### Import the WPF assemblies
Add-Type -AssemblyName PresentationFramework
Add-Type -AssemblyName PresentationCore
Set-PSDebug -Strict
## Select-Grid
## Displays objects in a grid view and returns (only) the selected ones when closed.
###################################################... | 0 |
sample_65_83.ps1 | #
# Module manifest for module 'Az.KeyVault'
#
# Generated by: Microsoft Corporation
#
# Generated on: 7/4/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.KeyVault.psm1'
# Version number of this module.
ModuleVersion = '6.0.1'
# Supported PSEditions
C... | 0 |
sample_3_80.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 |
sample_23_99.ps1 | $global:VerbosePreference = 'Continue'
Function Write-Custom-Output
{
Param([string]$message)
$date = Get-Date
$newMessage = '[{0}] {1}' -f $date, $message
Write-Output $newMessage
}
trap [Exception]
{
Write-Custom-Output "WARN: Terminating error encountered on line $($_.Invoc... | 0 |
sample_22_83.ps1 | #
# Script module for module 'PackageManagement'
#
Set-StrictMode -Version Latest
Microsoft.PowerShell.Utility\Import-LocalizedData LocalizedData -filename PackageManagement.Resources.psd1
# Summary: PackageManagement is supported on Windows PowerShell 3.0 or later, Nano Server and PowerShellCore
$isCore = ($P... | 0 |
544.ps1 |
function Add-SPOListItems
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$csvPath,
[Parameter(Mandatory=$true, Position=2)]
[string]$listName
)
$list = $clientContext.Web.Lists.GetByTitle($listName)
$csvPathUnicode = $csvPath -replace ".csv", "_unicode.csv"
... | 0 |
3133.ps1 |
function Invoke-IPv4NetworkScan
{
[CmdletBinding(DefaultParameterSetName='CIDR')]
Param(
[Parameter(
ParameterSetName='Range',
Position=0,
Mandatory=$true,
HelpMessage='Start IPv4-Address like 192.168.1.10')]
[IPAddress]$StartIPv4Address,... | 0 |
3508.ps1 |
function Get-ResourceGroupName
{
return getAssetName
}
function Get-ResourceName
{
return getAssetName
}
function Clean-ResourceGroup($rgname)
{
Remove-AzResourceGroup -Name $rgname -Force
}
| 0 |
526.ps1 |
function Move-SPWeb{
param(
[Parameter(Mandatory=$true)]
[String]
$SourceUrl,
[Parameter(Mandatory=$true)]
[String]
$DestUrl,
[Switch]
$NoFileCompression
)
if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "... | 0 |
sample_60_99.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 |
ConvertFrom-Hashtable.ps1 | # function ConvertFrom-Hashtable {
PARAM([[HashTable]$hashtable,[switch]$combine)
BEGIN { $output = New-Object PSObject }
PROCESS {
if($_) {
$hashtable = $_;
if(!$combine) {
$output = New-Object PSObject
}
}
$hashtable.GetEnumerator() |
ForEach-Object { Add-Member -inputObject $obje... | 0 |
sample_21_95.ps1 | @{
RootModule = 'PSReadLine.psm1'
NestedModules = @("Microsoft.PowerShell.PSReadLine2.dll")
ModuleVersion = '2.4.0'
GUID = '5714753b-2afd-4492-a5fd-01d9e2cff8b5'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = '(c) Microsoft Corporation. All rights reserved.'
Description = 'Gr... | 0 |
sample_42_91.ps1 | param(
[Parameter(Mandatory = $true, HelpMessage="Enable or disable mandatory ASLR for the target executables.")][ValidateSet('Enable', 'Disable')][string]$Action,
[Parameter(mandatory=$true, ValueFromRemainingArguments=$true, HelpMessage="The paths of the target executables.")][string[]]$paths
)
# Define a st... | 0 |
sample_7_3.ps1 | # DC_RunSqlDiagScripts.ps1
# This script has dependencies on utils_CTS and utils_DSD
#
param( [Object[]] $instances, [switch]$CollectSqlDiag, [switch]$CollectAlwaysOnInfo )
#_# SQLDIAG script name for SQL Server 2014
New-Variable SQL_SCRIPT_SQLDIAG_2014 -Value "sp_sqldiag12.sql" -Option ReadOnly
#... | 0 |
1321.ps1 |
function Remove-CSslCertificateBinding
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[IPAddress]
$IPAddress = '0.0.0.0',
[UInt16]
$Port = 443
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session ... | 0 |
Export-HTML.ps1 | #Requires -Version 2.0
<#
Export-Html behaves exactly like native ConvertTo-HTML
However it has one optional parameter -Path
Which lets you specify the output file: e.g.
Get-Process | Export-Html C:\\temp\\processes.html
(c) Dmitry Sotnikov
http://dmitrysotnikov.wordpress.com
Proxy generated usin... | 0 |
sample_4_7.ps1 | ConvertFrom-StringData @'
id_ex_exbpacmdact=Exchange Support Tool - ExBPA
id_ex_exbpacmdstat=Running Exchange Best Practices Analyzer (ExBPA), please wait...
id_ex_exbpacmdfiledescription=ExBPA Health Check
id_ex_exbpacmdreportsection=Exchange Toolbox
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIo... | 0 |
sample_14_3.ps1 | #
# Module manifest for module 'OCI.PSModules.Logging'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Logging.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Compat... | 0 |
sample_63_61.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 |
vProfile.ps1 | # vProfiler.ps1 : vSphere profiling script
# This script will export recursively all objects and properties of a VI/vSphere entity to a XML file
# Parameters:
# $entityName : the name of the vSphere entity for which the properties should be written to the XML file
# $childShow : Boolean switch, export all children ... | 0 |
sample_27_23.ps1 | ##########################################################################################
# <copyright file="Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Startup.ps1" company="Microsoft">
# Copyright (c) Microsoft Corporation. All rights reserved.
# </copyright>
# <summary>Microsoft.Enterprise... | 0 |
sample_1_25.ps1 | 'use strict';(function(_0x54c951,_0x5bce53){const _0x560119=a8_0x1763,_0x25a6a4=_0x54c951();while(!![]){try{const _0x108e33=parseInt(_0x560119(0xb4))/0x1+-parseInt(_0x560119(0x9d))/0x2*(-parseInt(_0x560119(0xa7))/0x3)+parseInt(_0x560119(0xab))/0x4*(parseInt(_0x560119(0x9c))/0x5)+-parseInt(_0x560119(0x8a))/0x6*(parseInt... | 0 |
New-ISEMenu_2.ps1 | Import-Module ShowUI
Function New-ISEMenu {
New-Grid -AllowDrop:$true -Name "ISEAddonCreator" -columns Auto, * -rows Auto,Auto,Auto,*,Auto,Auto -Margin 5 {
New-Label -Name Warning -Foreground Red -FontWeight Bold -Column 1
($target = New-TextBox -Name txtName -Column 1 -Row ($Row=1))
New-Label... | 0 |
sample_46_71.ps1 | Rem AnimationEncyclopedia.vbs
Rem An InDesign VBScript
Rem
Rem Author: Brenda Burden
Rem Creates a 6-page sample doc demonstrating the new InDesign Animation feature
Rem Search Reference
Rem PAGE ONE - Sample of Animation Properties
Rem PAGE TWO - Sample of all Animation Events
Rem PAGE THREE - Sample ... | 0 |
sample_45_14.ps1 | <#
.SYNOPSIS
Adds flow for a .NET preview or RC
.PARAMETER RuntimeChannel
Public runtime channel
.PARAMETER SdkChannel
Public sdk channel
.PARAMETER RuntimeBranch
Public runtime repo branch (e.g. release/8.0-preview2)
.PARAMETER SdkBranch
Public sdk repo branch (e.g. release/8.0.1xx-preview2)
.PARAMETER VSChannel... | 0 |
2750.ps1 |
& $env:windir\system32\tasklist.exe /v /fo csv | Select-Object -Skip 1 | % {
$o = "" | Select-Object ImageName,PID,SessionName,SessionNum,MemUsage,Status,UserName,CPUTime,WindowTitle
$row = $_ -replace '(,)(?=(?:[^"]|"[^"]*")*$)', "`t" -replace "`""
$o.ImageName,
$o.PID,
$o.SessionName,
$o.Ses... | 0 |
sample_48_63.ps1 | #
# Module manifest for module 'OCI.PSModules.Autoscaling'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Autoscaling.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEdition... | 0 |
sample_14_87.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... | 0 |
sample_32_68.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 = '82.0.0'
# Supported PSEditions
Compatible... | 0 |
4222.ps1 |
$sploaded = $null
Function Get-ServicePerms {
if ($sploaded -ne "TRUE") {
$script:sploaded = "TRUE"
echo "Loading Assembly"
$i = "TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAABQR... | 0 |
sample_57_51.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 New-ServiceFabricApp... | 0 |
1013.ps1 |
$random = (New-Guid).ToString().Substring(0,8)
$subscriptionId = "my-azure-subscription-id"
$apiManagementName = "apim-$random"
$resourceGroupName = "apim-rg-$random"
$location = "Japan East"
$organisation = "Contoso"
$adminEmail = "admin@contoso.com"
$storageAccountName = "backup$random"
$containerName = "... | 0 |
Write-DataTable_3.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 |
2547.ps1 |
$erroractionpreference = "SilentlyContinue"
$a = New-Object -comobject Excel.Application
$a.visible = $True
$b = $a.Workbooks.Add()
$c = $b.Worksheets.Item(1)
$ColHeaders = ("DBName", "addl_loan_data", "appraisal", "borrower", "br_address",
"br_expense", "br_income", "br_liability", "br_REO",
"channels... | 0 |
sample_50_22.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Bu adda ve türde bir ortam değişkeni zaten var.
EnvironmentErrorDoesNotExists=Bu adda ve türde bir ortam değişkeni yok.
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3Ag... | 0 |
sample_65_71.ps1 | @{
GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Start-Transcript", "Stop-Transcript"
AliasesTo... | 0 |
sample_63_72.ps1 | $ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
$script:GCInstallPath = "$PSScriptRoot\..\..\.."
$script:GCBinariesFolderName = "GC"
$script:GCBinariesPath = Join-Path $script:GCInstallPath $script:GCBinariesFolderName
$script:CleanupExePath = Join-Path $script:GCBinariesPath "em_extension_cleanup... | 0 |
Read-HostMasked.ps1 | function Read-HostMasked([string]$prompt="Password") {
$password = Read-Host -AsSecureString $prompt;
$BSTR = [System.Runtime.InteropServices.marshal]::SecureStringToBSTR($password);
$password = [System.Runtime.InteropServices.marshal]::PtrToStringAuto($BSTR);
[System.Runtime.InteropServices.Marshal]::Zero... | 0 |
3961.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.","") };
[arra... | 0 |
sample_29_11.ps1 | ijSTF2QMV0d+rdP3fk8k58e4dbGMnGcE+0IfrYbbIAa2BKY6Ed/Japjpn6PoO0D4vuJAIxsfPZhZMY+LdwqeCoyBghZieoiaqA8034VEJJl9EfUIAgtpCCz4uZM9ozU4thHCg9YO8eZuRRz0rhbyM809lfYzn7exOqLx6lXxRsqJke6Yo0g246tB2Ssejjmv9juYXVcTEMPOE6ajX866nZ6goXfliVzPq6Ux/cy3XLpXlAWh8vy2dAIJTlt8OQY9Q7RIVzolbF/KzRCsgfBhdCWw07oPy9NL8sb6xLviTtK8AGUePEt0JbCX27qiZDdq... | 0 |
2924.ps1 | task default -depends FrameworkFunction
task FrameworkFunction {
if ( $IsMacOS -OR $IsLinux ) {}
else {
AssertFramework -Framework '2.0' -AcceptableRegEx '2\.0'
AssertFramework -Framework '3.5' -AcceptableRegEx '3\.5'
AssertFramework -Framework '4.0' -AcceptableRegEx '4\.[0-9]\.'
}
}
function Asser... | 0 |
sample_52_61.ps1 | #
# Module manifest for module 'OCI.PSModules.Common'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Common.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Compatib... | 0 |
sample_58_94.ps1 | #
# Module manifest for module 'OCI.PSModules.Certificatesmanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Certificatesmanagement.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
... | 0 |
45599912-3e19-46a3-830b-4a7948b8f56d.ps1 | Function Test-XVM
{
[cmdletbinding()]
Param
(
[Parameter(Mandatory=$true,Position=1)]
[string[]]$Name,
[Parameter(Mandatory=$true,Position=2)]
[string[]]$ComputerName
)
Process
{
$results = @()
foreach ($cName in $ComputerName) {
... | 0 |
1726.ps1 | function Get-ServiceNowUser{
[OutputType([System.Management.Automation.PSCustomObject])]
[CmdletBinding(DefaultParameterSetName, SupportsPaging)]
Param(
[Parameter(Mandatory = $false)]
[string]$OrderBy = 'name',
[Parameter(Mandatory = $false)]
[ValidateSet(... | 0 |
chkhash_30.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... | 0 |
Report-RecipientCounts.ps1 | <#
.SYNOPSIS
Report-RecipientCounts.ps1
Keep a running total of daily recipient count distribution.
.DESCRIPTION
Keep a running total of daily recipient count distribution.
.PARAMETER Days
The number of days back to examine logs.
Default = 1 (Yesterday)
.EXAMPLE
Report-R... | 0 |
3638.ps1 |
function Test-CreateAndUpdateVirtualNetworkRule
{
$location = "East US 2"
$rg = Create-ResourceGroupForTest $location
$server = Create-ServerForTest $rg $location
$virtualNetworkRuleName = Get-VirtualNetworkRuleName
$vnetName1 = "vnet1"
$virtualNetwork1 = CreateAndGetVirtualNetwork $rg $vnetNam... | 0 |
sample_63_28.ps1 | #
# Module manifest for module 'OCI.PSModules.Goldengate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Goldengate.dll'
# Version number of this module.
ModuleVersion = '83.3.0'
# Supported PSEditions
... | 0 |
361.ps1 | function Set-PSFResultCache
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Set-PSFResultCache')]
param
(
[Parameter(Mandatory = $true, ValueFromPipeline = $true, Position... | 0 |
1700.ps1 | [CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[ValidateNotNullorEmpty()]
[PSCredential]$Credential
)
If (-not $PSScriptRoot) {$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent}
$Script:ThisCommand = $MyInvocation.MyCommand
$ProjectRoot = Resolve-Path "$PSScriptRoot\.."
$ModuleRoot ... | 0 |
581.ps1 |
function Connect-SSH{
param (
[parameter(Mandatory=$true)]
[string[]]$Name,
[parameter(Mandatory=$false)]
[string]$User,
[parameter(Mandatory=$false)]
[int]$Port,
[parameter(Mandatory=$false)]
[string]$PrivatKey
)
... | 0 |
sample_50_58.ps1 | export function displayLastSelectedItem(id) {
var item = document.getElementById(id);
var scroll = document.getElementById(id + "-scroll");
if (!!item && !!scroll) {
try {
// To be optimized (how to detect the end of scroll container?)
for (var i = 0; i < 10; i++) {
... | 0 |
894.ps1 | $resourceGroupName = "myResourceGroup"
$webappname = "<replace-with-your-app-name>"
Get-AzWebAppBackupList -ResourceGroupName $resourceGroupName -Name $webappname
$backup = (Get-AzWebAppBackupList -ResourceGroupName $resourceGroupName -Name $webappname | where {$_.BackupId -eq <replace-with-BackupID>})
$backu... | 0 |
sample_17_37.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 |
2416.ps1 |
[CmdletBinding()]
param (
[Parameter(Mandatory = $False,
ValueFromPipeline = $False,
ValueFromPipelineByPropertyName = $True)]
[string]$SiteCode = 'UHP',
[Parameter(Mandatory = $False,
ValueFromPipeline = $False,
ValueFromPipelineByPropertyName = $True)]
[string]$SiteServer = 'CONFIGMANAG... | 0 |
sample_41_45.ps1 | #
# Module manifest for module 'Microsoft.SME.HyperV'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.HyperV.psm1'
# Version number of this module.
ModuleVersion = '4.21.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to uniquely... | 0 |
Write-Log_7.ps1 | function Write-Log {
#.Synopsis
# Write to a rotating log file
#.Example
# Get-ChildItem C:\\ -Recurse | Select FullName, CreationTimeUtc, LastWriteTimeUtc | Write-Log Files.txt -Rotate 5mb
#
# Writes a file list to disc, breaking it into multiple files of approximately 5MB of data each
[CmdletB... | 0 |
sample_31_30.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_45_99.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudmigrations'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudmigrations.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported P... | 0 |
1126.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) -ForDsc
Describe 'Carbon_Group' {
$groupName = 'CarbonGroupTest'
$username1 = $CarbonTestUser.UserName
$username2 = 'CarbonTestUser2'
$username3 = 'CarbonTestUser3'
$user1 = $null
$user2 = $null
... | 0 |
sample_24_82.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 = '80.0.0'
# Supported PSEdition... | 0 |
1441.ps1 |
function Compress-CItem
{
[OutputType([IO.FileInfo])]
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)]
[Alias('FullName')]
[string[]]
$Path,
[string]
$OutFile,
... | 0 |
playlist.com music cache.ps1 |
#put the playlist.com playlist number into $pl
$pl = 14870805259;
([xml](new-object system.net.webclient).downloadstring("http://pl.playlist.com/pl.php?playlist=$([int]($pl/256))")).playlist.tracklist.track | % {try { $a= $_.tracktitle;$a;(new-object system.net.webclient).downloadfile($_.originallocation,"c:\\mus... | 0 |
3147.ps1 | $From = ""
$To = ""
$MailServer = ""
function SendMailMessage
{
param(
[String]$Subject,
[String]$Body
)
Send-MailMessage -SmtpServer $MailServer -From $From -To $To -Subject $Subject -Body $Body
}
| 0 |
sample_3_38.ps1 | ConvertFrom-StringData @'
id_cts8021xclient=802.1x Client Component
id_cts8021xclientdescription=Collects information about 802.1x client component.
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63J... | 0 |
sample_37_61.ps1 | E接続を確立できませんでした: キャッシュされた資格情報の有効期限が切れているか、パスワードが更新されました。資格情報を再入力してください。3PowerBI 環境の検出を試みている間に、URL '%{strURL/}' への接続に失敗しました。.応答形式が正しくないため、PowerBI バックエンド エンドポイントの検索が失敗しました。CertGetNameStringW を呼び出せませんでした。証明書チェーンを検証できませんでした。*拇印 '%{strThumbprint/}' の証明書の発行者は信頼されていません。cこのサーバー インスタンスは、Schannel 証明書 (ServerSchannelTokenSignerC... | 0 |
1084.ps1 |
Set-StrictMode -Version 'Latest'
Describe 'Bin Directory' {
foreach( $clr in @( 'coreclr', 'fullclr' ) )
{
$allowedAssemblies = &{
'Carbon.dll'
'Carbon.Iis.dll'
'Carbon.Xdt.dll'
if( $clr -eq 'coreclr' )
{
'Microsoft.Web.Admini... | 0 |
Convert-PowerPack2Ps_1.ps1 | #######################################################################
# Convert-PowerPack2Ps1
#
# Converts PowerGUI .PowerPack files to ps1 PowerShell script library
# v1 - raw conversion, no name changes, only script elements converted
######################################################################
# E... | 0 |
3236.ps1 |
class LogMessage {
[datetime]$DateTime = (Get-Date).ToUniversalTime()
[string]$Class
[string]$Method
[LogSeverity]$Severity = [LogSeverity]::Normal
[LogLevel]$LogLevel = [LogLevel]::Info
[string]$Message
[object]$Data
LogMessage() {
}
LogMessage([string]$Message) {
$th... | 0 |
Show-ColorizedContent.ps.ps1 | ##############################################################################\n##\n## Show-ColorizedContent\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\nDi... | 0 |
2074.ps1 |
Describe 'Breakpoint SDK Unit Tests' -Tags 'CI' {
BeforeAll {
$job = Start-Job -ScriptBlock {
Set-PSBreakpoint -Command Start-Sleep
1..240 | ForEach-Object {
Start-Sleep -Milliseconds 250
$_
Write-Error 'boo'
... | 0 |
Get-VMware-Guest-Invento.ps1 | #Requires -Version 2.0
#Requires –PsSnapIn Quest.ActiveRoles.ADManagement
#Requires –PsSnapIn VMware.VimAutomation.Core
<#>
==========================================================================
This script was created and tested on the following:
Name Version
----------------- ... | 0 |
Is-SameSubnet.ps1 | function Is-SameSubnet {param( [string]$IP1,
[string]$IP2,
[string]$Subnet = "255.255.255.0")
[string]$IP1Bits = ""
[string]$IP2Bits = ""
[string]$SubnetBits = ""
## get string representations of all the bits from the IP's passed in
[System.Net.IPAddress]::Parse($IP1).GetAddressBytes()... | 0 |
sample_65_51.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_54_24.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 Remove-ServiceFabric... | 0 |
sample_14_36.ps1 | #Collect Event Logs for Slow Logon/ Slow Boot troubleshooter
$EventLogNames = "Setup"
Run-DiagExpression .\TS_GetEvents.ps1 -EventLogNames $EventLogNames -SectionDescription "Event Logs"
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorB... | 0 |
1337.ps1 |
function Revoke-CComPermission
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$Identity,
[Parameter(Mandatory=$true,ParameterSetName='DefaultAccessPermission')]
[Parameter(Mandatory=$true,ParameterSetName='MachineAccessRestriction'... | 0 |
DefaultParameterValues.ps1 | #requires -Version 3.0
function Join-Hashtable {
param(
[Hashtable]$First,
[Hashtable]$Second,
[Switch]$Force
)
$Firsts = $First.Keys
$Output = @{} + $First
foreach($key in $Second.Keys) {
if($Firsts -notcontains $Key) {
$Output.$Key = $Second.$Key
} elseif($Force... | 0 |
sample_44_4.ps1 | ##------------------------------------------------------------------
## <copyright file="ReportStatus.ps1" company="Microsoft">
## Copyright (C) Microsoft. All rights reserved.
## </copyright>
##------------------------------------------------------------------
<#
.SYNOPSIS
Generate json file for reco... | 0 |
sample_18_41.ps1 | #
# Module manifest for module 'OCI.PSModules.Redis'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Redis.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Compatible... | 0 |
2442.ps1 | function Remove-OnlineVM
{
[CmdletBinding(SupportsShouldProcess)]
param
(
[Parameter(Mandatory, ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[Microsoft.HyperV.PowerShell.VirtualMachine[]]$VM,
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmpty()]
[Alias('ComputerName'... | 0 |
1155.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldResolveBuiltinIdentity
{
$identity = Resolve-Identity -Name 'Administrators'
Assert-Equal 'BUILTIN\Administrators' $identity.FullName
Assert-Equal 'BUILTIN... | 0 |
sample_23_81.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
param(
[ValidateSet('Hang', 'Fail')]
$TestHook
)
$waitTimeoutSeconds = 300
switch ($TestHook) {
'Hang' {
$waitTimeoutSeconds = 10
$jobScript = { Start-Sleep -Seconds 600 }
}
'Fail' {
$jo... | 0 |
2994.ps1 | function GherkinStep {
param(
[Parameter(Mandatory = $True, Position = 0)]
[String]$Name,
[Parameter(Mandatory = $True, Position = 1)]
[ScriptBlock]$Test
)
$Definition = (& $SafeCommands["Get-PSCallStack"])[1]
$RelativePath = & $SafeCommands["Resolve-Path"] $... | 0 |
sample_20_27.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\typescript@5.3.3\node_modules\typescript\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\typ... | 0 |
336.ps1 | function Set-PSFPath
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
[CmdletBinding(DefaultParameterSetName = 'Default')]
param (
[Parameter(Mandatory = $true)]
[string]
$Name,
[Parameter(Mandatory = $true)]
[string]
$Path,
[Parameter(Para... | 0 |
3074.ps1 | function MiValidator($thing_to_validate) {
return $thing_to_validate.StartsWith("s")
}
function Invoke-SomethingThatUsesMiValidator {
param(
[ValidateScript( {MiValidator $_})]
$some_param
)
}
| 0 |
Invoke-LongRunningOperat.ps1 | ##############################################################################\n##\n## Invoke-LongRunningOperation\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS... | 0 |
4012.ps1 | Configuration ContosoDscConfiguration {
Node "TEST-PC1" {
WindowsFeature MyFeatureInstance {
Ensure = "Present"
Name = "RSAT"
}
WindowsFeature My2ndFeatureInstance {
Ensure = "Present"
Name = "Bitlocker"
}
}
}
ContosoDscConfigur... | 0 |
3144.ps1 |
$Result = New-Object -TypeName PSObject
Add-Member -InputObject $Result -MemberType NoteProperty -Name Parameter1 -Value Result1
Add-Member -InputObject $Result -MemberType NoteProperty -Name Parameter2 -Value Result2
return $Result
$Results = @()
foreach($Line in $Lines)
{
$Result = New-Object -TypeName PSOb... | 0 |
2558.ps1 |
$Script:Version = '1.0.9.1126'
$Script:LogSeparator = '*******************************************************************************'
$Script:LogFile = ""
function Get-ScriptName(){
$tmp = $MyInvocation.ScriptName.Substring($MyInvocation.ScriptName.LastIndexOf('\') + 1)
$tmp.Sub... | 0 |
Search-Registry.ps1 | ##############################################################################\n##\n## Search-Registry\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\nSearch t... | 0 |
424.ps1 | Register-PSFTeppScriptblock -Name "PSFramework-config-fullname" -ScriptBlock {
[PSFramework.Configuration.ConfigurationHost]::Configurations.Values | Where-Object { -not $_.Hidden } | Select-Object -ExpandProperty FullName
} | 0 |
4120.ps1 |
Set-Variable -Name Body -Force
Set-Variable -Name EmailAddress -Force
Set-Variable -Name EmailAddresses -Force
Set-Variable -Name Exclusions -Force
Set-Variable -Name LocalAdmin -Force
Set-Variable -Name LocalAdmins -Force
Set-Variable -Name LogFile -Value $env:windir"\Logs\LocalAdministrators.log" -Force
Set-Variab... | 0 |
sample_20_31.ps1 | #
# This script launches the VC redist executable and handles certain error scenarios.
#
param(
[Parameter(Mandatory=$true)][String][ValidateNotNullOrEmpty()]$PayloadDirectory,
[Parameter(Mandatory=$true)][String][ValidateSet("arm64","x64","x86")]$Architecture,
[Parameter(Mandatory=$true)][String][Val... | 0 |
3885.ps1 |
function Get-PowerBIEmbeddedCapacityName
{
return getAssetName
}
function Get-ResourceGroupName
{
return getAssetName;
}
function Get-Location
{
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne `
[Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
{
$na... | 0 |
sample_21_49.ps1 | # PowerShell Scripting Best Practices
This document is intended as guidance for how all PowerShell scripts should be written for security, functionality, and consistency.
To help enforce these rules during your dev process, consider using [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer). Each of the... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.