filename
stringlengths
5
142
content
stringlengths
2
26M
label
int64
0
1
Show-HtmlHelp.ps1
##############################################################################\n##\n## Show-HtmlHelp\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\nLaunches t...
0
1629.ps1
function Save-ExcelasCSV { param ( [string[]]$files = $(Throw 'No files provided.'), [string]$OutFolder, [switch]$Overwrite ) BEGIN { function Release-Ref ($ref) { ([System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$ref) -gt 0) ...
0
sample_48_4.ps1
#======================================================================================================================================================================= # Copyright (c) Microsoft Corporation. All rights reserved. # # Description: # RemoveMDS.ps1 # Kill all Monitoring processes and clean up tra...
0
sample_48_12.ps1
# ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License...
0
sample_34_22.ps1
# # Module manifest for module 'OCI.PSModules.Networkfirewall' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Networkfirewall.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported P...
0
4242.ps1
$Source = @" using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Reflection; public class sRDI { [StructLayout(LayoutKind.Sequential, Pack = 1)] struct IMAGE_DATA_DIRECTORY { public uint VirtualAddress; public uint Size; } //[StructLay...
0
1694.ps1
function Expand-OU ($searchroot) { $searchrootarray = $searchroot.split('/') | ? {$_ -and $_ -notmatch '^(?:\s+)?$'} $dn = ([adsi]"LDAP://$($searchrootarray[0])").distinguishedname.ToString() $searchrootarray = $searchrootarray | select -Skip 1 foreach ($obj in $searchrootarray) { $quer...
0
sample_21_26.ps1
########################################################### # # 'ExtensionService' module # ########################################################### $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest Import-Module "$PSScriptRoot\ServiceHelper.psm1" $script:GCInstallPath = "$PSScriptRoot\.....
0
ConvertTo-ASCII_1.ps1
#requires �version 2.0 #region Help <# .SYNOPSIS Automation script for file character set format conversion to ASCII encoding. .DESCRIPTION Script for automating the conversion of files to ASCII format. Good for if you've used Out-File without specifying the encoding. Which would make a Unicode formatt...
0
Invoke-Web 4.2.ps1
function ConvertTo-Dictionary { param( [Parameter(Mandatory=$true,ValueFromPipeline=$true,ParameterSetName="Hashtable")] [Hashtable[]]$Hashtable, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName="WebHeaders")] [System.Collections.Specialized.Na...
0
128.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 ($Aa...
0
sample_10_12.ps1
#************************************************ # Function.ps1 # Version 1.0.0 # Date: 03-01-2012 # Author: Wilson Souza - wsouza@microsoft.com # Description: This script contains functions used by others ps1 files #************************************************ Import-LocalizedData -BindingVariable ScriptSt...
0
1356.ps1
function Get-CFileSharePermission { [CmdletBinding()] [OutputType([Carbon.Security.ShareAccessRule])] param( [Parameter(Mandatory=$true)] [string] $Name, [string] $Identity ) Set-StrictMode -Version 'Latest' Use-CallerPreference ...
0
Function Run-Script_3.ps1
################################################################################# # This function should be included in the PowerShell ISE profile.ps1 and it will # display the start and end times of any scripts started by clicking 'Run Script' # in the Add-ons Menu, or F2; additionally they will be logged to the S...
0
sample_33_99.ps1
# # Module manifest for module 'OCI.PSModules.Queue' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Queue.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Compatible...
0
3724.ps1
function Test-DataLakeStoreTrustedIdProvider { param ( $location ) if ([string]::IsNullOrEmpty($location)) { $location = Get-Location -providerNamespace "Microsoft.CognitiveServices" -resourceType "accounts" -preferredLocation "West US"; } try { $resourceGroupName = Ge...
0
803.ps1
Describe "A dummy test" { Context "When a pester file is given" { It "Should return it symbols" { } It "Should return context symbols" { } It "Should return describe symbols" { } } }
0
2428.ps1
param( [Parameter(Mandatory=$true)][string]$FolderPath, [Parameter(Mandatory=$true)][string]$TfsUrl, [PSCredential]$Credential = (Get-Credential), [switch]$Overwrite = $false ) param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [ValidateScript({ if (-not (Test-Path -Path $_ -PathType Container)...
0
WinFirewall-Stoped.ps1
function WinFirewall-Stoped(){ param ( $computer ) c:\\PsTools\\PsExec.exe \\\\"$computer" sc stop sharedaccess }
0
New Portgroups.ps1
get-vc virtualCenterServerName get-vmhost | Get-VirtualSwitch -Name SwitchName | New-VirtualPortGroup -Name VLAN_12 -VLANID 12
0
1070.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ResolveRelativePathWithExplicitPath { $fileDir = New-TempDir $to = Join-Path $fileDir 'myfile.txt' $from = [System.IO.Path]::GetTempPath() $relativ...
0
SQL Query - AD Pwd Reset.ps1
<# .SYNOPSIS Author:......Vidrine Date:........2012/04/08 .DESCRIPTION Script connects to a SQL database and runs a query against the specified table. Depending on table record values, an Active Directory user object will have it's password reset. Once, the account is reset the SQL record is updated. ...
0
sample_57_86.ps1
@{ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Start-Transcript", "Stop-Transcript" ...
0
sample_1_84.ps1
#************************************************ # TS_HPPrinterDriverVersionCheck.ps1 # Version 1.0.1 # Date: 07/23/2013 # Author: v-alyao # Description: [KSE Rule] [ Windows V3] HKCU\Software\Hewlett-Packard registry hive increases in size on Citrix servers # Rule number: ca320e17-1fa3-4740-9f81-c97f299741b0 ...
0
sample_29_7.ps1
# # Module manifest for module 'OCI.PSModules.Apmtraces' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Apmtraces.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions Co...
0
sample_34_86.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 = '81.0.0' # Supported PSEditi...
0
3683.ps1
function Test-BlobDataSetMappingCrud { $resourceGroup = getAssetName try { $AccountName = getAssetName $ShareSubscriptionName = getAssetName $DataSetMappingName = getAssetName $StorageAccountId = getAssetName $DataSetId = getAssetName $ContainerName = getAssetName $createdContainerDatasetMapping...
0
sample_57_66.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 = '83.3.0' # Supported P...
0
2572.ps1
param ( [string]$filename = $(throw "need a filename, e.g. c:\temp\test.xls"), [string]$worksheet ) if (-not (Test-Path $filename)) { throw "Path '$filename' does not exist." exit } if (-not $worksheet) { Write-Warning "Defaulting to Sheet1 in workbook." $worksheet = "Sheet1" } $filename = R...
0
sample_58_31.ps1
# Localized 05/01/2024 11:12 PM (GMT) 303:7.1.41104 Add-AppDevPackage.psd1 # Culture = "en-US" ConvertFrom-StringData @' ###PSLOC PromptYesString=Д&а PromptNoString=&Нет BundleFound=Найденный набор: {0} PackageFound=Обнаружен пакет: {0} EncryptedBundleFound=Найден зашифрованный набор: {0} EncryptedPackageFoun...
0
EchoTest.cmd.ps1
@Echo 00: %0 @Echo 01: %1 @Echo 02: %2 @Echo 03: %3 @Echo 04: %4 @Echo 05: %5 @Echo 06: %6 @Echo 07: %7 @Echo 08: %8 @Echo 09: %9 @Echo All together, it looked like this to DOS: @Echo %0 %*
0
group-byobject_2.ps1
function Group-ByObject { #.Synopsis # Groups by a set of properties, returning objects #.Description # A wrapper for the built-in Group-Object cmdlet which returns one of the original objects (with separate properties for each property used to group) rather than a simple string representation as the "name" of the ...
0
sample_38_56.ps1
# # Module manifest for module 'OCI.PSModules.Limits' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Limits.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions Compatib...
0
sample_4_26.ps1
ConvertFrom-StringData @' id_sql_setup_collect_bootstrap_logs=Collecting SQL Setup Bootstrap Logs id_sql_setup_collect_2005_logs=Collecting SQL 2005 Bootstrap Logs id_sql_setup_collect_2008_2008r2_logs=Collecting SQL 2008 and 2008R2 Bootstrap Logs id_sql_setup_collect_2012_logs=Collecting SQL 2012 Bootstrap Logs i...
0
Snapshot VM in a folder.ps1
#Revision 1 #7-29-2008 #author Jon Owings #contact - jowings at securas dot com # #Create a snapshot of all the vm's in a folder, #be sure to change to match your enviroment. use at your own risk, snapshots have been known to #cause certain configurations to lock (freeze) so test in a dev enviroment first. #...
0
sample_35_64.ps1
# # Script module for module 'Az.ApiManagement' that is executed when 'Az.ApiManagement' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 05/16/2024 06:33:06 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try ...
0
2808.ps1
if (Get-Command logparser.exe) { $lpquery = @" SELECT COUNT(ImagePath, LaunchString, MD5) as ct, ImagePath, LaunchString, MD5, Publisher FROM *autorunsc.tsv WHERE Publisher not like '(Verified)%' and (ImagePath not like 'File not found%'...
0
393.ps1
$global:BannedCommands = @( 'Write-Host', 'Write-Verbose', 'Write-Warning', 'Write-Error', 'Write-Output', 'Write-Information', 'Write-Debug' ) $global:MayContainCommand = @{ "Write-Host" = @('Write-PSFHostColor.ps1') "Write-Verbose" = @() "Write-Warning" = @() "Write-Error" = @('Invoke-PSFCommand.ps1',...
0
sample_18_65.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=此名稱和類型的環境變數已存在。 EnvironmentErrorDoesNotExists=此名稱和類型的環境變數不存在。 '@ # SIG # Begin signature block # MIIoOwYJKoZIhvcNAQcCoIIoLDCCKCgCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIB...
0
sample_42_65.ps1
ConvertFrom-StringData @' FailoverClustersModuleRequired=Nenašel se požadovaný modul PowerShell (FailoverClusters). Pomocí nástroje Role a funkce nainstalujte: Nástroje pro vzdálenou správu serveru | Nástroje pro správu funkcí | Nástroje Clustering s podporou převzetí služeb při selhání | Modul clusteru s podporou pře...
0
ImaginaryFriendFeed.ps1
function New-ImaginaryFriend { ##.Note ## DEPENDS on the WatiN module in http`://poshcode.org/1108 ##.Synopsis ## Creates a new "Imaginary Friend" on friendfeed by automating your browser ##.Example ## New-ImaginaryFriend PoshCode @{Twitter="PoshCode"} http`://poshcode.org/PoshCode.png ## [CmdletBindin...
0
sample_40_95.ps1
# Localized 05/06/2022 10:07 PM (GMT) 303:7.0.30723 Microsoft.PowerShell.ODataUtilsStrings.psd1 # Localized PSODataUtils.psd1 ConvertFrom-StringData @' ###PSLOC SelectedAdapter=Dot sourcing '{0}'. ArchitectureNotSupported=This module is not supported on your processor architecture ({0}). ArguementNullError=Fai...
0
97.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$true, HelpMessage="AdminUser@myenvironment.onmicrosoft.com")] $AdminUser, [Parameter(Mandatory=$false, HelpMessage="MySecAdminGroup")] [string]$SecAdminGroup, [Parameter(Mandatory=$false, HelpMessage="c:\mylist.txt")] $SecurityGroupList ) ...
0
sample_44_80.ps1
using module ..\Common\MountedImage.psm1 Import-Module -Name "$PSScriptRoot\..\..\Common\Helpers.psm1" Import-Module -Name "$PSScriptRoot\..\..\Common\NetworkHelpers.psm1" Import-Module -Name "$PSScriptRoot\..\..\Common\StorageHelpers.psm1" Import-Module -Name "$PSScriptRoot\RoleHelpers.psm1" Import-Module -Name "...
0
3930.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.","") } [array]$...
0
4440.ps1
function Remove-PackageSource { param ( [string] $Name ) Write-Debug ($LocalizedData.ProviderApiDebugMessage -f ('Remove-PackageSource')) Set-ModuleSourcesVariable -Force $ModuleSourcesToBeRemoved = @() foreach ($moduleSourceName in $Name) { if($request.IsCanc...
0
1311.ps1
function Get-CIPAddress { [CmdletBinding(DefaultParameterSetName='NonFiltered')] param( [Parameter(ParameterSetName='Filtered')] [Switch] $V4, [Parameter(ParameterSetName='Filtered')] [Switch] $V6 ) Set-StrictMode -Version 'Latest...
0
sample_24_93.ps1
### # ==++== # # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
0
sample_19_51.ps1
ConvertFrom-StringData @' id_files=Collecting files id_filescab=Collecting CBS Cabs id_fileslogs=Collecting log files '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAI...
0
Set-DNSServersToOpenDNS.ps1
Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'" | ForEach-Object { $_.SetDNSServerSearchOrder(@("208.67.222.222","208.67.220.220")); }
0
1689.ps1
function Decode-Text { param ( [string]$Text, [validateset('SecureString', 'SecureStringWithKey', 'Base64', 'ASCII')] [string]$Method = 'Base64' ) process { if (!$Text) { $Text = $input } } end { switch ($method) { 'SecureSt...
0
sample_61_57.ps1
# # Module manifest for module 'OCI.PSModules.Accessgovernancecp' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Accessgovernancecp.dll' # Version number of this module. ModuleVersion = '84.0.0' # Suppo...
0
sample_43_92.ps1
# # Module manifest for module 'OCI.PSModules.Stackmonitoring' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Stackmonitoring.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported P...
0
3686.ps1
function Test-AccountCrud { $resourceGroup = TestSetup-CreateResourceGroup try{ $AccountName = getAssetName $tags = @{"tag1" = "value1"; "tag2" = "value2"} $AccountLocation = Get-Location "Microsoft.DataShare" "accounts" "WEST US" $createdAccount = New-AzDataShareAccount -Name $AccountName...
0
1663.ps1
function Get-InstalledApps { param ( [Parameter(ValueFromPipeline=$true)] [string[]]$ComputerName = $env:COMPUTERNAME, [string]$NameRegex = '' ) foreach ($comp in $ComputerName) { $keys = '','\Wow6432Node' foreach ($key in $keys) { try { ...
0
519.ps1
function Get-SPListFiles{ param( ) Get-SPSite | %{ $SPsite = $_ $SPsite.RecycleBin | where{$_.ItemType -eq "File"} |%{ $ItemUrl = $SPsite.Url + "/" + $_.DirName + "/"+ $_.LeafName New-Object PSObject -Property @{ ...
0
2258.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=$false, HelpMessa...
0
Parse-ApacheRedirects.ps1
<# .SYNOPSIS Parses an Apache redirect file to identify broken entries. .DESCRIPTION All redirects will be followed and the final response code will be processed as follows: 200 - OK 401 - OK 403 - Broken 404 - Broken *** - Optionally remove with -RemoveUnknownEr...
0
sample_44_8.ps1
<# .SYNOPSIS Install and run the 'Microsoft.DotNet.VersionTools.Cli' tool with the 'trim-artifacts-version' command to trim the version from the NuGet assets file name. .PARAMETER InputPath Full path to directory where artifact packages are stored .PARAMETER Recursive Search for NuGet packages recursively #> Param(...
0
Findup_23.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; using System.Text.RegularExpressions; namespace Findup { public class FileLengthComparer : I...
0
2492.ps1
[CmdletBinding()] [OutputType([System.Management.Automation.PSCustomObject])] param ( [Parameter(Mandatory)] [ValidateScript({ Test-Connection -ComputerName $_ -Count 1 -Quiet})] [string[]]$Computername, [Parameter(Mandatory)] [ValidateSet('WinRm','Smb','Dns','ActiveDirectoryGeneral','ActiveDirectoryGlobalCatalo...
0
sample_65_41.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_47_57.ps1
# # Module manifest for module 'OCI.PSModules.Desktops' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Desktops.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Comp...
0
sample_62_93.ps1
#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" $pathsep=":" $env_node_path=$env:NODE_PATH $new_node_path="$basedir\..\..\..\..\..\acorn@8.11.3\node_modules" if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux builds of Node ...
0
sample_6_87.ps1
# ********************************************************************************************************************* # Version 1.0 # Date: 02-29-2012 # Author: Vinay Pamnani - vinpa@microsoft.com # Description: # Collects Configuration Manager Client Information # 1. Gets CCMExec service Status, Start time,...
0
2569.ps1
$Database = "dbamaint" $Server = "PSQLPA24" $SMTPServer = "smtp.domain.com" $AttachmentPath = "C:\Dexma\Logs\output.csv" $SqlQuery = "exec sel_TRNSizing" $SqlConnection = New-Object System.Data.SqlClient.SqlConnection $SqlConnection.ConnectionString = "Data Source=$Server;Initial Catalog=$Database;Integrated Securi...
0
sample_28_66.ps1
[CmdletBinding(PositionalBinding=$false)] Param( [switch][Alias('h')]$help, [switch][Alias('t')]$test, [ValidateSet("Debug","Release")][string[]][Alias('c')]$configuration = @("Debug"), [string][Alias('v')]$verbosity = "minimal", [switch]$vs, [ValidateSet("windows","linux","osx")][string]$os, [switch]$tes...
0
sample_41_22.ps1
Param( [parameter(Mandatory = $true)] [string] $histogramFile ) ## list of histograms aligning with Edge performance metrics $metricNames = @() $metricNames += "PageLoad.Experimental.PaintTiming.NavigationToFirstMeaningfulPaint" $metricNames += "PageLoad.PaintTiming.NavigationToFirstContentfulPa...
0
sample_15_22.ps1
$ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest $script:GCInstallPath = "$PSScriptRoot\..\..\.." $script:GCBinariesFolderName = "GC" $script:GCBinariesPath = Join-Path $script:GCInstallPath $script:GCBinariesFolderName $script:CleanupExePath = Join-Path $script:GCBinariesPath "em_extension_cleanup...
0
sample_63_23.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 Get-ServiceFabricApp...
0
sample_35_72.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function Invoke-VerifyDLLSign { $CurrentDir = Split-Path -Parent $PSCommandPath $DLLPath = Join-Path $CurrentDir Intel.Wsman.Scripting.dll $sign = Get-AuthenticodeSignature $DLLPath if ($sign.Status -ne "Valid") { Write-Error "Intel.Wsman.S...
0
3484.ps1
function Test-ConfigurationPipelining{ $config = New-AzHDInsightClusterConfig -ClusterType Hadoop -ClusterTier Standard Assert-NotNull $config.ClusterType Assert-NotNull $config.ClusterTier Assert-AreEqual $config.AdditionalStorageAccounts.Count 0 $config = $config | Add-AzH...
0
mGet-DatastoreList.ps1
Function mGet-DatastoreList { #Parameter- Name of the VMware cluster to choose a datastore from. param($Cluster) #get alphabetically last ESX host in the VMware cluster (it's likely the last host added to the cluster, so this might smoke out any problems) $VMH = get-vmhost -Location $cluster | Where-Object { ($_....
0
sample_10_39.ps1
ConvertFrom-StringData @' id_appliedsectemploutput=Applied Security Templates id_appliedsectemplobtaining=Gathering applied security templates '@ # SIG # Begin signature block # MIIoVAYJKoZIhvcNAQcCoIIoRTCCKEECAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG #...
0
1505.ps1
function Assert-DirectoryExists { [CmdletBinding()] param( [Parameter(Position=0)] [string] $Path, [Parameter(Position=1)] [string] $Message ) Set-StrictMode -Version 'Latest' if( -not (Test-Path -Path $Path -Pat...
0
sample_27_45.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
count-object_1.ps1
#a function to count how many items there are, whether its an array, a collection, or actually just # a single no array/non list/non collection object in which case it would be 1 function count-object ($InputObject) { if ($inputobject -eq $Null ) { return 0} if ($inputobject -is [system.array]) { return $inputob...
0
929.ps1
$omsId = "<Replace with your OMS Id>" $omsKey = "<Replace with your OMS key>" $resourceGroup = "myResourceGroup" $location = "westeurope" $vmName = "myVM" $securePassword = ConvertTo-SecureString ' ' -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential ("azureuser", $securePassword) N...
0
FTP module.ps1
<# .Synopsis Utilities for communicating with FTP server. #> function Get-ScriptPath { Split-Path $myInvocation.ScriptName } Import-Module (Join-Path (Get-ScriptPath) common.psm1) -Force <# .Synopsis Lists contents of directory via FTP. .Parameter oath URL of directory to list. .Para...
0
sample_12_60.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 = '81.0.0' # Supported PSEdition...
0
sample_8_34.ps1
# Sample diagnostic function # # Wrapped in a region same name as function name # Change the name and code as needed # # You can test your diagnostic function by running xray in developer mode, e.g.: # .\xray.ps1 -Diagnostic net_dnscli_KB4562541_sample -DevMode #region net_dnscli_KB4562541_sample <# Compone...
0
3063.ps1
Set-StrictMode -Version Latest InModuleScope Pester { if ($PSVersionTable.PSVersion.Major -ge 5) { function Invoke-DummyFunction { param( [Parameter(Mandatory = $true)] $MandatoryParam, [ValidateNotNullOrEmpty()] [DateTime]$Param...
0
sample_1_36.ps1
#- Enumerate minifilter drivers via Fltmc.exe command Function RunFltmc ($FltmcCommand, [switch]$CollectFile) { $OutputFile = $ComputerName + "_Fltmc.TXT" $CommandLineToExecute = "cmd.exe /c $FltmcCommand >> $OutputFile" #header $date=Get-Date "-" * ($CommandLineToExecute.Length + 35) + "`r`n[$date]...
0
sample_15_41.ps1
trap { # If we except, lets report it visually. Can help with debugging if there IS a problem # in here. Write-Host "EXCEPTION: $($PSItem.ToString())" -ForegroundColor Red Write-Host "$($PSItem.ScriptStackTrace)" Start-Sleep 10 } # Get an environment variable with default value if not present fu...
0
Get-Entropy_1.ps1
## function Get-Entropy { <# .SYNOPSIS Calculate the entropy of a byte array. Author: Matthew Graeber (@mattifestation) .PARAMETER ByteArray Specifies the byte array containing the data from which entropy will be calculated. .EXAMPLE C:\\PS> $RandArray = New-Object Byte[](10000) ...
0
892.ps1
$resourceGroupNameSub1 = "<replace-with-your-group-name>" $resourceGroupNameSub2 = "<replace-with-desired-new-group-name>" $webAppNameSub1 = "<replace-with-your-app-name>" $webAppNameSub2 = "<replace-with-desired-new-app-name>" $appServicePlanSub2 = "<replace-with-desired-new-plan-name>" $locationSub2 = "West Europe" ...
0
sample_33_82.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 = '74.1.0' # Supported PSEditions Compatible...
0
Set-LocalPassword.ps1
# Sets local account passwords on one or more computers # usage [computerName1,computerName2,... | ] ./Set-LocalPassword.ps1 [-user] <userName> [-password] <password> [[-computers] computerName1,computerName2,...] param( [string] $User , [string] $Password , [string[]] $ComputerNames = @() ) $ComputerN...
0
2444.ps1
function Get-VMError { [CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipelineByPropertyName)] [ValidateNotNullOrEmpty()] [Alias('ComputerName')] [string]$Server, [Parameter()] [ValidateNotNullOrEmpty()] [pscredential]$Credential ) $whereFilter = { $_.TimeCreated -gt (Get-Date).Ad...
0
82bfeecc-3581-4dec-8684-4e98aef8a59a.ps1
# Enumerate fan speeds on an ESX host that is running WSMAN. # This doesn't take advantage of CTP3's WSMAN cmdlets. # Needs winrm installed. $serverName = "your.server" $user = "root" $password = "password" $x = [xml](winrm enumerate ` http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor ` "-...
0
2294.ps1
$vCenterServer = "server.contoso.com" try { if(-not (Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) { Add-PSSnapin VMware.VimAutomation.Core -ErrorAction Stop } Set-PowerCLIConfiguration -DefaultVIServerMode Single -InvalidCertificateAction Ignore -Confirm:$false...
0
Read-HostWithPrompt.ps1
#############################################################################\n##\n## Read-HostWithPrompt\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\nRead ...
0
sample_37_81.ps1
@{ GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" NestedModules="Microsoft.PowerShell.Commands.Management.dll" HelpInfoURI = 'https://aka...
0
sample_51_97.ps1
# # Module manifest for module 'OCI.PSModules.Datacatalog' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datacatalog.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEdition...
0
Get-SNMPHost.ps1
Param($VC,$ESXCreds=(Get-Credential)) Write-Host "Connecting to VC to get ESX Hosts" Connect-VIServer $VC | out-null $ESXHosts = Get-VMHost foreach($esxhost in $ESXHosts) { Write-Host " Connecting to $esxhost" Connect-VIServer $esxhost.name -cred $ESXCreds | out-null $SNMPHost = Get-VMHostSnmp ...
0
869.ps1
function Start-MahoutJob { $ErrorActionPreference = "Stop" $context = Get-AzContext if ($context -eq $null) { Connect-AzAccount } $context $clusterName = Read-Host -Prompt "Enter the HDInsight cluster name" $creds=Get-Credential -UserName "admin"...
0
sample_65_24.ps1
<# .DESCRIPTION Support Enter-SmePSSession to specified computer as specified username. Password will be promoted. - Enabled by adding "%ProgramFiles%\Windows Admin Center\PowerShell\Modules" to $env:PSModulePath #> Function Enter-SmePSSession { <# .SYNOPSIS Remote logon to PowerShell sessio...
0
4240.ps1
function Invoke-EventVwrBypass { [CmdletBinding(SupportsShouldProcess = $True, ConfirmImpact = 'Medium')] Param ( [Parameter(Mandatory = $True)] [ValidateNotNullOrEmpty()] [String] $Command, [Switch] $Force ) $mscCommandPath = "HKCU:\Software\Classes\m...
0
Export-WLANSettings.ps1
# ============================================================================================== # # # NAME: Export-WLANSettings.ps1 # # AUTHOR: Jan Egil Ring # # DATE : 14.03.2010 # # COMMENT: Using netsh.exe to loop through each WLAN on the system and export the settings to the user-provided ...
0
sample_54_23.ps1
# # Module manifest for Dell Command | PowerShell Provider 'DellBIOSProvider' # # Generated by: Dell BizClient Team # # Generated on: 4/30/2014 # @{ # Script module or binary module file associated with this manifest RootModule = 'DellBIOSProviderARM64.dll' # Version number of this module. ModuleVersio...
0