filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
sample_42_41.ps1 | #
# Module manifest for module 'OCI.PSModules.Waf'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waf.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
3939.ps1 |
function Check-CmdletReturnType
{
param($cmdletName, $cmdletReturn)
$cmdletData = Get-Command $cmdletName;
Assert-NotNull $cmdletData;
[array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") ... | 0 |
sample_8_48.ps1 | #************************************************
# TS_PrintHpzui4wmCheck.ps1
# Version 1.0.1
# Date: 2/29/12
# Author: jasonf
# Description: KB947477 Detect the OEM HP driver hpzui4wm.DLL. This driver is known to cause the print spooler to crash or hang.
#************************************************
#str... | 0 |
sample_62_91.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
function Copy-ToTemp
{
... | 0 |
sample_62_69.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudmigrations'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudmigrations.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported P... | 0 |
sample_35_5.ps1 | #
# Module manifest for module 'PSScriptAnalyzer'
#
@{
# Author of this module
Author = 'Microsoft Corporation'
# Script module or binary module file associated with this manifest.
RootModule = 'PSScriptAnalyzer.psm1'
# Version number of this module.
ModuleVersion = '1.22.0'
# ID used to uniquely identify this mod... | 0 |
3034.ps1 | Set-StrictMode -Version Latest
InModuleScope Pester {
Describe "Should -Exist" {
It "returns true for paths that exist" {
$TestDrive | Should Exist
$TestDrive | Should -Exist
}
It "returns false for paths do not exist" {
"$TestDrive\nonexistant" | Should... | 0 |
881.ps1 |
New-AzResourceGroup -Name myResourceGroupAG -Location eastus
$backendSubnetConfig = New-AzVirtualNetworkSubnetConfig `
-Name myBackendSubnet `
-AddressPrefix 10.0.1.0/24
$agSubnetConfig = New-AzVirtualNetworkSubnetConfig `
-Name myAGSubnet `
-AddressPrefix 10.0.2.0/24
$vnet = New-AzVirtualNetwork `
-Resour... | 0 |
3212.ps1 | [CmdletBinding()]
param($maxKeys = 25)
class KeyInfo
{
KeyInfo([string]$k, [ConsoleKeyInfo]$ki, [bool]$investigate)
{
$this.Key = $k
$this.KeyChar = $ki.KeyChar
$this.ConsoleKey = $ki.Key
$this.Modifiers = $ki.Modifiers
$this.Investigate = $investigate
}
[string... | 0 |
sample_35_9.ps1 | #
# Module manifest for module 'OCI.PSModules.Vbsinst'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vbsinst.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
Compat... | 0 |
Enable-HistoryPersistenc.ps1 | ##############################################################################\n##\n## Enable-HistoryPersistence\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n... | 0 |
sample_13_51.ps1 | #
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ... | 0 |
sample_45_92.ps1 | #
# Module manifest for module 'OCI.PSModules.Databasemanagement'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Databasemanagement.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Suppo... | 0 |
Aero Glass PowerShell.ps1 | #requires -version 2
param([switch]$Disable)
add-type -namespace Hacks -name Aero -memberdefinition @"
[StructLayout(LayoutKind.Sequential)]
public struct MARGINS
{
public int left;
public int right;
public int top;
public int bottom;
}
[DllImport("d... | 0 |
Replicate-ADDS.ps1 | # Transcribe output to log
$null = Start-Transcript "$pwd\\$([System.IO.Path]::GetFileNameWithoutExtension($MyInvocation.MyCommand.Definition)).log"
# Check the QAD snapins are installed
if ( (Get-PSSnapin -Name Quest.ActiveRoles.ADManagement -ErrorAction silentlycontinue) -eq $null ) {
# The QAD snapin is not act... | 0 |
sample_30_31.ps1 | "use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Clear = void 0;
const switch_1 = require("../switch");
class Clear extends switch_1.Switch {
switch = 'clear';
}
exports.Clear = Clear;
//# sourceMappingURL... | 0 |
1732.ps1 | function Get-ServiceNowConfigurationItem {
[OutputType([System.Management.Automation.PSCustomObject])]
[CmdletBinding(DefaultParameterSetName, SupportsPaging)]
Param(
[Parameter(Mandatory = $false)]
[string]$OrderBy = 'name',
[Parameter(Mandatory = $false)]
... | 0 |
4130.ps1 |
Function BitLockerSAK {
[cmdletBinding()]
Param (
[Switch]$IsTPMActivated,
[Switch]$IsTPMEnabled,
[Switch]$IsTPMOwnerShipAllowed,
[Switch]$ResumeEncryption,
[Switch]$GetEncryptionState,
[Switch]$GetProtectionStatus,
[switch]$Encrypt,
[Parameter(ParameterSetName = 'OwnerShip')][switch]$TakeTPMOwnerS... | 0 |
sample_26_18.ps1 | TOPIC
about_poshsvntarget
Short description
Describes how to specify cmdlet target.
Long description
Some Subversion operations support specifying either a local Path to a
working copy or a remote Url to a repository as a target.
You can specify target of the operation by setting the `-Ta... | 0 |
04180226-a26b-47be-abbd-9eb998596807.ps1 | <#=====================================================
SYNOPSIS
Create an Excel workbook for a teacher.
The workbook contains a worksheet for each class.
=====================================================#>
<#=====================================================
RETRIEVE CURRENT USER'S LOGON
Prefer API to ... | 0 |
2705.ps1 |
$Mod = New-InMemoryModule -ModuleName Win32
$ImageDosSignature = psenum $Mod PE.IMAGE_DOS_SIGNATURE UInt16 @{
DOS_SIGNATURE = 0x5A4D
OS2_SIGNATURE = 0x454E
OS2_SIGNATURE_LE = 0x454C
VXD_SIGNATURE = 0x454C
}
$ImageFileMachine = psenum $Mod PE.IMAGE_FILE_MACHINE UInt16 @{
UNKNOWN = 0x... | 0 |
79de7fa1-6c33-48aa-b0e4-a5f72def9bcc.ps1 | ################################################################
#
# PC Info v1.0 for SNOS(http://www.snos.ru/)
# (c)2009 by MakcoH(http://twitter.com/MakcoH)
# Script gathers information about remote PC using SCCM and WMI
#
################################################################
# Get... | 0 |
sample_58_75.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 = '87.0.0'
# Supported PSEditi... | 0 |
sample_57_72.ps1 | # Import the helper functions
Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false
function Get-TargetResource
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param
(
[parameter(Mandatory = $true)]
[System.String]
$Category
)
#Write-Verbose "Use this cmdlet t... | 0 |
sample_35_67.ps1 | #
# Module manifest for module 'OCI.PSModules.Cims'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cims.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
CompatiblePS... | 0 |
1270.ps1 |
function Start-CDscPullConfiguration
{
[CmdletBinding(DefaultParameterSetName='WithCredentials')]
param(
[Parameter(Mandatory=$true,ParameterSetName='WithCredentials')]
[string[]]
$ComputerName,
[Parameter(ParameterSetName='WithCredentials')]
[PSCredential... | 0 |
1683.ps1 |
$ShellApp = new-Object -ComObject shell.application
Add-Type -AssemblyName PresentationFramework
[xml]$xaml = @"
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="AlliedVOA | Mini Desktop Tool - Folder ... | 0 |
http___harleydavidsonmot.ps1 | Sow nothing, reap nothing.
-----------------------------------
| 0 |
4450.ps1 | function Find-Package
{
[CmdletBinding()]
param
(
[string[]]
$names,
[string]
$requiredVersion,
[string]
$minimumVersion,
[string]
$maximumVersion
)
Write-Debug ($LocalizedData.ProviderApiDebugMessage -f ('Find-Package'))
Set-M... | 0 |
sample_53_84.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 |
1851.ps1 |
$script:oldModulePath = $env:PSModulePath
function Add-ModulePath
{
param([string]$Path, [switch]$Prepend)
$script:oldModulePath = $env:PSModulePath
if ($Prepend)
{
$env:PSModulePAth = $Path + [System.IO.Path]::PathSeparator + $env:PSModulePath
}
else
{
$env:PSModulePat... | 0 |
sample_16_38.ps1 | #
# Module manifest for module 'OCI.PSModules.Bastion'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Bastion.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
Compat... | 0 |
sample_56_13.ps1 | #
# Module manifest for module 'OCI.PSModules.Networkloadbalancer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Networkloadbalancer.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Sup... | 0 |
sample_48_57.ps1 | $path = (Get-Location).path
$CurrentValue = [Environment]::GetEnvironmentVariable("PSModulePath", "Machine")
If (-Not ($CurrentValue -Like "*$path*") ) {
write "path is " + $path
$NewValue = $CurrentValue + ";$path"
[Environment]::SetEnvironmentVariable("PSModulePath", $NewValue, "Machine")
}
# SIG... | 0 |
sample_24_2.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 = '79.0.0'
# Supported PSEdi... | 0 |
sample_28_96.ps1 | ## Copyright (c) Microsoft Corporation. All rights reserved.
<#
.SYNOPSIS
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans.
.DESCRIPTION
This cmdlet collects a performance recording of Microsoft Defender Antivirus
scans. These performance recordings contain Microsoft-Antimal... | 0 |
3461.ps1 |
function Test-DataFlowDebugScenario
{
$dfname = Get-DataFactoryName
$rgname = Get-ResourceGroupName
$rglocation = Get-ProviderLocation ResourceManagement
$dflocation = Get-ProviderLocation DataFactoryManagement
New-AzResourceGroup -Name $rgname -Location $rglocation -Force
... | 0 |
sample_0_93.ps1 | #pragma namespace("\\\\.\\Root\\CIMV2\\DCIM")
instance of __Win32Provider as $ismserviceprovider
{
Name = "ismserviceprovider";
ClsId = "{22CB8761-914A-11cf-B705-00AA0062CBC9}";
Pure=FALSE;
UnloadTimeout = "00000000000005.000000:000";
ImpersonationLevel = 1;
PerUserInitialization = TRU... | 0 |
1021.ps1 |
$subscriptionId = '<Specify your subscription ID here>'
Select-AzSubscription -SubscriptionId $subscriptionId
$labRg = '<Specify your lab resource group name here>'
$labName = '<Specify your lab name here>'
$lab = Get-AzResource -ResourceId ('/subscriptions/' + $subscriptionId + '/resourceGroups/' + $labRg + '/prov... | 0 |
sample_1_29.ps1 | [dynamic, provider("dcismprovider"),
Description(
"DCIM_PresenceAndStatusSensor is a derivation of "
"CIM_Sensor, and represents a sensor.")]
class DCIM_PresenceAndStatusSensor : CIM_Sensor
{
[
Description ("The current state indicated by the Sensor. This is always one of the \"Possi... | 0 |
sample_11_13.ps1 | Signature-Version: 1.0
SHA-256-Digest-Manifest-Main-Attributes: 6O7HmBCrTSNxX243vN9FnfZPeGnR4
HdagZa0WCFVhWg=
SHA-256-Digest-Manifest: 2Mg/wtAdxyVaqshqUkObkEICHRS1s8WLRtNCmuswMQM=
Created-By: 1.8.0_112 (Oracle Corporation)
Name: com/microsoft/azure/toolkit/lib/appservice/deploy/FlexFunctionDe
ployHandler.html... | 0 |
New-Event_1.ps1 | function New-Event {
<#
.Synopsis
Generates a new event from a plain English string
.Description
Takes a plain English date-time string like "Scrum every day at 9am" or "Lunch every other Tuesday at noon" and turns it into an event object (see notes).
.Example
New-Event Lunch every other Friday at 11:45... | 0 |
AJAX Scrape.ps1 | ## scraping method for ajax driven websites. in this example, google marketplace is the target.
## requires: watin, htmlagilitypack
## http://watin.org/
## http://htmlagilitypack.codeplex.com/
## this scripts directs watin to gunbros and angry birds product pages and htmlagility is used to scrape user revie... | 0 |
sample_9_47.ps1 | ConvertFrom-StringData @'
id_servermanagerinfo=Server Manager Information
id_servermanagerobtaining=Obtaining Server Manager logs and role information
id_servermanageroclist=Optional Components list (oclist)
'@
# SIG # Begin signature block
# MIIoRgYJKoZIhvcNAQcCoIIoNzCCKDMCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# B... | 0 |
636.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://switch.dl.sourceforge.net/project/sevenzip/7-Zip/9.20/7z920-x64.msi","http://downloads.sourceforge.net/sevenzip/7za920.zip"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Pare... | 0 |
sample_17_93.ps1 | @{
GUID="CA046F10-CA64-4740-8FF9-2565DBA61A4F"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Get-WinEvent", "New-WinEvent", "Get-C... | 0 |
sample_20_84.ps1 | ConvertFrom-StringData @'
id_rdsserverprogress=Gathering RDS Information:
id_rdsgetport=Getting RDP-TCP configured port from registry
id_rdslistenport=Connecting to RDP-TCP port.
id_rdslistenporterror=Check if nothing is listening on PortNumber:
id_rdsqwinsta=Getting QWinSta report.
id_rdsrdpcert=Connecting to RD... | 0 |
2337.ps1 | function findOldADComputers () {
$aOldComputers = @();
$aAllAdComputers = Get-ADComputer -Filter * -Properties LastLogonDate,PasswordLastSet | Where { $_.Enabled -eq $true };
foreach ($oAdComputer in $aAllAdComputers) {
if ($oAdComputer.lastLogonDate -ne $null) {
if ($oAdComputer.lastLogonDate -lt [DateTime]::... | 0 |
2312.ps1 | function ConvertMySqlRow-ToJson
{
[CmdletBinding()]
[OutputType('System.IO.FileInfo')]
param
(
[Parameter(Mandatory, ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[System.Data.DataRow[]]$Row,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[ValidatePattern('\.json$')]
[ValidateScript({ -not... | 0 |
DefaultParameterValues_2.ps1 | # DefaultParameters Module
# 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
# 1.0 - initial release
function Export-DefaultParameter {
#.Synopsis
# Exports the current default parameter values
[CmdletBinding()]
par... | 0 |
Add EventLogs to Mongo.ps1 | <#
.NOTES
AUTHOR: Sunny Chakraborty(sunnyc7@gmail.com)
WEBSITE: http://tekout.wordpress.com
CREATED: 8/20/2012
Requires:
a) PowerShell v2 or better
b) Requires Mongo Official C# driver
https://github.com/mongodb/mongo-csharp-driver/downloads
Tested using 1.5.0.X
c) Thanks to Justin Dearing for this:
https:... | 0 |
Tac (reverse cat).ps1 | param([string]$path)
Set-PSDebug -Strict
$fs = New-Object System.IO.FileStream ((Resolve-Path $path), 'Open', 'Read')
trap { $fs.Close(); break }
$pos = $fs.Length
$sb = New-Object System.Text.StringBuilder
while (--$pos -ge 0) {
[void]$fs.Seek($pos, 'Begin')
$ch = [char]$fs.ReadByte()
if ($ch ... | 0 |
ConvertFrom-SDDL.ps1 | filter ConvertFrom-SDDL
{
<#
.SYNOPSIS
Convert a raw security descriptor from SDDL form to a parsed security descriptor.
Author: Matthew Graeber (@mattifestation)
.DESCRIPTION
ConvertFrom-SDDL generates a parsed security descriptor based upon any string in raw security descriptor definition l... | 0 |
sample_39_35.ps1 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.Synopsis
Registers or unregisters the PowerShell ETW manifest
.Parameter Path
The fully qualified path to the PowerShell.Core.Instrumentation.man manifest file.
The default value is the location of this script.
.Paramet... | 0 |
Get-XamlControlTemplate.ps1 | ## Get-XamlControlTemplate\n## Dump a WPF control's default XAML template\n########################################################################################################################\n## Usage:\n## Get-XamlControlTemplate System.Windows.Navigation.NavigationWindow\n## Get-XamlControlTemplate MenuItem\n## G... | 0 |
747.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter()]
[ValidateSet('64-bit', '32-bit')]
[string]$Architecture = '64-bit',
[parameter()]
[ValidateSet('Stable-System', 'Stable-User', 'Insider-System', 'Insider-User')]
[string]$BuildEdition = "Stable-System",
[Parameter()]
... | 0 |
sample_15_4.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 |
4041.ps1 |
function Test-EndpointCrudAndAction
{
$profileName = getAssetName
$resourceGroup = TestSetup-CreateResourceGroup
$resourceLocation = "EastUS"
$profileSku = "Standard_Microsoft"
$createdProfile = New-AzCdnProfile -ProfileName $profileName -ResourceGroupName $resourceGroup.ResourceGroup... | 0 |
Start-SQL 1.0.ps1 | # Start-Sql.ps1
###################################################################################################
# This is a SCRIPT which emits functions and variables into the global scope
# Most importantly, it uses a variable $SqlConnection which is expected to exist....
#
# On my computer, I set default val... | 0 |
sample_57_52.ps1 | "use strict";(self.webpackChunk_fta_workstation_web=self.webpackChunk_fta_workstation_web||[]).push([[7889],{27889:function(m,e,t){t.r(e),t.d(e,{default:function(){return r}});var n=t(95336),a=t(1295);const i=Object.freeze({displayName:"HTML",injections:{"R:text.html - (comment.block, text.html meta.embedded, meta.tag.... | 0 |
sample_4_96.ps1 | #************************************************
# TS_DetectWeakKeys.ps1
# Version 1.0.1
# Date: 8/6/2012
# Author: tspring
# Description: [Idea ID 5009] [Windows] Weak Key Block Detection
# Rule number: 5009
# Rule URL: http://sharepoint/sites/rules/Rule Submissions/Forms/DispForm.aspx?ID=5009
# This rule ... | 0 |
sample_42_13.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmcontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmcontrolplane.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported P... | 0 |
sample_23_37.ps1 | @{
IncludeRules = @(
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
'PSUseConsistentWhitespace',
'PSUseConsistentIndentation',
'PSAlignAssignmentStatement',
'PSUseCorrectCasing'
)
Rules = @{
PSPlaceOpenBrace = @{
Enable ... | 0 |
2667.ps1 |
cls
Import-Module b:\PnPPowerShell\V16\OfficeDevPnP.PowerShell.Commands.dll
Import-Module "C:\Program Files (x86)\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.PowerShell.dll"
$outputFile = "<output file location>"
$site = "<site url>"
... | 0 |
Get-MonthAccountCreated .ps1 | function Get-MonthAccountCreated {
<#
.SYNOPSIS
Gets Account created in given month.
.DESCRIPTION
Gets Account created in given month.
.EXAMPLE
Get-MonthAccountCreated -Month 2 -Year 2012
.EXAMPLE
Get-MonthAccountCreated -Month 10 -Year 2012
.PARAMETER ... | 0 |
sample_28_73.ps1 | # Localized 05/07/2022 03:57 AM (GMT) 303:7.0.30723 AssignedAccessMsg.psd1
# Localized resources for AssignedAccess.psm1
ConvertFrom-StringData @'
###PSLOC
AppliedSettings=User and Application set, log on as this user to start Assigned Access
ClearedSettings=Cleared Assigned Access, settings reset to factory defa... | 0 |
2291.ps1 |
[CmdletBinding(SupportsShouldProcess = $true)]
param(
[parameter(Mandatory = $true, ParameterSetName = "DefaultSet", HelpMessage = "Specify the type of object to query for")]
[parameter(Mandatory = $true, ParameterSetName = "CriteriaSet")]
[ValidateNotNullOrEmpty()]
[ValidateSet("User")]
[string]$O... | 0 |
Test-Server_2.ps1 | Function Test-Server{
[cmdletBinding()]
param(
[parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string[]]$ComputerName,
[parameter(Mandatory=$false)]
[switch]$CredSSP,
[Management.Automation.PSCredential] $Credential)
begin{
$total = Get-Date
$results = @()
if($credssp){if(!($credential)){Wri... | 0 |
sample_57_48.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_59_4.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 = '86.0.0'
# Supported PSEditions
Compatible... | 0 |
1917.ps1 |
Describe "Get-PSCallStack DRT Unit Tests" -Tags "CI" {
BeforeAll {
$scriptFileName = "GetTryCatchCallStack.ps1"
$scriptFilePath = Join-Path $TestDrive -ChildPath $scriptFileName
}
It "Verifies that the script block of a catch clause does not show up on the call stack" {
$fileStream... | 0 |
sample_49_27.ps1 | #
# Module manifest for module 'OCI.PSModules.Aianomalydetection'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Aianomalydetection.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Suppo... | 0 |
sample_46_42.ps1 | #
# Module manifest for module 'OCI.PSModules.Identitydomains'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Identitydomains.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported P... | 0 |
sample_50_98.ps1 | #
# Module manifest for module 'Az.Attestation'
#
# Generated by: Microsoft Corporation
#
# Generated on: 23/04/2024
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Az.Attestation.psm1'
# Version number of this module.
ModuleVersion = '2.0.2'
# Supported PSEdi... | 0 |
3097.ps1 | Set-StrictMode -Version Latest
$here = $MyInvocation.MyCommand.Path | Split-Path
Import-Module $here/TypeClass.psm1 -DisableNameChecking
function New-Dictionary ([hashtable]$Hashtable) {
$d = new-object "Collections.Generic.Dictionary[string,object]"
$Hashtable.GetEnumerator() | foreach { $d.Add($_.Key, $_.V... | 0 |
vibackup-lx_2.ps1 | Param (
$viServer,
$bakVM,
$lxDest
)
#region check
if (!$viServer) { $viServer = Read-Host -Prompt "VI Server " }
if (!$bakVM) { $bakVM = Read-Host -Prompt "VM to Backup " }
if (!$lxDest) { $lxDest = Read-Host -Prompt "Backup Path (ex. /srv/backup) " }
#endregion
#region globalvars
$encoding = "OEM"
... | 0 |
ISE-Snippets.ps1 | #requires -version 2.0
## ISE-Snippets module v 1.0
## DEVELOPED FOR CTP3
## See comments for each function for changes ...
##############################################################################################################
## As a shortcut for every snippet would be to much, I created Add-Snippet whic... | 0 |
finddupe_7.ps1 | function Get-MD5([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]'))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.MD5CryptoServiceProvider];
$hashAlgorithm = new-object $cryptoServiceProvider
$stream = $file.OpenRead();
$hashByteArray = $hashA... | 0 |
Get-WebSite_1.ps1 | function Get-WebSite {
<#
.SYNOPSIS
Retrieves information about a website.
.DESCRIPTION
Retrieves information about a website.
.PARAMETER Url
URL of the website to test access to.
.PARAMETER UseDefaultCredentials
Use the currently authenticated user's credentials
.PARAMETER Proxy
Us... | 0 |
sample_0_99.ps1 | ConvertFrom-StringData @'
id_ctsnetadapters=Network Adapters
id_ctsnetadaptersdescription=Collects information about the Network Adapters
'@
# SIG # Begin signature block
# MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQ... | 0 |
sample_58_5.ps1 | class AzStackHciConnectivityTarget
{
# Attributes for Azure Monitor schema
[string]$Name #Name of the individual test/rule/alert that was executed. Unique, not exposed to the customer.
[string]$Title #User-facing name; one or more sentences indicating the direct issue.
[string]$Severity #Severity o... | 0 |
Highlight syntax_1.ps1 | #code which need highlight
$code = @'
#just example
Get-Process | % {
try {
"{0, 7} {1}" -f $_.Id, $_.MainModule.ModuleName
}
catch [System.ComponentModel.Win32Exception] {}
}
'@
function frmMain_Show {
Add-Type -AssemblyName System.Windows.Forms
#keywords
$type = New-Object "Collection... | 0 |
sample_67_94.ps1 | #
# Copyright (c) Microsoft Corporation.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE ... | 0 |
3710.ps1 |
function Test-NewAzureRmCognitiveServicesAccount
{
$rgname = Get-CognitiveServicesManagementTestResourceName;
try
{
$accountname = 'csa' + $rgname;
$skuname = 'S2';
$accounttype = 'TextAnalytics';
$loc = Get-Location -providerNamespace "Microsoft... | 0 |
WriteFileName_1.ps1 | # functions to print overwriting multi-line messages. Test script will accept a file/filespec/dir and iterate through all files in all subdirs printing a test message + file name to demostrate.
# e.g. PS>.\\writefilename.ps1 c:\\
# call WriteFileName [string]
# after done writing series of overwriting messages, cal... | 0 |
sample_19_56.ps1 | #************************************************
# DC_Bluetooth-Component.ps1
# Version 1.0: Created
# Date: 2020
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects information about the Bluetooth Component.
#*******************************************************
Trap [Exception]
{
# ... | 0 |
2208.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server where the SMS Provider is installed")]
[ValidateNotNullOrEmpty()]
[ValidateScript({Test-Connection -ComputerName $_ -Count 1 -Quiet})]
[string]$SiteServer,
[parameter(Mandatory=$true, HelpMessag... | 0 |
sample_52_6.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 |
3341.ps1 |
function Remove-Plugin {
[PoshBot.BotCommand(
Aliases = ('rp', 'removeplugin'),
Permissions = 'manage-plugins'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string]$Name,
[parameter(Position ... | 0 |
sample_7_10.ps1 | #************************************************
# DC_DSMisc.ps1
# Version 1.0.1
# Date: 07-10-2009
# VBScript by Craig Landis (clandis@microsoft.com)
# PS1 by Andret Teixeira
#************************************************
Import-LocalizedData -BindingVariable DSMiscStrings -FileName DC_DSMisc -UICulture e... | 0 |
sample_5_8.ps1 | #************************************************
# DC_NPS-Component.ps1
# Version 1.0
# Date: 2009-2014
# Author: Boyd Benson (bbenson@microsoft.com)
# Description: Collects information about NPS/RADIUS.
# Called from: Networking Diagnostics
# [we] 2022-03-16: masked 'Shared secret'
#**************************... | 0 |
Create SP2010 Farm V_2.ps1 | ############################################################################
## Create-SPFarm
## V 0.3
## Jos.Verlinde
############################################################################
Param ( [String] $Farm = "SP2010",
[String] $SQLServer = $env:COMPUTERNAME,
[String] $Passphrase = "pass@word1"... | 0 |
816.ps1 | . .\ReferenceFileA.ps1
. ./ReferenceFileB.ps1
. .\ReferenceFileC.ps1
function My-Function ($myInput)
{
My-Function $myInput
}
Get-ChildItem
| 0 |
sample_17_29.ps1 | #************************************************
# TS_B2693877_Sophos_BEFLTCheck.ps1
# Version 1.0.1
# TemplateVersion 1.2
# Date: 04/26/2012 11:29:18
# Author: jasonf
# Description: Check for the presence of Sophos BEFLT.SYS version 5.60.1.7
#************************************************
Import-Localize... | 0 |
3926.ps1 |
function Test-AzureIotDpsLinkedHubLifeCycle
{
$Location = Get-Location "Microsoft.Devices" "Device Provisioning Service"
$IotDpsName = getAssetName
$ResourceGroupName = getAssetName
$IotHubName = getAssetName
$hubKeyName = "ServiceKey"
$Sku = "S1"
$LinkedHubName = [string]::Format("{0}... | 0 |
sample_38_9.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 |
VMtoolsUpgrade-disable_2.ps1 | #####################################################################
# Purpose: "Check and upgrade Tools during power cycling"
# Author: David Chung
# Support: IT Infrastructure
# Docs: N/A
#
# Instruction: 1. Create CSV file with list of servers
# 2. Execute script from PowerCLI
# 3. Enter... | 0 |
1790.ps1 |
Describe "New-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') {
BeforeAll {
$defaultParamValues = $PSdefaultParameterValues.Clone()
$IsNotSkipped = ($IsWindows -and !$IsCoreCLR)
$PSDefaultParameterValues["it:skip"] = !$IsNotSkipped
}
AfterAll {
$global:PSDef... | 0 |
sample_49_35.ps1 | #
# Module manifest for module 'OCI.PSModules.Cloudbridge'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Cloudbridge.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEdition... | 0 |
sample_27_10.ps1 | #
# Module manifest for module 'OCI.PSModules.Datalabelingservicedataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datalabelingservicedataplane.dll'
# Version number of this module.
ModuleVersion... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.