def _format_windows_for_key(primary_key, output, return_primary_key=True):
    """Format the windows powershell output that uses 'Format-Line'
       into a dict of dicts.
    """
    primary_key = primary_key.strip()
    lines = {}
    one_item = {}
    key_value = ''
    for line in output:
        line_data = line.split(':')
        if len(line_data) > 1:
            this_key = line_data[0].strip()
            this_data = line_data[1].strip()
            if len(line_data) > 2:
                this_data = ':'.join(line_data[1:]).strip()
            if this_key != primary_key:
                one_item.update({this_key: this_data})
            else:
                key_value = this_data
        elif line == '':
            if one_item:
                lines[key_value] = one_item
                one_item = {}
                key_value = ''
        else:
            this_data = line.strip()
            appended_data = one_item[this_key] + this_data
            one_item.update({this_key: appended_data})
    if return_primary_key:
        return {primary_key: lines}
    else:
        return lines
