protected override void ProcessRecord()
        {
            if (SettingsStore.ProfileExists(ProfileName, ProfileLocation))
            {
                if (!ConfirmShouldProceed(Force.IsPresent, ProfileName, "Remove-AWSCredentialProfile"))
                {
                    return;
                }

                // clear credentials from credentials store
                SettingsStore.UnregisterProfile(ProfileName, ProfileLocation);

                // find profiles with the same name in .NET and default shared files
                var leftoverProfiles = SettingsStore.GetProfileInfo(null).Where(pi => string.Equals(pi.ProfileName, ProfileName, StringComparison.Ordinal));

                // issue warnings for those profiles
                foreach (var profileProperties in leftoverProfiles)
                {
                    if (string.Equals(profileProperties.StoreTypeName, typeof(SharedCredentialsFile).Name, StringComparison.Ordinal))
                    {
                        WriteWarning("Remove succeeded, but there is still a profile named '" + ProfileName + "' in the shared credentials file at " +
                                     profileProperties.ProfileLocation + ".");
                    }
                    else if (string.Equals(profileProperties.StoreTypeName, typeof(NetSDKCredentialsFile).Name, StringComparison.Ordinal))
                    {
                        WriteWarning("Remove succeeded, but there is still a profile named '" + ProfileName + "' in the .NET credentials file.");
                    }
                }
            }
            else
            {
                ThrowTerminatingError(new ErrorRecord(new ArgumentException("The CredentialProfile '" + ProfileName + "' does not exist."),
                                                      "ArgumentException", ErrorCategory.InvalidArgument, this));
            }
        }
        protected override void ProcessRecord()
        {
            if (!SkipProfileStore.IsPresent)
            {
                WriteWarning("Please use the Remove-AWSCredentialProfile cmdlet to delete the default profile.  This functionality will be removed from this cmdlet in a future release.");

                // Remove stored credentials
                SettingsStore.UnregisterProfile(SettingsStore.PSDefaultSettingName, ProfileLocation);

                // Remove stored legacy credentials
                SettingsStore.UnregisterProfile(SettingsStore.PSLegacyDefaultSettingName, ProfileLocation);
            }

            if (!SkipShell.IsPresent)
            {
                string scope = MyInvocation.BoundParameters.ContainsKey("Scope") ? Scope.ToString() + ":" : "";

                // Clear credentials from shell
                this.SessionState.PSVariable.Set(scope + SessionKeys.AWSCredentialsVariableName, null);

                // Clear region from shell
                this.SessionState.PSVariable.Set(scope + SessionKeys.AWSRegionVariableName, null);
            }
            else if (MyInvocation.BoundParameters.ContainsKey("Scope"))
            {
                this.ThrowTerminatingError(new ErrorRecord(
                                               new ArgumentException("Parameters Scope and SkipShell cannot be used together."),
                                               "ArgumentException", ErrorCategory.InvalidArgument, this));
            }
        }