filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
Sort IE Favorites_1.ps1 | $Results = gci $env:userprofile\\favorites -rec -inc *.url |
? {select-string -inp $_ -quiet "^URL=http"} |
select @{Name="Name"; Expression={[IO.Path]::GetFileNameWithoutExtension($_.FullName)}},
@{Name="URL"; Expression={get-content $_ | ? {$_ -match "^URL=http"} | % {$_.Substring(4)}}}
New-Item $env:userprofil... | 0 |
Pivot-Object_1.ps1 | #.Synopsis
# Pivot multiple objects which are normalized with properties that are name, value pairs.
#.Description
# Takes a series of objects where there are multiple rows to represent each object, with a pair of columns with the name and value of an additional property, and outputs new objects which have those ... | 0 |
3387.ps1 |
function Assert-Throws
{
param([ScriptBlock] $script, [string] $message)
try
{
&$script
}
catch
{
if ($message -ne "")
{
$actualMessage = $_.Exception.Message
Write-Output ("Caught exception: '$actualMessage'")
if ($actualMessage -eq $message)
{
... | 0 |
sample_32_39.ps1 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 0 |
Delete AD Users.ps1 | function Delete-ADUser
{
Param($userName = $(throw 'Enter a username to delete'))
$searcher = New-Object System.DirectoryServices.DirectorySearcher([ADSI]"","(&(objectcategory=user)(sAMAccountName=$userName))")
$user = $searcher.findone().GetDirectoryEntry()
$user.psbase.DeleteTree()
}
$NumDays = 90
$Lo... | 0 |
1980.ps1 |
Describe "New-Object" -Tags "CI" {
It "Support 'ComObject' parameter on platforms" {
if ($IsLinux -or $IsMacOs ) {
{ New-Object -ComObject "Shell.Application" } | Should -Throw -ErrorId "NamedParameterNotFound,Microsoft.PowerShell.Commands.NewObjectCommand"
} else {
... | 0 |
sample_26_46.ps1 | /*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-------------... | 0 |
sample_20_18.ps1 | #
# Module manifest for module 'ThreadJob'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = '.\Microsoft.PowerShell.ThreadJob.dll'
# Version number of this module.
ModuleVersion = '2.0.3'
# ID used to uniquely identify this module
GUID = '0e7b895d-2fec-43f7-8cae-11... | 0 |
sample_36_35.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Microsoft.PowerShell.Utility\Import-LocalizedData -BindingVariable Strings -FileName Strings -ErrorAction Ignore
Microsoft.PowerShell.Management\Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 | ForEach-Object {
. $PSItem.FullName
}
... | 0 |
sample_55_54.ps1 | function trySetDesignerProp(tname, ttype, val) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0);
trait.value = val;
}
if (command.getTrait("state").value == 0) {
command.getTrait("state").value = 2;
trySetDesignerProp("exportAsText", "bool", true);
}
else {
command.g... | 0 |
3733.ps1 |
function Get-ResourceGroupName
{
return getAssetName
}
function Get-ResourceName
{
return getAssetName
}
function Get-ProviderLocation($provider)
{
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsoft.Azure.Test.HttpRecorder.HttpRecorderMode]::Playback)
{
$namespace... | 0 |
dvSwitchNetworkAdapter.ps1 | <#
.SYNOPSIS
Retrieves the virtual network adapters available on a vSphere server.
.DESCRIPTION
A replacement for the default cmdlet will work with either a standard vSwitch or a dvSwitch.
Retrieves the virtual network adapters available on a vSphere server.
.PARAMETER VM
... | 0 |
Get-Parameter.ps1 | param($Cmdlet) $CmdletInfo = Get-Command -CommandType Cmdlet -Name $Cmdlet
if ( $? ) {
if ($CmdletInfo.GetType().Name -eq "CmdletInfo" ) {
$parsed = $CmdletInfo.Definition `
-replace "\\] \\[", "]`n[" `
-replace "> \\[", ">`n[" `
-replace "$C... | 0 |
sample_6_78.ps1 | # Copyright ? 2011, Microsoft Corporation. All rights reserved.
# This script will collect the metabase.xml or applicationHost.config file, along with all web.config files
# Collects Framework directory Configuration files
# for the web sites passed into the script
# Written By: Bret Bentzinger
# Date: July 7,... | 0 |
New-ElevatedTask 2.7.ps1 | #requires -version 2.0
###############################################################################
## New-ElevatedTask is a script (for Vista) which creates "elevated" scheduled
## tasks by exploiting the import-from XML feature of schtasks.exe /Create /XML
##
## Creates a new "On Demand Only" scheduled task ... | 0 |
sample_46_49.ps1 | # escape=`
# -----------------------------------------------------------------------------------------
# This file describes the standard way to build Docker in a container on Windows
# Server 2016 or Windows 10.
#
# Maintainer: @jhowardmsft
# ---------------------------------------------------------------------------... | 0 |
1038.ps1 |
[CmdletBinding()]
param(
)
@( 'http://msdn.microsoft.com/en-us/library/windows/desktop/bb530716.aspx', 'http://msdn.microsoft.com/en-us/library/windows/desktop/bb545671.aspx' ) |
ForEach-Object { Invoke-WebRequest -Uri $_ } |
Select-Object -ExpandProperty 'RawContent' |
Select-String -AllMatche... | 0 |
2430.ps1 |
[CmdletBinding()]
param (
[Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)]
[string[]]$ServiceName,
[Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)]
[ValidateScript({Test-Connection -ComputerName $_ -Quiet -Count 1 })]
[string[]]$Computername = 'localhost',
[Parameter(Mandat... | 0 |
sample_30_77.ps1 | #
# Module manifest for module 'OCI.PSModules.Loganalytics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loganalytics.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditi... | 0 |
sample_7_43.ps1 | ConvertFrom-StringData @'
id_activity_utils=Initializing Diagnostics
id_utils_init=Gathering environment details and detecting roles...
'@
# SIG # Begin signature block
# MIIoQgYJKoZIhvcNAQcCoIIoMzCCKC8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQ... | 0 |
WhoIs_1.ps1 | param([String] $DomainName = '192.168.0.1')
$socket = New-Object System.Net.Sockets.Socket ([System.Net.Sockets.AddressFamily]::InterNetwork, [System.Net.Sockets.SocketType]::Stream, [System.Net.Sockets.ProtocolType]::Tcp)
$Socket.Connect('whois.arin.net', 43) | out-null
$bytes = [System.Text.Encoding]::ASCII.GetB... | 0 |
sample_53_27.ps1 | @{
IncludeRules = @(
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
'PSUseConsistentWhitespace',
'PSUseConsistentIndentation',
'PSAlignAssignmentStatement',
'PSUseCorrectCasing'
)
Rules = @{
PSPlaceOpenBrace = @{
Enable ... | 0 |
Resolve-Aliases _3.7.ps1 | #requires -version 2.0
## ResolveAliases Module v 1.6
########################################################################################################################
## Sample Use:
## Resolve-Aliases Script.ps1 | Set-Content Script.Resolved.ps1
## ls *.ps1 | Resolve-Aliases -Inplace
##############... | 0 |
1295.ps1 |
function Set-CServiceAcl
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[Parameter(Mandatory=$true)]
[Security.AccessControl.DiscretionaryAcl]
$Dacl
)
Set-StrictMode ... | 0 |
SearchZIP_4.psm1 .ps1 | function SearchZIPfiles {
<#
.SYNOPSIS
Search for (filename) strings inside compressed ZIP or RAR files (V2.8).
.DESCRIPTION
In any directory containing a large number of ZIP/RAR compressed Web Page files
this procedure will search each individual file name for simple text strings,
listing both the source RAR... | 0 |
3316.ps1 |
function Get-Permission {
[PoshBot.BotCommand(
Aliases = ('getpermission'),
Permissions = 'view'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Position = 0)]
[string]$Name
)
if ($PSBoundParameters.ContainsKey('Name')) ... | 0 |
1722.ps1 | Function Add-ServiceNowAttachment {
[System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidUsingConvertToSecureStringWithPlainText','')]
[System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidGlobalVars','')]
[OutputType([PSCustomObject[]])]
[CmdletBinding(DefaultParameterSetName,SupportsShou... | 0 |
Test-Port_5.ps1 | Param([string]$srv,$port=135,$timeout=3000,[switch]$verbose)
# Test-Port.ps1
# Does a TCP connection on specified port (135 by default)
$ErrorActionPreference = "SilentlyContinue"
# Create TCP Client
$tcpclient = new-Object system.Net.Sockets.TcpClient
# Tell TCP Client to connect to machine on Port
... | 0 |
sample_18_85.ps1 | #************************************************
# DC_NetworkList-Component.ps1
# Version 1.0
# Date: 2009
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about the NetworkList Component.
# Called from: Main Networking Diag
#*****************************************************... | 0 |
Invoke-RemoteExpression..ps1 | ##############################################################################\n##\n## Invoke-RemoteExpression\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\n... | 0 |
sample_1_54.ps1 | // ==================================================================
// DCIM_CLPConcreteJob
// ==================================================================
// Class: DCIM_CLPConcreteJob
[ dynamic, provider("dcismprovider")]
class DCIM_CLPConcreteJob : CIM_ConcreteJob
{
[Write, Description (
... | 0 |
3540.ps1 |
function Test-AzureSqlGetContainers
{
$vault = Get-AzRecoveryServicesVault -ResourceGroupName "sqlpaasrg" -Name "sqlpaasrn";
$containers = Get-AzRecoveryServicesBackupContainer `
-VaultId $vault.ID `
-ContainerType "AzureSQL" `
-BackupManagementType "AzureSQL";
Assert-AreEqual $containers[0].Na... | 0 |
Set-IPAddress_7.ps1 | # corrected version - $mask variable corrected to match in both places
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 sub... | 0 |
953.ps1 |
$uniqueId=$(-join ((97..122) + (48..57) | Get-Random -Count 15 | % {[char]$_}))
$apiVersion = "2015-04-08"
$location = "West US 2"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount-$uniqueId"
$resourceType = "Microsoft.DocumentDb/databaseAccounts"
$locations = @(
@{ "locationName"="Wes... | 0 |
2952.ps1 | Properties {
$x = 1
}
Task default -Depends RunNested1, RunNested2, CheckX
Task RunNested1 {
Invoke-psake .\nested\nested1.ps1
}
Task RunNested2 {
Invoke-psake .\nested\nested2.ps1
}
Task CheckX{
Assert ($x -eq 1) '$x was not 1'
}
| 0 |
Import-Certificate_3.ps1 | function Import-Certificate {\n<#\n .SYNOPSIS\n Imports certificate in specified certificate store.\n\n .DESCRIPTION\n Imports certificate in specified certificate store.\n\n .PARAMETER CertFile\n The certificate file to be imported.\n\n .PARAMETER StoreNames\n The certificate store(s) in which the certificate sh... | 0 |
sample_62_22.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 = '88.1.0'
# S... | 0 |
sample_36_5.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.CloudService.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.CloudService.internal.psm1'
if(Test-Path $internalModulePath) {... | 0 |
sample_61_98.ps1 | Y表“%{oii_IMBITableName/}”的列“%{oii_IMBIColumnName/}”中包含空白值,这对于多对一关系中的一方上的列或用作表的主键的列而言是不允许的。=表未处于可查询状态,因为基础增量表“%{oii_deltaTableName/}”中的数据已更改。请查看更改并刷新数据集。ă无法将值“%{ccon_value/}”转换为 Direct Lake 表列“%{oii_tableName/}”[“%{oii_columnName/}”] 的类型“%{semanticType/}”、基础 parquet 逻辑类型“%{logicalType/}”和物理类型“%{physicalType/}”。请将列的数据类型转... | 0 |
227.ps1 | Function Lock-Computer
{
$signature = @"
[DllImport("user32.dll", SetLastError = true)]
public static extern bool LockWorkStation();
"@
$LockComputer = Add-Type -memberDefinition $signature -name "Win32LockWorkStation" -namespace Win32Functions -passthru
$LockComputer::LockWorkStation() | Out-Null
} | 0 |
130.ps1 |
function Get-AuthToken {
[cmdletbinding()]
param
(
[Parameter(Mandatory=$true)]
$User
)
$userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User
$tenant = $userUpn.Host
Write-Host "Checking for AzureAD module..."
$AadModule = Get-Module -Name "AzureAD" -ListAvailable
if ($Aa... | 0 |
UCS-ServiceProf-fromList.ps1 | <#
====================================================================
Author(s): Josh Atwell <josh.c.atwell@gmail.com>
Link: www.vtesseract.com
File: Get-UCSServiceProfileAssociations-FromList.ps1
Purpose: Gets Service Profile Associations for all UCS clusters
provided in a list.
If you want to v... | 0 |
2781.ps1 |
[CmdletBinding()]
Param ([Parameter(Mandatory)] [string[]] $memstream = $(Throw("-memstream is required")),
[Parameter(Mandatory)] [string[]] $outputloc = $(Throw("-outputloc is required"))
)
function Get-DecompressedByteArray {
[CmdletBinding()] Param ([Parameter(ValueFromPipeline,ValueFromPipelineBy... | 0 |
2769.ps1 |
Get-ItemProperty -Path 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\*' | Where-Object { $_.Debugger }
Get-ItemProperty -Path 'HKLM:SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\*' | Where-Object { $_.Debugger } | 0 |
sample_33_36.ps1 | <#
.SYNOPSIS
Update display scaling values for each monitor to match either (1) default system account or (2) current user
.DESCRIPTION
Make reg keys for the specified account match the default account or current user
• HKCU\Control Panel\Desktop\PerMonitorSettings
... | 0 |
Speech Recognition.ps1 | $null = [Reflection.Assembly]::LoadWithPartialName("System.Speech")
## Create the two main objects we need for speech recognition and synthesis
if(!$Global:SpeechModuleListener){ ## For XP's sake, don't create them twice...
$Global:SpeechModuleSpeaker = new-object System.Speech.Synthesis.SpeechSynthesizer
$... | 0 |
960.ps1 |
$apiVersion = "2015-04-08"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount"
$databaseName = "database1"
$collectionName = "collection1"
$databaseThroughputResourceName = $accountName + "/mongodb/" + $databaseName + "/throughput"
$databaseThroughputResourceType = "Microsoft.DocumentDb/databaseAcc... | 0 |
sample_2_46.ps1 | #************************************************
# utils_load20072010powershell.ps1
# Version 2.0.1
# Date: 04-12-2013
# Author: Brian Prince - brianpr@microsoft.com
# Description: Utility functions specific to Exchange 2007 2010
#************************************************
# For backward compatability ... | 0 |
sample_38_99.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Invoke-AMTSOL {
<#
.Synopsis
Establishes a Serial-Over-LAN (SOL) session
.Description
This CmdLet establishes a Serial-Over-LAN communication to interact with clients that have Intel Active Management Technology (AMT) firm... | 0 |
Import-Delimited 2.4.ps1 | ################################################################################
## Convert-Delimiter - A function to convert between different delimiters.
## E.g.: commas to tabs, tabs to spaces, spaces to commas, etc.
################################################################################
## Written pri... | 0 |
2856.ps1 | function Exec {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[scriptblock]$cmd,
[string]$errorMessage = ($msgs.error_bad_command -f $cmd),
[int]$maxRetries = 0,
[string]$retryTriggerErrorPattern = $null,
[string]$workingDirectory = $null
)
... | 0 |
sample_43_4.ps1 | #
# Module manifest for module 'Az.ServiceFabric'
#
# Generated by: Microsoft Corporation
#
# Generated on: 5/16/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.ServiceFabric.psm1'
# Version number of this module.
ModuleVersion = '3.3.3'
# Supported PS... | 0 |
Join-Collections_1.ps1 | #requires -version 2.0
## Version 1.0 First post http://poshcode.org/1459
## Version 1.1 Fixed column uniqueness bug
#.Note
# Depends on ConvertFrom-HashTable http://poshcode.org/1118
#.Synopsis
# Performs a inner join on two collections of objects based on a common key column.
#.Description
# Takes two ... | 0 |
sample_48_17.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_54_91.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_50_97.ps1 | # ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apach... | 0 |
sample_59_26.ps1 | #
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ... | 0 |
1063.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldConvertToBase64
{
$expectedValue = 'YAAxADIAMwA0ADUANgA3ADgAOQAwAC0APQBxAHcAZQByAHQAeQB1AGkAbwBwAFsAXQBcAGEAcwBkAGYAZwBoAGoAawBsADsAJwB6AHgAYwB2AGIAbgBtACwALgAvACA... | 0 |
sample_11_18.ps1 | #
# Module manifest for module 'OCI.PSModules.Governancerulescontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Governancerulescontrolplane.dll'
# Version number of this module.
ModuleVersion =... | 0 |
sample_22_48.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.EventGrid.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.EventGrid.internal.psm1'
if(Test-Path $internalModulePath) {
... | 0 |
d1c44eb5-e148-4345-a712-661f0b8e3e08.ps1 | #
# simple example using a hash to parse CAS Connect Logs
#
# after using the get-CASConnectLogEntries.ps1 to collect the log information
# this script runs thru those files and counts Cached vs Classic
#
#
# the directory where you keep these "cas connect logs" - change to fit your needs
$Script:CasLogUNC... | 0 |
1416.ps1 |
function Get-CIisConfigurationSection
{
[CmdletBinding(DefaultParameterSetName='Global')]
[OutputType([Microsoft.Web.Administration.ConfigurationSection])]
param(
[Parameter(Mandatory=$true,ParameterSetName='ForSite')]
[string]
$SiteName,
[Parameter(Pa... | 0 |
2880.ps1 | task default -depends A,B,C
task A {
"TaskA"
}
task B -precondition { return $false } {
"TaskB"
}
task C -precondition { return $true } {
"TaskC"
}
| 0 |
sample_50_10.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=The required PowerShell module (FailoverClusters) was not found. Use Roles & Features Tool to install: Remote Server Administration Tools | Feature Administration Tools | Failover Clustering Tools | Failover Cluster Module for Windows PowerShell.
HyperVModuleRe... | 0 |
sample_43_75.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 = '77.0.0'
# Suppo... | 0 |
3297.ps1 |
function Remove-PoshBotStatefulData {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidGlobalVars', '', Scope='Function', Target='*')]
[cmdletbinding(SupportsShouldProcess)]
param(
[parameter(Mandatory)]
[string[]]$Name,
[validateset('Global','Module')]
... | 0 |
2755.ps1 |
Function Expand-Zip ($zipfile, $destination) {
[int32]$copyOption = 16
$shell = New-Object -ComObject shell.application
$zip = $shell.Namespace($zipfile)
foreach($item in $zip.items()) {
$shell.Namespace($destination).copyhere($item, $copyOption)
}
}
$rkpath = ($env:SystemRoot + "\rekall.z... | 0 |
sample_63_0.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 = '85.1.0... | 0 |
sample_11_91.ps1 | #************************************************
# TS_NetworkDTCEnabled.ps1
# Version 1.0.0
# Date: 03-23-2012
# Author: Jeremy LaBorde - jlaborde
# Description: Checks to see if Network DTC
# is enabled
#
#************************************************
. .\DistSvcs_Utils.ps1
Import-LocalizedData -B... | 0 |
sample_63_9.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 |
333.ps1 | function Get-PSFPath
{
[CmdletBinding()]
Param (
[Parameter(Mandatory = $true, Position = 0)]
[string]
$Name
)
process
{
Get-PSFConfigValue -FullName "PSFramework.Path.$Name"
}
} | 0 |
2967.ps1 | $nugetBinPath = Join-Path -Path $env:ChocolateyInstall -ChildPath 'bin'
$packageBatFileName = Join-Path -Path $nugetBinPath -ChildPath 'psake.bat'
Remove-Module -Name [p]sake -Verbose:$false
Remove-Item -Path $packageBatFileName -Force -Confirm:$false
Write-Host 'PSake has been uninstalled'
| 0 |
sample_43_68.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may c... | 0 |
sample_37_30.ps1 | #
# Module manifest for module 'OCI.PSModules.Aispeech'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aispeech.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Comp... | 0 |
sample_60_54.ps1 | #
# Module manifest for module 'OCI.PSModules.Vnmonitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vnmonitoring.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditi... | 0 |
sample_4_4.ps1 | ConvertFrom-StringData @'
id_ssas_collectssasregkeys=Analysis Services Registy Keys
id_ssas_collectssasregkeysdesc=Collecting SQL Server Analysis Services registry keys
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYC... | 0 |
The other Post.ps1 | $insParm = '/s /v"/qn /norestart"'
$updList = get-cluster -name $YouClusterNameHere | get-vm |
where-object {$_.powerstate -eq "PoweredON"} |
foreach-object { get-view $_.ID } |
where { $_.guest.toolsstatus -match "toolsOld" }
foreach ($uVM in $updList)
{
$uVM.name
$uVM.UpgradeTools_Task($insParm)
... | 0 |
sample_2_13.ps1 |
// Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved.
// ==================================================================
// DCIM_SwitchConnectionView
// ==================================================================
[dynamic, provider("dcismprovider"),
Description(
"The ... | 0 |
sample_7_97.ps1 | ConvertFrom-StringData @'
id_descriptors=Collecting Windows Update service descriptors
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC0vOKl... | 0 |
sample_38_17.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 |
616.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "https://download-installer.cdn.mozilla.net/pub/firefox/releases/27.0.1/win32/de/Firefox%20Setup%20Stub%2027.0.1.exe"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Conf... | 0 |
sample_38_87.ps1 |
param()
# generate rest API client
$errorActionPreference = "Stop"
# cleanup if exists
if (Test-Path ./clients) {
Write-Host "Removing old clients ..."
# we are on gitlab?
if ($null -ne $env:IS_GITLAB_CI) {
rm -rf ./clients
} else {
sudo rm -rf ./clients
}
}
if (Test-Path ./tor... | 0 |
sample_15_9.ps1 | #************************************************
# TS_HyperVSCSIDiskEnum.ps1
# Version 1.0.1
# Date: 03-08-2011
# Author: Andre Teixeira - andret
# Description: This checks the number of subkeys under HKLM\System\CurrentControlSet\Enum\SCSI\Disk&Ven_Msft&Prod_Virtual_Disk
# If it is large (more th... | 0 |
sample_62_51.ps1 | #
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ... | 0 |
sample_51_37.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
# Import Observability EventSource
$observabili... | 0 |
2286.ps1 | [CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server name with SMS Provider installed")]
[parameter(ParameterSetName="Text")]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[ValidateNotNullorEmpty()]
[string]$SiteServer,
[... | 0 |
sample_49_87.ps1 | function Get-WAC1PClusterDetails {
<#
.SYNOPSIS
Get cluster name and domain.
.DESCRIPTION
Get cluster name and domain.
.ROLE
Administrators
#>
$cluster = Get-Cluster
$clusterName = $cluster.Name
$clusterDomain = $cluster.Domain
"$clusterName.$clusterDomain"
}
## [END] Get-WAC1PClusterDetails... | 0 |
sample_47_52.ps1 | #
# Module manifest for module 'OCI.PSModules.Managementagent'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Managementagent.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported P... | 0 |
1200.ps1 |
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
function Assert-InheritanceEnabled
{
param(
$Path
)
It 'should enable inheritance' {
$acl = Get-Acl -Path $path
$acl.AreAccessRulesProtected | Should Be ... | 0 |
Easy Migration Tool v_2.1.ps1 | #Generated Form Function
function GenerateForm {
########################################################################
# Code Generated By: Richard Yaw
# Generated On: 07/12/2011
#
# Easy Migration Script for VMware (Version 2.0)
# - Added a "Reload Tasks" feature.
# - Fixed issue with the Undo feature for S... | 0 |
sample_43_21.ps1 | #
# Module manifest for module 'ThreadJob'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = '.\Microsoft.PowerShell.ThreadJob.dll'
# Version number of this module.
ModuleVersion = '2.0.3'
# ID used to uniquely identify this module
GUID = '0e7b895d-2fec-43f7-8cae-11... | 0 |
sample_52_5.ps1 | # ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apach... | 0 |
sample_9_37.ps1 | ConvertFrom-StringData @'
id_etltraceenable=Enabling %Component% Event Trace Log
id_etltraceenabledesc=Enabling Event Trace Log for %Component%
id_etltracereprotitle=Please click 'Next' to start collecting data
id_etltracereprodescription=Please click 'Next' to start collecting information. You will be prompted to ... | 0 |
3455.ps1 |
function Get-ResourceGroupName
{
return getAssetName
}
function Get-DataFactoryName
{
return getAssetName
}
function Get-ProviderLocation($provider)
{
"West Europe"
}
function CleanUp($rgname, $dfname)
{
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -ne [Microsof... | 0 |
sample_0_38.ps1 |
if($debug -eq $true){[void]$shell.popup("Run DC_FCInfo.ps1")}
if ($OSArchitecture -eq 'ARM')
{
'Skipping running {fcinfo.exe} since it is not supported in ' + $OSArchitecture + ' architecture.' | WriteTo-StdOut
return
}
Import-LocalizedData -BindingVariable FCInfoStrings
Write-DiagProgress -Activity $FCIn... | 0 |
sample_29_37.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 = '74.1.0'
... | 0 |
sample_50_84.ps1 | let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl();
let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/webCore.eventHandlers.js"];
let currentScriptElement = document.querySelector("script[src='Scripts/webCore.plugin.js']");
if (currentScriptElement !== null) {
scr... | 0 |
sample_14_48.ps1 | <# ------ Input Prompts ------ #>
$fields = @(
New-Object "System.Management.Automation.Host.FieldDescription" "Input"
New-Object "System.Management.Automation.Host.FieldDescription" "Input List"
)
$fields[1].SetParameterType([int[]])
$host.UI.Prompt("Caption", "Message", $fields)
Get-Credential
G... | 0 |
sample_38_85.ps1 | function New-AzDataProtectionPolicyTagCriteriaClientObject{
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IScheduleBasedBackupCriteria')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates a new criteria objec... | 0 |
sample_30_23.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\resolve@1.22.8\node_modules\resolve\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\resolve@... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.