Skip to content

Commit

Permalink
Set LoggingPath dynamically
Browse files Browse the repository at this point in the history
use task sequence variable %OSDTargetSystemDrive% to set logging path
  • Loading branch information
mt7479 committed Apr 4, 2017
1 parent ef6b387 commit bf02415
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions Scripts/Get-DriverPackages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ try
# Import PS Modules
ImportPsModules

# Set Logging Path
SetLoggingPath

# Create and add more funcitons

# Import Driver Package XML created from SCCM
Expand Down Expand Up @@ -61,10 +64,6 @@ try

#Script variables. Modify as necessary

$Script:LoggingPath = 'c:\Windows\Temp\Get-DriverPackages.log'
LogTraceMessage "Variable LoggingPath set to $script:LoggingPath"
Write-Verbose "Variable LoggingPath set to $script:LoggingPath"

# Add variables here

$Script:DefaultDriverPacakge = 'TEE00026'
Expand Down Expand Up @@ -205,6 +204,22 @@ try
[array]$script:TraceMessage += (Get-Date).ToString() + ': ' + $strMessage + '~~'
}

Function SetLoggingPath
{
# Function Started
LogTraceMessage "*** Function SetLoggingPath ***"
Write-Verbose "*** Function SetLoggingPath Started ***"

$script:LoggingPath = $script:tsenv.Value("OSDTargetSystemDrive") + "\windows\temp\Get-DriverPackages.log"

LogTraceMessage "SetLoggingPath = $script:LoggingPath"
Write-Verbose "SetLoggingPath = $script:LoggingPath"

# Function Finished
LogTraceMessage "*** Function SetLoggingPath Finished ***"
Write-Verbose "*** Function SetLoggingPath Finished ***"
}

# Script Started
LogTraceMessage "*** Get-DriverPacakge ***"
Write-Verbose "*** Get-DriverPacakge ***"
Expand Down

0 comments on commit bf02415

Please sign in to comment.