Skip to content

Instantly share code, notes, and snippets.

@andikrueger
Last active December 19, 2017 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andikrueger/4a4c68f6511ecb1dbcec09ac06008424 to your computer and use it in GitHub Desktop.
Save andikrueger/4a4c68f6511ecb1dbcec09ac06008424 to your computer and use it in GitHub Desktop.
PowerShell DSC Script Resource to configure php_wincache.dll extension in php.ini file
Script PhpWinCache {
GetScript = {
return @{
Result = ""
}
}
TestScript = {
$iniFile = "$($phpDirectory)\php.ini"
$currentStatus = Select-String -Path $iniFile -Pattern "^extension=php_wincache.dll"
Write-Debug "$($currentStatus)"
return ($null -ne $currentStatus)
}
SetScript = {
$iniFile = "$($phpDirectory)\php.ini"
Add-Content -Path $iniFile -Value "`r`nextension=php_wincache.dll" -Force
}
DependsOn = @("[File]PhpWinCache", "[File]PhpIni")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment