filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
SSL Oblivious Web Client.ps1 | function New-TrustAllWebClient {
# Create a compilation environment
$Provider=New-Object Microsoft.CSharp.CSharpCodeProvider
$Compiler=$Provider.CreateCompiler()
$Params=New-Object System.CodeDom.Compiler.CompilerParameters
$Params.GenerateExecutable=$False
$Params.GenerateInMemory=$True
$Params.IncludeDe... | 0 |
IADsDNWithBinary Cmdlet.ps1 | @@//Adapted from code @ http://mow001.blogspot.com/2006/01/msh-snap-in-to-translate.html Thanks!
using System;
using System.ComponentModel;
using System.Management.Automation;
using System.Reflection;
using System.Diagnostics;
namespace space
{
// This class defines the properties of a snap-in
[... | 0 |
sample_48_75.ps1 |
function getWorldMatrix(element) {
return element.getTrait("WorldTransform").value;
}
var isOrtho = false;
function getCameraElement() {
var camera = document.elements.findElementByTypeId("Microsoft.VisualStudio.3D.PerspectiveCamera");
if (camera == null) {
isOrtho = true;
came... | 0 |
Send-HTMLFormattedEmail_4.ps1 | ##################################################
# cmdlets
##################################################
#-------------------------------------------------
# Send-HTMLFormattedEmail
#-------------------------------------------------
# Usage: Send-HTMLFormattedEmail -?
#------------------------------------... | 0 |
1744.ps1 |
[cmdletbinding(DefaultParameterSetName='default')]
param (
[string] $fork = 'powershell',
[string] $branch = 'master',
[string] $location = "$pwd\powershell",
[string] $destination = "$env:WORKSPACE",
[ValidateSet("win7-x64", "win7-x86", "win-arm", "win-arm64", "fxdependent", "fxdependent-win... | 0 |
sample_18_39.ps1 | ConvertFrom-StringData @'
id_rsop=Resultant Set of Policy (RSoP)
id_rsopobtaining=Obtaining Resultant Set of Policy (RSoP) via gpresult.exe utility
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JN... | 0 |
Seach-LocalGroupMemberDo.ps1 | function Seach-LocalGroupMemberDomenNetwork() {
param(
$Domen,
$User
)
function Ping ($Name){
$ping = new-object System.Net.NetworkInformation.Ping
if ($ping.send($Name).Status -eq "Success") {$True}
else {$False}
trap {Write-Verbose "Ошибка пи&#... | 0 |
1291.ps1 |
function Get-CPermission
{
[CmdletBinding()]
[OutputType([System.Security.AccessControl.AccessRule])]
param(
[Parameter(Mandatory=$true)]
[string]
$Path,
[string]
$Identity,
[Switch]
$Inherited
)
... | 0 |
1827.ps1 |
function Get-RandomString
{
param ( [int]$Length = 8 )
$chars = .{ ([int][char]'a')..([int][char]'z');([int][char]'A')..([int][char]'Z') }
([char[]]($chars | Get-Random -Count $Length)) -join ""
}
function Get-NonExistantProviderName
{
param ( [int]$Length = 8 )
do {
$providerName = Get-R... | 0 |
sample_46_97.ps1 | #
# Module manifest for module 'OCI.PSModules.Tenantmanagercontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Tenantmanagercontrolplane.dll'
# Version number of this module.
ModuleVersion = '83... | 0 |
Update Subnet Masks.ps1 | #config
@@#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@#NOTE: Does not support IPv6. If used on a network with static IPv6 addresses,
@@#they may be lost.
@@#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@$network = "10.200.*"
@@$newSubnet = ... | 0 |
sample_0_54.ps1 | #
# Module manifest for module 'OCI.PSModules.Licensemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll'
# Version number of this module.
ModuleVersion = '92.1.0'
# Supported PSE... | 0 |
Rename NICs.ps1 | $Shell = New-Object -com shell.application
$NetCons = $Shell.Namespace(0x31)
$NetCons.Items() |
where {$_.Name -like 'Local Area Connection*'} |
foreach{$AdapName=$_.Name; get-WmiObject -class Win32_NetworkAdapter |
where-Object {$_.NetConnectionID -eq $AdapName} |
foreach {$MAC=$_.MacAddress}
... | 0 |
Manage ASP_4.NET Providers.ps1 | # Manage_ASP_NET_Providers.ps1
# by Chistian Glessner
# http://iLoveSharePoint.com
# have to be initialized. If you want to change the app config you have to restart PowerShell
param($appConfigPath=$null)
# App config path have to be set before loading System.Web.dll
[System.AppDomain]::CurrentDomain.SetData(... | 0 |
1042.ps1 |
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$WebRoot,
[Switch]
$SkipCommandHelp
)
Set-StrictMode -Version 'Latest'
function Out-HtmlPage
{
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
[... | 0 |
sample_12_90.ps1 | #
# Module manifest for module 'OCI.PSModules.Osmanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osmanagement.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditi... | 0 |
sample_22_23.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 = '79.0.0'
# Supported PSEditi... | 0 |
Get Twitter RSS Feed_1.ps1 | param ([String] $ScreenName)
$client = New-Object System.Net.WebClient
$idUrl = "https://api.twitter.com/1/users/show.json?screen_name=$ScreenName"
$data = $client.DownloadString($idUrl)
$start = 0
$findStr = '"id":'
do {
$start = $data.IndexOf($findStr, $start + 1)
if ($start -gt 0) {
$s... | 0 |
sample_20_60.ps1 | # Web Deploy: Powershell script to set up delegated deployments with Web Deploy
# Copyright (C) Microsoft Corp. 2010
#
# Requirements: IIS 7, Windows Server 2008 (or higher)
#
# elevatedUsername/elevatedPassword: Credentials of a user that has write access to applicationHost.config. Used for createApp, appPoolNetF... | 0 |
2187.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, HelpMess... | 0 |
Get-User_3.ps1 | function Get-User($user)
{
# this function should be passed the CN of the user to be returned
$dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
$root = [ADSI] "LDAP://$($dom.Name)"
$searcher = New-Object System.DirectoryServices.DirectorySearcher $root
$searcher.filter = "(&(objec... | 0 |
3386.ps1 |
$excludedExtensions = @(".dll", ".zip", ".msi", ".exe")
function Get-Transcript
{
param([string] $path)
return Get-Content $path |
Select-String -InputObject {$_} -Pattern "^Start Time\s*:.*" -NotMatch |
Select-String -InputObject {$_} -Pattern "^End Time\s*:.*" -NotMatch |
Select-St... | 0 |
Sweet Child O' Mine.ps1 | #First Stanza
[System.Console]::Beep(587.3,200)
[System.Console]::Beep(1174.7,200)
[System.Console]::Beep(880,200)
[System.Console]::Beep(784,200)
[System.Console]::Beep(1568,200)
[System.Console]::Beep(880,200)
[System.Console]::Beep(1480,200)
[System.Console]::Beep(880,200)... | 0 |
sample_4_84.ps1 | # Localized 10/16/2024 05:34 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Sì
PromptNoString=&No
BundleFound=Pacchetto trovato: {0}
PackageFound=Pacchetto trovato: {0}
EncryptedBundleFound=Bundle crittografato trovato: {0}
EncryptedPackag... | 0 |
FTP upload_5.ps1 | @charset "utf-8";
/*
Credit:http://www.templatemo.com
*/
body {
margin: 0px;
padding: 0px;
color: #c2bead;
font-family: Tahoma, Geneva, sans-serif;
font-size: 12px;
line-height: 1.5em;
background-color: #2f2e28;
background-image: url(images/templatemo_body.jpg);
background-repeat: repeat-y;
bac... | 0 |
4464.ps1 |
function Find-PSResource {
[OutputType([PSCustomObject[]])]
[Cmdletbinding(SupportsShouldProcess = $true)]
Param
(
[Parameter(ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true,
Position = 0)]
[ValidateNotNullOrEmpty()]
... | 0 |
444.ps1 | Register-PSFConfigValidation -Name "stringarray" -ScriptBlock {
Param (
$Value
)
$Result = New-Object PSObject -Property @{
Success = $True
Value = $null
Message = ""
}
try
{
$data = @()
foreach ($item in $Value)
{
$data += [string]$item
}
}
catch
{
$Result.Message = "Not a str... | 0 |
sample_3_18.ps1 | If ($OSVersion.Major -ge 6)
{
Import-LocalizedData -BindingVariable SLMGRStrings
Write-DiagProgress -Activity $SLMGRStrings.ID_KMSActivation -Status $SLMGRStrings.ID_KMSActivationObtaining
Function Runslmgr ([string]$ScriptOption="")
{
$CommandToExecuteLenght = $ScriptOption.Length + 10
"-" * ($Com... | 0 |
sample_6_63.ps1 | ConvertFrom-StringData @'
id_sccm_activity_genericinfo=Gathering OS Information
id_sccm_genericinfo_osinfo=Obtaining OS Details
id_sccm_genericinfo_sysinfo=Obtaining SystemInfo, Running Tasks and Services
id_sccm_genericinfo_msinfo=Obtaining MSInfo Output
id_sccm_genericinfo_rsop=Obtaining GPResult Output
id_sccm... | 0 |
770.ps1 |
[CmdletBinding(DefaultParameterSetName = "Build")]
param(
[Parameter(ParameterSetName="Bootstrap")]
[switch]
$Bootstrap,
[Parameter(ParameterSetName="Build")]
[switch]
$Clean,
[Parameter(ParameterSetName="Build")]
[switch]
$Test
)
$NeededTools = @{
VSCode = "Visual Studio ... | 0 |
sample_3_77.ps1 | Vigor2865 Series User’s Guide 796 TTeellnneett CCoommmmaanndd:: aaddssll ppvvccbbiinnddiinngg This command can configure PVC to PVC binding. Such command is available only for PPPoE and MPoA 1483 Bridge mode. SSyynnttaaxx adsl pvcbinding [pvc_x pvc_y | status | -1 ] SSyynnttaaxx DDeessccrriippttiioonn Param... | 0 |
976.ps1 |
$SubscriptionId = ''
$resourceGroupName = "myResourceGroup-$(Get-Random)"
$location = "westeurope"
$adminSqlLogin = "SqlAdmin"
$password = "ChangeYourAdminPassword1"
$serverName = "server-$(Get-Random)"
$databaseName = "myImportedDatabase"
$storageAccountName = "sqlimport$(Get-Random)"
$storageContainerName = "i... | 0 |
New-Script.ps1 | ## New-Script function
## Creates a new script from the most recent commands in history
##################################################################################################
## Example Usage:
## New-Script ScriptName 4
## creates a script from the most recent four commands
## New-Script... | 0 |
2749.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)
}
}
if ([environment]::OSVersion.Version.... | 0 |
4068.ps1 |
[CmdletBinding()]
param
(
[switch]$FileOutput,
[ValidateNotNullOrEmpty()][string]$FileName = 'TrustedSitesReport.txt'
)
function Get-RelativePath {
[CmdletBinding()][OutputType([string])]
param ()
$Path = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent) + "\"
Return $Path
}
$HKCU = $(get-item "HK... | 0 |
sample_63_44.ps1 | <#
.SYNOPSIS
UninstallSyncServiceIIS.ps1 script file
This is a place-holder file only fofr agent patch build purposes
#>
Write-Host "This file functionality is deprecated and is place-holder only"
# SIG # Begin signature block
# MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# ... | 0 |
111.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
i... | 0 |
sample_55_57.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=An environment variable of this name and type already exists.
EnvironmentErrorDoesNotExists=An environment variable of this name and type does not exist.
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# ... | 0 |
1405.ps1 |
function Join-CIisVirtualPath
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,Position=0)]
[string]
$Path,
[Parameter(Position=1)]
[string]
$ChildPath
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Se... | 0 |
Start-BootsTimer_2.ps1 | function Start-BootsTimer {
#.Syntax
# Creates a stay-on-top countdown timer
#.Description
# A WPF borderless count-down timer, with audio/voice alarms and visual countdown + colored progress indication
#.Parameter EndMessage
# The message to be spoken by a voice when the time is up...
#.Parameter StartMessag... | 0 |
sample_19_18.ps1 | #
# Module manifest for module 'OCI.PSModules.Filestorage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Filestorage.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEdition... | 0 |
sample_63_73.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 License... | 0 |
Invoke-ComplexDebuggerSc.ps1 | #############################################################################\n##\n## Invoke-ComplexDebuggerScript\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS... | 0 |
sample_58_32.ps1 | $version="0.54.3"
$fzf_base=Split-Path -Parent $MyInvocation.MyCommand.Definition
function check_binary () {
Write-Host " - Checking fzf executable ... " -NoNewline
$output=cmd /c $fzf_base\bin\fzf.exe --version 2>&1
if (-not $?) {
Write-Host "Error: $output"
$binary_error="Invalid binary"
} else {
... | 0 |
sample_14_37.ps1 | #
# Module manifest for module 'OCI.PSModules.Dashboardservice'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dashboardservice.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported... | 0 |
sample_7_30.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al... | 0 |
Custom Speech Commands_3.ps1 | #Filename commands.ps1
import-module "G:\\Documents\\Speech Macros\\custom.psm1"
import-module "G:\\Documents\\Speech Macros\\alice.psm1"
Add-SpeechCommands @{
"test command" = { Say $(Respond "3:2,4:0-2") }
" * the percentages * " = { Say $(Percentages) }
" * star date * " = { Say "Current,... | 0 |
MoveJunkEmail.ps1 | <######################################################
Name: MoveJunkEmail.ps1
Author: Shawn Harris
Date: 15 Oct 2012
Purpose: Move specified messages from JunkEmail to another
folder. Criteria can be filtered with the restricted property.
######################################################>
#Assembly can ... | 0 |
sample_14_10.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 |
SMS_2.psm1.ps1 | <#
.Synopsis
Functions for managing SMS and SCCM.
.Notes
NAME: SMS.psm1
AUTHOR: Tim Johnson <tojo2000@tojo2000.com>
#>
#Requires -version 2.0
[string]$default_wmi_provider_server = 'myserver'
[string]$default_site = 'S00'
function Get-SmsWmi {
<#
.Synopsis
A function for accessing the... | 0 |
540.ps1 |
function Add-SPODateTimeFieldtoList
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string] $listTitle,
[Parameter(Mandatory=$true, Position=2)]
[string] $fieldName
)
$newField = "<Field Type='DateTime' DisplayName='$fieldName' Name='$fieldName' required='FALSE'/>"
Add-... | 0 |
sample_67_70.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.Synopsis
Registers or unregisters the PowerShell ETW manifest
.Parameter Path
The fully qualified path to the PowerShell.Core.Instrumentation.man manifest file.
The default value is the location of this script.
.Paramet... | 0 |
sample_42_47.ps1 | #
# Module manifest for module 'OCI.PSModules.Ocicontrolcenter'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ocicontrolcenter.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported... | 0 |
sample_45_30.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerengine'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerengine.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported P... | 0 |
2842.ps1 |
function Test-ModuleVersion {
[CmdletBinding()]
param (
[string]$currentVersion,
[string]$minimumVersion,
[string]$maximumVersion,
[string]$lessThanVersion
)
begin {
}
process {
$result = $true
if("$minimumVersion$maximumVersion$lessth... | 0 |
sample_55_84.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 = '83.1.0'
# Suppo... | 0 |
sample_31_75.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 = '80.0.0'
# S... | 0 |
Speech Recognition 2.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 |
sample_57_26.ps1 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apa... | 0 |
sample_4_59.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_4_24.ps1 | #************************************************
# TS_SurfaceDetectFirmwareVersions.ps1
# Description: SurfaceDetectFirmwareVersions
#
# Rule GUID: 34F6567E-7B92-4C37-B1CA-5DE6E66D4881
#
# Files:
# TS_SurfaceDetectFirmwareVersions.ps1
# RC_SurfaceDetectFirmwareVersions.xml
# Include.xml
#
# Output files:
#... | 0 |
sample_43_81.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplaceprivateoffer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplaceprivateoffer.dll'
# Version number of this module.
ModuleVersion = '83.2.0... | 0 |
sample_25_58.ps1 | #
# Module manifest for module 'OCI.PSModules.Generativeaiinference'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Generativeaiinference.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
#... | 0 |
168.ps1 | Write-Host "[Math]::Round(7.9)"
Write-Host "[Convert]::ToString(576255753217, 8)"
Write-Host "[Guid]::NewGuid()"
Write-Host "[Net.Dns]::GetHostByName('schulung12')"
Write-Host "[IO.Path]::GetExtension('c:\test.txt')"
Write-Host "[IO.Path]::ChangeExtension('c:\test.txt', 'bak')" | 0 |
2111.ps1 |
Describe 'Parallel switch syntax' -Tags 'CI' {
Context 'Should be able to retrieve AST of parallel switch' {
BeforeAll {
$ast = [System.Management.Automation.Language.Parser]::ParseInput(
'switch -parallel ($foo) {1 {break}}', [ref] $null, [ref] $null)
}
It '... | 0 |
461.ps1 |
Set-PSFConfig -Module PSFramework -Name 'Runspace.StopTimeoutSeconds' -Value 30 -Initialize -Validation "integerpositive" -Handler { [PSFramework.Runspace.RunspaceHost]::StopTimeoutSeconds = $args[0] } -Description "Time in seconds that Stop-PSFRunspace will wait for a scriptspace to selfterminate before killing it."
| 0 |
3264.ps1 |
enum AccessRight {
Allow
Deny
}
enum ConnectionStatus {
Connected
Disconnected
}
enum TriggerType {
Command
Event
Regex
}
enum Severity {
Success
Warning
Error
None
}
enum LogLevel {
Info = 1
Verbose = 2
Debug = 4
}
enum LogSeverity {
Normal
Warning... | 0 |
sample_12_8.ps1 | ConvertFrom-StringData @'
id_filesnottobackup2k3check_st=There are too many HKLM\\SYSTEM\\CurrentControlSet\\Control\\BackupRestore\\FilesNotToBackup entries and this may cause problems with ntbackup
'@
# SIG # Begin signature block
# MIIoUwYJKoZIhvcNAQcCoIIoRDCCKEACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgE... | 0 |
1189.ps1 |
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'Get-ComPermission' {
It 'should get com access permissions' {
$rules = Get-ComPermission -Access -Default
$rules | Should -Not -BeNullOrEmpty
$rules.Count | Should -BeGreaterThan 1
... | 0 |
Compare-Agents_1.ps1 | #This scripts compares the agents that are installed in two zones and
#gives the agents that are not common.
#Usage:
#Compare-Agents.ps1 -server1 RMSServer1.contoso.com -server2 RMSServer2.contoso.com -output c:\\Temp.txt
#RMSServer1 is the one whose agents are to be moved.
param([string] $Server1,$Server2,$outp... | 0 |
sample_50_18.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=Modul PowerShell yang diperlukan (FailoverClusters) tidak ditemukan. Gunakan Alat Peran & Fitur untuk menginstal: Alat Administrasi Server Jarak Jauh | | Alat Administrasi Fitur | Alat Pengklusteran Failover Modul Kluster Failover untuk Windows PowerShell.
'@
... | 0 |
sample_53_70.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 |
Set-UserCannotChangePass.ps1 | #########1#########2#########3#########4#########5#########6#########7#########8#########9#########1
#########0#########0#########0#########0#########0#########0#########0#########0#########0#########0
#
# Author: Erik McCarty
#
# Description: Set the "user Cannot Change Password" property on an active
# director... | 0 |
sample_43_52.ps1 | Rem AnimationEncyclopedia.vbs
Rem An InDesign VBScript
Rem
Rem Author: Brenda Burden
Rem Creates a 6-page sample doc demonstrating the new InDesign Animation feature
Rem Search Reference
Rem PAGE ONE - Sample of Animation Properties
Rem PAGE TWO - Sample of all Animation Events
Rem PAGE THREE - Sample ... | 0 |
Roll-Dice_2.ps1 | # Roll-Dice.ps1
# Cody Bunch
# ProfessionalVMware.com
Begin {
$rand = New-Object System.Random
$dice = $rand.next(1,4)
}
Process {
if ( $_ -isnot [VMware.VimAutomation.Types.Snapshot] ) { continue }
if ($dice -gt 1) {
$_ | Remove-Snapshot -Confirm:$false
Write-Host "OH NOES! Snapshot $_ Has been... | 0 |
3028.ps1 | function Should-HaveCount($ActualValue, [int] $ExpectedValue, [switch] $Negate, [string] $Because) {
if ($ExpectedValue -lt 0) {
throw [ArgumentException]"Excpected collection size must be greater than or equal to 0."
}
$count = if ($null -eq $ActualValue) {
0
}
else {
$... | 0 |
2228.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, HelpMess... | 0 |
Make a phone call_3.ps1 | <#
.NOTES
AUTHOR: Sunny Chakraborty(sunnyc7@gmail.com)
WEBSITE: http://tekout.wordpress.com
VERSION: 0.1
CREATED: 17th April, 2012
LASTEDIT: 17th April, 2012
Requires: PowerShell v2 or better
.CHANGELOG
4/17/2012 Try passing powershell objects to PROTO API and pass the variables to .JS file
P... | 0 |
sample_59_51.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 |
2771.ps1 |
if (Test-Path "$env:SystemRoot\sigcheck.exe") {
$rootpath = Get-Random -Minimum 1 -Maximum 6
switch ($rootpath) {
1 { $rootpath = "$env:temp\" }
2 { $rootpath = "$env:systemroot\" }
3 { $rootpath = "$env:allusersprofile\" }
4 { $rootpath = "$env:ProgramFiles\" }
5... | 0 |
sample_48_65.ps1 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apa... | 0 |
Get-SRVPriority.ps1 | #Returns the priority SRV hostname and port for a particular service and domain.
function Get-SRVPriority {
param( [string] $query = $( Throw "Query required in the format _Service._Proto.DomainName (ie, `"_ftp._tcp.myserver.net`" or `"_xmpp-client._tcp.gmail.com`").") )
#get all the SRV records for this servic... | 0 |
sample_29_46.ps1 | #
# Module manifest for module 'OCI.PSModules.Licensemanager'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Licensemanager.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSE... | 0 |
291.ps1 | function Get-PSFTaskEngineCache
{
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFTaskEngineCache')]
Param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]
$Module,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]
$... | 0 |
308.ps1 | function Register-PSFTeppScriptblock
{
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFTeppScriptblock')]
Param (
[Parameter(Mandatory = $true)]
[System.Management.Automation.ScriptBlock]
$ScriptBlock,
[Parameter(Mandatory = $true)]
[string]
$Name,
... | 0 |
SqlProxy_6.psm1.ps1 | # ---------------------------------------------------------------------------
### <Author>
### Chad Miller
### </Author>
### <Description>
### Based on functions in SQLPSX. SqlProxy.psm1 module is used for administering
### SQL Server logins, users, and roles. Designed to be used with PS Remoting.
### All actio... | 0 |
Test-Hash_1.ps1 | function Test-Hash {
#.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
# C:\\PS>ls .\\Bin\\Release -recurse | Test-Hash -BasePath .\\Bin\\Release -Type SHA256 | Export-CSV ~\\Hashes.... | 0 |
4330.ps1 | function Get-EnvironmentVariable
{
param
(
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[String]
$Name,
[parameter(Mandatory = $true)]
[int]
$Target
)
if ($Target -eq $script:EnvironmentVariableTarget.Process)
{
return [S... | 0 |
2469.ps1 |
$files = [ordered]@{
'SQLSysClrTypes.msi' = 'http://go.microsoft.com/fwlink/?LinkID=239644&clcid=0x409'
'SharedManagementObjects.msi' = 'http://go.microsoft.com/fwlink/?LinkID=239659&clcid=0x409'
'PowerShellTools.msi' = 'http://go.microsoft.com/fwlink/?LinkID=239656&clcid=0x409'
'azure-powershell.0.9.8.msi' =... | 0 |
605.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://download.microsoft.com/download/D/E/0/DE02CCED-5209-49FC-9F1B-0F86D3269D4C/sharepointclientcomponents_x64.msi"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Con... | 0 |
1958.ps1 |
Describe "Select-Xml DRT Unit Tests" -Tags "CI" {
BeforeAll {
$testfile = "TestDrive:\testfile.xml"
$xmlContent = @"
<?xml version ="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book category="CHILDREN">
<title lang="english">Harry Potter</title>
<price>30.00</price>
</book>
<book category="WEB">
<title ... | 0 |
sample_2_39.ps1 | #************************************************
# DC_NfsClient-Component.ps1
# Version 1.0.06.26.14: Created script.
# Version 1.1.08.14.14: Updated comments. TFS264083
# Date: 2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about NFS Client.
# Called from: Main Networkin... | 0 |
sample_11_92.ps1 | # Load Common Library
# Load Reporting Utilities
#_#$debug = $false
. ./utils_cts.ps1
#_#. ./TS_RemoteSetup.ps1
$FirstTimeExecution = FirstTimeExecution
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.ScriptLineNumber)): $_" -shortformat; continue
Write-Host "$($_.... | 0 |
sample_38_65.ps1 | #
# Module manifest for module 'OCI.PSModules.Common'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Common.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
Compatib... | 0 |
sample_35_84.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Autoscale.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Module]::Instance
# Export nothing to clear implici... | 0 |
sample_20_80.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\cssesc@3.0.0\node_modules\cssesc\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\cssesc@3.0.... | 0 |
sample_47_59.ps1 | #
# Module manifest for module 'OCI.PSModules.Loggingingestion'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported... | 0 |
validate an IP address_3.ps1 | # validate given IP address as an IPAdress (given string input)
PARAM($IP=$(read-host "Enter any IP Address"))
## YOU could do this, but ...
# $IP -match "(\\d{1,3}).(\\d{1,3}).(\\d{1,3}).(\\d{1,3})" -and -not ([int[]]$matches[1..4] -gt 255)
## you shouldn't parse things yourself when it's in the framework. You... | 0 |
sample_24_28.ps1 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
#-------------------------------------------------------------------------
$ErrorActionPreference = "Stop"
$paramsRegKey = 'HKLM:\SYSTEM\CurrentControlSet\Services\ADSync\Param... | 0 |
sample_33_77.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 = '79.0.0'
# Supported PSEdi... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.