This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure path to the root of your web project | |
$webRoot = "C:\inetpub\wwwroot\Kentico\CMS\" | |
$bin = $webRoot + "bin\" | |
# Load settings from web.config | |
[System.AppDomain]::CurrentDomain.SetData("APP_CONFIG_FILE", $webRoot + "web.config") | |
Add-Type -AssemblyName System.Configuration | |
[Configuration.ConfigurationManager].GetField("s_initState", "NonPublic, Static").SetValue($null, 0) | |
[Configuration.ConfigurationManager].GetField("s_configSystem", "NonPublic, Static").SetValue($null, $null) | |
([Configuration.ConfigurationManager].Assembly.GetTypes() | where {$_.FullName -eq "System.Configuration.ClientConfigPaths"})[0].GetField("s_current", "NonPublic, Static").SetValue($null, $null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$url = "http://localhost/kentico/rest/CMS.User/administrator" | |
# Enter correct username:password | |
$credentialsBytes = [System.Text.Encoding]::UTF8.GetBytes("administrator:") | |
$credentialsEncoded = [System.Convert]::ToBase64String($credentialsBytes) | |
$headers = @{} | |
$headers.Add("Authorization", "Basic $($credentialsEncoded)") | |
# Change requested mime/type |
NewerOlder