filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
List AD Attributes_3.ps1 | $forest = [DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()
$Schema = $forest.schema
$Properties = $Schema.FindAllProperties()
foreach($property in $Properties)
{
"#################################"
"Name: {0}" -f $property.Name
"Link: {0}" -f $property.link
"LinkID: {0}" -f $prope... | 0 |
sample_31_58.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_39_45.ps1 | import{m as s}from"./index.js";/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.45.0(5e5af013f8d295555a7210df0d5f2cea0bf5dd56)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/m... | 0 |
sample_14_72.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=O módulo do PowerShell necessário (FailoverClusters) não foi encontrado. Use a Ferramenta Funções e Recursos para instalar: Ferramentas de Administração de Servidor Remoto | Ferramentas de Administração de Recursos | Ferramentas de Cluster de Failover | Módulo d... | 0 |
4463.ps1 |
function Save-PSResource {
[OutputType([void])]
[cmdletbinding(SupportsShouldProcess = $true)]
Param
(
[Parameter(Mandatory = $true,
ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true,
Position = 0,
ParameterSetName = 'Nam... | 0 |
Get KB-articles of SP_1.ps1 | function Get-Sp1Articles()
{
$web = New-Object System.Net.WebClient
# Microsoft XLS-Datei über google herunterladen, damit kommt die XLS-Datei als in HTML konvertierte Datei
$html = $web.DownloadString(‘http://webcache.googleusercontent.com/search?q=cache:trZowCK8jvcJ:download.microsoft.com/download/... | 0 |
sample_9_85.ps1 | #************************************************
# DC_CSVinfo.ps1
# 2019-03-17 WalterE added Trap #_# , 2020-09-28 add skipCsvSMB
# 2023-02-20 WalterE mod Trap #we#
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host ... | 0 |
sample_39_23.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 |
2707.ps1 | function Get-ObjDump
{
[CmdletBinding()] Param (
[Parameter(Position = 0, Mandatory = $True, ValueFromPipeline = $True)]
[ValidateScript({ Test-Path $_ })]
[String[]]
$Path
)
BEGIN
{
$Code = @'
using System;
using System.IO;
using System... | 0 |
sample_7_67.ps1 | #************************************************
# TS_TelnetSystemAccount.ps1
# Version 1.0.1
# Date: 5/9/2012
# Author: v-blchen
# Description: [Idea ID 2695] [Windows] Check the Log On account for the Telnet service to verify it's not using the Local System account
# Rule number: 2695
# Rule URL: //sharepo... | 0 |
sample_17_66.ps1 | #
# Module manifest for module 'OCI.PSModules.Osuborganizationsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll'
# Version number of this module.
ModuleVersion... | 0 |
sample_14_51.ps1 | # Rule ID 4628
# ---------
# http://sharepoint/sites/rules/Rule%20Submissions/Dynamics-CRM_ehagen_2012-06-11-03-02-42.xml
#
# Description: This checks to see if the data types on each CRM registry key is correct.
#
# Related KB
#-----------
# Script Author: jrandall
#
PARAM($RegistryPath=$null)
#r... | 0 |
2801.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(CommandLine) as Cnt,
CommandLine,
Hash
FROM
*ProcsWMI.tsv
GROUP BY
CommandLine,
Hash
ORDER BY
Cnt ASC
"@
& logparser -stats:off -i:csv -dtlines:0 -fixedsep:on -rtp:-1 "$lpquery"... | 0 |
362.ps1 | function Clear-PSFResultCache
{
[CmdletBinding(ConfirmImpact = 'Low', SupportsShouldProcess = $true, HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Clear-PSFresultCache')]
param (
)
if ($pscmdlet.ShouldProcess("Result cache", "Clearing the result cache"))
{
[PSFramework.ResultCache.... | 0 |
3390.ps1 |
function Test-VirtualMachineExtension
{
$rgname = Get-ComputeTestResourceName
try
{
$loc = Get-ComputeVMLocation;
New-AzureRmResourceGroup -Name $rgname -Location $loc -Force;
$vmsize = 'Standard_A2';
$vmname = 'vm' + $rgname;
... | 0 |
Export-CSV -Append.ps1 | #Requires -Version 2.0
<#
This Export-CSV behaves exactly like native Export-CSV
However it has one optional switch -Append
Which lets you append new data to existing CSV file: e.g.
Get-Process | Select ProcessName, CPU | Export-CSV processes.csv -Append
For details, see
http://dmitrysotnikov.w... | 0 |
1849.ps1 |
Describe "Remove-Module -Name | -FullyQualifiedName | -ModuleInfo" -Tags "CI" {
BeforeAll {
Remove-Module -Name "Foo", "Bar", "Baz" -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Path "$testdrive\Modules\Foo\1.0\" -Force > $null
New-Item -ItemType Directory -Path "$testdrive... | 0 |
sample_25_69.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 |
Deploy VM with Static IP_1.ps1 | # 1. Create a simple customizations spec:
$custSpec = New-OSCustomizationSpec -Type NonPersistent -OSType Windows `
-OrgName “My Organization” -FullName “MyVM” -Domain “MyDomain” `
–DomainAdminUsername “user” –DomainAdminPassword “password”
# 2. Modify the default network customization settings:
$custSpec ... | 0 |
sample_16_72.ps1 | <#
.SYNOPSIS
Finds or generates a valid certificate for the given VM on the host and installs
that certificate as the TLS signing certificate on the guest.
.PARAMETER Session
Passed in Remote session object that can be generated from Local-Create-Remote-Session.ps1
.PARAMETER VmName
The name ... | 0 |
3505.ps1 |
function Test-GetApplicationInsightsContinuousExport
{
$rgname = Get-ApplicationInsightsTestResourceName;
try
{
$appName = "app" + $rgname;
$loc = Get-ProviderLocation ResourceManagement;
$kind = "web";
New-AzResourceGroup -Name $rgname -Location $loc;
... | 0 |
sample_18_61.ps1 | #
# Module manifest for module 'OCI.PSModules.Apigateway'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apigateway.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
... | 0 |
sample_31_7.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.MarketplaceOrdering.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module]::Instance
# Export nothing to c... | 0 |
Get-FeedInfo.ps1 | function Get-FeedInfo([string[]]$feeds) {
# $feeds is an array of rss/atom URLs
$blogs=@(); $broken=@(); $feeds = $feeds | sort -unique {$_}
foreach($feed in $feeds){
try {
$xml = Get-WebPageContent $feed;
} catch {
$broken += $feed
$xml = $null
}
if($xml.html.rss) { $xml = $... | 0 |
618.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://dlc.sun.com.edgesuite.net/virtualbox/4.3.14/VirtualBox-4.3.14-95030-Win.exe"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
Executable = "C:\Program Files (x86)\... | 0 |
3818.ps1 |
function Test-VirtualMachineScaleSetDiskEncryptionExtension
{
[string]$loc = Get-ComputeVMLocation;
$loc = $loc.Replace(' ', '');
$rgname = 'adetstrg';
$vmssName = 'vmssadetst';
$keyVaultResourceId = '/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/resourceGroups/suredd-rg/pr... | 0 |
Get-MWSOrder.ps1 | // --------------------------------------------------------------------------------------------------------------------
// <copyright file="GetOrderCmdlet.cs" company="Huddled Masses">
// Copyright (c) 2011 Joel Bennett
// </copyright>
// <summary>
// Defines the Get-Order Cmdlet for Amazon Marketplace Orders ... | 0 |
sample_52_36.ps1 | const debug = (
typeof process === 'object' &&
process.env &&
process.env.NODE_DEBUG &&
/\bsemver\b/i.test(process.env.NODE_DEBUG)
) ? (...args) => console.error('SEMVER', ...args)
: () => {}
module.exports = debug
// SIG // Begin signature block
// SIG // MIIoQAYJKoZIhvcNAQcCoIIoMTCCKC0CAQExDzANBglg
// ... | 0 |
sample_23_71.ps1 | #
# Module manifest for module 'OCI.PSModules.Ailanguage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ailanguage.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
... | 0 |
sample_65_75.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 = '86.0.0'
# Supported PSEdition... | 0 |
sample_63_68.ps1 | # Import the helper functions
Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false
function Get-TargetResource
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param
(
[parameter(Mandatory = $true)]
[System.String]
$Category
)
#Write-Verbose "Use this cmdlet t... | 0 |
sample_13_43.ps1 | ConvertFrom-StringData @'
id_roiscan=Robust Office Inventory Scan
id_roiscanobtaining=Collecting Robust Office Inventory Scan
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIB... | 0 |
3760.ps1 |
$SESSION_RG = "flowrg"
$SESSION_IA = "PS-Tests-Sessions"
$AGREEMENT_X12_Name = "PS-X12-Agreement"
$AGREEMENT_Edifact_Name = "PS-Edifact-Agreement"
function Test-GetReceivedIcn()
{
$resultNoType = Get-AzIntegrationAccountReceivedIcn -ResourceGroupName $SESSION_RG -Name $SESSION_IA -AgreementNam... | 0 |
sample_65_59.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_53_66.ps1 | #
# Module manifest for module 'OCI.PSModules.Threatintelligence'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Threatintelligence.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Suppo... | 0 |
Chassis Type_1.ps1 | $system = Get-WMIObject -class Win32_systemenclosure
$type = $system.chassistypes
Switch ($Type)
{
"1" {"Chassis type is: $Type - Other"}
"2" {"Chassis type is: $type - Virtual Machine"}
"3" {"Chassis type is: $type - Desktop"}
"4" {"Chassis type is: $type - Low Profile Desk... | 0 |
Get-MemberBody.ps1 | #Requires ILSpy.
#Tested with version 2.1.0.1603
#http://ilspy.net/
Add-Type -Path "Mono.Cecil.dll"
Add-Type -Path "ICSharpCode.Decompiler.dll"
[void][System.Reflection.Assembly]::LoadFrom("ILSpy.exe")
function Get-MemberBody
{
[CmdletBinding()]
param(
[Parameter(ParameterSetName="MI")]
[... | 0 |
sample_56_65.ps1 | #
# Module manifest for module 'OCI.PSModules.Workrequests'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Workrequests.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditi... | 0 |
sample_49_55.ps1 | <#
.SYNOPSIS
Collect all the logs for an SRSv2 device, and place them in a zip file.
.DESCRIPTION
Create a zip file in the Rigel folder on the system drive. The zip
will contain all of the relevant application and system log files the
dev team requires for debugging. The ... | 0 |
sample_30_80.ps1 | #
# Module manifest for module 'Microsoft.SME.ServiceViewer'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.ServiceViewer.psm1'
# Version number of this module.
ModuleVersion = '4.11.2'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID us... | 0 |
2585.ps1 |
[string] $script:filename = "E:\Dexma\EnumSqlServer\EnumSqlServer.html";
[bool] $script:checkServices = $true;
[bool] $script:getServerInfo = $true;
[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.ConnectionInfo');
[void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.... | 0 |
sample_38_33.ps1 | $url = $args[0]
Write-Host "Downloading Microsoft Edge Dev"
$wc = New-Object net.webclient
$msiInstaller = "$env:temp\microsoft-edge-dev.msi"
$wc.Downloadfile($url, $msiInstaller)
Write-Host "Installing Microsoft Edge Dev"
$arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $arguments -... | 0 |
JSON 1.4.ps1 | #requires -version 2.0
# Version History:
# v 0.5 - First Public version
# v 1.0 - Made ConvertFrom-Json work with arbitrary JSON
# - switched to xsl style sheets for ConvertTo-JSON
# v 1.1 - Changed ConvertFrom-Json to handle single item results
# v 1.2 - CodeSigned to make a fellow geek happy
# v 1.3 - ... | 0 |
1657.ps1 |
function Enable-PSRemoting {
param (
[string[]]$Computers = (Read-Host 'Enter computer name'),
[switch]$ShowSkipped
)
if (!$Computers) {Throw 'No computer name entered.'}
$services = 'WinRM', 'RasAuto', 'RpcLocator', 'RemoteRegistry', 'RemoteAccess'
$skipped = @()
... | 0 |
sample_46_11.ps1 | #
# Module manifest for module 'OCI.PSModules.Genericartifactscontent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Genericartifactscontent.dll'
# Version number of this module.
ModuleVersion = '83.2.0... | 0 |
Get-Cpl.ps1 | function Get-Cpl {
dir $env:windir\\system32 | Where-Object {$_.Extension -eq ".cpl"} | Select-Object Name,@{Name="Description";Expression={$_.VersionInfo.FileDescription}} | Sort-Object Description | Format-Table -AutoSize
}
| 0 |
Set-RDPSetting.ps1 | ########################################################################################################################
# NAME
# Set-RDPSetting
#
# SYNOPSIS
# Adds or updates a named property to an existing RDP file.
#
# SYNTAX
# Edit-RDP [-Path] <string> [-Name] <string> [[-Value] <object>] [-Pass... | 0 |
sample_6_31.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_29_9.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... | 0 |
sample_19_94.ps1 | #************************************************
# DC_WinUpdateCollect.ps1
# Version 1.1
# Date: 2009-2019
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects WindowsUpdate information.
# Called from: TS_AutoAddCommands_Apps.ps1
#*******************************************************
Trap ... | 0 |
sample_7_18.ps1 | ConvertFrom-StringData @'
id_Files=Collecting Log Files
ID_FilesCab=Cabinet Files
ID_FilesLogs=Log Files
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCG... | 0 |
BufferBox 3.6.ps1 | ####################################################################################################
## This script is just a demonstration of some of the things you can do with the buffer
## in the default PowerShell host... it serves as a reminder of how much work remains on
## PoshConsole, and as an inspiration t... | 0 |
sample_49_49.ps1 | #
# Module manifest for module 'PowerShellEditorServices'
#
# Generated by: daviwil
#
# Generated on: 5/12/2016
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'PowerShellEditorServices.Commands.psm1'
# Version number of this module.
ModuleVersion = '0.2.0'
# I... | 0 |
sample_25_32.ps1 | #
# Module manifest for module 'OCI.PSModules.Bastion'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Bastion.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Compat... | 0 |
2603.ps1 | function Get-FileVolume{
param([string]$PathName)
$check = $PathName.Substring(0,$PathName.LastIndexOf('\')+1)
$volumes = (gwmi win32_volume| where {$_.drivetype -eq 3}|select name|out-string -stream).Trim()
if($volumes -contains $check){
return gwmi win32_volume| where {$_.name -eq $... | 0 |
sample_33_41.ps1 | #
# Module manifest for module 'OCI.PSModules.Monitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Monitoring.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
... | 0 |
2911.ps1 | Properties {
[string]$testProperty = "Test123"
}
BuildTearDown {
[string]$expected = "Test123"
if ($testProperty -ne $expected) {
throw "Expected '$expected', but was actually '$testProperty'"
}
}
Task default -depends Compile,Test,Deploy
Task Compile {
"Compiling"
}
Task Test -depends C... | 0 |
sample_3_42.ps1 | #************************************************
# TS_EventLogStoppedGPPCheck.ps1
# Version 1.0.1
# Date: 4/3/2013
# Author: v-blchen
# Description: [Idea ID 7018] [Windows] Event Log Service won't start
# Rule number: 7018
# Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.aspx?ID=701... | 0 |
1418.ps1 |
function Test-CSslCertificateBinding
{
[CmdletBinding()]
param(
[IPAddress]
$IPAddress,
[Uint16]
$Port
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
$ge... | 0 |
sample_54_68.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 |
sample_28_5.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 |
ASPX Mailbox (4 of 6).ps1 | using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
using System.Net.Mail;
using System.Text.RegularExpressions;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Mailb... | 0 |
Get-ProcAddress.ps1 | function Get-ProcAddress {
<#
.Synopsis
Returns the address of the desired Windows API function.
.Description
The Get-ProcAddress function returns the address of the desired Windows API
function. The technique used to get the address does not rely upon P/Invoke or
compiling C# code. GetProcAddress can be acces... | 0 |
ESX Lun Latencies_1.ps1 | function Get-VMHostLunLatency {
param([parameter(Mandatory=$true, ValueFromPipeline=$true)] $VMHost)
process {
$luns = Get-ScsiLun -VmHost $VMHost
$DiskStats = $VMHost |
Get-Stat -stat disk.totalreadlatency.average,disk.totalwritelatency.average -maxsamples 1 -realtime
foreach ($lun in $l... | 0 |
Out-Voice 1.2.ps1 | # ---------------------------------------------------------------------------
## <Script>
## <Author>
## Joel "Jaykul" Bennett
## </Author>
## <Description>
## Outputs text as spoken words
## </Description>
## <Usage>
## Out-Speech "Hello World"
## </Usage>
## </Script>
# -----------------------------------... | 0 |
4062.ps1 |
[CmdletBinding()]
param ()
function Uninstall-MSIByName {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][String]$ApplicationName,
[ValidateNotNullOrEmpty()][String]$Switches
)
$Executable = $Env:windir + "\system32\msiexec.exe"
$Uninstall = Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\Curr... | 0 |
sample_37_17.ps1 | BeforeAll {
$ModuleManifestName = 'SampleModule.psd1'
Import-Module $PSScriptRoot\..\$ModuleManifestName
}
Describe 'Module Manifest Tests' {
It 'Passes Test-ModuleManifest' {
Test-ModuleManifest -Path $PSScriptRoot\..\$ModuleManifestName
$? | Should -Be $true
}
}
# SIG # Beg... | 0 |
sample_54_86.ps1 | #
# Module manifest for module 'OCI.PSModules.Resourcescheduler'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Resourcescheduler.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Support... | 0 |
Get_Set Signature (CTP2)_3.ps1 | #Requires -version 2.0
## Authenticode.psm1
####################################################################################################
## Wrappers for the Get-AuthenticodeSignature and Set-AuthenticodeSignature cmdlets
## These properly parse paths, so they don't kill your pipeline and script if you incl... | 0 |
SCOM-CreatePortMonitor.ps1 | param($serverName,$portNumber,$pollIntervalSeconds,$watcherNodes,$displayName,$targetMp)
function GetPortMonitoringTemplate
{
$criteria = "Name = 'Microsoft.SystemCenter.SyntheticTransactions.TCPPortCheck.Template'";
$templateCriteria = new-object Microsoft.EnterpriseManagement.Configuration.MonitoringTempla... | 0 |
sample_27_29.ps1 | let resizeObserver;
let observerAddRemove;
export function FluentOverflowInitialize(dotNetHelper, id, isHorizontal, querySelector) {
var localSelector = querySelector;
if (!localSelector) {
// cannot use :scope for node.matches() further down
localSelector = ".fluent-overflow-item";
... | 0 |
3934.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 |
Get-DiskUsage.ps1 | ## du.ps1 Get-DiskUsage
###############################
## Note: $unit can be: kb, mb, gb, or an empty string (to get bytes)
###############################
## -Force causes du to include System ReparsePoints
## This means including folders like Vista's ~\\Documents\\My Pictures (which is a symlink to ~\\Pictur... | 0 |
3082.ps1 | Given "there is a background" {
}
Given "it sets x to (\d+)" {
param([int]$value)
$script:x = $value
}
Given "it sets y to (\d+)" {
param([int]$value)
$script:y = $value
}
Given "we add y to x" {
param([int]$value)
$script:x += $script:y
}
Then "x should be (\d+)" {
param([int]$valu... | 0 |
sample_26_37.ps1 | # Localized 05/07/2022 03:58 AM (GMT) 303:7.0.30723 MSFT_RegistryResource.strings.psd1
# Localized resources for MSFT_EnvironmentResource
ConvertFrom-StringData @'
###PSLOC
ParameterValueInvalid=(ERROR) Parameter '{0}' has an invalid value '{1}' for type '{2}'
InvalidPSDriveSpecified=(ERROR) Invalid PSDrive '{0... | 0 |
sample_10_10.ps1 | #************************************************
# TS_DetectLowPathMTU.ps1
# Version 1.0
# Date: 02/06/2014
# Author: BBenson
# Description:
# Rule number: 262755
# Rule ID: d2aaab92-c906-4b3e-a4e5-67244c49c422
# Rule URL: https://kse.microsoft.com/Contribute/Idea/de6654f5-8b05-4f97-b67b-f9ad51bc78ab
# P... | 0 |
sample_38_60.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 |
1056.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$carbonTestInstaller = Join-Path -Path $PSScriptRoot -ChildPath 'MSI\CarbonTestInstaller.msi' -Resolve
$carbonTestInstallerActions = Join-Path -Path $PSScriptRoot -ChildPath 'MSI\CarbonTestInstallerWithCustomActions.msi' -Reso... | 0 |
sample_67_38.ps1 | #
# Module manifest for module 'OCI.PSModules.Healthchecks'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditi... | 0 |
bc7d5dc9-76a4-432e-ad15-2f3acae17658.ps1 | param (
$UserName,
$FilePath,
[switch]$SaveCredential=$False,
[switch]$RdpSaveCredential=$False,
[switch]$DeleteCredential=$False,
[switch]$Help=$False
)
$ScriptFilenam = $MyInvocation.MyCommand.Name # ScriptFilename wo path.
$ScriptUnbArgs = $MyInvocation.UnboundArguments # UnNamed Arguments of the Po... | 0 |
sample_38_72.ps1 | #
# Module manifest for module 'Microsoft.SME.ServerManager'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.ServerManager.psm1'
# Version number of this module.
ModuleVersion = '4.13.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID us... | 0 |
sample_58_67.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 = '85.2.0'
# Supported PSEditions
Co... | 0 |
Get_Set Signature 2.0.ps1 | #Requires -version 2.0
## Authenticode.psm1 updated for PowerShell 2.0 (with time stamping)
####################################################################################################
## Wrappers for the Get-AuthenticodeSignature and Set-AuthenticodeSignature cmdlets
## These properly parse paths, so they... | 0 |
sample_7_29.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 functions.
# 1. Defines commonly used functions in the Troublesho... | 0 |
3584.ps1 |
function Create-ResourceGroupForTest
{
$useExistingService = [Microsoft.Azure.Commands.DataMigrationConfig]::GetConfigBool("useExistingService")
$location = [Microsoft.Azure.Commands.DataMigrationConfig]::GetConfigString("Location")
$rg = $null
if($useExistingService)
{
$rgName = [Microsoft.Azure.C... | 0 |
sample_51_39.ps1 | <#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
function Stop-Process2 {
[CmdletBinding(SupportsShouldProcess = $true)]
[Alias()]
[OutputType([int])]
param(
# Param1 help description
... | 0 |
Copy__Paste__Clear.ps1 | using System;
using System.Text;
using System.Threading;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyVersion("2.0.0.0")]
namespace Clip {
internal static class WinAPI {
[DllImport("kernel32.dll")]
internal static extern IntPtr GetConsoleWindow();
[DllI... | 0 |
3132.ps1 |
function Get-IPv4Subnet
{
[CmdletBinding(DefaultParameterSetName='CIDR')]
param(
[Parameter(
Position=0,
Mandatory=$true,
HelpMessage='IPv4-Address which is in the subnet')]
[IPAddress]$IPv4Address,
[Parameter(
ParameterSetName='... | 0 |
sample_31_36.ps1 | #
# Module manifest for module 'OCI.PSModules.Osuborganizationsubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osuborganizationsubscription.dll'
# Version number of this module.
ModuleVersion... | 0 |
sample_57_32.ps1 | <#
.SYNOPSIS
Script to run the tests
.DESCRIPTION
This script activates the venv and launches pytest
.EXAMPLE
test.ps1
#>
param(
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD=$false,
[Parameter(Mandatory=$false, ValueFromRemainingArguments=$t... | 0 |
sample_14_49.ps1 | # Copyright ?2008, 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 |
sample_7_52.ps1 | #************************************************
# DC_DPMEventLogs.ps1
# Version 1.0.1
# Date: 06-29-2011
# Author: Patrick Lewis - patlewis@microsoft.com
# Description: This script get DPM related event logs
#************************************************
if($debug -eq $true){[void]$shell.popup("Run DC_DPMEv... | 0 |
sample_60_2.ps1 | #
# Module manifest for module 'OCI.PSModules.Clusterplacementgroups'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Clusterplacementgroups.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
... | 0 |
1335.ps1 |
function Enable-CIisSecurityAuthentication
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]
$SiteName,
[Alias('Path')]
[string]
$VirtualPath = '',
[Parameter(Mandatory=$tr... | 0 |
sample_19_32.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 = '77.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
sample_49_72.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... | 0 |
397.ps1 |
$PSF_OnRemoveScript = {
if ([runspace]::DefaultRunspace.Id -eq 1)
{
Wait-PSFMessage -Timeout 30s -Terminate
Get-PSFRunspace | Stop-PSFRunspace
[PSFramework.PSFCore.PSFCoreHost]::Uninitialize()
}
$psframework_pssessions.Values | Remove-PSSession
[PSFramework.FlowControl.CallbackHost]::RemoveRunspaceO... | 0 |
Out-DataTable_5.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 |
Robocopy Wrapper.ps1 |
function Copy-Robocopy
{
param
(
[Parameter(Position=0, Mandatory=$true)]
[String] $Source,
[Parameter(Position=1, Mandatory=$true)]
[String] $Target,
[Parameter(Position=2, Mandatory=$false)]
[String[]] $Files = @("*.*"),
[Parameter(Position=3, Mandatory=$false)]
[String] $Op... | 0 |
311.ps1 | function Remove-PSFLicense
{
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Low', HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Remove-PSFLicense')]
Param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[PSFramework.License.License[]]
$License,
[switch]
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.