filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
Sync-Time_2.ps1 | function sync-time(
[string] $server = "clock.psu.edu",
[int] $port = 37)
{
$servertime = get-time -server $server -port $port -set
#leave off -set to just check the remote time
write-host "Server time:" $servertime
write-host "Local time :" $(date)
}
| 0 |
sample_30_36.ps1 | ---
- name: Get Storage information.
ansible.builtin.uri:
url: "https://{{ hostname }}:{{ https_port }}{{ api_system }}/Storage"
register: virtual_disk_result
delegate_to: "{{ idrac_gather_facts_delegate }}"
- name: Get all storage controller ids.
ansible.builtin.set_fact:
storage_ids_list: "{{ virtual... | 0 |
4078.ps1 | Clear-Host
Set-Variable -Name a -Scope Global -Force
Set-Variable -Name SMSCli -Scope Global -Force
$SMSCli = [wmiclass] "root\ccm:SMS_Client"
$a = $SMSCli.TriggerSchedule("{00000000-0000-0000-0000-000000000001}")
If ($a.__PROPERTY_COUNT -eq 1) {
$SMSCli.Dispose
Remove-Variable -Name a -Scope Global -Force
Remove-... | 0 |
sample_19_60.ps1 | # Copyright (c) 2023 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
name: CI
on:
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request.
pull_request:
... | 0 |
sample_15_96.ps1 | ConvertFrom-StringData @'
id_dpm_activity=Gathering DPM Information
id_dpm_status_getdpminfo=Running GetDPMInfo.ps1
id_dpm_installed=DPM has been detected as installed
id_dpm_info=DPMInfo
id_dpm_information=DPM Information
id_dpm_not_installed=DPM has NOT been detected as installed
id_dpm_settings=DPM Settings
... | 0 |
new get-childitem.ps1 | Function Get-ChildItem {
<#
.ForwardHelpTargetName Get-ChildItem
.ForwardHelpCategory Cmdlet
#>
[CmdletBinding(DefaultParameterSetName='Items', SupportsTransactions=$true)]
param(
[Parameter(ParameterSetName='Items', Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)]
[Sys... | 0 |
2166.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=$true, HelpMessag... | 0 |
sample_19_72.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 |
4140.ps1 |
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][string]$Application,
[ValidateNotNullOrEmpty()][string]$LogFileName,
[string]$LogFileLocation,
[switch]$ExactFileName
)
function New-LogFile {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][string]$Log
)
$LogFile = Get-ChildItem -Path $LogFi... | 0 |
2490.ps1 |
function Start-PacketTrace {
[CmdletBinding()]
[OutputType()]
param
(
[Parameter()]
[ValidateNotNullOrEmpty()]
[ValidateScript({ Test-Path -Path ($_ | Split-Path -Parent) -PathType Container })]
[ValidatePattern('.*\.etl$')]
[string[]]$TraceFilePath,
[Parameter()]
[switch]$Force
)
begin {
Set-St... | 0 |
Find Local Group Members_8.ps1 | # Author: Hal Rottenberg
# Purpose: Find matching members in a local group
# Used tip from RichS here: http://powershellcommunity.org/Forums/tabid/54/view/topic/postid/1528/Default.aspx
# Change these two to suit your needs
$ChildGroups = "Domain Admins", "Group Two"
$LocalGroup = "Administrators"
$MemberName... | 0 |
sample_34_16.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 |
1111.ps1 |
$siteName = 'Anonymous Authentication'
$sitePort = 4387
$webConfigPath = Join-Path $TestDir web.config
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Start-Test
{
Uninstall-IisWebsite $siteName
Install-IisWebsite -Na... | 0 |
391.ps1 | $moduleRoot = (Resolve-Path "$PSScriptRoot\..\..").Path
. "$PSScriptRoot\FileIntegrity.Exceptions.ps1"
function Get-FileEncoding
{
[CmdletBinding()]
Param (
[Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)]
[Alias('FullName')]
[string]
$Path
)
[byte[]]$byte = get-content -Encoding... | 0 |
sample_6_97.ps1 | ConvertFrom-StringData @'
id_surfacepro3detectconnectedstandbyhibernationconfig=Detect Surface Pro 3 Connected Standby Hibernation Configuration Issue
id_surfacepro3detectconnectedstandbyhibernationconfigdesc=Detected Surface Pro 3 Connected Standby Hibernation Configuration Issue.
'@
# SIG # Begin signature bloc... | 0 |
sample_3_98.ps1 | #
# Module manifest for module 'OCI.PSModules.Oda'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Oda.dll'
# Version number of this module.
ModuleVersion = '92.1.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
sample_42_49.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmsynthetics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmsynthetics.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEdi... | 0 |
sample_7_35.ps1 | #
# Module manifest for module 'OCI.PSModules.Ospgateway'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ospgateway.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported PSEditions
... | 0 |
Remove Disabled AD Users.ps1 | import-module ActiveDIrectory
search-adaccount -searchbase "ou=UserObjectsPendingDeletion,DC=mydomain,DC=com" -Accountinactive -Timespan 400.00:00:00 | where {$_.objectclass -eq 'user'} | remove-aduser -confirm:$false
| 0 |
sample_27_14.ps1 | #
# Module manifest for module 'OCI.PSModules.Computecloudatcustomer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Computecloudatcustomer.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
... | 0 |
sample_53_67.ps1 | param( [string]$DataPath, `
[switch]$AcceptEula, `
[switch]$Trace, `
[switch]$Logs, `
[switch]$Activity, `
[switch]$Fwd, `
[switch]$FwdCli, `
[switch]$RemShell, `
[switch]$HTTPSYS, `
[switch]$WinHTTP, `
[switch]$CAPI, `
[switch]$Ker... | 0 |
Update-ISETabs.ps1 | foreach($tab in $psISE.PowerShellTabs) {
foreach($file in $tab.Files) {
$position = Select-Object -InputObject $file.Editor -Property CaretLine, CaretColumn
$content = Get-Content $file.FullPath -Raw
if($content -ne $file.Editor.Text) {
$file.Editor.Text = Get-Content $file.FullPath -... | 0 |
sample_48_91.ps1 | export function setControlAttribute(id, attrName, value) {
const fieldElement = document.querySelector("#" + id)?.shadowRoot?.querySelector(".selected-value");
if (!!fieldElement) {
fieldElement?.setAttribute(attrName, value);
}
}
// SIG // Begin signature block
// SIG // MIIoJwYJKoZIhvcN... | 0 |
sample_3_87.ps1 | @{
# Script module or binary module file associated with this manifest
ModuleToProcess = 'nuget.psm1'
# Version number of this module.
ModuleVersion = '2.0.0.0'
# ID used to uniquely identify this module
GUID = '76e6f9c4-7045-44c0-a557-17fab0835c12'
# Author of this module
Author = 'NuGet Team'
# Com... | 0 |
2165.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, ParameterSetName="AppName", HelpMessage="Specify the app name to search for within the App Store.")]
[ValidateNotNullOrEmpty()]
[ValidatePattern("^[A-Za-z\s]*$")]
[string]$AppName,
[parameter(Mandatory=$true, Parameter... | 0 |
sample_45_52.ps1 | #
# Module manifest for module 'OCI.PSModules.Goldengate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Goldengate.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
... | 0 |
sample_39_67.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_94.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_24_5.ps1 | @{
GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
FunctionsToExport = @()
CmdletsToExport = "Get-Credential", "Get-ExecutionP... | 0 |
sample_63_40.ps1 | #
# Module manifest for module 'OCI.PSModules.Operatoraccesscontrol'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Operatoraccesscontrol.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
#... | 0 |
h20 -Hashtables 2 object_1.ps1 | #hashtable to object function.
#used to be able to make custom objects with math inside the pipeline
#e.g. 1..10 | h20 { @{karl = $_;dude = $_+1} }
#gps | h20 { @{name = $_.processname; mem = $_.workingset / 1MB} }
function h20([scriptblock]$sb )
{
begin {}
process{ if ($sb -ne $null)
{
... | 0 |
sample_57_22.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_52_12.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 |
3962.ps1 |
function Test-ApplicationSecurityGroupCRUD
{
$rgLocation = Get-ProviderLocation ResourceManagement
$resourceTypeParent = "Microsoft.Network/ApplicationSecurityGroups"
$location = Get-ProviderLocation $resourceTypeParent
$rgName = Get-ResourceGroupName
$asgName = Get-ResourceName
... | 0 |
Wacth TechED Sessions.ps1 | ipmo WPK
Function Get-TechEDSession {
$url = "https://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/RSS/"
$wc = New-Object net.webclient
#$wc.Proxy.Credentials = Get-Credential
$feed = ([xml]($wc.downloadstring($url))).rss.channel.item
$feed | ForEach {
... | 0 |
3343.ps1 |
function Remove-ScheduledCommand {
[PoshBot.BotCommand(
Aliases = ('removeschedule', 'remove-schedule'),
Permissions = 'manage-schedules'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[ValidateNotNullO... | 0 |
229.ps1 | $UserSam = "TestAccount"
$Search = New-Object -TypeName System.DirectoryServices.DirectorySearcher -ErrorAction 'Stop'
$Search.Filter = "(&((objectclass=user)(samaccountname=$UserSam)))"
$Search.FindAll() | ForEach-Object -Process {
$Account = $_
$AccountGetDirectory = $Account.GetDirec... | 0 |
Findup_17.ps1 | using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.IO;
using System.Text.RegularExpressions;
namespace Findup
{
public class FileLengthComparer : I... | 0 |
Expand-Alias 2.0.ps1 | #requires -version 2.0
## ResolveAlias Module v2.0
########################################################################################################################
## Version History
## 1.0 - First Version. "It worked on my sample script"
## 1.1 - Now it parses the $(...) blocks inside strings
## 1.2 - So... | 0 |
102.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 ($Aad... | 0 |
3125.ps1 |
function Clear-ARPCache
{
[CmdletBinding()]
param(
)
Begin{
if(-not([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator"))
{
Write-Warning -Message "Administrator r... | 0 |
1876.ps1 |
Describe "Get-RunspaceDebug" -Tags "CI" {
Context "Check return types of RunspaceDebug" {
It "Should return Microsoft.Powershell.Commands.PSRunspaceDebug as the return type" {
$rs = Get-RunspaceDebug
$rs | Should -Not -BeNullOrEmpty
$rs[0] | Should -BeOfType "Microsoft.PowerShell.Com... | 0 |
sample_67_55.ps1 | #
# Module manifest for module 'OCI.PSModules.Opsi'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Opsi.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEditions
CompatiblePS... | 0 |
sample_4_63.ps1 | #************************************************
# TS_KB2655998_InactiveTSPorts.ps1
# Version 1.0.1
# Date: 03/21/2012 11:19:10
# Author: jasonf
# Description: Checks for inactive ts ports described in http://blogs.technet.com/b/askperf/archive/2012/03/06/performance-issues-due-to-inactive-terminal-server-ports.... | 0 |
SharePoint Large Lists.ps1 | [reflection.assembly]::loadwithpartialname("Microsoft.SharePoint")
$cs = [microsoft.sharepoint.administration.spwebservice]::ContentService
$global:largeListThreshhold = 2000
function Is-Admin([Microsoft.SharePoint.SPRoleAssignment]$roleAssignment)
{
return (($roleAssignment.roledefinitionbindings | where { ($_... | 0 |
2029.ps1 |
using namespace System.Management.Automation.Language
Describe "StaticParameterBinder tests" -Tags "CI" {
BeforeAll {
$testCases = @(
@{
Source = 'Get-Alias abc'
Description = 'string constant value'
BoundParametersCount = 1
Exce... | 0 |
sample_18_78.ps1 | Set-StrictMode -Version Latest
Import-Module (Join-Path $PSScriptRoot "Events.psm1")
Write-EventLog @EVL_CURTAINAPP -Message "Launching CurtainApp"
& $PSScriptRoot\CurtainApp\CurtainApp.exe --timeout 300 --mode "outofpackage"
& $Env:SystemDrive\Rigel\x64\Scripts\Provisioning\ScriptLaunch.ps1 ApplyConfig.ps1 -... | 0 |
4320.ps1 |
function Test-EquivalentLocation {
[CmdletBinding()]
[OutputType("bool")]
param(
[Parameter(Mandatory = $false)]
[string]$LocationA,
[Parameter(Mandatory = $false)]
[string]$LocationB
)
$LocationA = $LocationA.TrimEnd("\/")
$LocationB = $LocationB.TrimEnd("\/... | 0 |
Hash Checker_4.ps1 | #.Synopsis
# Test the HMAC hash(es) of a file
#.Description
# Takes the HMAC hash of a file using specified algorithm, and optionally, compare it to a baseline hash
#.Example
# Test-Hash npp.5.3.1.Installer.exe -HashFile npp.5.3.1.release.md5
#
# Searches the provided hash file for a line matching the "... | 0 |
sample_18_31.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 = '79.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
262.ps1 | function ConvertTo-Base64
{
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true,
ValueFromPipeline = $true)]
[ValidateScript({ Test-Path -Path $_ })]
[String]$Path
)
Write-Verbose -Message "[ConvertTo-Base64] Converting image to Base64 $Path"
[System.convert]::ToBase64String((Get-Content -Path $... | 0 |
3746.ps1 |
function Get-AllSecretPermissions
{
return @(
"get",
"list",
"set",
"delete",
"backup",
"restore",
"recover"
)
}
function Get-AllKeyPermissions
{
return @(
"get",
"create",
"delete",
"list",
"up... | 0 |
4179.ps1 |
Function GetRelativePath{
Set-Variable -Name RelativePath -Scope Local -Force
$RelativePath = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\"
Return $RelativePath
Remove-Variable -Name RelativePath -Scope Local -Force
}
Function GenerateGUID {
Set-Variable -Name GetGUID -Scope Loca... | 0 |
3177.ps1 | Function Get-GPPFile
{
[cmdletbinding(DefaultParameterSetName='Name')]
param(
[Parameter( Position=0,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
ParameterSetName='Name'
)]
[string[]]$Name = $null,
... | 0 |
748.ps1 |
param(
[Parameter(Mandatory)]
[string]$LastReleaseTag,
[Parameter(Mandatory)]
[string]$Token,
[Parameter(Mandatory)]
[string]$NewReleaseTag,
[Parameter()]
[switch]$HasCherryPick
)
$Script:powershell_team = @(
... | 0 |
sample_57_79.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_50_31.ps1 | #
# This private script adds $InterfaceType members to $psObject which invokes on $wrappedObject
#
Param(
$psObject,
$wrappedObject,
[Type]$InterfaceType
)
function GetInvoker
{
Param(
$Target,
$Method
)
if ($Method.IsGenericMethodDefinition) {
return {... | 0 |
sample_0_66.ps1 | #************************************************
# DC_RDSHelper.ps1
# Version 1.0.1
# Date: 21-01-2012
# Author: Daniel Grund - dgrund@microsoft.com /#_# WalterE
# Description:
# RDS helper file
# 1.0.0 Beta release
# 1.0.1 Added advapi32 to get userrightsassigments
#****************************************... | 0 |
sample_35_2.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 |
4144.ps1 |
[CmdletBinding()]
param ()
function Get-Architecture {
[CmdletBinding()][OutputType([string])]
param ()
$OSArchitecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture
$OSArchitecture = $OSArchitecture.OSArchitecture
Return $OSArchitecture
}
function Get-MSIInformation {
... | 0 |
157.ps1 | function Get-LogFast
{
[CmdletBinding()]
PARAM (
$Path = "c:\Biglog.log",
$Match
)
BEGIN
{
$StreamReader = New-object -TypeName System.IO.StreamReader -ArgumentList (Resolve-Path -Path $Path -ErrorAction Stop).Path
}
PROCESS
{
while ($StreamReader.Peek() -gt -1)
{
$Line = $Stream... | 0 |
sample_61_23.ps1 | # Localized 02/22/2024 08:42 AM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=是(&Y)
PromptNoString=否(&N)
BundleFound=找到了捆绑: {0}
PackageFound=找到包: {0}
EncryptedBundleFound=找到加密的包: {0}
EncryptedPackageFound=找到加密的包: {0}
CertificateFound=找到证书: ... | 0 |
Get-NestedGroups v_3.ps1 | Function Global:Get-NestedGroups {
<#
.SYNOPSIS
Enumerate all AD group memberships of an account (including nested membership).
.DESCRIPTION
This script will return the AD group objects for each group the user is a member of.
.PARAMETER UserName
The username whose group memberships to find.
.E... | 0 |
Run-Query (SharePoint).ps1 | function Run-Query($siteUrl, $queryText)
{
[reflection.assembly]::loadwithpartialname("microsoft.sharePOint") | out-null
[reflection.assembly]::loadwithpartialname("microsoft.office.server") | out-null
[reflection.assembly]::loadwithpartialname("microsoft.office.server.search") | out-null
$s = [microsoft.share... | 0 |
sample_7_79.ps1 | #************************************************
# TS_ClusterCAUWMINamespaceCheck.ps1
# Version 1.0.1
# Date: 1/16/2013
# Author: v-kaw
# Description: [Idea ID 6519] [Windows] Invalid Class error on 2012 Clusters (SDP)
# Rule number: 6519
# Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispF... | 0 |
PowerOAuth Beta 2.ps1 | if(@(Import-ConstructorFunctions -Path "$PSScriptRoot\\Types_Generated").Count -lt 3) {
Add-ConstructorFunction -T Hammock.Authentication.OAuth.OAuthCredentials, Hammock.RestClient, Hammock.RestRequest -Path "$PSScriptRoot\\Types_Generated"
}
$RequestToken = "request_token"
$AccessToken = "access_token"
$Auth... | 0 |
3637.ps1 |
function Test-ThreatDetectionUpdatePolicyWithClassicStorage
{
$testSuffix = getAssetName
Create-ThreatDetectionClassicTestEnvironment $testSuffix
$params = Get-SqlThreatDetectionTestEnvironmentParameters $testSuffix
try
{
Set-AzSqlDatabaseThreatDetectionSetting -ResourceGroupName $params.rg... | 0 |
Get-Films (From Netflix).ps1 | function Get-Films {
param($Name)
$proxy = New-ODataServiceProxy http://odata.netflix.com/Catalog/
if($Name -match "\\*") {
$sName = $Name -replace "\\*"
$Global:Films = $proxy.Titles.AddQueryOption('$filter',"substringof('$sName',Name)") | Where { $_.Name -like $Name }
} else {
$Glob... | 0 |
Select-EnumeratedType_1.ps1 | #requires -version 2
if (-not(test-path variable:script:_helpcache))
{
$SCRIPT:_helpCache = @{}
}
function Select-EnumeratedType
{
<#
.SYNOPSIS
Visually create an instance of an enum.
.DESCRIPTION
Visually create an instance of an enum with an easy to use menu system... | 0 |
sample_52_80.ps1 | @{
# Script module or binary module file associated with this manifest.
RootModule = 'Plaster.psm1'
# ID used to uniquely identify this module
GUID = 'cfce3c5e-402f-412a-a83a-7b7ee9832ff4'
# Version number of this module.
ModuleVersion = '1.1.3'
# Private data to pass to the module specif... | 0 |
sample_43_86.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 |
63.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 |
2956.ps1 | properties {
$x = $null
$y = $null
$z = $null
}
task default -depends TestProperties
task TestProperties {
Assert ($x -ne $null) "x should not be null. Run with -properties @{'x' = '1'; 'y' = '2'}"
Assert ($y -ne $null) "y should not be null. Run with -properties @{'x' = '1'; 'y' = '2'}"
Assert ($z -eq $... | 0 |
2374.ps1 | function Copy-FileWithHashCheck {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ValueFromPipeline = $True)]
[Alias('Fullname')]
[string]$SourceFilePath,
[Parameter(Mandatory = $true)]
[ValidateScript({ Test-Path -Path $_ -PathType Container })]
[string]... | 0 |
sample_42_56.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 = '73.1.0'
# Supported PSEditions
... | 0 |
sample_24_35.ps1 | #
# Module manifest for module 'OCI.PSModules.Databasemanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Databasemanagement.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Suppo... | 0 |
Test-Port_2.ps1 | function Test-Port{
<#
.SYNOPSIS
Tests port on computer.
.DESCRIPTION
Tests port on computer.
.PARAMETER computer
Name of server to test the port connection on.
.PARAMETER port
Port to test
.PARAMETER tcp
Use tcp port
.PARAMETER udp
Use udp port
.PARAMETER UDP... | 0 |
4047.ps1 |
param([string]$outputDir = $(throw "You must specify the output path to emit the generated file"),
[string]$localizedHelpPath = $(throw "You must specify the path to the localized help dir"),
[string]$configuration = $(throw "You must specify the build configuration"))
$ScriptDir = Split-Pa... | 0 |
658.ps1 |
$reportPortalUri = if ($env:PesterPortalUrl -eq $null) { 'http://localhost/reports' } else { $env:PesterPortalUrl }
$reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl }
function VerifyCatalogItemDoesNotExists()
{
param(
[Parameter(Manda... | 0 |
sample_31_46.ps1 | ConvertFrom-StringData @'
IPAddressDisplayNameFormat=IP Address: {0}
NetworkNameDisplayNameFormat=Name: {0}
NetworkNameOfflineDisplayNameFormat=IP Address: Address on "{0}"
CreateClusterProgressValidationStart=Validating servers suitability for a failover cluster.
CreateClusterProgressValidationEnd=Done validating... | 0 |
2529.ps1 | param([string[]]$paths = "paths",[string]$ext = "ext", [switch]$del)
function Search($path, $ext, $del)
{
Start-Job {param($path,$ext,$del)
$logfile = "E:\GetFiles-$ext.txt"
$files = gci $path -r -i *.$ext
$files |out-file $logfile
$sum = $files |measure-object -property length -sum
$count = $files... | 0 |
sample_64_0.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_23_35.ps1 | ConvertFrom-StringData @'
IPAddressDisplayNameFormat=Adresse IP : {0}
NetworkNameDisplayNameFormat=Nom : {0}
NetworkNameOfflineDisplayNameFormat=Adresse IP : adresse sur « {0} »
CreateClusterProgressValidationStart=Validation de l'adéquation des serveurs pour un cluster de basculement.
CreateClusterProgressValidat... | 0 |
be1eed1f-2503-4aa5-b552-787f15259255.ps1 | @@---------------------logoff_clientside_interactive.ps1-----------------
#powershell -ExecutionPolicy Unrestricted logoff_clientside_interactive.ps1
$ErrorActionPreference = "silentlycontinue"
$mycreds = (Get-Credential)
Invoke-Command -ComputerName terminalserver -Credential $mycreds {
&"C:\\Program Files\\int... | 0 |
2177.ps1 |
Import-Module -Name ConfigurationManager
Set-Location -Path P01:
$ApplicationName = "ConfigMgr 2012 R2 SP1 CU1 Console"
$ApplicationDescription = "Created with PowerShell"
$ApplicationSoftwareVersion = "5.0.8239.1206"
$ApplicationPublisher = "Microsoft"
$ApplicationPath = "\\CM01\Source$\Apps\CM2012R2SP1Console\Ad... | 0 |
sample_13_56.ps1 | #************************************************
# DC_NgenCollect.ps1
# Version 1.0
# Date: 2009-2019
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects .Net Framework nGen files
# Called from: TS_AutoAddCommands_Apps.ps1
#*******************************************************
Trap [Excep... | 0 |
sample_45_47.ps1 | #
# Script module for module 'Az.Aks' that is executed when 'Az.Aks' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:39
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
if ((Ge... | 0 |
sample_22_7.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydomains'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydomains.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported P... | 0 |
Invoke-ElevatedCommand_1.p.ps1 | param
(
## The script block to invoke elevated
[Parameter(Mandatory = $true)]
[ScriptBlock] $Scriptblock,
## Any input to give the elevated process
[Parameter(ValueFromPipeline = $true)]
$InputObject,
## Switch to enable the user profile
[switch] $EnableProfile
)
begi... | 0 |
sample_20_7.ps1 | ConvertFrom-StringData @'
id_crmcollectactivity=Collecting System Information
id_crmformattingdata=Formatting Data
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADA... | 0 |
sample_6_64.ps1 | #************************************************
# TS_DefaultDynamicPortChanged.ps1
# Version 1.0.1
# Date: 5/8/2013
# Author: v-kaw
# Description: [Idea ID 5438] [Windows] Windows 2012 Hyper-V SPN and SCP not registered if customer uses a non default dynamicportrange
# Rule number: 5438
# Rule URL: http://s... | 0 |
Invoke-CmdScript.ps1 | ##############################################################################\n##\n## Invoke-CmdScript\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\nInvoke ... | 0 |
sample_27_26.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(Mand... | 0 |
1312.ps1 |
function Write-CFile
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
$Path,
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[AllowEmptyCollection()]
[AllowEmptyString()]
[string[]]$InputObject,
... | 0 |
sample_66_57.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydataplane.dll'
# Version number of this module.
ModuleVersion = '88.1.0'
# Support... | 0 |
sudo.ps1 | [CmdletBinding()]
Param(
[Parameter(ValueFromRemainingArguments=$true)]
$command=$(Read-Host "You must specify a command")
)
#requires -version 2.0
function global:Sudo {
## In order to use this, you have to
## Create a "Scheduled Task" named "Elevated powershell.exe" to run
## PowerShell -Command ... | 0 |
Import-Certificate_8.ps1 | #requires -Version 2.0
function Import-Certificate
{
param
(
[IO.FileInfo] $CertFile = $(throw "Paramerter -CertFile [System.IO.FileInfo] is required."),
[string[]] $StoreNames = $(throw "Paramerter -StoreNames [System.String] is required."),
[switch] $LocalMachine,
[switch] $CurrentUser,
[string... | 0 |
sample_55_58.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="E:\艺施胡\alova-devtools\node_modules\.pnpm\typescript@5.5.3\node_modules\typescript\bin\node_modules;E:\艺施胡\alova-devtools\node_modules\.pnpm\typescript@5.5.3\node_modules... | 0 |
2812.ps1 |
$data = $null
foreach ($file in (ls *svcall.xml)) {
$data += Import-Clixml $file
}
$data | Select-Object Caption, Pathname | Sort-Object Caption, Pathname | Group-Object Caption, Pathname | Sort-Object Name | 0 |
Watch-Process.ps1 | ## Watch-Process.ps1
## Continuously display a process list, sorted
## by the desired criteria.
##
## usage: poll-process [sortCriteria] [pollInterval]
##
## sortCriteria must be one of "Id", "ProcessName", "MainWindowTitle",
## "Processor", "Disk", or "WorkingSet"
## pollInterval ... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.