This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Set-SCCMDetectionRuleForDeploymentType { | |
Param( | |
[Parameter(Mandatory=$True)] | |
[ValidateSet("RegistryKey","File","Folder","MSI","Assembly","Other")] | |
$DetectionType, | |
[Parameter(Mandatory=$False,ParameterSetName="FileDetection")][ValidateNotNullOrEmpty()][String]$FileName, | |
[Parameter(Mandatory=$False,ParameterSetName="FileDetection")][ValidateNotNullOrEmpty()][String]$FolderPath, | |
[Parameter(Mandatory=$False,ParameterSetName="FileDetection")]$Is64bit, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function New-SCCMDetectionRuleForDeploymentType { | |
Param( | |
[Parameter(Mandatory=$True)] | |
[ValidateSet("RegistryKey","File","Folder","MSI","Assembly","Other")] | |
$DetectionType, | |
[Parameter(Mandatory=$False,ParameterSetName="FileDetection")][ValidateNotNullOrEmpty()][String]$FileName, | |
[Parameter(Mandatory=$False,ParameterSetName="FileDetection")][ValidateNotNullOrEmpty()][String]$FolderPath, | |
[Parameter(Mandatory=$False,ParameterSetName="FileDetection")]$Is64bit, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Load-ConfigMgrAssemblies { | |
Param( | |
$AdminConsoleDirectory = "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin" | |
) | |
#Add-Type -Path "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\DcmObjectModel.dll" | |
$filesToLoad = "Microsoft.ConfigurationManagement.ApplicationManagement.dll","AdminUI.WqlQueryEngine.dll", "AdminUI.DcmObjectWrapper.dll","DcmObjectModel.dll","AdminUI.AppManFoundation.dll","AdminUI.WqlQueryEngine.dll","Microsoft.ConfigurationManagement.ApplicationManagement.Extender.dll","Microsoft.ConfigurationManagement.ManagementProvider.dll","Microsoft.ConfigurationManagement.ApplicationManagement.MsiInstaller.dll" | |
Set-Location $AdminConsoleDirectory | |
[System.IO.Directory]::SetCurrentDirectory($AdminConsoleDirectory) | |
foreach($fileName in $filesToLoad) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Create-RandomFiles{ | |
<# | |
.SYNOPSIS | |
Generates a number of dumb files for a specific size. | |
.DESCRIPTION | |
Generates a defined number of files until reaching a maximum size. | |
.PARAMETER Totalsize | |
Specify the total size you would all the files combined should use on the harddrive. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-CMSurfaceNetworkAdapter { | |
Param( | |
[string]$Add, | |
[string]$Remove, | |
[switch]$ListSurfaceAdapters | |
) | |
#Based on following technet article: https://blogs.technet.microsoft.com/system_center_configuration_manager_operating_system_deployment_support_blog/2015/08/27/reusing-the-same-nic-for-multiple-pxe-initiated-deployments-in-system-center-configuration-manger-osd/ | |
$Root = 'HKLM:\SOFTWARE\Microsoft\SMS\Components\SMS_DISCOVERY_DATA_MANAGER' | |
$Item = 'ExcludeMACAddress' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Print-WebPageToPDF{ | |
<# | |
.SYNOPSIS | |
Prints a specefic webPage to PDF. | |
.DESCRIPTION | |
If no fileName is given, it will print the file name with the current date & time | |
.EXAMPLE | |
Will print a file called powershelldistrict.pdf to the path C:\temp\print |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-Joke | |
{ | |
((iwr -uri "http://tambal.azurewebsites.net/joke/random").content |Convertfrom-Json).joke | |
} | |
Get-Joke |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-MacOsXsysteminformation { | |
[xml]$infos = system_profiler -xml | |
return $infos | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class Computer { | |
[String]$Name | |
[String]$Type | |
[string]$Description | |
[string]$owner | |
[string]$Model | |
[int]$Reboots | |
[void]Reboot(){ | |
$this.Reboots ++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enum ServerType { | |
HyperV | |
Sharepoint | |
Exchange | |
Web | |
ConfigMgr | |
} |
OlderNewer