filename
stringlengths
5
142
content
stringlengths
2
26M
label
int64
0
1
sample_65_80.ps1
[CmdletBinding(PositionalBinding=$false)] Param( [string] $configuration = 'Debug', [string] $task, [string] $verbosity = 'minimal', [string] $msbuildEngine = $null, [switch] $restore, [switch] $prepareMachine, [switch] $help, [Parameter(ValueFromRemainingArguments=$true)][String[]]$properties ) $ci = ...
0
2746.ps1
try { $IEUrlInfo = Get-WmiObject -Namespace 'root\cimv2\IETelemetry' -Class IEURLInfo -ErrorAction Stop $IEUrlInfo } catch [System.Management.ManagementException] { throw 'WMI Namespace root\fimv2\IETelemetry does not exist.' }
0
1105.ps1
function Start-TestFixture { & (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve) } function Test-ShouldJoinPaths { Assert-Equal 'SiteName' (Join-IisVirtualPath 'SiteName' '') Assert-Equal 'SiteName' (Join-IisVirtualPath 'SiteName' $null) Assert-Equal 'SiteName' (Join-I...
0
Clear-XCAttributes.ps1
param( [Parameter(Position=0,ValueFromPipeline=$True)] [ValidateNotNullorEmpty()] $User, [switch]$ClearXCAttributes ) begin{ $Global:LegacyXCUsers = @() # attributes to be nulled according to: # http://blogs.technet.com/b/exchange/archive/2006/10/13/3395089.aspx $XCattributes=@( "adminDisplayName","altRecip...
0
1711.ps1
function Set-ServiceNowAuth { [CmdletBinding()] Param ( [Parameter(Mandatory = $true)] [ValidateScript({Test-ServiceNowURL -Url $_})] [Alias('ServiceNowUrl')] [string]$Url, [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [System.Management.Auto...
0
PS2WCF.ps1
# Call WCF Services With PowerShell V1.0 22.12.2008 # # by Christian Glessner # Blog: http://www.iLoveSharePoint.com # Twitter: http://twitter.com/cglessner # Codeplex: http://codeplex.com/iLoveSharePoint # # requires .NET 3.5 # load WCF assemblies [void][System.Reflection.Assembly]::LoadWithPartialName("Sy...
0
PS2WCF_4.ps1
<# .SYNOPSIS Functions to call WCF Services With PowerShell. .NOTES Version 1.1 10.02.2012 Requires Powershell v2 and .NET 3.5 Original version by Christian Glessner Blog: http://www.iLoveSharePoint.com Twitter: http://twitter.com/cglessner Codeplex: http://codeplex.com/iLoveSharePoint PowerS...
0
sample_16_0.ps1
##---------------------------------------------------------------------------- ## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved. ##---------------------------------------------------------------------------- # Import string constants . ./StringConstants.ps1 Stop-Service -Name $ServiceConsta...
0
sample_23_49.ps1
# # Module manifest for module 'OCI.PSModules.Usageapi' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Usageapi.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Comp...
0
652.ps1
$reportPortalUri = if ($env:PesterPortalUrl -eq $null) { 'http://localhost/reports' } else { $env:PesterPortalUrl } $reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl } function VerifyCatalogItemExists() { param( [Parameter(Mandatory = ...
0
sample_12_75.ps1
# # Module manifest for module 'OCI.PSModules.Mysql' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Mysql.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions Compatible...
0
set-FSRMQuotaBasedOnSQL.ps1
#0# init $error.clear() cls $ErrorActionPreference= "Stop" # do zmiany na "SilentlyContinue" lub "Continue" po adaptacji #/0# #1# sql conn parameters $dataSource = "Serwer\\SQL01" $database = "nazwaBazyDanych" #$authentication = "Integrated Security=SSPI" # preferowana metoda, ale nie zawsze si&#281; tak da...
0
LoadModuleConfig_1.ps1
################################################################################ ## Script Name: LoadModuleConfig ## Created On: 01/21/2010 ## Author: Thell Fowler ## File: LoadModuleConfig.ps1 ## Usage: Called from the NestedModules value from a module manifest. ## Version:...
0
sample_36_21.ps1
Import-Module $(Join-Path $PSSCriptRoot Helpers.psm1) (git remote show origin | Get-Matches "(?mi)HEAD branch: (?<branch>[^\r\n]+)" ).branch # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIB...
0
450.ps1
Register-PSFConfigValidation -Name "integer" -ScriptBlock { Param ( $Value ) $Result = New-Object PSOBject -Property @{ Success = $True Value = $null Message = "" } try { [int]$number = $Value } catch { $Result.Message = "Not an integer: $Value" $Result.Success = $False return $Result } $Re...
0
479.ps1
function New-TreeObjectArray{ param( $Array, $Objects, $Attribute, $Filter, $Level = 0, $MaxLoops = 10 ) $Objects = $Objects.psobject.Copy() if( -not ($Level -eq $MaxLoops)){ $Level++ ...
0
finddupe_8.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
chkhash_3.ps1
# calculate SHA512 of file. function Get-SHA512([System.IO.FileInfo] $file = $(throw 'Usage: Get-MD5 [System.IO.FileInfo]')) { $stream = $null; $cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoServiceProvider]; $hashAlgorithm = new-object $cryptoServiceProvider $stream = $file.Open...
0
3037.ps1
function Should-BeLikeExactly($ActualValue, $ExpectedValue, [switch] $Negate, [String] $Because) { [bool] $succeeded = $ActualValue -clike $ExpectedValue if ($Negate) { $succeeded = -not $succeeded } if (-not $succeeded) { if ($Negate) { return New-Object psobject -Prop...
0
sample_22_1.ps1
# # Module manifest for module 'OCI.PSModules.Aidocument' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aidocument.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEditions ...
0
Out-DataTable_3.ps1
####################### <# .SYNOPSIS Creates a DataTable for an object .DESCRIPTION Creates a DataTable based on an objects properties. .INPUTS Object Any object can be piped to Out-DataTable .OUTPUTS System.Data.DataTable .EXAMPLE $dt = Get-psdrive| Out-DataTable This example creates a DataTable fr...
0
4286.ps1
function C2-Server { Param($PoshPath, $RestartC2Server) If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) { $arguments = "& '" + $myinvocation.mycommand.definition + "'" Start-Process -File...
0
sample_56_26.ps1
ConvertFrom-StringData @' ###PSLOC ArcMachineAlreadyExistsInResourceGroupError = Arc machine(s) with names: {0} already exists in the Resource Group {1}. Use a different Resource group for registration or specify a different Arc for Servers Resource Group. ArcMachineNotFound = No Arc machine(s) were found with the s...
0
841.ps1
class CsvProcessor { [psobject]$Logger [psobject]$ProcessItemFunction CsvProcessor($logger, $processItemFunction) { $this.Logger = $logger $this.ProcessItemFunction = $processItemFunction } [psobject] LoadCsv($CsvFilePath) { $resolvedCsvPath = Resolve-Path -LiteralP...
0
print-file.ps1
function print-file($file) { begin { function internal-printfile($thefile) { if ($thefile -is [string]) {$filename = $thefile } else { if ($thefile.FullName -is [string] ) { $filename = $THEfile.FullName } } $start = new-ob...
0
Services Auto NotRunning.ps1
Get-WmiObject Win32_Service -ComputerName . |` where {($_.startmode -like "*auto*") -and ` ($_.state -notlike "*running*")}|` select DisplayName,Name,StartMode,State|ft -AutoSize
0
sample_25_60.ps1
# # Module manifest for module 'OCI.PSModules.Ospgateway' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ospgateway.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions ...
0
4343.ps1
function Get-ProviderName { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [PSCustomObject] $PSCustomObject ) $providerName = $script:NuGetProviderName if((Get-Member -InputObject $PSCustomObject -Name PackageManagementProvider)) { $providerName = $P...
0
sample_57_37.ps1
Get-Service -DisplayName "Dell TechHub" | Start-Service # SIG # Begin signature block # MIIvMAYJKoZIhvcNAQcCoIIvITCCLx0CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB9fVTjCxy7nd/b # c2JDhnRLmvteuxXiugYqE6HxKZ...
0
sample_29_4.ps1
@{ GUID = "A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author = "PowerShell" CompanyName = "Microsoft Corporation" Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" FunctionsToExport = @() CmdletsToExport = "Get-Credential", "Get-ExecutionP...
0
Set-PSObjectDefaultPrope.ps1
function Set-PSObjectDefaultProperties { param( [PSObject]$Object, [string[]]$DefaultProperties ) $name = $Object.PSObject.TypeNames[0] $xml = "<?xml version='1.0' encoding='utf-8' ?><Types><Type>" $xml += "<Name>$($name)</Name>" $xml...
0
1511.ps1
function Assert-FileDoesNotContain { [CmdletBinding()] param( [Parameter(Position=0)] [string] $Path, [Parameter(Position=1)] [string] $Needle, [Parameter(Position=2)] $Message ) Set-StrictMo...
0
sample_45_11.ps1
# # Module manifest for module 'OCI.PSModules.Managementdashboard' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Managementdashboard.dll' # Version number of this module. ModuleVersion = '83.2.0' # Sup...
0
sample_52_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
sample_38_63.ps1
# # Module manifest for module 'PowerShellProTools' # # Generated by: Ironman Software, LLC # # Generated on: 3/19/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'PowerShellProTools.psm1' # Version number of this module. ModuleVersion = '2024.3.0' # Suppo...
0
sample_46_89.ps1
function Clear-NearbyShareInstallation { # Remove shortcuts in start menu for all users Write-Host 'Started to remove shortcuts ...' $profiles = Get-WmiObject -Class Win32_UserProfile foreach ($profile in $profiles) { if ($profile.Special) { continue } $userStartMenuPath = Join-Pat...
0
sample_10_59.ps1
ConvertFrom-StringData @' id_mats_networkadapter=Network Adapter id_mats_networkadaptertype=Type id_mats_networkadapterspeed=Speed id_mats_ipaddresses=IP Addresses id_mats_defaultgateway=Default Gateway id_mats_dnsservers=DNS Servers id_mats_proxyenabled=Proxy Server id_enabled=Enabled id_mats_proxyserveradd=P...
0
sample_54_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...
0
sample_65_11.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
Live@Edu password reset.ps1
#---------------------------------------------- #region Application Functions #---------------------------------------------- function OnApplicationLoad { #Note: This function runs before the form is created #Note: To get the script directory in the Packager use: Split-Path $hostinvocation.MyCommand.path #No...
0
2934.ps1
Framework '4.6.1' task default -depends MsBuild task MsBuild { if ( $IsMacOS -OR $IsLinux ) {} else { $output = &msbuild /version /nologo 2>&1 Assert ($output -NotLike '14.0') '$output should contain 14.0' } }
0
656.ps1
$reportPortalUri = if ($env:PesterPortalUrl -eq $null) { 'http://localhost/reports' } else { $env:PesterPortalUrl } $reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl } function VerifyFileWasDownloaded() { param( [Parameter(Mandatory = ...
0
2322.ps1
[CmdletBinding()] param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string[]]$ComputerName, [Parameter()] [ValidateNotNullOrEmpty()] [pscredential]$Credential ) <<<<<<< HEAD $ErrorActionPreference = 'Stop' $scriptBlock = { function Test-RegistryKey { [OutputType('bool')...
0
sample_43_5.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
sample_45_27.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 = '77.0.0' # Supported P...
0
2757.ps1
function Compute-FileHash { Param( [Parameter(Mandatory = $true, Position=1)] [string]$FilePath, [ValidateSet("MD5","SHA1","SHA256","SHA384","SHA512","RIPEMD160")] [string]$HashType = "MD5" ) switch ( $HashType.ToUpper() ) { "MD5" { $hash = [System.Security.Cryptography.MD5]...
0
Get-InstalledProgram_v_2.ps1
function Get-InstalledProgram() { param ( [String[]]$Computer, $User ) if ($User -is [String]) { $Connection = Get-Credential -Credential $User } if ($Connection -eq $null){ foreach ($Comp in $Computer){ $Install_soft = gwmi win32_product -ComputerName $Comp | where {$_.vendor -notlike ...
0
sample_38_41.ps1
# DO NOT COPY THIS MANIFEST VERBATIM. THIS IS JUST A SAMPLE. # GENERATE YOUR MANIFEST USING THE New-ModuleManifest COMMAND TO # GUARANTEE YOU GET A UNIQUE GUID FOR YOUR MODULE. @{ # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additio...
0
1718.ps1
function Update-ServiceNowChangeRequest { Param( [parameter(Mandatory=$true)] [parameter(ParameterSetName='SpecifyConnectionFields')] [parameter(ParameterSetName='UseConnectionObject')] [parameter(ParameterSetName='SetGlobalAuth')] [string]$SysId, ...
0
2690.ps1
function Register-ProcessModuleTrace { [CmdletBinding()] Param () if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) { throw 'You must run this cmdlet from an elevated PowerShell se...
0
sample_37_58.ps1
# # Module manifest for module 'OCI.PSModules.Ocvp' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ocvp.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions CompatiblePS...
0
4261.ps1
$Global:ExploitTable = $null function Get-FileVersionInfo ($FilePath) { $VersionInfo = (Get-Item $FilePath).VersionInfo $FileVersion = ( "{0}.{1}.{2}.{3}" -f $VersionInfo.FileMajorPart, $VersionInfo.FileMinorPart, $VersionInfo.FileBuildPart, $VersionInfo.FilePrivatePart ) return $FileVersion }...
0
Creating Bulk users.ps1
The final.csv file is the name of file which i created and its located on the desktop of the window server. after running the script i received this error Import-Csv : Cannot open file "C:\\Users\\Administrator\\final.csv". At line:1 char:23 + $Password = Import-Csv <<<< final.csv| foreach { New-Mailbox -alias $_.A...
0
More PSDrives.ps1
function Mount-UserDrives { <# .Synopsis Create additional user drives. .Description To remove drives created with this function use Remove-UserDrives. .Link New-PSDrive Remove-UserDrives #> [Enum]::GetNames([Environment+SpecialFolder]) | % { New-PSDrive ...
0
sample_61_79.ps1
# # Module manifest for module 'OCI.PSModules.Core' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Core.dll' # Version number of this module. ModuleVersion = '86.2.0' # Supported PSEditions CompatiblePS...
0
2619.ps1
if(-not (Test-Path 'C:\QWitness')){ New-Item -Path 'C:\QWitness' -ItemType Directory New-SmbShare -name QWitness -Path 'C:\QWitness' -FullAccess Everyone } $StartTime = Get-Date Import-Module FailoverClusters New-Cluster -Name 'ENDOR' -NoStorage -Node @('TARKIN','VADER') -StaticAddress 10.10.10.100 | Set-...
0
sample_62_10.ps1
# # Module manifest for module 'OCI.PSModules.Aivision' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Aivision.dll' # Version number of this module. ModuleVersion = '85.2.0' # Supported PSEditions Comp...
0
sample_62_17.ps1
# Script: tss_ExportVPNProfiles.ps1 #region ::::: Script Input PARAMETERS ::::: #$ScriptVer="1.01" #Date: 2024-03-21 [CmdletBinding()]param( [Parameter(Mandatory=$true, Position=0)] [String] $PrefixTime, [Parameter(Mandatory=$true, Position=1)] [string] $TssPhase ) function CollectNET_VpnProfiles { # Get VPN...
0
sample_52_71.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_50_80.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Support.private.dll') # Get the private module's instance $instance = [Microsoft.Azure.PowerShell.Cmdlets.Support.Module]::Instance # Export nothing to clear implicit exports ...
0
2044.ps1
Describe "Telemetry for shell startup" -Tag CI { BeforeAll { $cacheDir = [System.Management.Automation.Platform].GetField("CacheDirectory","NonPublic,Static").GetValue($null) $uuidPath = Join-Path -Path $cacheDir -ChildPath telemetry.uuid $uuidFileExists = Test-Path ...
0
1071.ps1
Set-StrictMode -Version 'Latest' $TestCertPath = Join-Path -Path $PSScriptRoot -ChildPath 'Certificates\CarbonTestCertificate.cer' -Resolve $TestCert = New-Object Security.Cryptography.X509Certificates.X509Certificate2 $TestCertPath & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -R...
0
3806.ps1
function get_all_vm_locations { if ((Get-ComputeTestMode) -ne 'Playback') { $namespace = "Microsoft.Compute" $type = "virtualMachines" $location = Get-AzResourceProvider -ProviderNamespace $namespace | where {$_.ResourceTypes[0].ResourceTypeName -eq $type} if ($l...
0
sample_52_0.ps1
# # Module manifest for module 'Az.Advisor' # # Generated by: Microsoft Corporation # # Generated on: 23/04/2024 # @{ # Script module or binary module file associated with this manifest. RootModule = 'Az.Advisor.psm1' # Version number of this module. ModuleVersion = '2.0.1' # Supported PSEditions C...
0
4003.ps1
$script:AutomationAccountName = "mirichmo-aatest-WUS2" $script:ResourceGroupName = "mirichmo-aatest-wus2-rg" $script:TestRunbookName = "TestRunbookName" $script:TestRunbookTwoParamsName = "TestRunbookTwoParamsName" function Create-PublishedRunbook { param( [Parameter (Mandatory = $true)] [Stri...
0
sample_2_62.ps1
<# .SYNOPSIS DEV Components and Scenarios module for learning and demoing TSS Framework usage. This is NOT related to any specific POD and not designed for learning and troubleshooting. .DESCRIPTION DEV Components and Scenarios module for learning and demoing TSS Framework usage. This is NOT related...
0
sample_39_93.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
0
sample_54_50.ps1
# # Module manifest for module 'OCI.PSModules.Adm' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Adm.dll' # Version number of this module. ModuleVersion = '83.1.0' # Supported PSEditions CompatiblePSEd...
0
sample_1_4.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
sample_7_63.ps1
ConvertFrom-StringData @' id_adapterkb980486check=Checking 6to4 and physical adapters id_adapterkb980486checkdesc=Checking the number of 6to4 and physical adapters (KB 980486) '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3Ag...
0
1713.ps1
function Update-ServiceNowRequestItem { [System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidUsingConvertToSecureStringWithPlainText','')] [System.Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidGlobalVars','')] [OutputType([void],[System.Management.Automation.PSCustomObject])] [CmdletBindin...
0
4478.ps1
configuration PSModule_InstallModuleSpecificVersionConfig { param ( [Parameter()] [System.String[]] $NodeName = 'localhost', [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [System.String] $ModuleName, [Parameter(Mandatory = $true)...
0
Get-PrinterInfo_1.ps1
$strComputer = "PrinterName" $Ports = get-wmiobject -class "win32_tcpipprinterport" -namespace "root\\CIMV2" -computername $strComputer $Printers = get-wmiobject -class "Win32_Printer" -namespace "root\\CIMV2" -computername $strComputer $ports | Select-Object Name,Hostaddress | Set-Variable port $Printers | Select-...
0
sample_60_47.ps1
# # Module manifest for module 'OCI.PSModules.Autoscaling' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Autoscaling.dll' # Version number of this module. ModuleVersion = '85.2.0' # Supported PSEdition...
0
2140.ps1
if ( $IsCoreCLR ) { return } Describe "Interface inheritance with remoting proxies" -Tags "CI" { $src = @" using System; using System.ServiceModel; namespace MSFT_716893 { [ServiceContract] public interface IInterface1 { [OperationContract]string BaseOperation(int i); } [Service...
0
sample_53_4.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
VMtoolsUpgrade-disable_1.ps1
##################################################################### # TIAA-CREF VMWare Standard Scripts - PowerCLI # # 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 # ...
0
2636.ps1
function New-LabVM{ param([string]$VMName ,[string]$VMPath ,[string]$VHDPath ,[string[]]$VMSwitches ,[string[]]$ISOs ,[string]$VMSource ,[Parameter(Mandatory=$true)][System.Management.Automation.PSCredential]$LocalCred ) try{ $VHDFile = Join-Path -...
0
New-Script 2.ps1
## New-Script function ## Creates a new script from the most recent commands in history ################################################################################################## ## Example Usage: ## New-Script ScriptName 4 ## creates a script from the most recent four commands ## New-Script...
0
sample_29_54.ps1
ConvertFrom-StringData @' EnvironmentErrorAlreadyExists=Det finns redan en miljövariabel med det här namnet och av den här typen. EnvironmentErrorDoesNotExists=Det finns ingen miljövariabel med det här namnet och av den här typen. '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkg...
0
sample_12_92.ps1
#************************************************ # TS_ClusterValidationTests.ps1 # Version 1.0.1 # Date: 07-24-2009 # Author: Andre Teixeira - andret@microsoft.com # Hacked by Jacques Boulet - jaboulet@microsoft.com - 2019-02-21 # Description: This script is used to obtain cluster validation report. # ...
0
Get-RelativePath.ps1
function Get-RelativePath { <# .SYNOPSIS Get a path to a file (or folder) relative to another folder .DESCRIPTION Converts the FilePath to a relative path rooted in the specified Folder .PARAMETER Folder The folder to build a relative path from .PARAMETER FilePath The File (or folder) to build a re...
0
850.ps1
$ResourceGroup = "{ReplaceWithYourResourceGroup}" $StorageAccountName = "{ReplaceWithYourStorageAccountName}" $ContainerName = "`$logs" $CustomerId = "{ReplaceWithYourLogAnalyticsWorkspaceId}" $SharedKey = "{ReplaceWithYourLogAnalyticsWorkspacePrimaryKey}" $LogType = "{ReplaceW...
0
GPRS Online log_2.ps1
<# .SYNOPSIS Get-GprsTime (V3.0 Update for Windows 7) Check the total connect time of any GPRS devices from a specified date. Use Get-Help .\\Get-GprsTime -full to view Help for this file. .DESCRIPTION Display all the GPRS modem Event Log entries. While applications issued by the mobile phone manufacturers wi...
0
sample_17_59.ps1
##---------------------------------------------------------------------------- ## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved. ##---------------------------------------------------------------------------- # Import string constants . ./StringConstants.ps1 # Import shared functions and var...
0
Show-ConsoleMenu.ps1
function Show-ConsoleMenu { #.Synopsis # Displays a menu in the console and returns the selection #.Description # Displays a numbered list in the console, accepts a typed number from the user, and returns it. #.Example # ls | Show-ConsoleMenu -Title "Please pick a file to delete:" -Passthru | rm -whatif # # ...
0
Send-HTMLFormattedEmail_1.ps1
#------------------------------------------------- # Send-HTMLFormattedEmail #------------------------------------------------- # Usage: Used to send an HTML Formatted Email that is based on an XSLT template. #------------------------------------------------- function Send-HTMLFormattedEmail{ param ( [string]...
0
1887.ps1
Import-Module HelpersCommon Describe "Export-Csv" -Tags "CI" { BeforeAll { $testObject = @("test","object","array") $testCsv = Join-Path -Path $TestDrive -ChildPath "output.csv" $newLine = [environment]::NewLine $P1 = [pscustomobject]@{"P1" = "first"} $P2 = [pscustomobjec...
0
Get-User_4.ps1
function Get-User($user) { # this function should be passed the CN of the user to be returned $dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() $root = [ADSI] "LDAP://$($dom.Name)" $searcher = New-Object System.DirectoryServices.DirectorySearcher $root $searcher.filter = "(&(objec...
0
Set-FileWriteable.ps1
function Set-FileWriteable { #.Example # $s = New-PSSession $ComputerName # C:\\PS>$files = Invoke-Command $s { ls } # .... # C:\\PS>Set-FileWriteable $files # param( [Parameter(Mandatory=$true,ValueFromPipeline=$true)] $File , [switch]$Passthru ) process { foreach($path in @($file)) { ...
0
2422.ps1
[CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [ValidateScript({Test-Connection -ComputerName $_ -Quiet -Count 1})] [string]$Computername, [ValidateScript({ Test-Connection -ComputerName $_ -Quiet -Count 1 })] [string]$SiteServer = 'CONFIGMANAGER' ) begin...
0
2513.ps1
$Error.Clear() $erroractionpreference = "SilentlyContinue" $a = New-Object -comobject Excel.Application $a.visible = $True $b = $a.Workbooks.Add() $c = $b.Worksheets.Item(1) $c.Cells.Item(1,1) = "Machine Name" $c.Cells.Item(1,2) = "SNMP Updated" $d = $c.UsedRange $d.Interior.ColorIndex = 19 $d.Font.ColorIndex = 11 $...
0
sample_57_35.ps1
# diag_uex.psm1 # Created by tdimli # March 2020 # # Diagnostic functions for UEX area # version $UEX_version = "1.0.231129.0" # Area and Area/Component arrays $UEX = @("xray_uex_wmi") #Component/Diagnostic Function arrays $xray_uex_wmi = @("uex_wmi_KB2020286") # begin: diagnostic functions #regio...
0
3403.ps1
function Test-SetAzureRmVMSqlServerAKVExtension { Set-StrictMode -Version latest; $ErrorActionPreference = 'Stop' $rgname = Get-ComputeTestResourceName $loc = Get-ComputeVMLocation try { New-AzureRmResourceGroup -Name $rgname -Location $loc -Force; $vmsize...
0
1889.ps1
Describe "Get-Random DRT Unit Tests" -Tags "CI" { $testData = @( @{ Name = 'no params'; Maximum = $null; Minimum = $null; GreaterThan = -1; LessThan = ([int32]::MaxValue); Type = 'System.Int32' } @{ Name = 'only positive maximum number'; Maximum = 100; Minimum = $null; GreaterThan = -1; LessThan =...
0
4354.ps1
function New-PackageSourceFromModuleSource { param ( [Parameter(Mandatory=$true)] $ModuleSource ) $ScriptSourceLocation = $null if(Get-Member -InputObject $ModuleSource -Name $script:ScriptSourceLocation) { $ScriptSourceLocation = $ModuleSource.ScriptSourceLocation }...
0
sample_58_96.ps1
b)1*A"Es"Fj1 %+?ht34?O`>0H_r"2'=P-+=R6h0FfNS5!C)O4<Q:2+>#3'+>5Jm./s6#&1J_c4s2sM+>5Dk/M8n'0/=Xurr4Yd.3Lf<+?Vb/0/4S$ %/i=b)1*A"Es8NBS+?ht34?O`>0d&&#2'=P-+=R6hs#heR5!C)O4<Q:3+>#3'+>5Jm./s8H>q$m[4s2sM+>5Gl/M8n'0/=Xurr4)Y %.3Lf<+?Vb/0/4S$/i=b)1*A"Eru`=2+?ht34?O`>0d&&#2'=P-+=R6h0F90N5!C)O4<Q:3+>#3'+>5Jm./s6#$Rm2^4s2sM+>5Gl %...
0
SNTP.ps1
\n<#\n.SYNOPSIS\nGets the SNTP servers a machine is configured to use\n \n.DESCRIPTION\nGets the SNTP servers a machine is configured to use\n \n.PARAMETER Server\nThe machine to get the SNTP Servers for\n \n.EXAMPLE\nPS C:\\> Get-SNTPServer -Server MachineName\nThis is return the SNTP servers for MachienName\n \n.EXAM...
0
Set-ScreenResolution.ps1
Function Set-ScreenResolution { <# .Synopsis Sets the Screen Resolution of the primary monitor .Description Uses Pinvoke and ChangeDisplaySettings Win32API to make the change .Example Set-ScreenResolution -Width 1024 -Height 768 #> param ( [Parameter(Mandatory...
0
sample_46_60.ps1
export function displayLastSelectedItem(id) { var item = document.getElementById(id); var scroll = document.getElementById(id + "-scroll"); if (!!item && !!scroll) { try { // To be optimized (how to detect the end of scroll container?) for (var i = 0; i < 10; i++) { ...
0