public/Get-IntakeYears.ps1

Function Get-IntakeYears {

    <#
    .SYNOPSIS
        A Quick function that shows what year group matches to what intake year
      
      
    .NOTES
        Name: Get-IntakeYears
        Author: Elliott Marter
      
      
    .EXAMPLE
        Get-IntakeYears
      
      
    .LINK
        https://www.powershellgallery.com/profiles/elliottmarter
    #>


    $Year = (get-date -UFormat %Y) -as [int]

    if ((get-date -UFormat %m) -ge "09") {
        $Year = ($Year + 1)
    }
        
    Write-Host "Year R:" ($Year - 1) -ForegroundColor Red
    Write-Host "Year 1:" ($Year - 2) -ForegroundColor Blue
    Write-Host "Year 2:" ($Year - 3) -ForegroundColor Cyan
    Write-Host "Year 3:" ($Year - 4) -ForegroundColor DarkGreen
    Write-Host "Year 4:" ($Year - 5) -ForegroundColor Green
    Write-Host "Year 5:" ($Year - 6) -ForegroundColor DarkMagenta
    Write-Host "Year 6:" ($Year - 7) -ForegroundColor Magenta

}