filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
Get-ProcedureCallTree.ps1 | #requires -version 2
#Uses SQLParser.ps1 script http://poshcode.org/1445 to return Stored Procedure Call Tree
#Chad Miller
#http://chadwickmiller.spaces.live.com/
param ($procedure, $server, $database, $schema='dbo')
add-type -AssemblyName Microsoft.SqlServer.Smo
#Only create the dynamic SQLParser type if... | 0 |
2698.ps1 | filter ConvertTo-String
{
[OutputType([String])]
Param (
[Parameter( Mandatory = $True,
Position = 0,
ValueFromPipeline = $True )]
[ValidateScript({-not (Test-Path $_ -PathType Container)})]
[String]
$Path
)
$FileStream = New-Obj... | 0 |
552.ps1 |
function Get-SPOSolutionId
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$solutionName
)
$fileUrl = Join-SPOParts -Separator '/' -Parts $clientContext.Site.ServerRelativeUrl, "/_catalogs/solutions/", $solutionName
$solution = $clientContext.Site.RootWeb.GetFileByServ... | 0 |
4477.ps1 |
configuration PSModule_InstallModuleWithinVersionRangeConfig
{
param
(
[Parameter()]
[System.String[]]
$NodeName = 'localhost',
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[System.String]
$ModuleName,
[Parameter(Mandatory = $tr... | 0 |
sample_63_7.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#####################################################################################################
#
# Registers the WinRM endpoint for this instance of PowerShell.
#
# If the parameters '-PowerShellHome' were specified, it means that t... | 0 |
New-ODataServiceProxy_2.ps1 | function New-ODataServiceProxy {
#.Synopsis
# Creates a proxy class for an odata web service
# YOU NEED TO BE VERY CAREFUL NOT TO OUTPUT THE PROXY OBJECT TO THE POWERSHELL HOST!
#.Description
# Uses the data service client utility (DataSvcUtil.exe) to generate a proxy class (and types for all objects) for an O... | 0 |
1579.ps1 |
function Remove-MrSavedCredential {
[CmdletBinding(SupportsShouldProcess,
ConfirmImpact='Medium')]
param (
[Parameter(Mandatory,
ValueFromPipelineByPropertyName)]
[string]$Target
)
PROCESS {
if ($PSCmdlet.ShouldProcess($Target,'Delete')) {... | 0 |
Farm Backup.ps1 | ##################################
#This errors out in ISE, so use cmd window.
#The script below fixes the error just below.
#Cannot access the local farm. Verify that the local farm is
#properly configured, currently available, and that you have
#the appropriate permissions to access the database before
#tryi... | 0 |
1605.ps1 |
write-host "
write-host "
write-host "
write-host "
write-host "
write-host "
$a = (Get-Host).PrivateData
$a.WarningBackgroundColor = "red"
$a.WarningForegroundColor = "white"
gc env:computername
Get-Date
function Read-Choice {
PARAM([string]$message, [string[]]$choices, [int]$defaultChoice=12... | 0 |
2032.ps1 |
Describe 'Tests for $ErrorView' -Tag CI {
It '$ErrorView is an enum' {
$ErrorView | Should -BeOfType [System.Management.Automation.ErrorView]
}
It '$ErrorView should have correct default value' {
$expectedDefault = 'NormalView'
if ((Get-ExperimentalFeature -Name PSErrorView).En... | 0 |
sample_64_26.ps1 | ##------------------------------------------------------------------
## <copyright file="Disable-Extension.ps1" company="Microsoft">
## Copyright (C) Microsoft. All rights reserved.
## </copyright>
##------------------------------------------------------------------
$ErrorActionPreference = "Stop"
$functio... | 0 |
sample_65_26.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_51_88.ps1 | ###-begin-{pkgname}-completion-###
Register-ArgumentCompleter -CommandName '{pkgname}' -ScriptBlock {
param(
$WordToComplete,
$CommandAst,
$CursorPosition
)
function __{pkgname}_debug {
if ($env:BASH_COMP_DEBUG_FILE) {
"$args" | Out-File -Append ... | 0 |
sample_5_91.ps1 | #************************************************
# TS_PowerCFG.ps1
# Version 3.0
# Date: 14/03/2013
# Author: v-kaw
# Description: Running powercfg.exe to obtain power settings information
# Note: This is the third edition of this file. Ideal ID for this edition is 6292.
# Ideal ID for second edition is ... | 0 |
1523.ps1 |
function Assert-GreaterThan
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
[object]
$InputObject,
[Parameter(Position=1)]
[object]
$LowerBound,
[Parameter(Position=2)]
[string]
$Message
... | 0 |
524.ps1 |
function Get-SPObjectPermissions{
param(
[Parameter(Mandatory=$false)]
[string]$Identity,
[switch]$IncludeChildItems,
[switch]$Recursive,
[switch]$OnlyLists,
[switch]$OnlyWebsites,
[switch]$ByUsers
)
if(-not (Get-PSSnapin "Mic... | 0 |
sample_8_0.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 |
AD-GroupMembers_v2.ps1 | function AD-GroupMembers() {
param (
$Domen,
$Group,
$User
)
if ($User){$Connection = Get-Credential -Credential $user}
if($Connection){$Member = Get-QADGroupMember -Service $Domen -Identity $Group -Credential $Connection -SizeLimit 0 -ErrorAction SilentlyContinue | Sort Name | Format-List Name,NTAccountName,Sid... | 0 |
Get-BogonList_1.ps1 | function Get-BogonList {
<#
.SYNOPSIS
Gets the bogon list.
.DESCRIPTION
The Get-BogonList function retrieves the bogon prefix list maintained by Team Cymru.
A bogon prefix is a route that should never appear in the Internet routing table.
A packet routed over the public Internet (not including o... | 0 |
sample_46_36.ps1 |
function Start-AzDataProtectionBackupInstanceRestore
{
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IOperationJobExtendedInfo')]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Trigg... | 0 |
sample_63_87.ps1 | #
# Module manifest for module 'OCI.PSModules.Jms'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jms.dll'
# Version number of this module.
ModuleVersion = '89.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
1628.ps1 |
function Add-Zip {
param (
[string]$sourceFile,
[string]$zipFile
)
begin {
function Resolve-FullPath ([string]$Path) {
if ( -not ([System.IO.Path]::IsPathRooted($Path)) ) {
$Path = "$PWD\$Path"
}
[IO.Path... | 0 |
Split-Job Version 1.2.ps1 | #requires -version 1.0
################################################################################
## Run commands in multiple concurrent pipelines
## by Arnoud Jansveld - www.jansveld.net/powershell
##
## Basic "drop in" usage examples:
## - Functions that accept pipelined input:
## Without Spli... | 0 |
2565.ps1 |
$names = Get-Content e:\dexma\temp\tempserver.txt
foreach($name in $names) {
$svc = Get-WmiObject Win32_Service -ComputerName $name -Filter "name='DexFileImpExp2'"
if ($svc.Started -eq $true) {
Stop-Service -InputObject (get-Service -ComputerName PAPP10 -Name DexFileImpExp2)
Write-Host "Stopped ser... | 0 |
sample_52_83.ps1 | # ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apach... | 0 |
sample_4_70.ps1 | #************************************************
# Rule ID 29 from http://sharepoint/sites/diag/Rules/_layouts/listform.aspx?PageType=4&ListId=%7b1F944AAF-10B3-4442-8AA8-4A1EF2B0F5F8%7d&ID=29&ContentTypeID=0x0100969570CC59987E4BADAD7118A311DB4D
#************************************************
# TS_ClusterCNOCheck.... | 0 |
sample_63_51.ps1 | (this.webpackJsonp=this.webpackJsonp||[]).push([[206],{237:function(e,t){Prism.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:{function:{pattern:/(^|[^`])\$\((?:\$\(.*?\)|(?!\$\()[^\r\n)])*\)/,... | 0 |
2602.ps1 | function Measure-SQLExecution{
param($instancename
,$databasename = 'tempdb'
,[Parameter(ParameterSetName = 'SQLCmd',Mandatory=$true)]$sqlcmd
,[Parameter(ParameterSetName = 'SQLScript',Mandatory=$true)]$sqlscript)
$output = New-Object System.Object
$errval = $null
$output | Add... | 0 |
sample_17_92.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicemesh'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicemesh.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEdition... | 0 |
sample_17_33.ps1 | @{
RootModule = 'PSModule.psm1'
ModuleVersion = '2.2.5'
GUID = '1d73a601-4a6c-43c5-ba3f-619b18bbb404'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = '(c) Microsoft Corporation. All rights reserved.'
D... | 0 |
sample_35_35.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=필요한 PowerShell 모듈(FailoverClusters)을 찾을 수 없습니다. 역할 및 기능 도구를 사용하여 원격 서버 관리 도구 | 기능 관리 도구 | 장애 조치(failover) 클러스터링 도구 | Windows PowerShell용 장애 조치(failover) 클러스터 모듈을 설치하세요.
HyperVModuleRequired=필요한 PowerShell 모듈(Hyper-V)을 찾을 수 없습니다. 역할 및 기능 도구를 사용하여 원격 서버 관리 도구 | 역... | 0 |
sample_64_83.ps1 | #
# Module manifest for module 'OCI.PSModules.Objectstorage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Objectstorage.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEdi... | 0 |
sample_18_27.ps1 | #
# Module manifest for module 'OCI.PSModules.Emwarehouse'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Emwarehouse.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEdition... | 0 |
817.ps1 | function My-Function ($myInput)
{
My-Function $myInput
}
$things = 4
$things
My-Function $things
Write-Output "Hello World";
Get-ChildItem
gci
dir
Write-Host
Get-ChildItem
| 0 |
CenturionPortal.ps1 | ## New-CodeSigningCert.ps1
########################################################################################################################
## Does the setup needed to self-sign PowerShell scripts ...
## Generates a "test" self-signed root Certificate Authority
## And then generates a code-signing certific... | 0 |
4317.ps1 |
function RegisterTestRepository {
$testRepoRegistered = Get-PSRepository -Name $TestRepositoryName -ErrorAction SilentlyContinue
if (-not $testRepoRegistered) {
Register-PSRepository -Name $TestRepositoryName -SourceLocation $TestRepositorySource -InstallationPolicy Trusted
$testRepoRegi... | 0 |
3644.ps1 |
function Handle-InstanceFailoverGroupTest($scriptBlock, $rg = "testclrg", $primaryLocation = "southeastasia", $secondaryLocation = "southeastasia", $mi1 = $null, $mi2 = $null, $cleanup = $false)
{
try
{
$rg = if ($rg -eq $null) { "testclrg" } else { $rg }
$miName1 = if ($mi1 -eq $null) { "tdstage-ha... | 0 |
1004.ps1 |
$storageName = "<your-unique-storage-name>"
$myEndpoint = "<your-endpoint-URL>"
$myResourceGroup="<resource-group-name>"
New-AzResourceGroup -Name $myResourceGroup -Location westus2
New-AzStorageAccount -ResourceGroupName $myResourceGroup `
-Name $storageName `
-Location westus2 `
-SkuName Standard_LRS `... | 0 |
sample_59_97.ps1 | <#
.SYNOPSIS
Common Reporting functions across all modules/scenarios
.DESCRIPTION
Logging, Reporting
.INPUTS
Inputs (if any)
.OUTPUTS
Output (if any)
.NOTES
General notes
#>
function Set-AzStackHciOutputPath
{
param ($Path, $Source='AzStackHciEnvironmentChecker/Diagnostic')
... | 0 |
ISEFun.psm1.ps1 | # Module version 0.1
# Author: Bartek Bielawski (@bielawb on twitter)
# Purpose: Add functionality to PowerShell ISE
# Description: Adds Add-ons menu 'ISEFun' with all functions included.
# User can add any action there using Add-MyMenuItem function
# One of functions (Copy item from history) was build using... | 0 |
sample_9_0.ps1 | #This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER #EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABI... | 0 |
Get-Parameter 2.0.ps1 | #Requires -version 2.0
#.Synopsys
# Enumerates the parameters of one or more commands
#.Notes
# With many thanks to Hal Rottenberg, Oisin Grehan and Shay Levy
# Version 0.* - By Hal Rottenberg http://poshcode.org/549
# Version 0.* - By Oisín Grehan http://poshcode.org/446
# - Added resolving ali... | 0 |
1008.ps1 |
$myTopic = "<your-custom-topic-name>"
$myEndpoint = "<your-endpoint-URL>"
$myResourceGroup = "<resource-group-name>"
New-AzResourceGroup -Name $myResourceGroup -Location westus2
New-AzEventGridTopic -ResourceGroupName $myResourceGroup -Name $myTopic -Location westus2
New-AzEventGridSubscription `
-EventSu... | 0 |
sample_38_13.ps1 | ConvertFrom-StringData @'
FailoverClustersModuleRequired=O módulo PowerShell (FailoverClusters) necessário não foi encontrado. Utilize a Ferramenta de Funções e Funcionalidades para instalar: Ferramentas de Administração Remota do Servidor | Ferramentas de Administração de Funcionalidades | Ferramentas de Clustering d... | 0 |
sample_53_76.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Get-Token {
<#
.EXTERNALHELP ..\PowerShellEditorServices.Commands-help.xml
#>
[CmdletBinding()]
[OutputType([System.Management.Automation.Language.Token])]
[System.Diagnostics.CodeAnalysis.SuppressMessage... | 0 |
3388.ps1 |
function Test-VirtualMachineScaleSet
{
Test-VirtualMachineScaleSet-Common $false
}
function Test-VirtualMachineScaleSet-ManagedDisks
{
Test-VirtualMachineScaleSet-Common $true
}
function Test-VirtualMachineScaleSet-Common($IsManaged)
{
$rgname = Get-ComputeTestResourceName
try
... | 0 |
3574.ps1 |
function Get-ResourceGroupName
{
return getAssetName
}
function Get-ResourceName
{
return getAssetName
}
function Get-Location
{
return "West US"
}
function Get-OfferThroughput
{
return 1000
}
function Get-Kind
{
return "fhir-R4"
}
function Clean-ResourceGroup($rgname)
{
Re... | 0 |
sample_52_63.ps1 | #
# Module manifest for module 'OCI.PSModules.Recovery'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Recovery.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Comp... | 0 |
sample_17_52.ps1 | #
# Module manifest for module 'OCI.PSModules.Rover'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Rover.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
Compatible... | 0 |
sample_41_23.ps1 | # Localized 06/28/2023 07:58 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1
ConvertFrom-StringData @'
###PSLOC
Troubleshoot_Title=Αντιμετώπιση προβλημάτων
Troubleshoot_DetectDVDDevice=Έλεγχος συσκευής DVD...
Troubleshoot_DetectDVDvideoDecoder=Έλεγχος αποκωδικοποιητή βίντεο για αναπαραγωγή μέσου DVD...
Troublesh... | 0 |
sample_67_75.ps1 | #
# Module manifest for module 'OCI.PSModules.Marketplace'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Marketplace.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEdition... | 0 |
sample_8_86.ps1 | #************************************************
# TS_RegKeyCheck.ps1
# Version 1.0.1
# Date: 03-27-2011
# Author: Your Name - Your Email Address
# Description: This script checks if there is a registry value called 'DetectRootCause' in HKLM\SOFTWARE\Microsoft\Test
# And then flag it as a root cau... | 0 |
3661.ps1 |
function Test-StartJob
{
$a1 = Create-ElasticJobAgentTestEnvironment
$script = "SELECT 1"
$s1 = Get-AzSqlServer -ResourceGroupName $a1.ResourceGroupName -ServerName $a1.ServerName
$credential = Get-Credential $s1.SqlAdministratorLogin
$jc1 = $a1 | New-AzSqlElasticJobCredential -Name (Get-UserNa... | 0 |
3795.ps1 |
$global:ps_test_tag_name = 'crptestps6050'
function get_vm_config_object
{
param ([string] $rgname, [string] $vmsize)
$st = Write-Verbose "Creating VM Config Object - Start";
$vmname = $rgname + 'vm';
$p = New-AzVMConfig -VMName $vmname -VMSize $vmsize;
$st = Write-Verbo... | 0 |
sample_27_69.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 |
DefaultParameterValues_3.ps1 | # DefaultParameters Module
# 1.4 - removed extra parameter set to get parameter binding working better
# - added default aliases (sdp/gdp/rmdp)
#requires -version 3.0
# 1.3 - fixed denable/disable, added get and remove, and improved import and set
# 1.2 - added help and commands to enable/disable the defaults
... | 0 |
3356.ps1 |
param(
[CmdletBinding()]
[Parameter(Mandatory = $false, Position = 0)]
[switch]$IsNetCore,
[Parameter(Mandatory = $false, Position = 1)]
[ValidateSet("Debug", "Release")]
[string]$BuildConfig,
[Parameter(Mandatory = $false, Position = 2)]
[ValidateSet("All", "Latest", "... | 0 |
1591.ps1 | if ((get-host).Version.Major -ge 4){
$XmlQuery = [xml]@'
<QueryList>
<Query Id="0" Path="System">
<Select Path="System">*[System[Provider[@Name='disk'] and TimeCreated[timediff(@SystemTime) <= 86400000]]]</Select>
</Query>
</QueryList>
'@
$LogOutput = Get-WinEvent -FilterXml $XmlQuery -ErrorAction SilentlyCo... | 0 |
sample_0_52.ps1 | ConvertFrom-StringData @'
id_surfacepro3detectconnectedstandbystatus=Detect Surface Pro 3 Connected Standby Status Issue
id_surfacepro3detectconnectedstandbystatusdesc=Detected Surface Pro 3 Connected Standby Status Issue
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEF... | 0 |
Computer Inventory.ps1 | # ========================================================
#
# Script Information
#
# Title: Remote Computer Inventory
# Author: Assaf Miron
# Originally created: 21/06/2008
# Original path: Computer-Inventory.PS1
# Description: Collects Remote Computer Data Using WMI and Registry Access
# Outputs... | 0 |
252.ps1 | function Remove-SCCMUserDeviceAffinity
{
[CmdletBinding(DefaultParameterSetName = 'ResourceName')]
param
(
[Parameter(ParameterSetName = 'ResourceName')]
[Parameter(ParameterSetName = 'ResourceID')]
$SiteCode,
[Parameter(ParameterSetName = 'ResourceName',
... | 0 |
Backup-EventLogs.ps1 | Function Backup-EventLogs
{
<#
.SYNOPSIS
Backup Eventlogs from remote computer
.DESCRIPTION
This function backs up all logs on a Windows computer that have events written in them. This
log is stored as a .csv file in the current directory, where the filenam... | 0 |
Start-ComputerJobs.ps1 | #requires -version 2.0
function Start-ComputerJobs{
<#
.NOTES
Name: Start-ComputerJobs
Author: Tome Tanasovski
Created: 6/25/2010
Version: 1.0
Website: http://powertoe.wordpress.com
.SYNOPSIS
Multithreads a scriptblock with jobs
.DESCRIPTION
The St... | 0 |
4401.ps1 | function Add-ArgumentCompleter()
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string[]]$cmdlets,
[Parameter(Mandatory=$true)]
[string]$parameterName
)
try
{
if(Get-Command -Name Register-ArgumentCompleter -ErrorAction SilentlyContinue)
... | 0 |
POC-adding custom PS job.ps1 | #this is just a quite proof of concept, totally useless in of itself, with functions not fleshed out
function get-jobrepository
{
[CmdletBinding()]
param()
$pscmdlet.JobRepository
}
function add-job
{
[CmdletBinding()]
param($job)
$pscmdlet.JobRepository.add($job)
}
$src = @"
using System;
using Sy... | 0 |
sample_53_37.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmconfig'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmconfig.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Co... | 0 |
2390.ps1 |
function Enable-FileEncryption
{
[OutputType([void])]
[CmdletBinding()]
param
(
[Parameter(Mandatory,ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[System.IO.FileInfo]$File
)
begin {
$ErrorActionPreference = 'Stop'
}
process {
try
{
$File.Encrypt()
}
catch
{
$PSCmdlet.ThrowTerminat... | 0 |
sample_62_74.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 |
4136.ps1 |
[CmdletBinding()]
param ()
function Uninstall-MSIByName {
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()][String]$ApplicationName,
[ValidateNotNullOrEmpty()][String]$Switches
)
$Executable = $Env:windir + "\system32\msiexec.exe"
$Uninstall = Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\Curre... | 0 |
WakeOnLan.ps1 | #wakeonlan $computer
function WakeOnLan($computer)
{
$select=$select |where-object {$_.computername -eq $computer} |Select-Object mac
if ($select.mac -eq $null)
{
echo "workstation not found.epic fail. use all to wake'em all"
}
else
{
$select.mac -match "(..)(..)(..)(..)(..)(..)" | out-null
$mac... | 0 |
Copy Files Log to Excel.ps1 | # Get User/Pass
$Cred = Get-Credential
# Add Quest CMDLETS
Add-PSSnapin Quest.ActiveRoles.ADManagement -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
# Get Computer's from AD
$Computers = Get-QADComputer -SearchRoot "OU=Workstations,DC=Domain,DC=com" -Credential $Cred
# Import BITS for the file tra... | 0 |
728.ps1 |
function New-RsFolder
{
[cmdletbinding()]
param
(
[Parameter(Mandatory = $True)]
[Alias('ItemPath','Path')]
[string]
$RsFolder,
[Parameter(Mandatory = $True)]
[Alias('Name')]
[string]
$FolderName,
[string]
$Descriptio... | 0 |
Get MOSS User Profile_1.ps1 | function Get-UserProfile($accountName)
{
[reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint") | out-null
[reflection.assembly]::LoadWithPartialName("Microsoft.Office.Server") | out-null
$upm =[Microsoft.Office.Server.UserProfiles.UserProfileManager](
[Microsoft.Office.Server.ServerContext]::D... | 0 |
3999.ps1 |
$rg = "mms-wcus"
$aa = "JemalOMSAutomation"
$azureVMIdsW = @(
"/subscriptions/cd45f23b-b832-4fa4-a434-1bf7e6f14a5a/resourceGroups/mms-wcus/providers/Microsoft.Compute/virtualMachines/JemalCmdlet1",
"/subscriptions/cd45f23b-b832-4fa4-a434-1bf7e6f14a5a/resourceGroups/... | 0 |
Asp_2.net-Using httpConext.ps1 | Default.aspx
----------------
Partial Class _Default
Inherits System.Web.UI.Page
Dim var1 As String
Dim var2 As String
Protected Sub lnk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnk.Click
Context.Items("Nome") = var1
Context.Items("Email") = var2
Server.Transfer("pagina3.as... | 0 |
sample_28_39.ps1 | #
# This script handles common telemetry tasks for Install.ps1 and Add-AppDevPackage.ps1.
#
function IsVsTelemetryRegOptOutSet()
{
$VsTelemetryRegOptOutKeys = @(
"HKLM:\SOFTWARE\Policies\Microsoft\VisualStudio\SQM",
"HKLM:\SOFTWARE\Wow6432Node\Microsoft\VSCommon\16.0\SQM",
"HKLM:\S... | 0 |
3325.ps1 |
function Disable-ScheduledCommand {
[PoshBot.BotCommand(
Aliases = 'disableschedule',
Permissions = 'manage-schedules'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[ValidateNotNullOrEmpty()]
[... | 0 |
498.ps1 |
function Report-FileSystemPermissions{
param(
[parameter(Mandatory=$true)]
[String]$Path,
[parameter(Mandatory=$true)]
[int]$Levels
)
$FileSystemPermissionReport = @()
$FSfolders = Get-ChildItemRecurse -Path $Path -Levels $Levels -OnlyDi... | 0 |
Findup_4.ps1 | using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.IO;
namespace ConsoleApplication1
{
public class FileInfoExt
{
public FileInfoExt(Fil... | 0 |
341.ps1 | function Import-PSFConfig
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingEmptyCatchBlock", "")]
[CmdletBinding(DefaultParameterSetName = "Path", HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Import-PSFConfig')]
param (
[Parameter(Mandatory = $true, ValueFromPipeline = $t... | 0 |
2116.ps1 |
Describe 'Parallel foreach syntax' -Tags 'CI' {
Context 'Should be able to retrieve AST of parallel foreach' {
BeforeAll {
$ast = [System.Management.Automation.Language.Parser]::ParseInput(
'foreach -parallel ($foo in $bar) {}', [ref]$null, [ref]$null)
}
It '... | 0 |
sample_19_74.ps1 | #
# Module manifest for module 'OCI.PSModules.Onesubscription'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Onesubscription.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported P... | 0 |
sample_62_11.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 = '85.2.0'
# Supported PSEditions
CompatiblePS... | 0 |
sample_52_98.ps1 | #
# Module manifest for module 'OCI.PSModules.Jmsjavadownloads'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Jmsjavadownloads.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported... | 0 |
sample_51_83.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... | 0 |
4291.ps1 | function Invoke-SqliteQuery {
[CmdletBinding( DefaultParameterSetName='Src-Que' )]
[OutputType([System.Management.Automation.PSCustomObject],[System.Data.DataRow],[System.Data.DataTable],[System.Data.DataTableCollection],[System.Data.DataSet])]
param(
[Parameter( ParameterSetName='Src-Que',
... | 0 |
sample_13_2.ps1 | #region 'Old Code'
<#
if ($OSVersion.Major -eq 5)
{
# Disabling running on Win2K3 x64 due some reports of crashes for specific controllers
"[San.exe] - Skipping running san.exe on Windows prior to Server 2008" | WriteTo-StdOut
}
else
{
Import-LocalizedData -BindingVariable SanStorageInfoStrings
Write-Diag... | 0 |
1164.ps1 |
Set-StrictMode -Version 'Latest'
$parentFSPath = $null
$childFSPath = $null
$originalAcl = $null
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
function Assert-AclInheritanceDisabled
{
param(
$Path
)
It 'should disable access rule inheritance' {
... | 0 |
sample_56_7.ps1 | # Welcome to Teams Toolkit!
## Quick Start
> **Prerequisites**
>
> To run this app template in your local dev machine, you will need:
>
> - [Visual Studio 2022](https://aka.ms/vs) 17.9 or higher and [install Teams Toolkit](https://aka.ms/install-teams-toolkit-vs)
> - A [Microsoft 365 account for development](https://... | 0 |
2287.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Name of the Azure AD application to be created.")]
[ValidateNotNullOrEmpty()]
[string]$AppDisplayName,
[parameter(Mandatory=$true, HelpMessage="Name of a Resource Group in Azure that the OMS workspace used for... | 0 |
1349.ps1 |
function Set-CIisHttpHeader
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]
$SiteName,
[Alias('Path')]
[string]
$VirtualPath = '',
[Parameter(Mandatory=$true)]
[s... | 0 |
Import-Iis-Log_2.ps1 | param
(
[Parameter(
Mandatory=$true,
Position = 0,
ValueFromPipeline=$true,
HelpMessage="Specifies the path to the IIS *.log file to import. You can also pipe a path to Import-Iss-Log."
)]
[ValidateNotNullOrEmpty()]
[string]
$Path,
[Parameter(
Position = 1,
HelpMessage="Specifies the d... | 0 |
sample_30_14.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 = '77... | 0 |
3904.ps1 |
function Test-CertificateCrudOperations
{
$context = New-Object Microsoft.Azure.Commands.Batch.Test.ScenarioTests.ScenarioTestContext
$thumbprintAlgorithm = "sha1"
$localDir = ($pwd).Path
$certPathVs = $localDir + "/Resources/BatchTestCert01.cer"
$x509cert = New-Object Sy... | 0 |
Stored Credential Code.ps1 | #STORED CREDENTIAL CODE
$AdminName = Read-Host "Enter your Admin AD username"
$CredsFile = "C:\\$AdminName-PowershellCreds.txt"
$FileExists = Test-Path $CredsFile
if ($FileExists -eq $false) {
Write-Host 'Credential file not found. Enter your password:' -ForegroundColor Red
Read-Host -AsSecureString | ConvertF... | 0 |
1214.ps1 |
Set-StrictMode -Version 'Latest'
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$sourceRoot = $null;
$destinationRoot = $null
function Assert-Copy
{
param(
$SourceRoot,
$DestinationRoot,
[Switch]
$Recurse
)
Get-ChildItem -P... | 0 |
sample_12_1.ps1 | #************************************************
# TS_HyperVEvent106Check.ps1
# Version 1.0.08.26.14: Created Rule.
# Version 1.1.09.04.14: Configured the detection logic to flag events for only the last 7 days.
# Author: bbenson, tode
# Description: Check for Hyper-V Event 106
#*********************************... | 0 |
Split-String.ps1 | function Split-String {
#.Synopsis
# Split a string and execute a scriptblock to give access to the pieces
#.Description
# Splits a string (by default, on whitespace), and assigns it to $0, and the first 9 words to $1 through $9 ... and then calls the specified scriptblock
#.Example
# echo "this is one test ff... | 0 |
sample_42_89.ps1 | #
# Module manifest for module 'OCI.PSModules.Computecloudatcustomer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Computecloudatcustomer.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
... | 0 |
Get-DLRestriction_1.ps1 | ###########################################
# Get-DLRestriction
#
# Uses QAD cmdlets to retrieve distribution list restriction attributes
# and then provides a list of users which can send email messages to the group.
#
# Usage: Get-DLRestriction "Worldwide Everyone"
#
# Dmitry Sotnikov, http://dmitrysotnikov.... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.