Functions/Scripting/Profiling/Import-PSProfile.ps1
Function Import-PSProfile { [cmdletbinding()] Param ( # Scope for Profile [Parameter(Mandatory=$false)] [ValidateSet("Global","User")] [string] $ProfileScope = "User" ) Process { # Define Profile Path based on scope input $ProfilePath = switch($ProfileScope){"User"{$profile.CurrentUserAllHosts};"Global"{$profile.AllUsersAllHosts}} # Import Profile Data from Path if (test-path $ProfilePath){. $ProfilePath} } } |