filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
Resizer of pictures_1.ps1 | [reflection.assembly]::LoadWithPartialName("System.Drawing")
$SizeLimit=1280 # required size of picture's long side
$logfile="resizelog.txt" # log file for errors
$toresize=$args[0] # list of directories to find and resize images. can be empty
if ([string]$toresize -eq “”) { # if scr... | 0 |
sample_62_65.ps1 | #
# Module manifest for module 'OCI.PSModules.Loadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Loadbalancer.dll'
# Version number of this module.
ModuleVersion = '90.0.0'
# Supported PSEditi... | 0 |
sample_62_20.ps1 | LMetoda se ne može izvršiti kada je onemogućena pohrana s više snimki stanja.oZahtjev je ograničen, previše zahtjeva za ažuriranje izvora podataka koje pokreće korisnik u kratkom razdoblju.pNema dovoljno dozvola za osvježavanje tablice u načinu rada Direct Lake, obratite se autoru ovog skupa podataka.Nije moguće zadrž... | 0 |
sample_43_97.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 |
4315.ps1 |
Describe PowerShell.PSGet.PackageManagementIntegrationTests -Tags 'P1','OuterLoop' {
BeforeAll {
Import-Module "$PSScriptRoot\PSGetTestUtils.psm1" -WarningAction SilentlyContinue
Import-Module "$PSScriptRoot\Asserts.psm1" -WarningAction SilentlyContinue
$script:PSModuleSourcesPath = Ge... | 0 |
1692.ps1 |
filter notnull {
$props = @()
$obj = $_
$obj | gm -m *property | % { if ( $obj.$($_.name) ) {$props += $_.name} }
$obj | select $props
}
| 0 |
4033.ps1 |
function Test-ManagedApplicationDefinitionCRUD
{
$rgname = Get-ResourceGroupName
$appDefName = Get-ResourceName
$rglocation = "EastUS2EUAP"
$display = "myAppDefPoSH"
New-AzResourceGroup -Name $rgname -Location $rglocation
$actual = New-AzManagedApplicationDefinition -Name $appDefName -Resourc... | 0 |
sample_65_53.ps1 | $timestamp = get-date -uformat %Y%m%d-%k%M%S
$transcriptPath = "$($env:temp)\StorageSyncAgent-SetRegPIIAclSettings-$($timestamp).log"
Start-Transcript -Path $transcriptPath
# The following script removes read permissions from registry key locations which may contain PII information.
$regPaths = 'HKLM:\Software\Mi... | 0 |
sample_1_8.ps1 | 2160
[[["Fer","0","100ms"],[10800025,6]],[["Fer","0","1s"],[10800025,6]],[["Fer","0","Inst"],[10800025,6]],[["Fer","1-9","100ms"],[0,6]],[["Fer","1-9","1s"],[0,6]],[["Fer","1-9","Inst"],[0,6]],[["Fer","10-19","100ms"],[0,6]],[["Fer","10-19","1s"],[0,6]],[["Fer","10-19","Inst"],[0,6]],[["Fer","100","100ms"],[0,6]],[["Fe... | 0 |
sample_55_61.ps1 | @{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.ServiceFabric.Powershell'
# Version number of this module.
ModuleVersion = '3.1.0.0'
# ID used to uniquely identify this module
GUID = 'd2c42633-5254-4a82-a312-1dc0697a55cd'
# Author of this module
Author = '... | 0 |
sample_11_74.ps1 | @{
GUID="A1DA990A-4DC2-4f7e-BEB4-046A89B9D473"
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="© Microsoft Corporation. All rights reserved."
ModuleVersion = "2.0.0.0"
PowerShellVersion = "3.0"
ClrVersion = "4.0"
TypesToProcess="Microsoft.Iscsi.Targe... | 0 |
Generate Random Data.ps1 | $dictionaryWords = gc $dictionaryFile
$azLower = 'abcdefghijklmnopqrstuvwxyz'.ToCharArray()
$azUpper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.ToCharArray()
$hex = '012345679ABCDEF'.ToCharArray()
$digit = '0123456789'.ToCharArray()
$alphanumeric = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'.ToCharArray()... | 0 |
out-form with sort colum_1.ps1 | I think OUT-FORM is a very usefull function. I've added code to sort columns by clicking on headers.
You nedd just add the columnTag parameters specifing if colunm value is text or numeric:
out-form -data (get-process) -columnNames ("Name", "ID" ) -columnProperties ("Name", "ID") -columnTag ("Text", "Numeric")
... | 0 |
New-Choice_1.ps1 |
function New-Choice {
<#
.SYNOPSIS
The New-Choice function is used to provide extended control to a script author who writing code
that will prompt a user for information.
.PARAMETER Choices
An Array of Choices, ie Yes, No and Maybe
.PARAMETER Caption
Caption to present to end user
... | 0 |
4466.ps1 |
Publish-PSResource -name 'TestModule'
Publish-PSResource 'TestModule'
Publish-PSResource 'TestModule' -Path '.\*\somepath'
Publish-PSResource 'TestModule' -LiteralPath '.'
Publish-PSResource 'TestModule' -RequiredVersion '1.5.0'
Publish-PSResource 'TestModule' -Prerelease
Publish-PSResource 'TestModul... | 0 |
sample_58_73.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 |
3550.ps1 |
function Test-AzureVMGetItems
{
$location = Get-ResourceGroupLocation
$resourceGroupName = Create-ResourceGroup $location
try
{
$vm = Create-VM $resourceGroupName $location 1
$vm2 = Create-VM $resourceGroupName $location 12
$vault = Create-RecoveryServicesVault $resourceGroupName $location
... | 0 |
sample_49_67.ps1 | #
# Module manifest for module 'OCI.PSModules.Waas'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waas.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
CompatiblePS... | 0 |
946.ps1 |
$uniqueId=$(-join ((97..122) + (48..57) | Get-Random -Count 15 | % {[char]$_}))
$apiVersion = "2015-04-08"
$location = "West US 2"
$resourceGroupName = "myResourceGroup"
$accountName = "mycosmosaccount-$uniqueId"
$databaseName = "database1"
$containerName = "container1"
$databaseResourceName = $accountName + "/sql... | 0 |
WPF PingMonitor for 2.0.ps1 | if(!(Get-Command New-BootsWindow -EA SilentlyContinue)) {
# Add-PsSnapin PoshWpf
Import-Module PowerBoots
Add-BootsContentProperty 'DataPoints', 'Series'
#[Void][Reflection.Assembly]::LoadFrom( (Convert-Path (Resolve-Path "~\\Documents\\WindowsPowershell\\Libraries\\WPFVisifire.Charts.dll")) )
Add-B... | 0 |
804.ps1 | $Global:GlobalVar = 0
$UnqualifiedScriptVar = 1
$Script:ScriptVar2 = 2
"`$Script:ScriptVar2 is $Script:ScriptVar2"
function AFunction {}
filter AFilter {$_}
function AnAdvancedFunction {
begin {
$LocalVar = 'LocalVar'
function ANestedFunction() {
$nestedVar = 42
"`$nested... | 0 |
Set-EnvironmentVariable.ps1 | #requires -version 2
function Set-EnvironmentVariable {
param (
[String] [Parameter( Position = 0, Mandatory = $true )] $Name,
[String] [Parameter( Position = 1, Mandatory = $true )] $Value,
[EnvironmentVariableTarget]
[Parameter( Position = 2 )]
$Target = [EnvironmentVariableTarget]::Process,
... | 0 |
sample_51_34.ps1 | /*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.46.0(21007360cad28648bdf46282a2592cb47c3a7a6f)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-------------... | 0 |
sample_54_80.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 |
4011.ps1 |
$connectionName = "AzureRunAsConnection100"
try
{
$servicePrincipalConnection=Get-AutomationConnection -Name $connectionName
"Logging in to Azure..."
Add-AzureRmAccount `
-ServicePrincipal `
-TenantId $servicePrincipalConnection.TenantId `
-ApplicationId $servicePrin... | 0 |
sample_45_31.ps1 | #
# Module manifest for module 'OCI.PSModules.Ons'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ons.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
sample_40_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_30_52.ps1 | #
# Module manifest for module 'OCI.PSModules.Audit'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Audit.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Supported PSEditions
Compatible... | 0 |
607.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://www.truecrypt.org/download/transient/130a82428b303859fcb6/TrueCrypt%20Setup%207.1a.exe"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs | ForEach-Object{
... | 0 |
New-ISEMenu_4.ps1 | Import-Module ShowUI
Function New-ISEMenu {
New-Grid -AllowDrop:$true -Name "ISEAddonCreator" -columns Auto, * -rows Auto,Auto,Auto,*,Auto,Auto -Margin 5 {
New-Label -Name Warning -Foreground Red -FontWeight Bold -Column 1
($target = New-TextBox -Name txtName -Column 1 -Row ($Row=1))
New-Label... | 0 |
sample_19_84.ps1 | #************************************************
# DC_Repadmin.ps1
# Version 1.0.1
# Date: 03-6-2013
# Authors : Andre Teixeira/ David Fisher (CSS)/ Craig Landis
# Description: Run Repadmin utility to obtain Kerberos tickets and TGT
#************************************************
if($debug -eq $true){[vo... | 0 |
1306.ps1 |
function Test-CPathIsJunction
{
[CmdletBinding(DefaultParameterSetName='Path')]
param(
[Parameter(Mandatory=$true,ParameterSetName='Path',Position=0)]
[string]
$Path,
[Parameter(Mandatory=$true,ParameterSetName='LiteralPath')]
[string]
... | 0 |
sample_29_36.ps1 | #
# Module manifest for module 'Microsoft.Online.SharePoint.PowerShell'
#
# Generated by: Microsoft Corportation
#
# Generated on: 8/29/2011
#
@{
# Script module or binary module file associated with this manifest
ModuleToProcess = 'Microsoft.Online.SharePoint.PowerShell.dll'
# Version number of this modu... | 0 |
sample_15_85.ps1 | ConvertFrom-StringData @'
id_roiscan=Robust Office Inventory Scan
id_roiscanobtaining=Collecting Robust Office Inventory Scan
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIB... | 0 |
sample_45_74.ps1 | <#
.SYNOPSIS
Copies a cert from one store to another.
The below sample copies any of the "Relativity - CA" cert in Intermediate Certificate Authorities and puts them in Personal.
This helps the "Relativity Secret Store" cert become trusted so debugging a DevVM is possible.
.\Local-Copy-Cert -So... | 0 |
sample_59_16.ps1 | #
# Module manifest for module 'OCI.PSModules.Generativeai'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Generativeai.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEditi... | 0 |
Set-VMBuildCSV.ps1 | #######################################################################
#
# Purpose: Generate CSV file for VM builds without those darn Typos
# Author: David Chung
# Docs: N/A
#
# v.1 - 02/10/2011 Beta Initial Script
#
# Instruction: Launch the script from PowerCLI.
# Login to vSPhere server from... | 0 |
get-windowsproductkey.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 |
Get-WindowsExperience_1.ps1 | function Get-WindowsExperienceRating {
#.Synopsis
# Gets the Windows Experience Ratings
#.Parameter ComputerName
# The name(s) of the computer(s) to get the Windows Experience (WinSat) numbers for.
[CmdletBinding()]
param(
[Parameter(ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
[string[... | 0 |
sample_62_32.ps1 | #
# Module manifest for module 'OCI.PSModules.Nosql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Nosql.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditions
Compatible... | 0 |
sample_67_44.ps1 | LMetoda se ne može izvršiti kada je onemogućena pohrana s više snimki stanja.oZahtjev je ograničen, previše zahtjeva za ažuriranje izvora podataka koje pokreće korisnik u kratkom razdoblju.pNema dovoljno dozvola za osvježavanje tablice u načinu rada Direct Lake, obratite se autoru ovog skupa podataka.Nije moguće zadrž... | 0 |
3143.ps1 | [CmdletBinding()]
param(
[Parameter(
Position=0,
HelpMessage='Credentials to authenticate agains a remote computer')]
[System.Management.Automation.PSCredential]
[System.Management.Automation.CredentialAttribute()]
$Credential
)
| 0 |
Fast vMotion with GUI.ps1 | #Generated Form Function
function GenerateForm {
########################################################################
# Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) v1.0.3.0
# Generated On: 7/21/2009 2:07 PM
# Generated By: afokkema
###################################################... | 0 |
3083.ps1 | When 'I (?:set|initialize) the variable (?<Name>[\w:]+) to "(?<Value>[^"]+)"' {
param($Name, $Value)
switch ($Name) {
"One" {
$One = $Value
}
"Two" {
$Two = $Value
}
"Script:Two" {
$Script:Two = $Value
}
}
}
Given 'I initi... | 0 |
sample_24_56.ps1 | #
# Module manifest for module 'OCI.PSModules.Osubusage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Osubusage.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Co... | 0 |
LibraryMSCS_2.ps1 | # ------------------------------------------------------------------------
### <Script>
### <Author>
### Chad Miller
### </Author>
### <Description>
### Defines functions for working with Microsoft Cluster Service (MSCS)
### </Description>
### <Usage>
### . ./LibraryMSCS.ps1
### </Usage>
### </Script>
# --... | 0 |
sample_1_39.ps1 | #************************************************
# DC_NfsServer-Component.ps1
# Version 1.0.06.26.14: Created script.
# Version 1.1.08.13.14: Updated comments. Added data collection for NIS registry value: "HKLM\system\CurrentControlSet\services\NisSvc". TFS264084
# Date: 2014
# Author: Boyd Benson (bbenson@micr... | 0 |
pslauncher.ps1 | /*
* Compile this program by simply doing:
*
* csc.exe PSLauncher.cs
*
*/
// Requires powershell V2
/*
* The Problem:
* .ps1 scripts do not integrate with the shell nicely. You cannot
* simply associate powershell.exe with .ps1 and have them run when u
* double click them. Als... | 0 |
2178.ps1 | [CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true,ParameterSetName="Single")]
[parameter(ParameterSetName="Recurse")]
[string]$SiteServer,
[parameter(Mandatory=$false,ParameterSetName="Single")]
$ApplicationName,
[parameter(Mandatory=$true,ParameterSetName="Single")]
[parameter(ParameterSet... | 0 |
2425.ps1 | $serversOuPath = 'OU=Servers,DC=powerlab,DC=local'
$servers = Get-ADComputer -SearchBase $serversOuPath -Filter * |
Select-Object -ExpandProperty Name
$Header = @"
<style>
table {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
th... | 0 |
1837.ps1 |
Describe 'Clipboard cmdlet tests' -Tag CI {
BeforeAll {
$xclip = Get-Command xclip -CommandType Application -ErrorAction Ignore
}
Context 'Text' {
BeforeAll {
$defaultParamValues = $PSdefaultParameterValues.Clone()
$PSDefaultParameterValues["it:skip"] = ($IsWindow... | 0 |
Set-Wallpaper (CTP2).ps1 | #requires -version 2.0
## Set-Wallpaper - set your windows desktop wallpaper
###################################################################################################
## Usage:
## Set-Wallpaper "C:\\Users\\Joel\\Pictures\\Others Stock\\Potter Wasp.jpg" "Stretched"
## ls *.jpg | get-random | Set-Wal... | 0 |
NetBackup Backup Report.ps1 | ###################################################################################################
#
# NAME: NBU-BackupReport.ps1
#
# AUTHOR: Martijn Jonker
#
# COMMENT: Script to create a backup report from Netbackup jobs on windows platform.
# Adjust variables below this section.
# The script generates a rep... | 0 |
2724.ps1 |
& net localgroup administrators | Select-Object -Skip 6 | ? {
$_ -and $_ -notmatch "The command completed successfully"
} | % {
$o = "" | Select-Object Account
$o.Account = $_
$o
} | 0 |
sample_34_30.ps1 | #
# Module manifest for module 'OCI.PSModules.Ons'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Ons.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
2494.ps1 |
$ServiceName = "SQL Server (SOX2)"
$TranManSec = "Mutual"
$GroupPath = "HKLM:\Cluster\Groups"
$GroupList = dir $GroupPath
foreach ($Group in $GroupList)
{
$GroupChildPath = $Group.PSPath
if ((Get-ItemProperty -path $GroupChildPath -name Name).Name -eq $ServiceName)
... | 0 |
sample_48_1.ps1 | #
# Module manifest for module 'microsoft.remote-support'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'microsoft.remote-support.psm1'
# Version number of this module.
ModuleVersion = '1.0.8'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to u... | 0 |
1967.ps1 |
Describe "Measure-Object" -Tags "CI" {
BeforeAll {
$testObject = 1,3,4
$testObject2 = 1..100
}
It "Should be able to be called without error" {
{ Measure-Object | Out-Null } | Should -Not -Throw
}
It "Should be able to call on piped input" {
{ $testObject | Measur... | 0 |
sample_40_16.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-ExecutionPolicy", "Set-E... | 0 |
2188.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 |
sample_67_84.ps1 | #
# Module manifest for module 'OCI.PSModules.Events'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Events.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEditions
Compatib... | 0 |
Get-SiSReport_4.ps1 | Function Get-SiSReport
{
<#
.SYNOPSIS
Get the overall SIS usage information.
.DESCRIPTION
This function uses the sisadmin command to get the usage
information for a SIS enabled drive.
.PARAMETER SisDisk
The drive letter of a disk that ... | 0 |
SharePoint UserID grab.ps1 |
## .\\SharePoint_Users_Read.ps1 "http://some.urlname.com/" "User Information List" ""
## .\\SharePoint_Users_Read.ps1 "http://some.urlname.com/" "User Information List" "user, someone"
param(
[string] $rqurdstrPath = $(Throw "--SharePoint Core Path required."), #required parameter
[string] $rqurdstrListName = $... | 0 |
GPRS Online log_9.ps1 | <#
.SYNOPSIS
Get-GprsTime (V4.0 Update for Windows 7 and allow time correction)
(V4.4 'Interval' now incorporate previous 'FormatSpan' function)
(V4.6 'Adjust' pattern will now reject times like '1:300:50')
Check the total connect time of any GPRS SIM devices from a specified date.
Use ... | 0 |
1594.ps1 |
function CopyTo-Image {
param (
[string]$file,
[string]$image
)
$date = date -f yyyyMMddHHmmss
$fileext = $file.split('.')[-1]
if ($fileext -eq 'zip') {
$zip = $file
} else {
$zip = "c:\temp\$date.zip"
Compress-Archive $file $zip
}
$path = S... | 0 |
46.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 ($AadM... | 0 |
Remove broken NTFS perm.ps1 | #==========================================================================
# NAME: getunknownsids.ps1
#
# AUTHOR: Stephen Wheet
# Version: 4.0
# Date: 6/11/10
#
# COMMENT:
# This script was created to find unknown SIDs or old domain permissions
# on folders. It ignores folders where inheirtance is turned ... | 0 |
sample_26_5.ps1 | #
# Module manifest for module 'OCI.PSModules.Autoscaling'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Autoscaling.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEdition... | 0 |
3262.ps1 |
class CommandResult {
[bool]$Success
[object[]]$Errors = @()
[object[]]$Output = @()
[Stream]$Streams = [Stream]::new()
[bool]$Authorized = $true
[timespan]$Duration
[pscustomobject]Summarize() {
return [pscustomobject]@{
Success = $this.Success
Output = $t... | 0 |
sample_33_9.ps1 | $ErrorActionPreference = 'Stop'
<#
.Synopsis
Returns payload information from glcm. This info is required to send a heart beat request to AA
#>
function Get-HeartbeatInfo
{
[CmdletBinding()]
param()
$glcm = Get-DscLocalConfigurationManager
$configurationName = ""
$aaServerU... | 0 |
sample_41_29.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_23_5.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... | 0 |
1520.ps1 |
function Assert-DoesNotContain
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
[object]
$Haystack,
[Parameter(Position=1)]
[object]
$Needle,
[Parameter(Position=2)]
[string]
$Message
... | 0 |
sample_60_82.ps1 | $url = $args[0]
Write-Host "Downloading Microsoft Edge Dev"
$wc = New-Object net.webclient
$msiInstaller = "$env:temp\microsoft-edge-dev.msi"
$wc.Downloadfile($url, $msiInstaller)
Write-Host "Installing Microsoft Edge Dev"
$arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $arguments -... | 0 |
Get-Screenshot.ps1 | ## Get-Screenshot -- THIS ONE works on PowerShell 1.0 and .Net 2.0 (or better)
############################################################################################################
## Usage:
## Get-Screenshot "C:\\Screencaps\\Screenshot.jpg"
## Get-Screenshot "$pwd\\Screen $(Get-Date -f 'yyyy-MM-dd HH... | 0 |
SMS hierarchy in Visio.ps1 | # Name : smsDiagram.ps1
# Author : David "Makovec" Moravec
# Web : http://www.powershell.cz
# Email : powershell.cz@googlemail.com
# Twitter: makovec
#
# Description: Draw SMS 2003 hierarchy in Visio
#
# Version: 1.0
# History:
# v0.1 - (add) Alan's vDiagram functions
# (add) WMI query
# v0.... | 0 |
sample_7_60.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 |
sample_50_39.ps1 | <#########################################################################################################
# File: Deploy-Agent.ps1
#
# .DESCRIPTION
#
# Install Azure site recovery agent and register it. It requires two pre-defined variables ($keyContent and $node).
#
# Copyright (c) Microsoft Corp 2016... | 0 |
3674.ps1 |
function Test-CreateDatabaseCopy()
{
$location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia"
$rg = Create-ResourceGroupForTest $location
$server = Create-ServerForTest $rg $location
$database = Create-DatabaseForTest $rg $server "Standard"
$copyRg = Create-ResourceGroupForTest $loc... | 0 |
1759.ps1 |
python -c "print('Hi!')"
$data = python -c "print('Hi!')"
$data
5 + (python -c "print(2 + 3)") + 7
@"
print('Hi!')
"@ | out-file -encoding ascii hi
chmod +x hi
./hi
cat class1.py
./class1.py
$data = ./class1.py | ConvertFrom-JSON
$data[0]
$data[1]
$data[1].buz[1]
cat class1.ps1
(./cl... | 0 |
sample_5_42.ps1 | #************************************************
# DC_BitsServer-Component.ps1
# Version 1.0
# Date: 2009
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about the BITS Server Component.
#*******************************************************
Trap [Exception]
{
# Handle... | 0 |
sample_5_76.ps1 | # Localized 10/16/2024 05:34 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1
# Culture = "en-US"
ConvertFrom-StringData @'
###PSLOC
PromptYesString=&Evet
PromptNoString=&Hayır
BundleFound=Demet bulundu: {0}
PackageFound=Paket bulundu: {0}
EncryptedBundleFound=Şifreli demet bulundu: {0}
EncryptedPackageFound=Şif... | 0 |
PrinterQueStatistics.ps1 | #Printer Statistic checking script by Henrik Pedersen Ċmark
#This script is used to check how many times all printerques on the selected server has been used the latest X months
#First it gets all the events from the remote server's eventlog that are of ID 10 (successful print) and of the type "Print".
#Then it ch... | 0 |
3821.ps1 |
function Run-ComputeCloudExceptionTests
{
$rgname = Get-ComputeTestResourceName
try
{
$loc = Get-ComputeVMLocation;
New-AzResourceGroup -Name $rgname -Location $loc -Force;
$compare = "*Resource*not found*OperationID : *";
Assert-ThrowsLike { $s1... | 0 |
Compile-Help_1.ps1 | # Compile-Help.ps1
# by Jeff Hillman
#
# this script uses the text and XML PowerShell help files to generate HTML help
# for all PowerShell Cmdlets, PSProviders, and "about" topics. the help topics
# are compiled into a .chm file using HTML Help Workshop.
#
# Minor tweak by John Robbins to work on x64 when lo... | 0 |
sample_35_4.ps1 | @{
GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @('MSFT_MpPerformanceRecording.psm1')
FormatsToProcess = @(... | 0 |
sample_37_94.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... | 0 |
sample_35_0.ps1 | #
# Module manifest for module 'Microsoft.SME.NetworkController'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.NetworkController.psm1'
# Version number of this module.
ModuleVersion = '3.12.0'
# Supported PSEditions
# CompatiblePSEditions = @()
... | 0 |
2982.ps1 | function BeforeEachFeature {
[CmdletBinding(DefaultParameterSetName = "All")]
param(
[Parameter(Mandatory = $True, Position = 0, ParameterSetName = "Tags")]
[String[]]$Tags = @(),
[Parameter(Mandatory = $True, Position = 1, ParameterSetName = "Tags")]
[Parameter(Mandatory ... | 0 |
1860.ps1 |
Import-Module HelpersCommon
try
{
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()
$originalWarningPreference = $WarningPreference
$WarningPreference = "SilentlyContinue"
$IsNotSkipped = ($IsWindows -and $IsCoreCLR -and (Test-IsElevated) -and (Test-CanWriteToPsHome))
... | 0 |
sample_14_98.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 |
831.ps1 |
$cred = Get-Credential
New-AzVmss `
-ResourceGroupName "myResourceGroup" `
-VMScaleSetName "myScaleSet" `
-Location "EastUS" `
-VirtualNetworkName "myVnet" `
-SubnetName "mySubnet" `
-PublicIpAddressName "myPublicIPAddress" `
-LoadBalancerName "myLoadBalancer" `
-Credential $cred `
-UpgradePolicy... | 0 |
sample_1_79.ps1 | [dynamic, provider("dcismprovider"),
Description(
"DCIM_CMCService is a derivation of DCIM_ModularSystemService "
"with extrinsic method extensions ")]
class DCIM_CMCService : DCIM_ModularSystemService {
};
/* SIG # Begin signature block */
/* MIItDgYJKoZIhvcNAQcCoIIs/zCCLPsCAQExDzANBglghkgBZQME... | 0 |
Get-DellWarranty_1.ps1 | function Get-DellWarranty {
<#
.Synopsis
Provides warranty information for one or more Dell service tags.
.Description
Queries the Dell Website for a list of service tags and returns the warranty information as a custom object.
If a service tag has multiple warranties, they are... | 0 |
2ee1612d-7a4e-467a-8ae1-8c310bb1cba0.ps1 | #Purpose: To remotely query select machines for system information
#Author: Alex Smith
#Created: 6/11/2010
#Arguments: IP Addresses or Hostnames of target PCs then path and file name
#Examples: To query based on hostname or ip: C:\\>powershell .\\WMIQuery.ps1 host1
# To print to a file: C:\\>po... | 0 |
4282.ps1 | function Invoke-Inveigh
{
[CmdletBinding()]
param
(
[parameter(Mandatory=$false)][Array]$HTTPResetDelay = "Firefox",
[parameter(Mandatory=$false)][Array]$ProxyIgnore = "Firefox",
[parameter(Mandatory=$false)][Array]$SpooferHostsReply = "",
[parameter(Mandatory=$false)][Array]$SpooferHostsIgnore = ""... | 0 |
CertMgmt pack_1.ps1 | #####################################################################
# CertMgmtPack.ps1
# Version 0.51
#
# Digital certificate management pack
#
# Vadims Podans (c) 2009
# http://www.sysadmins.lv/
#####################################################################
#requires -Version 2.0
function Import-C... | 0 |
sample_54_39.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_13_55.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 = '74.1.0'
# Supported PSEditions
Comp... | 0 |
4253.ps1 | function Invoke-TokenManipulation
{
[CmdletBinding(DefaultParameterSetName="Enumerate")]
Param(
[Parameter(ParameterSetName = "Enumerate")]
[Switch]
$Enumerate,
[Parameter(ParameterSetName = "RevToSelf")]
[Switch]
$RevToSelf,
[Parameter(ParameterSetNam... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.