filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
sample_18_92.ps1 | ConvertFrom-StringData @'
id_sccm_checkservicestatus=Checking Status of Services
id_sccm_checkservicestatusdesc=Checking the status of
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQI... | 0 |
3014.ps1 | Set-StrictMode -Version Latest
describe 'New-MockObject' {
it 'instantiates an object from a class with no public constructors' {
$type = 'Microsoft.PowerShell.Commands.Language'
New-MockObject -Type $type | should -beoftype $type
}
}
| 0 |
Set-IPAddress_1.ps1 | function Set-IPAddress {
param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"),
[string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"),
[string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"),
[string]$gateway = $(read-host "E... | 0 |
Get-DNSZoneRecords_1.ps1 | #==========================================================================
# NAME: Get-DNSZoneRecords.ps1
# AUTHOR: Saehrig, Steven (trac3r726)
# DATE : 10/17/2008
#
# COMMENT:
# Just comment out the variable and enter the info you need for
# computername, dnszonename, and remove the credential portion if no... | 0 |
3593.ps1 |
function Get-AzureRmSecurityAlert-SubscriptionScope
{
$alerts = Get-AzSecurityAlert
Validate-Alerts $alerts
}
function Get-AzureRmSecurityAlert-ResourceGroupScope
{
$rgName = Get-TestResourceGroupName
$alerts = Get-AzSecurityAlert -ResourceGroupName $rgName
Validate-Alerts $alerts
}
funct... | 0 |
sample_62_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Loadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loadbalancer.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditi... | 0 |
sample_23_41.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudbridge'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudbridge.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEdition... | 0 |
WIMM Emulator Launcher.ps1 | ##
## Start-WimmEmulator.ps1
##
## Starts the WIMM emulator - must be placed in the add-ons\\addon_wimm_one_7\\tools
## directory along with the rest of the WIMM tools.
##
## http://dev.wimm.com/
if(-not $env:ANDROID_SDK_DIR)
{
$env:ANDROID_SDK_DIR = Resolve-Path (Join-Path $psscriptRoot ..\\..\\..)
}
... | 0 |
Remove-AeroPeek.ps1 | function Remove-AeroPeek {
PARAM(
[string]$Title="*",
[string]$Process="*"
)
BEGIN {
try {
$null = [Huddled.DWM]
} catch {
Add-Type -Type @"
using System;
using System.Runtime.InteropServices;
namespace Huddled {
public static class Dwm {
[DllImport("dwmapi.dll", PreserveSig = false... | 0 |
sample_5_37.ps1 | #************************************************
# DC_DFSClient-Component.ps1
# Version 1.0
# Date: 2009-2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about DFS Client.
# Called from: Main Networking Diag, WebClient Interactive Diag, and others.
#************************... | 0 |
514.ps1 |
function Set-SPADGroupPermission{
param(
[Parameter(Mandatory=$true)]
$Identity,
[Parameter(Mandatory=$true)]
[string]$ADGroup,
[Parameter(Mandatory=$true)]
[string]$Role,
[Parameter(Mandatory=$false)]
[string[]]$Exclude,
[switch]$Recursive,
[sw... | 0 |
New-PInvoke_1.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 user32 "void FlashWindow(IntPtr hwnd, bool bInvert)"
... | 0 |
sample_24_0.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.LoadTesting.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.LoadTesting.internal.psm1'
if(Test-Path $internalModulePath) {
... | 0 |
Deploying VM with static_1.ps1 | # 1. Create a simple customizations spec
$custSpec = New-OSCustomizationSpec -Type NonPersistent -OSType Windows -OrgName TestOrgName -FullName TestFullName -Workgroup TestWorkgroup
# 2. Modify the default network customization settings
$custSpec | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping -IpMod... | 0 |
sample_35_19.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_38_78.ps1 | const lang = Object.freeze({ "displayName": "PowerShell", "name": "powershell", "patterns": [{ "begin": "<#", "beginCaptures": { "0": { "name": "punctuation.definition.comment.block.begin.powershell" } }, "end": "#>", "endCaptures": { "0": { "name": "punctuation.definition.comment.block.end.powershell" } }, "name": "co... | 0 |
758.ps1 | $params = @{
HtmlBodyContent = "Testing JavaScript and CSS paths..."
JavaScriptPaths = ".\Assets\script.js"
StyleSheetPaths = ".\Assets\style.css"
}
$view = New-VSCodeHtmlContentView -Title "Test View" -ShowInColumn Two
Set-VSCodeHtmlContentView -View $view @params | 0 |
Send-Growl 1.0.ps1 | ## This is the first version of a Growl module (just dot-source to use in PowerShell 1.0)
## Initially it only supports a very simple notice, and I haven't gotten callbacks working yet
## Coming soon:
## * Send notices to other PCs directly
## * Wrap the registration of new messages
## * Figure out the stupid
... | 0 |
Select-CLSCompliant_1.ps1 | function Select-CLSCompliant {
#.Synopsis
# Outputs the same as "Select-Object *" with basic error handling for properties that are not CLS Compliant
[CmdletBinding()]
param([Parameter(ValueFromPipeline=$true)]$InputObject)
process {
foreach($in in $InputObject) {
$In | Select-Object *
trap ... | 0 |
2536.ps1 |
$vComputerName = "PSQLDLS34"
$vInstanceName = "MSSQLSERVER"
Write-Host "IP Address(es) that the SQL instance " $vComputerName "\" $vInstanceName " is listening on are listed below: "
$vListenAll = 0
$vTCPProps = get-WMIObject ServerNetworkProtocolProperty -ComputerName $vComputerName -NameSpace "root\Micros... | 0 |
sample_13_71.ps1 | # ***********************************************************************************************
# File: utils_ConfigMgr12-ps1
# Version 1.0
# Date: 02-17-2012 - Last edit 2022-06-01
# Author: Vinay Pamnani - vinpa@microsoft.com
# Description: Utility Script to load common variables/functions. View utils_ConfigM... | 0 |
Convert-BounceToX_1.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 |
2637.ps1 | $files = ls \\GLWASSQL\Backup2\GLWASSQL\ -Directory -Filter '*FULL*' -Recurse |
Where-Object {$_.FullName -notmatch 'master|model|msdb|SSISDB|Images'} |
ForEach-Object {Get-ChildItem $_.FullName | Sort-Object LastWriteTime -Descending | Select-Object -First 1} |
Sort-Object Size
"--Restore Script Generat... | 0 |
sample_25_6.ps1 | #
# Module manifest for module 'OCI.PSModules.Generativeaiinference'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Generativeaiinference.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
#... | 0 |
sample_26_25.ps1 | #
# Module manifest for module 'OCI.PSModules.Capacitymanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Capacitymanagement.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Suppo... | 0 |
2202.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed.")]
[ValidateNotNullOrEmpty()]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[string]$SiteServer,
[parameter(Mandatory=$false, HelpMes... | 0 |
1486.ps1 |
function New-ModuleHelpIndex
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$ModuleName,
[string[]]
$Script,
[string]
$TagsJsonPath
)
Set-StrictMode -Version 'Latest'
if( $TagsJsonPath )
... | 0 |
628.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.63-installer.exe"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs | ForEach-Object{
try{
$_.... | 0 |
sample_1_14.ps1 | <#
.SYNOPSIS
Scenario module for collecting Microsoft Remote Desktop Smart Card related data
.DESCRIPTION
Collect Smart Card related troubleshooting data
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedback : https://aka.ms... | 0 |
sample_44_74.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Eine Umgebungsvariable mit diesem Namen und Typ ist bereits vorhanden.
EnvironmentErrorDoesNotExists=Eine Umgebungsvariable mit diesem Namen und Typ ist nicht vorhanden.
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQME... | 0 |
sample_51_65.ps1 | ## Copyright (c) Microsoft Corporation. All rights reserved.
<#
.SYNOPSIS
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans.
.DESCRIPTION
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans. These performance recordings contain Microsoft-Antimal... | 0 |
sample_18_43.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.a... | 0 |
sample_21_83.ps1 | #
# Module manifest for module 'OCI.PSModules.Globallydistributeddatabase'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Globallydistributeddatabase.dll'
# Version number of this module.
ModuleVersion =... | 0 |
sample_61_24.ps1 | @{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.ServiceFabric.Powershell'
# Version number of this module.
ModuleVersion = '3.1.0.0'
# ID used to uniquely identify this module
GUID = 'd2c42633-5254-4a82-a312-1dc0697a55cd'
# Author of this module
Author = '... | 0 |
TabExpansion for V2CTP_6.ps1 | ## Tab-Completion
#################
## For V2CTP3.
## This won't work on V1 and V2CTP and V2CTP2.
## Please dot souce this script file.
## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list.
##
## What this can do is:
##
## [datetime]::n<tab>
## [datetime]::now.d... | 0 |
sample_5_39.ps1 | # 2023-02-24 WalterE mod Trap #we#
$startTime_AutoAdd = Get-Date
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_"
}
Write-Host -Background... | 0 |
sample_43_99.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubusage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubusage.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
Co... | 0 |
sample_47_96.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.HealthcareApis.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.HealthcareApis.internal.psm1'
if(Test-Path $internalModulePat... | 0 |
Get-Weather_2.ps1 | Function Get-Weather {
<#
.SYNOPSIS
Display weather data for a specific country and city.
.DESCRIPTION
Display weather data for a specific country and city. There is a possibility for this to fail if the web service being used is unavailable.
.PARAMETER Country
URL of the website to test access to.... | 0 |
2992.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Write xml test results" {
Setup -Dir "Results"
Context 'nunit' {
It "should write a successful test result" {
$TestResults = New-PesterState -Path TestDrive:\
$testResults.E... | 0 |
sample_52_84.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 |
23.ps1 | . $PSScriptRoot\Shared.ps1
Describe 'ParamsTabExpansion VSTS Tests' {
Context 'Push Parameters TabExpansion Tests' {
BeforeEach {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssigments', '')]
$repoPath = NewGitTempRepo
... | 0 |
3601.ps1 |
function Get-AzureRmSecurityLocation-SubscriptionScope
{
$locations = Get-AzSecurityLocation
Validate-Locations $locations
}
function Get-AzureRmSecurityLocation-SubscriptionLevelResource
{
$location = Get-AzSecurityLocation | Select -First 1
$fetchedLocation = Get-AzSecurityLocation -Name $l... | 0 |
sample_47_11.ps1 | #
# Module manifest for module 'OCI.PSModules.Functions'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Functions.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Co... | 0 |
sample_55_66.ps1 | # SharePoint references that need to remove when uninstall
$ReferencesToRemoveWhenUninstall = @(
@("Microsoft.SharePoint.Client"),
@("Microsoft.SharePoint.Client.Runtime"),
@("System.IdentityModel.Tokens.Jwt"),
@("Microsoft.IdentityModel.Tokens")
)
# SharePoint references that need to be copy l... | 0 |
sample_41_40.ps1 |
//
// show all meshes in the scene by setting Hidden=false
//
var c = document.elements.elementCount;
for (var i = 0; i < c; i++) {
var element = document.elements.getElement(i);
if (element.typeId == "Microsoft.VisualStudio.3D.Mesh") {
element.getTrait("Hidden").value = false;
}
}
/... | 0 |
Get-WebFile 1.0.ps1 | # ---------------------------------------------------------------------------
### <Script>
### <Author>
### Joel "Jaykul" Bennett
### </Author>
### <Description>
### Downloads a file from the web to the specified file path.
### </Description>
### <Usage>
### Get-URL http://huddledmasses.org/downloads/RunOnlyOn... | 0 |
sample_55_46.ps1 | ###########################################################
#
# 'ServiceHelper' module
#
###########################################################
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
$global:GCServiceName = "GCService"
$script:GCServiceBinaryName = "gc_service.exe"
$script:GC... | 0 |
1257.ps1 |
function ConvertTo-ProviderAccessControlRights
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[ValidateSet('FileSystem','Registry','CryptoKey')]
[string]
$ProviderName,
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string[]]
... | 0 |
sample_35_42.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | 0 |
3745.ps1 | $pfxPassword = "123"
function Get-CertificateSubjectName([string]$certificateName)
{
return 'CN=' + $certificateName + '.com'
}
function Get-X509FromSecretBySubjectDistinguishedName([string]$keyVault, [string]$secretName, [string]$subjectDistinguishedName)
{
$secret = Get-AzKeyVaultSecret $keyVault $secretNam... | 0 |
ConvertTo-Hex_9.ps1 | # Ported from C# technique found here: http://forums.asp.net/p/1298956/2529558.aspx
param ( [string]$SidString )
# Create SID .NET object using SID string provided
$sid = New-Object system.Security.Principal.SecurityIdentifier $sidstring
# Create a byte array of the proper length
$sidBytes = New-Object byte[] ... | 0 |
sample_27_7.ps1 | function New-AzWvdHostPool_FullSenerioCreate {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20230905.IHostPool')]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Paramete... | 0 |
sample_23_26.ps1 | parameters:
- name: channel
type: string
default: 1.77
- name: targets
default: []
type: object
# Todo: use 1ES pipeline once extension is installed in ADO
steps:
- task: RustInstaller@1
inputs:
rustVersion: ms-${{ parameters.channel }}
cratesIoFeedOverride: $(CARGO_REGISTRY)
... | 0 |
ConvertTo-PseudoType.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 |
4313.ps1 |
function SuiteSetup {
Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue
Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue
$script:PSGetLocalAppDataPath = Get-PSGetLocalAppDataPath
$script:TempPath = Get-TempPath
Install-NuGetBinarie... | 0 |
Get-CryptoBytes_1.ps1 | function Get-CryptoBytes {
#.Synopsis
# Generate Cryptographically Random Bytes
#.Description
# Uses RNGCryptoServiceProvider to generate arrays of random bytes
#.Parameter Count
# How many bytes to generate
#.Parameter AsString
# Output hex-formatted strings instead of byte arrays
param(
[Parameter(Va... | 0 |
sample_0_21.ps1 | ConvertFrom-StringData @'
id_sccm_activity_collectconfigmgrlogs=Obtaining Configuration Manager Logs
id_sccm_ccm_collectconfigmgrlogs=Copying CCM Logs...
id_sccm_sms_collectconfigmgrlogs=Copying SMS Logs...
id_sccm_crashdumps_collectconfigmgrlogs=Copying most recent copy of SMS CrashDumps...
id_sccm_adminui_collec... | 0 |
3713.ps1 |
function Get-ResourceGroupName
{
return getAssetName
}
function Get-WorkspaceCollectionName
{
return getAssetName
}
function Clean-ResourceGroup($rgname)
{
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback) {
... | 0 |
4408.ps1 | function Get-ScriptCommentHelpInfoString
{
[CmdletBinding(PositionalBinding=$false)]
Param
(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]
$Description,
[Parameter()]
[string]
$Synopsis,
[Parameter()]
[string[]]
... | 0 |
Create-Printers_1.ps1 | ###########################################################################"
#
# NAME: Create-Printers.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jan.egil.ring@powershell.no
# BLOG: http://blog.powershell.no
#
# COMMENT: Simple script to bulk-create printers on a print-server. Printers are imported from a csv-file.... | 0 |
sample_33_43.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_42_81.ps1 | param (
[Parameter(Mandatory = $true)]
[string] $CertificateStoreLocation,
[Parameter(Mandatory = $true)]
[string] $CertificatePfxFullPath,
[Parameter(Mandatory = $true)]
[string] $CertificateExportPfxPassword
)
# Import Certificate
try
{
$CertificateExportPfxPasswordSecureStrin... | 0 |
sample_43_22.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Get-Token {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding()]
[OutputType([System.Management.Automation.Language.Token])]
[System.Diagnostics.CodeAnalysis.SuppressMessage... | 0 |
sample_25_2.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 = '81.0.0'
# Supported PSEditions
... | 0 |
Vim25-less Crazy Magic_1.ps1 | cls
$ws = New-WebServiceProxy -Uri "http://192.168.1.1/sdk/vimService?wsdl" -Namespace "vimService1" ;
$ws.Url = "http://192.168.1.1/sdk/vimService";
$ws.UserAgent = "VMware VI Client/4.0.0";
$ws.CookieContainer = New-Object system.net.CookieContainer;
$mor_ret = new-object vimService1.ManagedObjectReferen... | 0 |
3828.ps1 |
function WcfRelayTests
{
$location = "West US"
$resourceGroupName = getAssetName
$namespaceName = getAssetName "Relay-NS"
$wcfRelayName = getAssetName "Relay-WcfR"
Write-Debug "Create resource group"
Write-Debug " Resource Group Name : $resourceGroupName"
New-AzResourceGroup -Name $resour... | 0 |
Hex dump sample.ps1 | C:\\WINDOWS\\system32
PS > hexdmp wsock32.dll
4d 5a 90 00 03 00 00 00 04 00 MZ........
00 00 ff ff 00 00 b8 00 00 00 ..ˇˇ......
00 00 00 00 40 00 00 00 00 00 ..........
e0 00 00 00 0e 1f ba 0e 00 b4 ‡.....∫...
09 cd 21 b8 01 4c cd 21 54 68 .Õ...LÕ.Th
69 73 20 70 72 6f 67 72 61 6d is.program
20 63 61 6e 6... | 0 |
722.ps1 |
function Out-RsCatalogItem
{
[CmdletBinding()]
param (
[Alias('ItemPath', 'Path', 'RsFolder')]
[Parameter(Mandatory = $True, ValueFromPipeline = $true)]
[string[]]
$RsItem,
[ValidateScript({ Test-Path $_ -PathType Container})]
[Parameter(Mandator... | 0 |
3350.ps1 |
[cmdletbinding(DefaultParameterSetName = 'task')]
param(
[parameter(ParameterSetName = 'task', Position = 0)]
[ValidateSet('default','Init','Test','Analyze','Pester','Build','Compile','Clean','Publish','Build-Docker','Publish-Docker','RegenerateHelp','UpdateMarkdownHelp','CreateExternalHelp')]
[string... | 0 |
new-pshash.ps1 | #this function takes nested hashtables and converts them to nested pscustomobjects
#it can also contain arrays of hashtables, and it will turn those hashtables in the arrays
#also into PScustomobjects
function new-pshash
{
[CmdletBinding()]
PARAM(
[parameter(valuefromPipeline=$true,Mandatory=$true, position = 1... | 0 |
sample_67_36.ps1 | <#
.SYNOPSIS
This module is part of TSS FW and implements support for tracing Container scenarios
.DESCRIPTION
This module is part of TSS FW and implements support for tracing Container scenarios
.NOTES
Dev. Lead: wiaftrin, milanmil
Authors : wiaftrin, milanmil
Requires : PowerShell V4(Supported f... | 0 |
3026.ps1 | function New-TestRegistry {
param(
[Switch]
$PassThru,
[string]
$Path
)
if ($Path -notmatch '\S') {
$directory = New-RandomTempRegistry
}
else {
if (-not (& $SafeCommands['Test-Path'] -Path $Path)) {
... | 0 |
sample_36_2.ps1 | # Localized 05/11/2024 04:05 AM (GMT) 303:7.2.30118 CL_LocalizationData.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Troubleshooting
Troubleshoot_DetectNetworkCache=Checking Windows Media Player network cache ...
Resolution_Title=Resolution
Resolution_ResetConfiguration=Resetting all configuration ... | 0 |
sample_55_70.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=Une variable d’environnement de ce nom et de ce type existe déjà.
EnvironmentErrorDoesNotExists=Aucune variable d’environnement de ce nom et de ce type n'existe.
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5... | 0 |
VerifyCategoryRule.ps1 | ## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n\nSet-StrictMode -Version Latest\n\nif($message.Body -match "book")\n{\n [Console]::WriteLine("This is a message about the book.")\n}\nelse\n{\n [Console]::WriteLine("This is an unknown message.")\n}
| 0 |
PowerShell Talk Chickens_2.ps1 | #The PowerShell Talk
#Virtualization Congress 2009
#
#The Chicken Counter Script
#Get our cretendials
#More on credential stores: http://professionalvmware.com/2009/04/09/posh-article-of-the-week-secure-credential-storage/
$credentials = Get-VICredentialStoreItem -File "c:\\scripts\\really_secure_file.xml"
... | 0 |
3087.ps1 | function Verify-Throw {
param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[ScriptBlock]$ScriptBlock
)
$exceptionThrown = $false
try {
$null = & $ScriptBlock
}
catch {
$exceptionThrown = $true
$_
}
if (-not $exceptionThrown) {
... | 0 |
3492.ps1 |
function Test-GetBlueprint
{
$blueprints = Get-AzBlueprint
Assert-True {$blueprints.Count -ge 1}
Assert-NotNull $blueprints[0].Name
Assert-NotNull $blueprints[0].Id
Assert-NotNull $blueprints[0].Scope
Assert-NotNull $blueprints[0].DefinitionLocationId
Assert-NotNull $blueprints[0].TargetScope
Assert-Not... | 0 |
sample_12_67.ps1 | ConvertFrom-StringData @'
id_tcpipsettingscheck=Checking for KB 967224
id_tcpipsettingscheckdesc=Checking for modified TcpIp Reg Parameters
'@
# SIG # Begin signature block
# MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX... | 0 |
sample_27_51.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 = '75.1.0'
# Supported PSEdition... | 0 |
sample_38_62.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | 0 |
sample_51_40.ps1 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
#-------------------------------------------------------------------------
Function WriteHtml
{
param
(
[string]
[parameter(mandatory=$true)]
... | 0 |
3754.ps1 |
function Get-ResourceGroupName
{
return getAssetName
}
function Get-TestStorageAccountName
{
return getAssetName
}
function Get-CommitmentPlanName
{
return getAssetName
}
function Get-WebServiceName
{
return getAssetName
}
function Get-ProviderLocation($providerNamespace, $resourc... | 0 |
2679.ps1 |
if (-not (Get-Module -ListAvailable -Name SharePointPnPPowerShellOnline))
{
Install-Module SharePointPnPPowerShellOnline
}
Import-Module SharePointPnPPowerShellOnline
$csvConfig = $null
$credentials = $null
$winCredentialsManagerLabel = "SPFX"
try
{
$csvConfig = Import-Csv -Path "./CreateSit... | 0 |
sample_45_22.ps1 | param($installPath, $toolsPath, $package, $project)
Import-Module (Join-Path $toolsPath common.psm1) -Force
try {
# Indicates if current project is a VB project
$IsVbProject = ($project.CodeModel.Language -eq [EnvDTE.CodeModelLanguageConstants]::vsCMLanguageVB)
if ($IsVbProject) {
... | 0 |
Set-OutlookSignature_1.ps1 | ###########################################################################"
#
# NAME: Set-OutlookSignature.ps1
#
# AUTHOR: Jan Egil Ring
#
# COMMENT: Script to create an Outlook signature based on user information from Active Directory.
# Adjust the variables in the "Custom variables"-section
# ... | 0 |
sample_11_37.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 |
demo.ps1 | \n[45]: [IO.File]::ReadAllLines( "C:\\Users\\Joel\\Sites\\webalizer.current" ).Length
31873
[46]: (gc C:\\Users\\Joel\\Sites\\webalizer.current).Length
31873
[47]: gph 2
Duration Average Lines Words Chars Type Commmand
-------- ------- ----- ----- ----- ---- --------
0.07910 0.07910 1 3 73 Co... | 0 |
sample_38_47.ps1 | #************************************************
# DC_Firewall-Component.ps1
# Version 1.0
# Version 1.1: Altered the runPS function correctly a column width issue.
# Date: 2009, 2014, 2020/waltere: add NetworkIsolation
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about the W... | 0 |
2552.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($conn_... | 0 |
sample_56_94.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 Publish-UpgradedServ... | 0 |
sample_37_91.ps1 | # region Generated
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | 0 |
sample_11_99.ps1 | #
# Module manifest for module 'OCI.PSModules.Oce'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Oce.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
sample_11_28.ps1 | # Copyright 2008, Microsoft Corporation. All rights reserved.
PARAM([string]$MachineName = $ComputerName,[string]$Path= $null)
if($debug -eq $true){[void]$shell.popup("Run DC_DeploymentLogsLogs.ps1")}
Import-LocalizedData -BindingVariable DeploymentLogsStrings
Write-DiagProgress -Activity $DeploymentLogsS... | 0 |
566.ps1 |
function Find-SPOFieldName
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string] $listTitle,
[Parameter(Mandatory=$true, Position=2)]
[string] $displayName
)
$web = $clientContext.Web
$list = $web.Lists.GetByTitle($listTitle)
$fields = $list.Fields
$clientConte... | 0 |
sample_26_85.ps1 | ## Copyright (c) Microsoft Corporation. All rights reserved.
<#
.SYNOPSIS
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans.
.DESCRIPTION
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans. These performance recordings contain Microsoft-Antimal... | 0 |
sample_51_2.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | 0 |
sample_59_39.ps1 | qيحتوي العمود '%{oii_groupedColumn/}' على مرجع GroupByColumn غير صالح عُيَّن على المعّرف '%I64u{groupByColumnId/}'dالعمود '%{oii_groupedColumn/}' مجموع بواسطة العمود '%{oii_groupByColumn/}' الذي ينتمي إلى جدول مختلف1لا يجوز تعيين اسم الدور إلى '*' أو '*SharePoint'.Kتشير العلاقة '%{ccon_relname/}' إلى عمود من النوع رقم ... | 0 |
sample_5_47.ps1 | #************************************************
# DC_GetSQLSetupLogs.ps1
# Version 1.0.0
# Date: 8-19-2011
# Author: Shon Hauck - Shonh@Microsoft.com
# Description: Used to Get SQL Setup Logs (Bootstrap Directory for SQL 9, 10 , 10.5, 11)
#
# Date: 4-15-2020
# Modified By: João Polisel - JPolisel@Microsoft.co... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.