# This file is part of Ansible

# Copyright: (c) 2020, Brian Scholer <@briantist>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
---
- name: Clear Repositories
  ansible.windows.win_shell: |
    Get-PSRepository | Unregister-PSRepository

- name: Add PSGallery
  ansible.windows.win_shell: |
    Register-PSRepository -Default

- name: Clear Installed Scripts
  ansible.windows.win_shell: |
    Get-InstalledScript | Uninstall-Script -Force

- name: Remove Directories
  ansible.windows.win_file:
    path: '{{ item.path }}'
    state: absent
  loop: "{{ repos }}"
