Skip to content

Instantly share code, notes, and snippets.

View Graham-Beer's full-sized avatar

Graham Beer Graham-Beer

View GitHub Profile
@Graham-Beer
Graham-Beer / Controller.ps1
Created May 3, 2016 18:38
App-V PowerShell removal script
<#
.SYNOPSIS
Remove Visio 2010 AppV Package
.DESCRIPTION
Controller script to invoke 'Remove-Package' cmdlet
.EXAMPLE
. .\$PSScriptRoot\Remove-AppvPackage.ps1
.LINK
Links to further documentation
.NOTES
@Graham-Beer
Graham-Beer / Get-NetDetails.ps1
Created May 17, 2016 20:43
Get IP from Host / Host from IP
<#
.Details
Small function to find either IP address from Host or Host from IP
By G Beer
#>
Function Get-NetDetails {
[CmdletBinding(DefaultParameterSetName='ByIP')]
param (
[Parameter(Mandatory = $true, ParameterSetName = 'ByIP')]
Synopsis
Find where an application has been deployed to.
.DESCRIPTION
To determine which collection an application has been deployed to. Results will show Name of application, the deployment ID
and the collection the application has been deployed to.
.EXAMPLE
get-AppDeployedToCollection -Application 'Microsoft Office 2016'
.OUTPUTS
Application_Name DeploymentID Deployed_To_Collection
---------------- ------------ ----------------------
Synopsis
Find where an application has been deployed to.
.DESCRIPTION
To determine which collection an application has been deployed to. Results will show Name of application, the deployment ID
and the collection the application has been deployed to.
.EXAMPLE
get-AppDeployedToCollection -Application 'Microsoft Office 2016'
.OUTPUTS
Application_Name DeploymentID Deployed_To_Collection
---------------- ------------ ----------------------
.Synopsis
Get deployment status of application
.DESCRIPTION
By querying the SCCM WMI class of "SMS_AppDeploymentAssetDetails", can obtain the status of a deployment.
Adding the application name and the collection of which the application was targeted, status results can be obtained.
A filter is set for the 5 status results which the MSDN documentation stats are avaiable.
.LINK
Please see 'https://msdn.microsoft.com/en-us/library/hh948459.aspx' for the class details of "SMS_AppDeploymentAssetDetails"
.EXAMPLES
5 examples available:
function Get-CMSiteOverview {
param([Switch]$Format)
<#
.DESCRIPTION
Display all site details.
Use format switch to display data as table or leave off for 'raw' data to use a 'manual' Select statement
.EXAMPLES
Get-CMSiteOverview
Get-CMSiteOverview -format
@Graham-Beer
Graham-Beer / get-pingStatus.ps1
Last active November 5, 2016 19:37
Ping tool
Function Get-PingStatus
{
param(
[Parameter(ValueFromPipeline=$true)]
[string]$device,
[validateSet("Online","Offline","ObjectTable")]
[String]$getObject
)
function Get-age {
param(
[Parameter(Mandatory=$true,
HelpMessage="Date must be written as dd/mm/yy",
Position=0)]
[ValidatePattern("^(0[1-9]|[12]\d|3[01])/(0[1-9]|1[0-2])/(\d{2})$")]
[string]$Bday
)
Begin {
function Get-NameInBinary {
param(
[parameter(DontShow)] # hide paramter to allow read host to promt for name(s)
[string]$name = $(read-host -Prompt "Enter Name(s)")
)
# Pass name from function to screen
"Your Name '{0}' in Binary is : " -f $name
# get the value of whitespace in binary to seperate names, surnames or middle names
@Graham-Beer
Graham-Beer / Get-DinoPW.ps1
Created April 23, 2018 15:12
Little function to make use of 'Dinopass' api
filter Get-DinoPW {
param (
[Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)]
[ValidateSet('Simple', 'Strong')]
$SetPwStrength
)
$uri = switch ($SetPwStrength) {
'Simple' { 'http://www.dinopass.com/password/simple' }
'Strong' { 'http://www.dinopass.com/password/strong' }
}