I am using a script which deletes files older than X days. Right now I put the variables right into the script.
Since I am still new to powershell i just know that there is a way to put the variables to a different file and then let the script "load" them.

now I have it like this :

```
#----- get current date ----#
$Now = Get-Date
#----- define amount of days ----#
$Days = "5"
#----- define folder where files are located ----#
$TargetFolder = "C:\www\data"
#----- define extension ----#
$Extension = "*.zip"
#----- define LastWriteTime parameter based on $Days ---# 
$LastWrite = $Now.AddDays(-$Days)

#----- get files based on lastwrite filter and specified folder ---#

"Script Exection Modes" 

"1 - Display all Configurations that are older than $Days days!" 
"2 - Delete all Configurations that are older than $Days days!"

$mode = Read-Host "Please select mode"

if ($mode -eq 1)

{$Files = Get-Childitem $TargetFolder -Include $Extension -Recurse | Where {$_.LastWriteTime -le "$LastWrite"} | where {$_.name -ne "configuration.zip"}

foreach ($File in $Files)
     {
if ($File -ne $NULL)
       {
         write-host $File.FullName -foregroundcolor "green"
         }
     else
          {
         Write-Host "No configurations found that are older than $Days days" -foregroundcolor "Green"
    }
}
}

if ($mode -eq 2)

{$Files = Get-Childitem $TargetFolder -Include $Extension -Recurse | Where {$_.LastWriteTime -le "$LastWrite"} | where {$_.name -ne "configuration.zip"}

foreach ($File in $Files)
     {
if ($File -ne $NULL)
       {
        write-host "Deleting File $File" -ForegroundColor "Red"
         Remove-Item $File.FullName -Whatif
         }
     else
          {
         Write-Host "Deletion complete" -foregroundcolor "Green"
    }
}
}

```

I want the Variable `$days` and the mode selection moved to another file. so that you either run script in mode 1 or in mode 2 without changing anything in this file.