Implements utility methods that might be used by Hosts.
        /// <summary>
        /// Gets an array of commands that can be run sequentially to set $profile and run the profile commands.
        /// </summary>
        /// <param name="shellId">The id identifying the host or shell used in profile file names.</param>
        /// <param name="useTestProfile">used from test not to overwrite the profile file names from development boxes</param>
        /// <returns></returns>
        internal static PSCommand[] GetProfileCommands(string shellId, bool useTestProfile)
        {
            List <PSCommand> commands               = new List <PSCommand>();
            string           allUsersAllHosts       = HostUtilities.GetFullProfileFileName(null, false, useTestProfile);
            string           allUsersCurrentHost    = HostUtilities.GetFullProfileFileName(shellId, false, useTestProfile);
            string           currentUserAllHosts    = HostUtilities.GetFullProfileFileName(null, true, useTestProfile);
            string           currentUserCurrentHost = HostUtilities.GetFullProfileFileName(shellId, true, useTestProfile);
            PSObject         dollarProfile          = HostUtilities.GetDollarProfile(allUsersAllHosts, allUsersCurrentHost, currentUserAllHosts, currentUserCurrentHost);
            PSCommand        command = new PSCommand();

            command.AddCommand("set-variable");
            command.AddParameter("Name", "profile");
            command.AddParameter("Value", dollarProfile);
            command.AddParameter("Option", ScopedItemOptions.None);
            commands.Add(command);

            string[] profilePaths = new string[] { allUsersAllHosts, allUsersCurrentHost, currentUserAllHosts, currentUserCurrentHost };
            foreach (string profilePath in profilePaths)
            {
                if (!System.IO.File.Exists(profilePath))
                {
                    continue;
                }
                command = new PSCommand();
                command.AddCommand(profilePath, false);
                commands.Add(command);
            }

            return(commands.ToArray());
        }
 /// <summary>
 /// Gets an array of commands that can be run sequentially to set $profile and run the profile commands.
 /// </summary>
 /// <param name="shellId">The id identifying the host or shell used in profile file names.</param>
 /// <returns></returns>
 public static PSCommand[] GetProfileCommands(string shellId)
 {
     return(HostUtilities.GetProfileCommands(shellId, false));
 }