####Parameter Builder Does Not Work#### <# .SYNOPSIS Use this script with SCCM to check if a specified certificate exists .DESCRIPTION This script is used to check if a certificate exists on a local machine which was created from a specified template from the certificate authority. By default the specified certificate is TemplateDisplayName = test, TemplateId = 1.1.1.1.1.1.1.1 This can be updated to be any other Certificate provided it follows correct format. .PARAMETER TemplateDisplayName The template Display Name that the local certificate should be created from. This is a human readable format. The default value is NM2-HO-Workstation-Auth .PARAMETER TemplateID The certificate numerical identifier. This is the computer readable format. .PARAMETER IncludeCertName A description of the IncludeCertName parameter. .OUTPUTS int .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2020 v5.7.178 Created on: 5/28/2020 9:09 AM Created by: Paul DeArment =========================================================================== #> [CmdletBinding(DefaultParameterSetName = 'Default', ConfirmImpact = 'None', SupportsShouldProcess = $false)] [OutputType([int], ParameterSetName = 'Default')] [OutputType([psobject], ParameterSetName = 'IncludeCertName')] param ( [Parameter(ParameterSetName = 'Default', Position = 0)] [Parameter(ParameterSetName = 'IncludeCertName')] [ValidateNotNullOrEmpty()] [string]$TemplateDisplayName = 'test', [Parameter(ParameterSetName = 'Default', Position = 1)] [Parameter(ParameterSetName = 'IncludeCertName')] [ValidateNotNullOrEmpty()] [string]$TemplateID = '1.1.1.1.1.1.1.1', [Parameter(ParameterSetName = 'IncludeCertName')] [switch]$IncludeCertName ) ####Function Builder Works#### <# .SYNOPSIS Use this script with SCCM to check if a specified certificate exists .DESCRIPTION This script is used to check if a certificate exists on a local machine which was created from a specified template from the certificate authority. By default the specified certificate is TemplateDisplayName = test, TemplateId = 1.1.1.1.1.1.1.1 This can be updated to be any other Certificate provided it follows correct format. .PARAMETER TemplateDisplayName The template Display Name that the local certificate should be created from. This is a human readable format. The default value is NM2-HO-Workstation-Auth .PARAMETER TemplateID The certificate numerical identifier. This is the computer readable format. .PARAMETER IncludeCertName A description of the IncludeCertName parameter. .OUTPUTS int .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2020 v5.7.178 Created on: 5/28/2020 9:09 AM Created by: Paul DeArment =========================================================================== #> function test{ [CmdletBinding(DefaultParameterSetName = 'Default', ConfirmImpact = 'None', SupportsShouldProcess = $false)] [OutputType([int], ParameterSetName = 'Default')] [OutputType([psobject], ParameterSetName = 'IncludeCertName')] param ( [Parameter(ParameterSetName = 'Default', Position = 0)] [Parameter(ParameterSetName = 'IncludeCertName')] [ValidateNotNullOrEmpty()] [string]$TemplateDisplayName = 'test', [Parameter(ParameterSetName = 'Default', Position = 1)] [Parameter(ParameterSetName = 'IncludeCertName')] [ValidateNotNullOrEmpty()] [string]$TemplateID = '1.1.1.1.1.1.1.1', [Parameter(ParameterSetName = 'IncludeCertName')] [switch]$IncludeCertName ) }