I was wondering if there was a way to delete multiple files in a directory, but not ALL the files. I know That with the dsc File resource you can delete the contents of a directory with the recurse=$true statement, but lets say I had 3 files in a directory named
And I only wanted to delete the files with the numbers in them. I tried using this value in the DestinationPath:
DestinationPath = "C:\Users\******\Desktop\MISC\example_log_test_folder\file.txt.*"
But powershell returned thsi to me:
Wildcard characters are not supported in DestinationPath property.
So I assume that powershell dsc doesnt recognize wildcards for manipulating multiple objects I think. So is there a way to delete multiple files with out having to declare a bunch of dsc statements?
You'd need to do a custom resource, or a Script resource.
You must be logged in to reply to this topic.