filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
2364.ps1 | $aDisabledAdComputers = Get-ADComputer -Filter * | Where-Object { $_.Enabled -eq $false };
foreach ($oAccount in $aDisabledAdComputers) {
Remove-ADObject -Identity $oAccount -Confirm:$false -Recursive;
} | 0 |
sample_59_34.ps1 | #
# Module manifest for module 'OCI.PSModules.Blockchain'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Blockchain.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditions
... | 0 |
Invoke-ADMTUserMigration.ps1 | ###########################################################################"
#
# NAME: Invoke-ADMTUserMigration.ps1
#
# AUTHOR: Jan Egil Ring
# EMAIL: jan.egil.ring@powershell.no
#
# COMMENT: This is an example on how to script the Active Directory Migration Tool (ADMT) using PowerShell.
# It`s based o... | 0 |
sample_50_54.ps1 |
function getWorldMatrix(element) {
return element.getTrait("WorldTransform").value;
}
var isOrtho = false;
function getCameraElement() {
var camera = document.elements.findElementByTypeId("Microsoft.VisualStudio.3D.PerspectiveCamera");
if (camera == null) {
isOrtho = true;
came... | 0 |
3296.ps1 |
function Set-PoshBotStatefulData {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidGlobalVars', '', Scope='Function', Target='*')]
[cmdletbinding(SupportsShouldProcess)]
param(
[parameter(Mandatory)]
[string]$Name,
[parameter(ValueFromPipeline,
... | 0 |
sample_49_28.ps1 | #########################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Localized PSGet.Resource.psd1
#
#########################################################################################
ConvertFrom-StringData @'
###PSL... | 0 |
sample_27_98.ps1 | #Requires -RunAsAdministrator
##------------------------------------------------------------------
## <copyright file="Install-ObservabilityExtension.ps1" company="Microsoft">
## Copyright (C) Microsoft. All rights reserved.
## </copyright>
##-----------------------------------------------------------------... | 0 |
Check Modules path_1..ps1 | function Update-ModulePath {
<#
.Synopsis
Command insures that path and the name of psm1 file are alike.
.Description
This function should help to troubleshoot modules. It loooks up path that should contain modules.
For each .psm1 file found it checks if parent folder containing th... | 0 |
sample_0_45.ps1 | /* ---------------------------------------------------------------------------
* DCIM_SMCLPADSystemComponent
* ---------------------------------------------------------------------------
*/
[ dynamic, provider("dcismprovider"),
Association,
Description ("It is used to aggregate CIM_ComputerSystem inst... | 0 |
New-XML.ps1 | ### A first stab at the worlds simplest DSL:
### How to generate XML from PowerShell, in code instead of string-substitution
$xlr8r = [type]::gettype("System.Management.Automation.TypeAccelerators")
$xlinq = [Reflection.Assembly]::Load("System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c56... | 0 |
sample_29_30.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 |
sample_33_12.ps1 | #
# Script module for module 'Az.ManagedServices' that is executed when 'Az.ManagedServices' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:41
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try... | 0 |
sample_35_88.ps1 | #
# Module manifest for module 'OCI.PSModules.Dns'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dns.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
sample_1_76.ps1 | ConvertFrom-StringData @'
id_kb947477_hpdlltitle=Checking Spooler Service for hpzui4wm.dll
id_kb947477_hpdlldescription=Checking for HP driver hpzui4wm.dll loaded in Spooler Service.
'@
# SIG # Begin signature block
# MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgE... | 0 |
3091.ps1 | function Verify-NotNull {
param (
[Parameter(ValueFromPipeline = $true)]
$Actual
)
if ($null -eq $Actual) {
throw [Exception]"Expected not `$null but got `$null."
}
$Actual
}
| 0 |
Invoke-ScriptThatRequire.ps1 | ###########################################################################\n##\n## Invoke-ScriptThatRequiresSta\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\nD... | 0 |
637.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://heanet.dl.sourceforge.net/project/greenshot/Greenshot/Greenshot%201.1/Greenshot-INSTALLER-1.1.7.17.exe"
Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\"
}
$Configs | ... | 0 |
Set-Keydelay.ps1 | Begin {
$key = "keyboard.typematicMinDelay"
$value = "2000000"
}
Process {
#Make Sure it's a VM
if ( $_ -isnot [VMware.VimAutomation.Client20.VirtualMachineImpl] ) { continue }
#Setup our Object
$vm = Get-View $_.Id
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec... | 0 |
sample_15_32.ps1 | # region Generated
# ----------------------------------------------------------------------------------
# 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 obt... | 0 |
sample_48_51.ps1 | =캐시를 실제로 업데이트하지 못하도록 캐시 유지 관리 작업을 사용하지 않도록 설정합니다. 대신 즉시 반환됩니다.빠른 검사 중에 제외된 파일 및 디렉터리를 검사합니다.ScanRtpExclusions스캔 스레드 수에 대한 상한값을 제거합니다.¤이 옵션을 사용하도록 설정하면 핵심 서비스에서 ECS(실험 및 구성 서비스) 사용을 중지하여 Microsoft Defender 바이러스 백신 및 기타 Defender 소프트웨어에 대한 중요한 조직별 수정 사항을 신속하게 제공합니다. 수정 사항은 보안 인텔리전스 업데이트를 통해 계속 제공됩니다.¿사용하도록 설정하면 핵심 서비스가... | 0 |
sample_43_88.ps1 | #
# Script module for module 'Az.PrivateDns' that is executed when 'Az.PrivateDns' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 05/16/2024 06:33:09
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
... | 0 |
sample_51_68.ps1 | #
# Module manifest for module 'OCI.PSModules.Monitoring'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Monitoring.dll'
# Version number of this module.
ModuleVersion = '79.0.0'
# Supported PSEditions
... | 0 |
sample_42_19.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 |
2246.ps1 |
Begin {
try {
$TSEnvironment = New-Object -ComObject Microsoft.SMS.TSEnvironment -ErrorAction Stop
}
catch [System.Exception] {
Write-Warning -Message "Unable to construct Microsoft.SMS.TSEnvironment object" ; exit 1
}
}
Process {
function Write-CMLogEntry {
param(
... | 0 |
Set-Wallpaper (CTP2)_1.ps1 | #requires -version 2.0
## Set-Wallpaper - set your windows desktop wallpaper
###################################################################################################
## Usage:
## Set-Wallpaper "C:\\Users\\Joel\\Pictures\\Wallpaper\\Dual Monitor\\mandolux-tiger.jpg" "Tile"
## ls *.jpg | get-random ... | 0 |
sample_53_15.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | 0 |
sample_23_6.ps1 | [CmdletBinding()]
param()
function findExistingImportModuleDirectives([Parameter(Mandatory=$true)][string]$path)
{
if (!(Test-Path $path))
{
return
}
$fileContents = Get-Content $path
$fileContents -match 'Import-Module.+?(?=posh-vcpkg)'
return
}
$scriptsDir = split-path -parent $scri... | 0 |
sample_14_61.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\he@1.2.0\node_modules\he\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\he@1.2.0\node_modul... | 0 |
sample_3_3.ps1 | #************************************************
# TS_ServerManagerRefreshIssue.ps1
# Version 1.0.1
# Date: 7/19/2013
# Author: v-kaw
# Description: [KSE Rule] [ Windows V3] Server Manager refresh issues and SDP changes reqd for MMC Snapin Issues in 2008, 2008 R2
# Rule number: b7d69da3-d4b7-4754-ad3c-49133b0d... | 0 |
Start-Demo 3.3.1.ps1 | ## Start-Demo.ps1
##################################################################################################
## This is an overhaul of Jeffrey Snover's original Start-Demo script by Joel "Jaykul" Bennett
##
## I've switched it to using ReadKey instead of ReadLine (you don't have to hit Enter each time)
## ... | 0 |
545.ps1 |
function Set-SPOWebPermissions
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$groupname,
[Parameter(Mandatory=$true, Position=2)]
[string]$roleType
)
process
{
Write-Host "Creating permissions for the web for the group $groupname and role $roleType" -foregroundcolor b... | 0 |
3659.ps1 |
function Test-ListStretchDatabaseRestorePoints
{
$location = Get-ProviderLocation "Microsoft.Sql/servers"
$serverVersion = "12.0";
$rg = Create-ResourceGroupForTest $location
try
{
$server = Create-ServerForTest $rg $location
$databaseName = Get-DatabaseName
$stretchdb = New-AzSqlDataba... | 0 |
1346.ps1 |
function Add-CTrustedHost
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string[]]
[Alias("Entries")]
$Entry
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.Sessio... | 0 |
sample_36_41.ps1 | #===========================================================================
#DVInstaller.ps1
#----------------------------------------------------------------------------
#Copyright (C) 2021 Intel Corporation
#SPDX-License-Identifier: MIT
#--------------------------------------------------------------------------*/
#... | 0 |
Issue-PendingRequest_1.ps1 | #####################################################################
# Issue certificate.ps1
# Version 1.0
#
# Issues certificate request from a pending request
#
# For this function to succeed, the certificate request must be pending
#
# Vadims Podans (c) 2010
# http://en-us.sysadmins.lv/
##################... | 0 |
sample_52_46.ps1 | ###########################################################
#
# 'ExtensionService' module
#
###########################################################
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
Import-Module "$PSScriptRoot\ServiceHelper.psm1"
$script:GCInstallPath = "$PSScriptRoot\..... | 0 |
Invoke-Generic_3.ps1 | function Invoke-Generic {
#.Synopsis
# Invoke Generic method definitions via reflection:
[CmdletBinding()]
param(
[Parameter(Position=0,Mandatory=$true,ValueFromPipelineByPropertyName=$true)]
[Alias('On')]
$InputObject
,
[Parameter(Position=1,ValueFromPipelineByPropertyName=$true)]
[Alias('Na... | 0 |
2339.ps1 |
[xml]$golden_gpo = gc '.\IE Settings.xml'
$gpos = Get-GPOReport -All -ReportType XML
$golden_gpo_computer_registry_settings = ($golden_gpo.GPO.Computer.ExtensionData | ? {$_.Name -eq 'Registry'}).childNodes.Policy | select name,state
$golden_gpo_user_ie_pref_settings = ($golden_gpo.GPO.User.ExtensionData | ? {$_.Nam... | 0 |
sample_65_97.ps1 | #
# Module manifest for module 'OCI.PSModules.Optimizer'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Optimizer.dll'
# Version number of this module.
ModuleVersion = '87.0.0'
# Supported PSEditions
Co... | 0 |
sample_43_63.ps1 | #!powershell
# -*- coding: utf-8 -*-
# (c) 2022, John McCall (@lowlydba)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#AnsibleRequires -CSharpUtil Ansible.Basic
#AnsibleRequires -PowerShell ansible_collections.lowlydba.sqlserver.plugins.module_utils._SqlServerUtils
#Req... | 0 |
sample_65_94.ps1 | <# # File: TSS_SEC.psm1
.SYNOPSIS
SEC module for collecting ETW traces and various custom tracing functionality
.DESCRIPTION
Define ETW traces for Windows SEC components
Add any custom tracing functinaliy for tracing SEC components
For Developers:
1. Switch test: .\TSS.ps1 -Start -SEC_TEST1... | 0 |
Invoke-Member.ps1 | ##############################################################################\n##\n## Invoke-Member\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\nEnables ea... | 0 |
sample_18_54.ps1 | ConvertFrom-StringData @'
id_systemservicediagnostic_sqlconnect=Connect to a Sql Server Instance
id_systemservicediagnostic_sqlconnectdesc=Trying to connect to Sql Server
id_axsqldataengine=Running SQL Query against Sql Server: %Server%
id_axsqldataenginedesc=Checking sql configuration : %DC_Name%
id_axsqlruleseng... | 0 |
sample_44_49.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | 0 |
sample_3_90.ps1 | ConvertFrom-StringData @'
id_netframeworkngenfiles_title=.Net Framework nGen files
id_netframeworkngenfiles_status=Collecting .Net Framework nGen files
'@
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE... | 0 |
86.88.239.115.ps1 | function Set-IPAddress {
param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"),
[string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"),
[string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"),
[string]$gateway = $(read-host "Enter... | 0 |
1423.ps1 |
function New-CTempDirectory
{
[CmdletBinding(SupportsShouldProcess=$true)]
[OutputType([IO.DirectoryInfo])]
param(
[string]
$Prefix
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
$tempDir = [... | 0 |
sample_17_22.ps1 | # Copyright 2008, Microsoft Corporation. All rights reserved.
PARAM([string]$MachineName = $ComputerName,[string]$Path= $null)
if($debug -eq $true){[void]$shell.popup("Run DC_DeploymentLogsLogs.ps1")}
Import-LocalizedData -BindingVariable DeploymentLogsStrings
Write-DiagProgress -Activity $DeploymentLogsS... | 0 |
sample_12_42.ps1 |
param(
[parameter(Mandatory = $false)]
$siteName,
[parameter(Mandatory = $false)]
$sitePhysicalPath,
[parameter(Mandatory = $false)]
$siteAppPoolName,
[parameter(Mandatory = $false)]
[int]$sitePort,
[parameter(Mandatory = $false)]
$deploymentUserName,
[... | 0 |
New-Zip_1.ps1 | Function New-Zip
{
<#
.SYNOPSIS
Create a Zip File from any files piped in.
.DESCRIPTION
Requires that you have the SharpZipLib installed, which is available from
http://www.icsharpcode.net/OpenSource/SharpZipLib/
.NOTES
File Name : PowerZip.psm1
Author : Christophe CREMON (uxone) - http://powershel... | 0 |
Share Perms.ps1 | $FolderPath = "\\\\FilerName\\ShareName"
$rootfolder = Get-ChildItem -Path $FolderPath -recurse
foreach ($file in $rootfolder) {
$file.FullName
Get-Acl $file.FullName | Format-List
$acl = Get-Acl $file.FullName
$acl.Access | %{$acl.RemoveAccessRule($_)}
... | 0 |
Set-Encoding_1.ps1 | function Set-Encoding{
<#
.Synopsis
Takes a Script file or any other text file into memory and Re-Encodes it in the format specified.
.Parameter Source
The path to the file to be re-encoded.
.Parameter Destination
The path to write the corrected file to
.Parameter Encoding
The encoding to convert ... | 0 |
Hack ESX MOTD.ps1 | $screen = @"
You see here a virtual switch. ------------ ------
#...........| |....|
--------------- ###------------ |...(|
|..%...........|########## ###-@...|
... | 0 |
HttpRest 1.0.2.ps1 | ## Http Rest
####################################################################################################
## The first implementation of the HttpRest module, as a bunch of script functions
## Based on the REST api from MindTouch's Dream SDK
##
## INSTALL:
## You need log4net.dll mindtouch.core.dll mindto... | 0 |
sample_32_72.ps1 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
#-------------------------------------------------------------------------
#
# Returns given date-time by locale 'en-us'
#
Function Global:GetDateTimeLocaleEnUs
{
param
... | 0 |
sample_47_47.ps1 | #
# Script module for module 'Az.LoadTesting' that is executed when 'Az.LoadTesting' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:41
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
{
... | 0 |
sample_28_45.ps1 | # Get the version of the Torizon IDE Extension from package.json
$env:TEST_EXTENSION_VERSION = ((Get-Content "package.json" -Raw) | ConvertFrom-Json).version
$env:TEST_VSCODE_CLEANUP = $true
# Start the tests from a clean environment, unless explictly setting to false
# the env variable
if ($env:TEST_VSCODE_CLEANUP -E... | 0 |
1976.ps1 |
Describe "Get-Verb" -Tags "CI" {
It "Should get a list of Verbs" {
Get-Verb | Should -Not -BeNullOrEmpty
}
It "Should get a specific verb" {
@(Get-Verb -Verb Add).Count | Should -Be 1
@(Get-Verb -Verb Add -Group Common).Count | Should -Be 1
}
It "Should get a specific gr... | 0 |
1088.ps1 |
& (Join-Path -Path $PSScriptRoot 'Initialize-CarbonTest.ps1' -Resolve)
Describe 'New-Junction' {
$JunctionPath = $null
$tempDir = Get-Item -Path 'TestDrive:'
BeforeEach {
$Global:Error.Clear()
$JunctionPath = Join-Path $tempDir ([IO.Path]::GetRandomFileName())
}
... | 0 |
sample_57_11.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
#
# ModifyProxySettings.ps1 - To be used by the installer - Mo... | 0 |
783.ps1 |
function Import-EditorCommand {
[OutputType([Microsoft.PowerShell.EditorServices.Services.PowerShellContext.EditorCommand])]
[CmdletBinding(DefaultParameterSetName='ByCommand')]
param(
[Parameter(Position=0,
Mandatory,
ValueFromPipeline,
... | 0 |
Compare-Agents.ps1 | #This scripts compares the agents that are installed in two zones and
#gives the agents that are not common.
#Usage:
#Compare-Agents.ps1 -server1 RMSServer1.contoso.com -server2 RMSServer2.contoso.com -output c:\\Temp.txt
#RMSServer1 is the one whose agents are to be moved.
param([string] $Server1,$Server2,$outp... | 0 |
3351.ps1 |
function Invoke-SafeWebRequest{
Param(
[Parameter(Mandatory=$True)]
[string]$Query
)
try
{
Write-Debug "Sending query to the server..."
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$jsonResult = Invoke-WebRequest $Query ... | 0 |
sample_3_49.ps1 | ConvertFrom-StringData @'
id_sbsl_mcafee_eepc_slowboot_sd=McAfee Endpoint Encryption for PCs (EEPC) may cause slow boot or delay between CTRL+ALT+DEL and Credential logon dialog
'@
# SIG # Begin signature block
# MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3A... | 0 |
viewAllTemplate.ps1 | <# view all template wsp on custom site url
based on
http://www.danielbrown.id.au/Lists/Posts/Post.aspx?ID=74
#>
$site = Get-SPSite "http://spf"
$web = $site.OpenWeb();
foreach($lang in $web.RegionalSettings.InstalledLanguages)
{
Write-Host "Displaying Sites for Langauge: ... | 0 |
Get_Set Signature (CTP2)_1.ps1 | #Requires -version 2.0
## Authenticode.psm1
####################################################################################################
## Wrappers for the Get-AuthenticodeSignature and Set-AuthenticodeSignature cmdlets
## These properly parse paths, so they don't kill your pipeline and script if you incl... | 0 |
sample_38_6.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
#
# Azure File Sync (AFS): repair the corrupted event channels
#
... | 0 |
115.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
i... | 0 |
NTFS ACLs Folder Tree_2.ps1 | #######################################
# TITLE: listACL.ps1 #
# AUTHOR: Santiago Fernandez Mu±oz #
# #
# DESC: This script generate a HTML #
# report show all ACLs asociated with #
# a Folder tree structure starting in #
# root specified by the user ... | 0 |
sample_44_16.ps1 | #
# Module manifest for module 'OCI.PSModules.Vault'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vault.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Supported PSEditions
Compatible... | 0 |
sample_11_51.ps1 | ConvertFrom-StringData @'
id_fileacl=Determining file ACL's
'@
# SIG # Begin signature block
# MIIoUQYJKoZIhvcNAQcCoIIoQjCCKD4CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA6VsPfmmzM00am
# qvD0ITk80rX9ws5... | 0 |
231.ps1 | function Get-SCSMServiceRequestComment
{
PARAM
(
[Parameter(ParameterSetName = 'General',
Mandatory = $true)]
$DateTime = $((Get-Date).AddHours(-24)),
[Parameter(ParameterSetName = 'GUID')]
$GUID
)
IF ($PSBoundParameters['GUID'])
{
$Tickets = Get-SCSMObject -id $GUID
}
ELSE
{
if ($DateTim... | 0 |
FTP upload_1.ps1 | $File = "D:\\Dev\\somefilename.zip"
$ftp = "ftp://username:password@example.com/pub/incoming/somefilename.zip"
"ftp url: $ftp"
$webclient = New-Object System.Net.WebClient
$uri = New-Object System.Uri($ftp)
"Uploading $File..."
$webclient.UploadFile($uri, $File)
| 0 |
sample_11_54.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... | 0 |
Get-SqlSpn.ps1 | #######################
<#
.SYNOPSIS
Gets MSQLSvc service principal names (spn) from Active Directory.
.DESCRIPTION
The Get-SqlSpn function gets SPNs for MSQLSvc services attached to account and computer objects
.EXAMPLE
Get-SqlSpn
This command gets MSSQLSvc SPNs for the current domain
.NOTES
Adapted from ht... | 0 |
sample_33_61.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 |
3667.ps1 |
function Test-CreateAgent
{
$location = Get-Location "Microsoft.Sql" "operations" "West US 2"
$rg1 = Create-ResourceGroupForTest
$s1 = Create-ServerForTest $rg1 $location
$db1 = Create-DatabaseForTest $s1
$db2 = Create-DatabaseForTest $s1
$db3 = Create-DatabaseForTest $s1
... | 0 |
1510.ps1 |
function Assert-Match
{
param(
[Parameter(Position=0,Mandatory=$true)]
[string]
$Haystack,
[Parameter(Position=1,Mandatory=$true)]
[string]
$Regex,
[Parameter(Position=2)]
[string]
... | 0 |
Get-MacAddressOui.ps1 | function Get-MacAddressOui {
<#
.SYNOPSIS
Gets a MAC address OUI (Organizationally Unique Identifier).
.DESCRIPTION
The Get-MacAddressOui function retrieves the MAC address OUI reference list maintained by the IEEE standards website and
returns the name of the company to which the MAC address OUI is ass... | 0 |
Get-QADGroupNesting.ps1 | Param (
[Parameter(Mandatory=$true,
Position=0,
ValueFromPipeline=$true,
HelpMessage="DN or ObjectGUID of the AD Group."
)]
[string]$groupIdentity,
[switch]$showTree
)
#Validate Quest PSSnapin is loaded
Add-PSSnapin -Name Quest.ActiveRoles.ADManagement -ErrorAction ... | 0 |
sample_51_17.ps1 | <#
.SYNOPSIS
Demonstrates how to write a command that works with paths that do
not allow wildards and do not have to exist.
.DESCRIPTION
This command does not require a LiteralPath parameter because the
Path parameter can handle paths that use wildcard characters. That's
because this command... | 0 |
1604.ps1 |
function Get-Shortcut {
param (
[parameter(mandatory=$true)]
[string]$Path
)
begin {
$WshShell = New-Object -ComObject WScript.Shell
}
process {
if (!$Path) {Throw 'No Source'}
$Shortcut = $WshShell.CreateShortcut($Path)
$Shortcut | sele... | 0 |
sample_48_81.ps1 | # Localized 05/06/2022 11:08 PM (GMT) 303:7.0.30723 ArchiveResources.psd1
# Localized ArchiveResources.psd1
ConvertFrom-StringData @'
###PSLOC
PathNotFoundError=The path '{0}' either does not exist or is not a valid file system path.
ExpandArchiveInValidDestinationPath=The path '{0}' is not a valid file system ... | 0 |
355.ps1 | function Get-PSFLoggingProvider
{
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFLoggingProvider')]
Param (
[Alias('Provider', 'ProviderName')]
[string]
$Name = "*"
)
begin
{
}
process
{
[PSFramework.Logging.ProviderHost]::Providers.Values | Where-Objec... | 0 |
sample_59_92.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 |
1941.ps1 |
Describe 'ConvertTo-Json' -tags "CI" {
BeforeAll {
$newline = [System.Environment]::NewLine
}
It 'Newtonsoft.Json.Linq.Jproperty should be converted to Json properly' {
$EgJObject = New-Object -TypeName Newtonsoft.Json.Linq.JObject
$EgJObject.Add("TestValue1", "123456")
$E... | 0 |
1501.ps1 |
function Assert-FileDoesNotExist
{
[CmdletBinding()]
param(
[Parameter(Position=0)]
[string]
$Path,
[Parameter(Position=1)]
[string]
$Message
)
Set-StrictMode -Version 'Latest'
if( Test-Path -Path $Path -PathType... | 0 |
sample_18_30.ps1 | #
# Module manifest for module 'OCI.PSModules.Dataintegration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dataintegration.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported P... | 0 |
Get-ObservedIPRange_1.ps1 | function Get-ObservedIPRange {
param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true,HelpMessage="Physical NIC from Get-VMHostNetworkAdapter")]
[VMware.VimAutomation.Client20.Host.NIC.PhysicalNicImpl]
$Nic
)
process {
$hostView = Get-VMHost -Id $Nic.VMHostId | Get-View -Property ConfigManager
... | 0 |
Remove-LocalProfile.ps1 | <#
.SYNOPSIS
Interactive menu that allows a user to connect to a local or remote computer and remove a local profile.
.DESCRIPTION
Presents an interactive menu for user to first make a connection to a remote or local machine. After making connection to the machine,
the user is presented with... | 0 |
sample_35_1.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.2.0'
# Suppo... | 0 |
sample_23_55.ps1 | # Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved.
Function Get-AMTEventLog {
<#
.Synopsis
Returns the Intel Active Management Technology event log.
.Description
This Cmdlet returns the Intel Active Management Technology(AMT) event log from clients that have Intel AMT firmware versi... | 0 |
sample_18_50.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 |
sample_42_60.ps1 | function New-AzDataProtectionBackupPolicy
{
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBaseBackupPolicyResource')]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates a new back... | 0 |
sample_25_30.ps1 | aufSeite1041,„Abfrage”aufSeite1045,„Berichtsausdruck”aufSeite1051,„Berichtsausdruck”aufSeite1051,„Standardabweichungen”aufSeite1069DatenpunktEinDatenpunktineinemPunktdiagramm.ZudenPunktdiagrammengehörenStreudiagramme,Polardiagramme,RadardiagrammeundBlasendiagramme.DiesesObjektgiltnurfürVorgängerdiagramme.Eigenschaftenv... | 0 |
Kill-Process.ps1 | function Kill-Process() {
param(
[string[]]$ComputerNames,
[string[]]$ProcessNames,
$User
)
###########################################################################################################
if ($ProcessNames -eq $null) {Write-Error 'The parametre "ProcessNames" cannot be empty';break}
################... | 0 |
sample_63_96.ps1 | #
# Module manifest for module 'OCI.PSModules.Analytics'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Analytics.dll'
# Version number of this module.
ModuleVersion = '84.0.0'
# Supported PSEditions
Co... | 0 |
sample_22_35.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerengine'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerengine.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported P... | 0 |
Auto ISE Preferences.ps1 | ##############################################################
#Author: Ravikanth Chaganti (http://www.ravichaganti.com/blog)
#Script: SaveISEPrefs.ps1
#Description: PowerShell ISE profile script to automatically
# archive changes to ISE preferences such as color
# schemes, font, etc
#####... | 0 |
sample_56_3.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
#
# Azure File Sync (AFS): repair the corrupted event channels
#
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.