Skip to content

Instantly share code, notes, and snippets.

@andikrueger
Last active December 19, 2017 09:49
Embed
What would you like to do?
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