I need to create a PS task that deletes files with the following extensions*.BAK, *.sv$, *.xlsx, *.Dwf from...

Can a space-faring robot still function over a billion years?

Iron deposits mined from under the city

Should we avoid writing fiction about historical events without extensive research?

Why would the IRS ask for birth certificates or even audit a small tax return?

Under what conditions would I NOT add my Proficiency Bonus to a Spell Attack Roll (or Saving Throw DC)?

What's the difference between Compensation, Indemnity, and Reparations?

Is being socially reclusive okay for a graduate student?

I've given my players a lot of magic items. Is it reasonable for me to give them harder encounters?

Where do you go through passport control when transiting through another Schengen airport on your way out of the Schengen area?

How did Haman know Moshe Rabeinu's Yahrzeit but not his Birthday?

Short story about an infectious indestructible metal bar?

In the world of The Matrix, what is "popping"?

How can I be pwned if I'm not registered on the compromised site?

Ignoring Someone as Wrongful Speech

Can a Mimic (container form) actually hold loot?

Should I use HTTPS on a domain that will only be used for redirection?

Naming Characters after Friends/Family

What is better: yes / no radio, or simple checkbox?

Giving a talk in my old university, how prominently should I tell students my salary?

Python 3.6+ function to ask for a multiple-choice answer

What is "desert glass" and what does it do to the PCs?

Was it really inappropriate to write a pull request for the company I interviewed with?

Can inspiration allow the Rogue to make a Sneak Attack?

Ultrafilters as a double dual



I need to create a PS task that deletes files with the following extensions*.BAK, *.sv$, *.xlsx, *.Dwf from my file path “C:Program files…” [on hold]


How to edit file on UNC path with vim from powershell?Powershell: Get inital character string from file name and create directory from string, then move filesSearch for a file with wildcards in the path using Windows command lineHow to create a script that launches a random video file from the folderFull server backup using powershell scriptSet the Creation Date of a file to that of another file with PowershellCan't run program with quoted argument from script, but can run it directly from the command-linecopy 100 new files from one directory and replace each file with the old files in their current locationTo open the file (from a file path) that resides in another file powershellNeed Windows script to create folders named with file dates and move files to the matching folder













0















Below scripts was worked for me. but it was not in right phase.



Get-ChildItem -Path 'D:pavan_test' *.bak | foreach { Remove-Item -Path $_.FullName }
Get-ChildItem -Path 'D:pavan_test' *.log | foreach { Remove-Item -Path $_.FullName }
Get-ChildItem -Path 'D:pavan_test' *.dwf | foreach { Remove-Item -Path $_.FullName }
Get-ChildItem -Path 'D:pavan_test' *.lck | foreach { Remove-Item -Path $_.FullName }
Get-ChildItem -Path 'D:pavan_test' *.txt | foreach { Remove-Item -Path $_.FullName }
Get-ChildItem -Path 'D:pavan_test' *.xlsx | foreach { Remove-Item -Path $_.FullName }
Get-ChildItem -Path 'D:pavan_test' *.sv$ | foreach { Remove-Item -Path $_.FullName }


Please help me while getting the above script into proper phase like below..



param (
$Path = "D:pavan_test",
$DaysOld = 2
)
Get-ChildItem $Path -Recurse -exclude *.txt, *.log,*.bak,*.dwf |
Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-$DaysOld) -and $_.PsIsContainer -eq $false}












share|improve this question









New contributor




Paawan Kumar Pala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as unclear what you're asking by DavidPostill 20 hours ago


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.























    0















    Below scripts was worked for me. but it was not in right phase.



    Get-ChildItem -Path 'D:pavan_test' *.bak | foreach { Remove-Item -Path $_.FullName }
    Get-ChildItem -Path 'D:pavan_test' *.log | foreach { Remove-Item -Path $_.FullName }
    Get-ChildItem -Path 'D:pavan_test' *.dwf | foreach { Remove-Item -Path $_.FullName }
    Get-ChildItem -Path 'D:pavan_test' *.lck | foreach { Remove-Item -Path $_.FullName }
    Get-ChildItem -Path 'D:pavan_test' *.txt | foreach { Remove-Item -Path $_.FullName }
    Get-ChildItem -Path 'D:pavan_test' *.xlsx | foreach { Remove-Item -Path $_.FullName }
    Get-ChildItem -Path 'D:pavan_test' *.sv$ | foreach { Remove-Item -Path $_.FullName }


    Please help me while getting the above script into proper phase like below..



    param (
    $Path = "D:pavan_test",
    $DaysOld = 2
    )
    Get-ChildItem $Path -Recurse -exclude *.txt, *.log,*.bak,*.dwf |
    Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-$DaysOld) -and $_.PsIsContainer -eq $false}












    share|improve this question









    New contributor




    Paawan Kumar Pala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.











    put on hold as unclear what you're asking by DavidPostill 20 hours ago


    Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.





















      0












      0








      0








      Below scripts was worked for me. but it was not in right phase.



      Get-ChildItem -Path 'D:pavan_test' *.bak | foreach { Remove-Item -Path $_.FullName }
      Get-ChildItem -Path 'D:pavan_test' *.log | foreach { Remove-Item -Path $_.FullName }
      Get-ChildItem -Path 'D:pavan_test' *.dwf | foreach { Remove-Item -Path $_.FullName }
      Get-ChildItem -Path 'D:pavan_test' *.lck | foreach { Remove-Item -Path $_.FullName }
      Get-ChildItem -Path 'D:pavan_test' *.txt | foreach { Remove-Item -Path $_.FullName }
      Get-ChildItem -Path 'D:pavan_test' *.xlsx | foreach { Remove-Item -Path $_.FullName }
      Get-ChildItem -Path 'D:pavan_test' *.sv$ | foreach { Remove-Item -Path $_.FullName }


      Please help me while getting the above script into proper phase like below..



      param (
      $Path = "D:pavan_test",
      $DaysOld = 2
      )
      Get-ChildItem $Path -Recurse -exclude *.txt, *.log,*.bak,*.dwf |
      Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-$DaysOld) -and $_.PsIsContainer -eq $false}












      share|improve this question









      New contributor




      Paawan Kumar Pala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      Below scripts was worked for me. but it was not in right phase.



      Get-ChildItem -Path 'D:pavan_test' *.bak | foreach { Remove-Item -Path $_.FullName }
      Get-ChildItem -Path 'D:pavan_test' *.log | foreach { Remove-Item -Path $_.FullName }
      Get-ChildItem -Path 'D:pavan_test' *.dwf | foreach { Remove-Item -Path $_.FullName }
      Get-ChildItem -Path 'D:pavan_test' *.lck | foreach { Remove-Item -Path $_.FullName }
      Get-ChildItem -Path 'D:pavan_test' *.txt | foreach { Remove-Item -Path $_.FullName }
      Get-ChildItem -Path 'D:pavan_test' *.xlsx | foreach { Remove-Item -Path $_.FullName }
      Get-ChildItem -Path 'D:pavan_test' *.sv$ | foreach { Remove-Item -Path $_.FullName }


      Please help me while getting the above script into proper phase like below..



      param (
      $Path = "D:pavan_test",
      $DaysOld = 2
      )
      Get-ChildItem $Path -Recurse -exclude *.txt, *.log,*.bak,*.dwf |
      Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-$DaysOld) -and $_.PsIsContainer -eq $false}









      powershell






      share|improve this question









      New contributor




      Paawan Kumar Pala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Paawan Kumar Pala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 20 hours ago









      DavidPostill

      106k26228263




      106k26228263






      New contributor




      Paawan Kumar Pala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 20 hours ago









      Paawan Kumar PalaPaawan Kumar Pala

      1




      1




      New contributor




      Paawan Kumar Pala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Paawan Kumar Pala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Paawan Kumar Pala is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      put on hold as unclear what you're asking by DavidPostill 20 hours ago


      Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









      put on hold as unclear what you're asking by DavidPostill 20 hours ago


      Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
























          0






          active

          oldest

          votes

















          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes

          Popular posts from this blog

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

          Tribunal Administrativo e Fiscal de Mirandela Referências Menu de...

          looking for continuous Screen Capture for retroactivly reproducing errors, timeback machineRolling desktop...