I’m extremely happy to announce Carbon v0.5.0.0. This should be the last release of Carbon before v1.0, which will probably be released in late February or early March. This is the most stable version of Carbon yet, and should be considered a beta of version 1.0.
In order to stabilize the API, make it internally consistent, and improve future maintainability, this release contains many backwards incompatible changes. We apologize for this inconvenience. API stability will be a high priority once v1.0 is out the door.
Please take some time within the next few weeks to download Carbon, and see how it works for you. If you notice any problems or have any suggestions, please file a bug report. Help us make Carbon even better!
Upgrade Instructions
Take the following steps to get your scripts to work with this release.
Certificates
Replaces usages of:
Get-SslCertificateBinding
withGet-SslCertificateBindings
Get-SslCertificateBinding -IPPort '0.0.0.0:443'
withGet-SslCertificateBindings
Get-SslCertificateBinding -IPPort '10.1.1.1:8001
withGet-SslCertificateBindings -IPAddress '10.1.1.1' -Port 8001
Test-SslCertificateBinding -IPPort '0.0.0.0:443
withTest-SslCertificateBinding
Test-SslCertificateBinding -IPPort '10.1.1.1:8001
withTest-SslCertificateBinding -IPAddress '10.1.1.1' -Port 8001
Set-SslCertificateBinding -IPPort '0.0.0.0:443
withSet-SslCertificateBinding
Set-SslCertificateBinding -IPort '1.2.3.4:8001' with
Set-SslCertificateBinding -IPAddress ‘1.2.3.4’ -Port 8001Remove-SslCertificateBinding -IPPort '0.0.0.0:443
withRemove-SslCertificateBinding
Remove-SslCertificateBinding -IPPort '10.1.1.1:8001
withRemove-SslCertificateBinding -IPAddress '10.1.1.1' -Port 8001
Computer
Replace usages of
Set-EnvironmentVariable -Scope 'Process'
withSet-EnvironmentVariable -ForProcess
Set-EnvironmentVariable -Scope 'User'
withSet-EnvironmentVariable -ForUser
Set-EnvironmentVariable -Scope 'ForComputer'
withSet-EnvironmentVariable -ForComputer
Cryptography
Protect-String -Scope CurrentUser
withProtect-String -ForUser
Protect-String -Scope LocalMachine
withProtect-String -ForComputer
IIS
- Renamed the
StatusCode
property on the object returned by Get-IisHttpRedirect toHttpResponseStatus
. Update usages accordingly. - The
Bindings
property returned byGet-IisWebsite
is now a collection ofMicrosoft.Web.Administration.Binding
objects. Update usages of$site.Bindings[$idx].IPAddress
and$site.Bindings[$idx].Port
to$site.Bindings[$idx].Endpoint.Address
and$site.Bindings[$idx].Endpoint.Port
, respectively.
Replace usages of:
Set-IisAnonymousAuthentication
withEnable-IisSecurityAuthentication -Anonymous
Set-IisAnonymousAuthentication -Disabled
withDisable-IisSecurityAuthentication -Anonymous
Set-IisBasicAuthentication
withEnable-IisSecurityAuthentication -Basic
Set-IisBasicAuthentication -Disabled
withDisable-IisSecurityAuthentication -Basic
Set-IisWindowsAuthentication
withEnable-IisSecurityAuthentication -Windows
andSet-IisWindowsAuthentication -DisableKernelMode
Set-IisWindowsAuthentication -UseKernelMode
withSet-IisWindowsAuthentication
Set-IisWindowsAuthentication -Disabled
withDisable-IisSecurityAuthentication -Windows
Unlock-IisConfigSection -Name <string>
withUnlock-IisConfigurationSection -SectionPath <string>
(runappcmd.exe lock config -section:?
for values to the newSectionPath
parameter)Unlock-IisBasicAuthentication
withUnlock-IisConfigurationSeciton -SectionPath 'system.webServer/security/authentication/basicAuthentication'
Unlock-IisCgi
withUnlock-IisConfigurationSeciton -SectionPath 'system.webServer/cgi'
Unlock-IisWindowsAuthentication
withUnlock-IisConfigurationSeciton -SectionPath 'system.webServer/security/authentication/windowsAuthentication'
INI
Replace usages of:
Split-Ini -Path <string>
withSplit-Ini -Path <string> -AsHashtable
(hashtable is no longer returned by default)Split-Ini -Path <string> -PassThru
withSplit-Ini -Path <string>
(per-line objects are now returned by default)
Path
Replace usages of
Get-PathRelativeTo -To <string> -From <string>'
withResolve-RelativePath -Path <string> -FromDirectory <string>
Get-PathRelativeTo -To <string> -From <string> -FromType 'File'
withResolve-RelativePath -Path <string> -FromFile <string>
Performance Counters
- Get-PerformanceCounters no longer returns an empty list if there are zero counters or a single element list if there is one counter. It now returns
null
and a single object, respectively. Update usages accordingly.
PowerShell
- Get-TrustedHosts no longer returns an empty list if there are no trusted hosts. It now return nothing/
null
. Update usages accordingly.
Security
- Assert-AdminPrivileges now returns
True
orFalse
if the user doesn’t have admin privileges. It also no longer throws an exception, but writes an error. If you want to preserve current behavior where it stops script execution, replace usages withAssert-AdminPrivileges -ErrorAction Stop
.
Shares
Replace usages of:
Install-Share -Permissions '"ShareAdmins,FULL"','"ShareWriters,CHANGE"','"ShareReaders,READ"'
withInstall-SmbShare -FullAccess ShareAdmins -ChangeAccess ShareWriters -ReadAccess ShareReaders
.
Windows Features
Replace usages of:
Test-WindowsFeature
withTest-WindowsFeature -Installed
Install-WindowsFeatureIis
withInstall-WindowsFeature -Iis
Install-WindowsFeatureIis -HttpRedirection
withInstall-WindowsFeature -Iis -IisHttpRedirection
Install-WindowsFeatureMsmq
withInstall-WindowsFeature -Msmq
Install-WindowsFeatureMsmq -HttpSupport
withInstall-WindowsFeature -Msmq -MsmqHttpSupport
Install-WindowsFeatureMsmq -ActiveDirectoryIntegration
withInstall-WindowsFeature -MsmqActiveDirectoryIntegration
New Features
IIS
- Created Get-IisConfigurationSection function for getting a site’s (and optional sub-directory’s) Microsoft.Web.Administration.ConfigurationSection.aspx) objects for an arbitrary IIS configuration section.
- Created Get-IisSecurityAuthentication function for getting a site’s (and optional sub-directory’s) anonymous, basic, digest, or Windows authentication configuration section.aspx).
- Created Test-IisSecurityAuthentication function for testing if anonymous, basic, digest, or Windows authentication is enabled for a website (and optional sub-directory).
- Created Get-IisConfigurationSection function for returning an arbitrary IIS configuration section using the Microsoft.Web.Administration API.
- Created Lock-IisConfigurationSection function for locking arbitrary global IIS configuration sections.
- Created Test-IisConfigurationSection function for testing if an configuration section exists or is locked or not.
- Created function Get-IisAppPool for getting a
Microsoft.Web.Administration.AppPool
object for an application pool. - Created function Uninstall-IisAppPool for removing an IIS application pool.
Windows Features
- Created new Get-WindowsFeature function for getting a list of available Windows features.
Bug Fixes
Service
- Install-Service not granting default service identity, Network Service, the correct permissions.
- Install-Service not correctly resolving local identity account names.
Enhancements
Certificates
- Moved functionality of
Get-SslCertificateBinding
into Get-SslCertificateBindings. Can now filter byIPAddress
and/orPort
. - Get-SslCertificateBindings now returns
Carbon.Certificates.SslCertificateBinding
objects. All information displayed by thenetsh http show sslcert
command is returned as part of those objects. - Get-SslCertificateBindings now supports filtering by
IPAddress
andPort
separately, instead of requiring both. The oldIPPort
parameter is replaced withIPAddress
andPort
parameters. - Test-SslCertificateBinding now supports testig by
IPAddress
andPort
separately, instead of requiring both. The oldIPPort
parameter is replaced withIPAddress
andPort
parameters. - Replaced
IPPort
parameter onGet-SslCertificateBinding
with separateIPAddress
andPort
parameters on Get-SslCertificateBindings. SetIPAddress
only if you want to bind to a specific IP address (i.e. not 0.0.0.0). SetPort
if not binding to port 443. - Replaced
IPPort
parameter on Remove-SslCertificateBinding with separateIPAddress
andPort
parameters. SetIPAddress
only if you want to remove a binding for a specific IP address (i.e. not 0.0.0.0). SetPort
if the binding is not on port 443. - Renamed
Remove-Certificate
to Uninstall-Certificate (added backwards-compatible alias in v0.5.0.1).
Computer
- Replaced the
Scope
parameter on Set-EnvironmentVariable and Remove-EnvironmentVariable with scope-specificForProcess
,ForUser
, andForComputer
switches.
Cryptography
- Replaced Protect-String’s
Scope
parameteter with theForUser
orForComputer
scope-specific switches.
Hosts File
- Set-HostsEntry no longer throws an exception if the hosts file contains an invalid line. Instead, a warning is written and the line is commented out.
INI
- Split-Ini now returns strongly-typed
Carbon.Ini.IniNode
objects instead of hashtables. - The line numbers returned by Split-Ini start at 1 instead of 0.
- Split-Ini now returns name/value objects by default (the
PassThru
switch is no longer needed for this behaviro). This makes it more PowerShell-y. The old behavior of returning aHashtable
is available be using the newAsHashtable
switch.
IIS
- Replaced
Set-IisAnonymousAuthentication
with Enable-IisSecurityAuthentication and Disable-IisSecurityAuthentication. - Replaced
Set-IisBasicAuthentication
with Enable-IisSecurityAuthentication and Disable-IisSecurityAuthentication. - Moved code to enable/disable Windows authentication from Set-IisWindowsAuthentication to Enable-IisSecurityAuthentication and Disable-IisSecurityAuthentication.
- Switched the default behavior of Set-IisWindowsAuthentication to enable kernel mode. To disable kernel mode, use the
DisableKernelMode
switch. - Renamed
Unlock-IisConfigSection
to Unlock-IisConfigurationSection. - Removed Unlock-IisConfigurationSection’s
Name
parameter and replaced it withSectionPath
, which takes a list of full path to the configuration section(s) to unlock. - Removed
Unlock-IisBasicAuthentication
in favor ofUnlock-IisConfigurationSection -SectionPath 'system.webServer/security/authentication/basicAuthentication'
. - Removed
Unlock-IisCgi
in favor ofUnlock-IisConfigurationSection -SectionPath 'system.webServer/cgi'
. - Removed
Unlock-IisWindowsAuthentication
in favor ofUnlock-IisConfigurationSection -SectionPath 'system.webServer/security/authentication/windowsAuthentication'
. - Renamed
Remove-Service
to Uninstall-Service (added backwards-compatible alias in v0.5.0.1). - Install-Service writes errors instead of throwing exceptions.
- Install-Service grants
ReadAndExecute
file system permissions on the service executable to the service identity instead ofFullControl
. - Improved Install-Service’s
WhatIf
support. - Renamed
Test-IisAppPoolExists
to Test-IisAppPool (added backwards-compatible alias in v0.5.0.1). - Renamed
Remove-IisWebsite
with Uninstall-IisWebsite (added backwards-compatible alias in v0.5.0.1). - Install-IisAppPool now always sets the application pool to run as the system’s default application pool identity if the
ServiceAccount
parameter isn’t given. - Install-IisAppPool now starts an IIS application pool if it is stoppped.
- Get-IisHttpRedirect now returns a
Carbon.Iis.HttpRedirectConfigurationSection
object. TheStatusCode
property on the old object is now namedHttpResponseStatus
. - Renamed the
StatusCode
parameter on Set-IisHttpRedirect toHttpResponseStatus
(added backwards-compatible alias in v0.5.0.1). - Get-IisWebsite now returns a
Microsoft.Web.Administration.Site
object.
MSMQ
- Renamed
Remove-MsmqMessageQueue
to Uninstall-MsmqMessageQueue (added backwards compatible alias in v0.5.0.1).
Path
- Renamed
Get-PathRelativeTo
to Resolve-RelativePath. Renamed itsTo
parameter toPath
, and moved it to position 0. Replaced/combined theFrom
andFromType
parameters withFromDirectory
andFromFile
parameters. - Renamed
ConvertTo-FullPath
to Resolve-FullPath (added backwards-compatible alias in v0.5.0.1). Added support for converting unrooted paths using the current location. - Renamed
Get-PathCanonicalCase
with Resolve-PathCase (added backwards-compatible alias in v0.5.0.1). Added support for piping inGet-Item
andGet-ChildItem
output, e.g.Get-Item C:\WINDOWS | Resolve-PathCase
returns C:\Windows.
Performance Counters
- Get-PerformanceCounters now returns nothing/
null
or a single object instead of an empty/single element array when there are no or one performance counters. - Install-PerformanceCounter no longer re-installs a counter if a counter with its name, description, and type already exist.
PowerShell
- Get-TrustedHosts now returns nothing/
null
if there are no trusted hosts. (It used to return an empty array.)
Security
- Assert-AdminPrivileges no longer throws an exception if the user doesn’t have administrative privileges. Instead, it writes an error and returns
False
. It returnsTrue
if the user has privileges.
Shares
- Replaced the
Permissions
parameter on Install-SmbShare withFullAccess
,ChangeAccess
, andReadAccess
parameters. Previously, to set share permissions, you passed in specially-formatted values to thePermission
parameter, e.g."MyGroup,FULL","MyOtherGroup,READ"
. Now, just pass a list of identity name(s) to theFullAccess
,ChangeAccess
, orReadAccess
parameters to grant those identies full, change, or read access, e.g.-FullAccess MyGroup -ReadAccess MyOtherGroup
.
Users and Groups
- Renamed
Remove-User
to Uninstall-User (added backwards-compatible alias in v0.5.0.1).
Windows Features
- Test-WindowsFeature now tests if a Windows feature exists, instead of if it is installed. Added an
Installed
switch to detect if a feature exists and if it is installed. - Renamed
Install-WindowsFeatures
to Install-WindowsFeature (added backwards-compatible alias in v0.5.0.1). - Renamed Install-WindowsFeature’s
Features
parameter toName
(added backwards-compatible alias in v0.5.0.1). - Removed
Install-WindowsFeatureIis
and replaced withIis
andIisHttpRedirection
switches on Install-WindowsFeature. - Removed
Install-WindowsFeatureMsmq
and replaced withMsmq
,MsmqHttpSupport
, andMsmqActiveDirectoryIntegration
switches on Install-WindowsFeature. - Renamed
Uninstall-WindowsFeatures
to Uninstall-WindowsFeature (added backwards-compatible alias in v0.5.0.1). - Renamed Uninstall-WindowsFeature’s
Features
parameter toName
(added backwards-compatible alias in v0.5.0.1). - Added
Iis
,IisHttpRedirection
,Msmq
,MsmqHttpSupport
, andHttpActiveDirectoryIntegration
switches to Uninstall-WindowsFeature. - Install-WindowsFeature, Test-WindowsFeature, and Uninstall-WindowsFeature are now available even if the current operating system doesn’t support managing Windows features. They don’t do anything in those situations, but they exist.
- Install-WindowsFeature, Test-WindowsFeature, and Uninstall-WindowsFeature are not available if the PowerShell v3.0 server manager cmdlets exists (on Windows 8/2012).
Miscellaneous
- Replaced all instances where functions were throwing exceptions with
Write-Error
. - The Carbon assembly is now versioned and signed.