filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
Compare-DatabaseSchema.ps1 | param( $SqlServerOne = 'YourDatabaseServer',
$FirstDatabase = 'FirstDatabaseToCompare',
$SqlUsernameOne = 'SQL Login',
$SqlPasswordOne = 'SQL Password',
$SqlServerTwo = 'YourDatabaseServer',
$SecondDatabase = 'SecondDatabaseToCompare',
$SqlUsernameTwo = 'SQL Login',
$SqlPasswordTwo = 'SQL Password',
$... | 0 |
4028.ps1 |
function Test-CreatesNewSimpleResource
{
$rgname = Get-ResourceGroupName
$rname = Get-ResourceName
$rglocation = Get-Location "Microsoft.Resources" "resourceGroups" "West US"
$location = Get-Location "Microsoft.Sql" "servers" "West US"
$apiversion = "2014-04-01"
$resourceType... | 0 |
sample_19_71.ps1 | ConvertFrom-StringData @'
id_ctsipsec=IPsec
id_ctsipsecdescription=Collects information about IPsec.
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlA... | 0 |
Get-Netstat 1,_1.ps1 | $null, $null, $null, $null, $netstat = netstat -a -n -o
[regex]$regexTCP = '(?<Protocol>\\S+)\\s+((?<LAddress>(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.(2[0-4]\\d|25[0-5]|[01]?\\d\\d?))|(?<LAddress>\\[?[0-9a-fA-f]{0,4}(\\:([0-9a-fA-f]{0,4})){1,7}\\%?\\d?\\... | 0 |
VM Performance Report - .ps1 | <#
.SYNOPSIS
The script creates an HTML report for given vSphere VM's, that contains VM performance data over a given period. The script then emails the report to a given address.
.DESCRIPTION
The script requires an input file, supplied as an argument to the script. The first line of this file contains an e... | 0 |
PurgeFiles script..ps1 | <#
.SYNOPSIS
PurgeFiles - recursively remove files with given extension and maximum age from a given path.
.DESCRIPTION
Read the synopsis
Example
PurgeFiles.psq -path C:\\temp -ext .tmp -max 24
.EXAMPLE
PurgeFiles.psq -path C:\\temp -ext .tmp -max 24
#>
# HISTORY
# 2010/01/29
# rluiten Created
para... | 0 |
Get-ServiceAccounts_1.ps1 | #requires -pssnapin PSCX
#Author: Glenn Sizemore glnsize@get-admin.com
#Purpose: Scan a remote system for any services running under a non standard account.
# Standard accounts would be considered, NT AUTHORITY\\NetworkService,
# NT AUTHORITY\\LocalService, LocalSystem, or .\\ASPNET
#... | 0 |
Check latest BIOS Rev.ps1 | $BiosRev = Get-WmiObject -Class Win32_BIOS -ComputerName $ComputerName -Credential $Credentials
# Shortened URL for the Dell Support page, fileid=441102, appears to be the identifier for BIOS downloads
# I tested this on a few different models of Dell workstations.
$DellBIOSPage = "http://support.dell.com/suppor... | 0 |
List AD Users CSV_1.ps1 | $NumDays = 0
$LogDir = ".\\User-Accounts.csv"
$currentDate = [System.DateTime]::Now
$currentDateUtc = $currentDate.ToUniversalTime()
$lltstamplimit = $currentDateUtc.AddDays(- $NumDays)
$lltIntLimit = $lltstampLimit.ToFileTime()
$adobjroot = [adsi]''
$objstalesearcher = New-Object System.DirectoryServices.Dire... | 0 |
PrinterActivity.ps1 | #PrinterChecking Script By Henrik Pedersen Ċmark and Daniel Lundgren
#This script is designed to check what printers that is still in use.
#It's assumed the printer is classed as inactive if it hasnt been used in X months
#The script is reading the Systemlog on a printserver of your choice, the one you type in the... | 0 |
sample_55_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.
# ------------------------------------------------------------
[CmdletBinding(DefaultParamet... | 0 |
sample_48_0.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ManagedServiceIdentity.private.dll')
# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ManagedServiceIdentity.internal.psm1'
if(Test-Path $i... | 0 |
sample_26_98.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 = '77.0.0'
# Support... | 0 |
sample_2_71.ps1 | ConvertFrom-StringData @'
id_printerkb2457866check=Checking for KB 2457866
id_printerkb2457866checkdesc=Checking for Event 602 on Microsoft-Windows-PrintService/Admin Event Log
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3A... | 0 |
2519.ps1 |
$MissingIndexesQuery =
"sel_SQLIndexesMissingByDatabase"
function Run-Query()
{
param (
$SqlQuery,
$SqlServer,
$SqlCatalog
)
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection("Data Source=$SqlServer;Integrated Security=SSPI;Initial Catalog=$SqlCatalog;");
$SqlCmd = New-Object System.Da... | 0 |
390.ps1 | Describe "Validating the module manifest" {
$moduleRoot = (Resolve-Path "$PSScriptRoot\..\..").Path
$manifest = ((Get-Content "$moduleRoot\PSFramework.psd1") -join "`n") | Invoke-Expression
Context "Basic resources validation" {
$files = Get-ChildItem "$moduleRoot\functions" -Recurse -File -Filter "*.ps1"
It "Ex... | 0 |
get windows product key_1.ps1 | function get-windowsproductkey([string]$computer)
{
$Reg = [WMIClass] ("\\\\" + $computer + "\\root\\default:StdRegProv")
$values = [byte[]]($reg.getbinaryvalue(2147483650,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion","DigitalProductId").uvalue)
$lookup = [char[]]("B","C","D","F","G","H","J","K","M","P","Q","R"... | 0 |
sample_39_89.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 = '75.1.0'
# Support... | 0 |
2538.ps1 |
param(
$SQLServer = 'STGSQLDOC710',
$ScriptDir = '\\xfs3\DataManagement\Footprints\31177',
$Beta = 1,
[String[]] $DatabaseList,
$FilePrefix = 'Log',
[switch]$Log
)
$SQuery = "SELECT StageDB FROM ClientConnection WHERE Beta = " + $Beta
$DQuery = "SELECT ReportDB FROM ClientConnection WHERE Beta = " + $Beta + "... | 0 |
sample_37_44.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 |
Select-ToString.ps1 | [CmdletBinding(DefaultParameterSetName='DefaultParameter')]
param(
[Parameter(ValueFromPipeline=$true)]
[System.Management.Automation.PSObject]
${InputObject},
[Parameter(ParameterSetName='DefaultParameter', Position=0)]
[System.String[]]
${Property},
[Parameter(ParameterSetName=... | 0 |
sample_48_61.ps1 | #
# Module manifest for module 'Az.Automation'
#
# Generated by: Microsoft Corporation
#
# Generated on: 12/15/2023
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.Automation.psm1'
# Version number of this module.
ModuleVersion = '1.10.0'
# Supported PSEdit... | 0 |
sample_15_78.ps1 | <#
.SYNOPSIS
Simplify data collection and diagnostics for troubleshooting Microsoft Remote Desktop (RDP/RDS/AVD/W365) related issues and a convenient method for submitting and following quick & easy action plans.
.DESCRIPTION
This script is designed to gather information to assist Microsoft Customer Suppo... | 0 |
Invoke-ResetPassword.ps1 | # From: Brandon Shell
# Purpose: To Reset Local User Account
# Example:
# -- To Reset user Password
# PS> Add-User -user Jsmith -password H!Th3r3 -server myserver1
# With Creds
# PS> Add-User -user Jsmith -password H!Th3r3 -server myserver1 -luser adminGuy -lPassword HateClearText!
... | 0 |
sample_18_90.ps1 | #
# Module manifest for module 'OCI.PSModules.Bds'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Bds.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
2143.ps1 |
Describe 'Line Continuance' -Tags 'CI' {
BeforeAll {
function ExecuteCommand {
param ([string]$command)
[powershell]::Create().AddScript($command).Invoke()
}
$whitespace = "`t `f`v$([char]0x00a0)$([char]0x0085)"
}
Context 'Lines ending with a backtick tha... | 0 |
sample_1_92.ps1 | # Load Reporting Utilities
#_#$debug = $false
# Load Common Library:
. ./utils_cts.ps1
<# Load the SQL Common Library
. ./utils_DSD.ps1 #SQL
. ./TS_RemoteSetup.ps1 #Cluster,HyperV,Remote
. ./utils_Exchange.ps1
#>
trap [Exception]{
WriteTo-StdOut "$($_.InvocationInfo.ScriptName)($($_.InvocationInfo.Script... | 0 |
sample_17_14.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=Nie znaleziono wymaganego modułu programu PowerShell (FailoverClusters). Użyj narzędzia Role i funkcje, aby zainstalować następujące oprogramowanie: Narzędzia administracji zdalnej serwera | Narzędzia do administrowania funkcjami | Narzędzia klastra trybu failov... | 0 |
sample_3_70.ps1 | "use strict";(self.webpackChunkTypeScriptModule=self.webpackChunkTypeScriptModule||[]).push([[1039],{43199:i=>{i.exports=JSON.parse('{"copilot-ext-auth-sdk.apiPluginAuthMessageTextWithAppName":"Vui lòng đăng nhập vào {0} để tiếp tục. Sau khi đăng nhập thành công, chúng tôi sẽ nhanh chóng bắt đầu xử lý truy vấn của bạn.... | 0 |
2756.ps1 |
$hashtype = "MD5"
function Compute-FileHash {
Param(
[Parameter(Mandatory = $true, Position=1)]
[string]$FilePath,
[ValidateSet("MD5","SHA1","SHA256","SHA384","SHA512","RIPEMD160")]
[string]$HashType = "MD5"
)
switch ( $HashType.ToUpper() )
{
"MD5" { $hash = [System.Securit... | 0 |
sample_42_40.ps1 | #
# Module manifest for module 'Az.EventGrid'
#
# Generated by: Microsoft Corporation
#
# Generated on: 5/16/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.EventGrid.psm1'
# Version number of this module.
ModuleVersion = '2.0.0'
# Supported PSEditions... | 0 |
sample_12_43.ps1 | ConvertFrom-StringData @'
id_b2693877_sophos_befltchecktitle=Checking for Ultimaco Safeware disk encryption
id_b2693877_sophos_befltcheckdesc=Checking for Ultimaco Safeware disk encryption version 5.6
id_b2693877_sophos_befltchecksd=Ultimaco Safeware (Sophos) disk encryption version 5.6 is known to cause corruption ... | 0 |
Add-NetworkPrinter.ps1 | ###########################################################################"
#
# NAME: Add-NetworkPrinter.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jan.egil.ring@powershell.no
#
# COMMENT: Windows PowerShell script to map a network printer based on Active Directory group membership.
# The get-GroupMembers... | 0 |
Debug Regex match.ps1 | <#
.SYNOPSIS
A very simple function to debug a Regex search operation and show any 'Match'
results.
.DESCRIPTION
Sometimes it is easier to correct any regex usage if each match can be shown
in context. This function will show each successful result in a separate
colour, including the strings both before and a... | 0 |
sample_50_32.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 = '81.0.0'
# Supported PSEdi... | 0 |
3448.ps1 |
function Get-ResourceGroupName
{
return getAssetName
}
function Get-DataFactoryName
{
return getAssetName
}
function Get-ProviderLocation($provider)
{
"Brazil South"
}
function Clean-DataFactory($rgname, $dfname)
{
if ([Microsoft.Azure.Test.HttpRecorder.HttpMockServer]::Mode -n... | 0 |
1609.ps1 | function Save-CSVasExcel {
param (
[string]$CSVFile = $(Throw 'No file provided.')
)
BEGIN {
function Resolve-FullPath ([string]$Path) {
if ( -not ([System.IO.Path]::IsPathRooted($Path)) ) {
$Path = "$PWD\$Path"
}
... | 0 |
New-WebServiceProxy_1.ps1 | #
# New-WebServiceProxy.ps1 (v3.0 Sep 23, 2009)
#
# Oisin Grehan <oising@gmail.com> (x0n)
#
# Usage:
# $proxy = .\\New-WebServiceProxy.ps1 [-Url] http://site/service.asmx [-Anonymous] [[-SoapProtocol] <Soap | Soap12>] [-Namespace <namespace>]
#
# to see available webmethods:
# $proxy | gm
#
# $url = "h... | 0 |
985.ps1 | Param(
[parameter(Mandatory=$true)]
$CsvFilePath
)
$ErrorActionPreference = "Stop"
$scriptsPath = $PSScriptRoot
if ($PSScriptRoot -eq "") {
$scriptsPath = "."
}
. "$scriptsPath\asr_logger.ps1"
. "$scriptsPath\asr_common.ps1"
. "$scriptsPath\asr_csv_processor.ps1"
Function ProcessItemImpl($processor, $cs... | 0 |
34acf364-c8a0-4ea5-8002-1b134280c15b.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 |
sample_57_56.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="$basedir\..\.store\typescript@5.4.5\node_modules"
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
... | 0 |
sample_24_49.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 = '81.0.0'
# Supported PSEditions
... | 0 |
sample_7_76.ps1 | ConvertFrom-StringData @'
id_printsettmpsystem32check_st=One or more TMP file found under system32 folder and this may cause problems to install printer drivers
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8... | 0 |
sample_24_36.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 |
chkhash_9.ps1 | # calculate SHA512 of file.
function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.Open... | 0 |
sample_9_82.ps1 | ConvertFrom-StringData @'
id_evalmediachecking=Checking information for Evaluation Media
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAVAd... | 0 |
sample_39_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 |
sample_10_67.ps1 | <#
.SYNOPSIS
MSRD-Collect graphical user interface (Lite version)
.DESCRIPTION
Module for the MSRD-Collect graphical user interface (Lite version)
.NOTES
Author : Robert Klemencz
Requires : MSRD-Collect.ps1
Version : See MSRD-Collect.ps1 version
Feedback : https://aka.ms/MSRD-C... | 0 |
sample_40_40.ps1 | #
# Module manifest for module 'OCI.PSModules.Keymanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Keymanagement.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEdi... | 0 |
sample_19_53.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
[CmdletBinding(DefaultParamet... | 0 |
sample_22_73.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 |
1944.ps1 |
Remove-Variable -Name var1 -ErrorAction SilentlyContinue -Force
Describe "Remove-Variable" -Tags "CI" {
It "Should throw an error when a dollar sign is used in the variable name place" {
New-Variable -Name var1 -Value 4
{ Remove-Variable $var1 -ErrorAction Stop } | Should -Throw -ErrorId "VariableNotFound,M... | 0 |
1286.ps1 |
function Find-CADUser
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$DomainUrl,
[Parameter(Mandatory=$true,ParameterSetName='BysAMAccountName')]
[string]
$sAMAccountName
)
Set-StrictMode -Ver... | 0 |
ASP Security Flaw Detect.ps1 | #
# This script will help detect vulnerable configuration for the Padding Oracle
# ASP.Net vulnerability documented in MS advisory 2416728.
#
cls
function List-WebServerPaths($server_instance) {
foreach($child in $server_instance.get_Children()) {
if($child.get_SchemaClassName() -eq "IIsWebVirtualDir")
... | 0 |
Get-WebFile _2.1.ps1 | ## Get-WebFile.ps1 (aka wget for PowerShell)
##############################################################################################################
## Downloads a file or page from the web
## History:
## v3.1 - Unwrap the filename when it has quotes around it
## v3 - rewritten completely using HttpWebReq... | 0 |
4bbeb588-aa6d-475c-861b-05a432703d58.ps1 | function CreateVDS(
$dvsName, $datacenter, $vmHost, $physicalNic, $portGroupType = "earlyBinding", `
[array]$portGroupNameList = @(),[array]$uplinkList = @() ) {
# ------- Create vDS ------- #
$dvsCreateSpec = New-Object VMware.Vim.DVSCreateSpec
$dvsCreateSpec.configSpec = New-Object VMware.V... | 0 |
sample_20_55.ps1 | $resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent
# Import localization helper functions.
$helperName = 'PowerShellGet.LocalizationHelper'
$dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1"
Import-Module -Name $... | 0 |
1317.ps1 |
function Test-CIisConfigurationSection
{
[CmdletBinding(DefaultParameterSetName='CheckExists')]
param(
[Parameter(Mandatory=$true)]
[string]
$SectionPath,
[Parameter()]
[string]
$SiteName,
[Parameter()]
[Al... | 0 |
3558.ps1 |
$JobQueryWaitTimeInSeconds = 0
$ResourceGroupName = "E2ERg"
$VaultName = "E2ETest"
$FabricNameToBeCreated = "ReleaseFabric"
$PrimaryFabricName = "IDCLAB-A137.ntdev.corp.microsoft.com"
$RecoveryFabricName = "IDCLAB-A147.ntdev.corp.microsoft.com"
$PolicyName = "E2EPolicy1"
$PrimaryProtectionContainerName ... | 0 |
sample_5_54.ps1 | #************************************************
# DC_RDSGW.ps1
# Version 1.0.1
# Date: 21-01-2012
# Author: Daniel Grund - dgrund@microsoft.com
# Description:
# This script gets the RDSSH config and
# checks vital signs to inform user.
# 1.0.0 Beta release
#************************************************... | 0 |
2767.ps1 |
$data = & $env:windir\system32\sc query | ForEach-Object {
$svc = $_
if ($svc -match "SERVICE_NAME:\s(.*)") {
& $env:windir\system32\sc qfailure $($matches[1])
}
}
$ServiceName = $RstPeriod = $RebootMsg = $CmdLine = $FailAction1 = $FailAction2 = $FailAction3 = $False
$data | ForEach-Object {
... | 0 |
sample_8_81.ps1 | Import-LocalizedData -BindingVariable Strings
Function GetWin32OSFromRemoteSystem([string] $MachineName){
trap [Exception]
{
WriteTo-ErrorDebugReport -ErrorRecord $_ -ScriptErrorText ("[GetWin32OSFromRemoteSystem] Error contacting " + $MachineName)
continue
}
#Obtain OS From Remote Machine and retu... | 0 |
sample_55_50.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 |
Autoload (beta 6).ps1 | #Requires -Version 2.0
## Version History
## beta 6 - 2010.05.18
## Fixed a bug in output when multiple outputs happen in the END block
## beta 5 - 2010.05.10
## Fixed non-pipeline use using $MyInvocation.ExpectingInput
## beta 4 - 2010.05.10
## I made a few tweaks and bug fixes whil... | 0 |
get windows product key_4.ps1 | function get-windowsproductkey([string]$computer)
{
$Reg = [WMIClass] ("\\\\" + $computer + "\\root\\default:StdRegProv")
$values = [byte[]]($reg.getbinaryvalue(2147483650,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion","DigitalProductId").uvalue)
$lookup = [char[]]("B","C","D","F","G","H","J","K","M","P","Q","R"... | 0 |
1329.ps1 |
function Disable-CAclInheritance
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
[Alias('PSPath')]
[string]
$Path,
[Switch]
$Preserve
... | 0 |
1948.ps1 |
Describe "XmlCommand DRT basic functionality Tests" -Tags "CI" {
BeforeAll {
if(-not ('IsHiddenTestType' -as "type"))
{
Add-Type -TypeDefinition @"
public class IsHiddenTestType
{
public IsHiddenTestType()
{
Property1 = 1;
Property2 = "some st... | 0 |
sample_20_89.ps1 | ---
#
# Get VM hosts and write information to a .csv file
#
- name: Get VM hosts and write information to a .csv file
hosts: localhost
connection: local
gather_facts: false
vars:
# Create an anchor for api_info that can be used throughout the file
api_info: &api_info
# if api_key vars are omitted,... | 0 |
sample_4_80.ps1 | Function RunBCDEdit ($BCDEditCommand, [switch]$CollectFile) {
$OutputFile = $ComputerName + "_BCDEdit.TXT"
$CommandLineToExecute = "cmd.exe /c $BCDEditCommand >> $OutputFile"
#header
$date=Get-Date
"-" * ($CommandLineToExecute.Length + 35) + "`r`n[$date] $BCDEditCommand`r`n" + "-" * ($BCDEditCommand.Leng... | 0 |
Re-IP VMs.ps1 | foreach ($entry in (import-csv "spreadsheet.csv")) {
$ipScript = @"
`$NetworkConfig = Get-WmiObject -Class Win32_NetworkAdapterConfiguration
`$NicAdapter = `$NetworkConfig | where {`$_.DHCPEnabled -eq "True"}
`$NicAdapter.EnableStatic('$entry.IP','$entry.Netmask')
`$NicAdapter.SetGateways('$entry.Gateway')
... | 0 |
2738.ps1 |
Get-Content $env:windir\logs\CBS\cbs.log | % {
$_ -replace "\s\s+", "`t"
} | % {
$r = [regex]','
$r.replace($_, "`t", 1)
} | % {
$o = "" | Select-Object Timestamp, MessageType, LogSource, Message
$o.Timestamp, $o.MessageType, $o.LogSource, $o.Message = ($_ -split "`t").Trim()
$o
} | 0 |
893.ps1 |
$gitrepo="https://github.com/Azure-Samples/app-service-web-dotnet-get-started.git"
$webappname="mywebapp$(Get-Random)"
$location="West Europe"
New-AzResourceGroup -Name myResourceGroup -Location $location
New-AzAppServicePlan -Name $webappname -Location $location -ResourceGroupName myResourceGroup -Tier Free
New... | 0 |
1930.ps1 |
Describe "Event Subscriber Tests" -tags "CI" {
BeforeEach {
Get-EventSubscriber | Unregister-Event
}
AfterEach {
Get-EventSubscriber | Unregister-Event
}
It "Register an event with no action, trigger it and wait for it to be raised." -Pending:$true{
Get-EventSubscribe... | 0 |
1690.ps1 | function upsidedown ([string]$text) {
$alpha = @'
up,upchar,down,downchar
a,97,?,592
b,98,q,113
c,99,?,596
d,100,p,112
e,101,?,477
f,102,?,607
g,103,?,387
h,104,?,613
i,105,i,305
j,106,?,638
k,107,?,670
l,108,l,108
m,109,?,623
n,110,u,117
o,111,o,111
... | 0 |
1760.ps1 |
& $PSScriptRoot/class1.py | ConvertFrom-JSON
| 0 |
sample_64_38.ps1 | #
# Module manifest for module 'OCI.PSModules.Identity'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identity.dll'
# Version number of this module.
ModuleVersion = '85.2.0'
# Supported PSEditions
Comp... | 0 |
sample_48_6.ps1 | [CmdletBinding()]
param (
[string]$ACLPath,
[string]$TargetPath
)
# Get the ACL from the source folder
$acl = Get-Acl -Path $ACLPath
$acl | fl
# Split the target path into individual folder names
$folders = $targetPath.Split('\')
# Initialize the folder variable into empty string
$folder = ""
... | 0 |
Write-Log.ps1 | function Write-Log {
#region Parameters
[cmdletbinding()]
Param(
[Parameter(ValueFromPipeline=$true,Mandatory=$true)] [ValidateNotNullOrEmpty()]
[string] $Message,
[Parameter()] [ValidateSet(“Error”, “Warn”, “Info”)]
[string] $Level = “Info”,
[Parameter()] [ValidateRange(1,30)]
... | 0 |
4173.ps1 |
[CmdletBinding()]
param ()
function Import-SCCMModule {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][string]$SCCMServer
)
$Architecture = (get-wmiobject win32_operatingsystem -computername $SCCMServer).OSArchitecture
$Uninstall = Invoke-Command -ComputerName $SCCMServer -ScriptBlock { Get-Chi... | 0 |
Get-WebFile 3.1.ps1 | ## Get-WebFile.ps1 (aka wget for PowerShell)
##############################################################################################################
## Downloads a file or page from the web
## History:
## v3.1 - Unwrap the filename when it has quotes around it
## v3 - rewritten completely using HttpWebReq... | 0 |
sample_30_79.ps1 | Add-AppxPackage
exit
cd C:\Users\sampler-win_10_x64\Desktop\
Get-AppxPackage >apps.tx
cd C:\Users\sampler-win_10_x64\Desktop\
Get-AppxPackage -allusers | Select Name, PackageFullName > apps_v2.txt
Get-AppxPackage | Select Name, PackageFullName > apps_v2.txt
Get-AppxPackage
Get-AppxPackage -Online
Get-AppxPacka... | 0 |
65b30476-81de-4034-8d3c-ef5e8bdd0e43.ps1 | $url = "http://dougfinke.com/scriptinggames/scriptinggames.html"
$web = New-Object System.Net.WebClient
foreach($line in ($web.downloadString($url)).split("`n")){
if($line -match "img"){
$line
$fileName = $line.substring($line.indexof("title=")+7,(($line.indexof(" src"))-1)-($line.indexof("t... | 0 |
sample_64_97.ps1 | <##############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
##############################################################>... | 0 |
sample_23_48.ps1 | # region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.CloudService.private.dll')
# Get the private module's instance
$instance = [Microsoft.Azure.PowerShell.Cmdlets.CloudService.Module]::Instance
# Export nothing to clear implicit ... | 0 |
sample_35_85.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicecatalog'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicecatalog.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSE... | 0 |
sample_12_86.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_16_73.ps1 | function PSConsoleHostReadLine
{
[System.Diagnostics.DebuggerHidden()]
param()
## Get the execution status of the last accepted user input.
## This needs to be done as the first thing because any script run will flush $?.
$lastRunStatus = $?
Microsoft.PowerShell.Core\Set-StrictMode -Off... | 0 |
sample_41_24.ps1 | #
# Module manifest for module 'OCI.PSModules.Core'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Core.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
CompatiblePS... | 0 |
sample_52_25.ps1 | #
# Module manifest for module 'OCI.PSModules.Mysql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Mysql.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Compatible... | 0 |
sample_27_62.ps1 | #
# Module manifest for module 'OCI.PSModules.Sch'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Sch.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
sample_18_64.ps1 | ConvertFrom-StringData @'
id_hypervevent106check=Checking for Hyper-V Event 106 in the last 7 days, which indicates a configuration issue with VMQ.
'@
# SIG # Begin signature block
# MIIoVQYJKoZIhvcNAQcCoIIoRjCCKEICAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNL... | 0 |
sample_41_20.ps1 | # Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString = &Yes
PromptNoString = &No
BundleFound = Found bundle: {0}
PackageFound = Found package: {0}
EncryptedBundleFound = Found encrypted bundle: {0}
EncryptedPackageFound = Found encrypted package: {0}
CertificateFou... | 0 |
sample_9_69.ps1 | ConvertFrom-StringData @'
id_ctssnmp=SNMP
id_ctssnmpdescription=Collects information about SNMP.
'@
# SIG # Begin signature block
# MIIoOQYJKoZIhvcNAQcCoIIoKjCCKCYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCA... | 0 |
Get-Parameter 1.21.ps1 | function Get-Parameter
{
[OutputType('System.String')]
[CmdletBinding()]
param(
[Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)]
[ValidateNotNullOrEmpty()]
[String]$Command,
[Parameter(Position=1)]
[String[]]$Name=@('*'),
[Parameter()]
[Validate... | 0 |
Get-WebFile _1.7.ps1 | ## Get-WebFile (aka wget for PowerShell)
##############################################################################################################
## Downloads a file or page from the web
## History:
## v3.7 - [int] to [long] to support files larger than 2.0 GB
## v3.6 - Add -Passthru switch to output TEXT fi... | 0 |
sample_32_6.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=Det gick inte att hitta den nödvändiga PowerShell-modulen (FailoverClusters). Använd verktyget Roller & funktioner för att installera: Verktyg för fjärrserveradministration | Funktionsadministrationsverktyg | Redundansklusterverktyg | Redundansklustermodulen för... | 0 |
sample_44_77.ps1 | let pluginUrl = window.chrome.webview.hostObjects.sync.external.GetPluginUrl();
let scripts = [pluginUrl, "Scripts/common.eventHandlers.js", "Scripts/docker.webCore.eventHandlers.js"];
let currentScriptElement = document.querySelector("script[src='Scripts/docker.webCore.plugin.js']");
if (currentScriptElement !== nu... | 0 |
USB Script backup_1.ps1 | <#
.SYNOPSIS
Backup-ToUSB.ps1 (Version 2.0, 6 Jan 2012)
The author may be contacted via www.SeaStarDevelopment.Bravehost.com
.DESCRIPTION
This script will backup recently changed *.ps1,*.psm1,*.psd1 files from any
selected folder (default is $pwd) to any number of inserted USB devices, on
which an archive fol... | 0 |
sample_9_22.ps1 | #************************************************
# TS_FirewallCheck.ps1
# Version 1.0
# Date: 5-1-2012
# Author: davidcop
# Description: Checks to see that the Windows Firewall service is running and set to the default start mode of Automatic on 2008/2008 R2 or higher Server
#************************************... | 0 |
4255.ps1 | function Set-LHSTokenPrivilege
{
[cmdletbinding(
ConfirmImpact = 'low',
SupportsShouldProcess = $false
)]
[OutputType('System.Boolean')]
Param(
[Parameter(Position=0,Mandatory=$True,ValueFromPipeline=$False,HelpMessage='An Token Privilege.')]
[ValidateSet(
"SeAssignPrimaryTokenPrivil... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.