Steven Ford
Steven Ford

Reputation: 1

Backup / copy of files from a specific appdata folder

I'm fairly new to using PowerShell and doing something like this.

I'd like to create a PowerShell script that I can share with other to copy over specific app data folder to an alternative drive.

I have this working for myself using the following $sourceDirectory = "C:\Users\*username*\AppData\Roaming\obs-studio\logs" $destinationDirectory = "C:\OBS Log Archive" Copy-item -Force -Recurse -Verbose $sourceDirectory -Destination $destinationDirectory

This works locally for me on my computer without issues.

I need to be able to replace username with a variable of the current user as others will be using this.

I'm not sure how to replace "username" with the user on another computer (variable I believe).

I would like to provide the user with an opportunity to identify / create a destination folder and determine the timeframe to retain files in the destination - i.e. 3, 7, 30, 90 days.

Upvotes: 0

Views: 8

Answers (0)

Related Questions