Suppose I have a product which I want to install on a non SSD drive, if exists. Otherwise, I want it to go on the drive C.
For example, the following configuration is supposed to install the Sql Server 2016 in the default location:
Configuration DevWorkstation
{
Import-DscResource –ModuleName PSDesiredStateConfiguration
Import-DscResource -ModuleName SqlServerDsc
node localhost
{
WindowsFeature 'NetFramework45'
{
Name = 'NET-Framework-45-Core'
Ensure = 'Present'
}
SqlSetup 'InstallDefaultInstance'
{
InstanceName = 'MSSQLSERVER'
Features = 'SQLENGINE,SSMS'
SQLCollation = 'SQL_Latin1_General_CP1_CI_AS'
SourcePath = '\\fileserver\installs\en_sql_server_2016_developer_with_service_pack_1_x64_dvd_9548071'
SQLSysAdminAccounts = @('Administrators')
DependsOn = '[WindowsFeature]NetFramework45'
}
}
}
However, I would like to check first if there is a non SSD drive and if present install it there.
As I understand it, I cannot use Powershell code, because that code runs during compilation. I need it to run during the configuration.
How do I do it?