troubleshooting Question

Powershell - Import File based on Day

Avatar of dann47
dann47 asked on
2 Comments1 Solution64 ViewsLast Modified:
I have a powershell script, that is going to be used by patching, at the moment i am having a different script for each day, that is importing a file based on that day - IE Monday Tuesday etc.  I have 2 variables that i am having to change on each script.  So question is, is there a way i can get powershell to import the file name based on day ?

For example, if a Thu import the below

#Variables For File Names

$fileName = "C:\Patching\Schedule\WinA-Test_Thu.txt"
$csvname =  "C:\Patching\Schedule\WinA-Test_Thu.csv"
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros