title: Remove despite "Device or resource busy" on a GitHub Actions Windows worker
body: <p>I would like to cleanup the gradle cache before storing it on GitHub actions. The current relevant configuration is the following:</p>
  <pre class="lang-yaml prettyprint-override"><code>      - name: Turn off the Gradle Daemon
          shell: bash
          run: ./gradlew --stop
        - name: Cleanup Gradle Cache
          shell: bash
          run: |
            rm -f ~/.gradle/caches/modules-2/modules-2.lock
            rm -f ~/.gradle/caches/modules-2/gc.properties
  </code></pre>
  <p>The process works perfectly under Linux and MacOS X, but on windows, despite stopping the Gradle Daemon before running the cleanup, I get the following error:</p>
  <pre><code>Run rm -f ~/.gradle/caches/modules-2/modules-2.lock
  rm: cannot remove '/c/Users/runneradmin/.gradle/caches/modules-2/modules-2.lock': Device or resource busy
  Error: Process completed with exit code 1.
  </code></pre>
  <p>Is there any way to <strong>force</strong> the removal of a file? I don't care about inconsistencies, I want that file removed, that's it.
  The removal must be performed in a continuos integration environment, so no graphical tools, just Powershell or git bash.</p>