PoshCode Archive  Artifact [5c015397ac]

Artifact 5c015397acc09488cb75c9dbecb7b3afb2b1a27b9504560c7545776df446f291:

  • File Setup-Profile.ps1 — part of check-in [5e81cd22af] at 2018-06-10 13:51:03 on branch trunk — Creates a blank profile (user: jmh6182 size: 761)

# encoding: ascii
# api: powershell
# title: Setup-Profile
# description: Creates a blank profile
# version: 0.1
# type: function
# author: jmh6182
# license: CC0
# function: Setup-Profile
# x-poshcode-id: 5158
# x-archived: 2014-05-15T01:29:19
# x-published: 2014-05-10T03:19:00
#
#
Function Setup-Profile{
    
    $hasProfile = Test-Path -Path $profile

    if ($hasProfile -eq $false){
        $answer = Read-Host "No profile detected. Would you like to create one? (Y)es or (N)o"
        while("y","n","yes","no" -notcontains $answer)
        {
        	$answer = Read-Host "Yes or No"
        }
        
            if ($answer -eq "y"){
                New-Item -Path $profile -ItemType "file" -Force
            } 
    }
}