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-SslCertificateBindingwithGet-SslCertificateBindingsGet-SslCertificateBinding -IPPort '0.0.0.0:443'withGet-SslCertificateBindingsGet-SslCertificateBinding -IPPort '10.1.1.1:8001withGet-SslCertificateBindings -IPAddress '10.1.1.1' -Port 8001Test-SslCertificateBinding -IPPort '0.0.0.0:443withTest-SslCertificateBindingTest-SslCertificateBinding -IPPort '10.1.1.1:8001withTest-SslCertificateBinding -IPAddress '10.1.1.1' -Port 8001Set-SslCertificateBinding -IPPort '0.0.0.0:443withSet-SslCertificateBindingSet-SslCertificateBinding -IPort '1.2.3.4:8001' withSet-SslCertificateBinding -IPAddress ‘1.2.3.4’ -Port 8001Remove-SslCertificateBinding -IPPort '0.0.0.0:443withRemove-SslCertificateBindingRemove-SslCertificateBinding -IPPort '10.1.1.1:8001withRemove-SslCertificateBinding -IPAddress '10.1.1.1' -Port 8001
Computer
Replace usages of
Set-EnvironmentVariable -Scope 'Process'withSet-EnvironmentVariable -ForProcessSet-EnvironmentVariable -Scope 'User'withSet-EnvironmentVariable -ForUserSet-EnvironmentVariable -Scope 'ForComputer'withSet-EnvironmentVariable -ForComputer
Cryptography
Protect-String -Scope CurrentUserwithProtect-String -ForUserProtect-String -Scope LocalMachinewithProtect-String -ForComputer
IIS
- Renamed the
StatusCodeproperty on the object returned by Get-IisHttpRedirect toHttpResponseStatus. Update usages accordingly. - The
Bindingsproperty returned byGet-IisWebsiteis now a collection ofMicrosoft.Web.Administration.Bindingobjects. Update usages of$site.Bindings[$idx].IPAddressand$site.Bindings[$idx].Portto$site.Bindings[$idx].Endpoint.Addressand$site.Bindings[$idx].Endpoint.Port, respectively.
Replace usages of:
Set-IisAnonymousAuthenticationwithEnable-IisSecurityAuthentication -AnonymousSet-IisAnonymousAuthentication -DisabledwithDisable-IisSecurityAuthentication -AnonymousSet-IisBasicAuthenticationwithEnable-IisSecurityAuthentication -BasicSet-IisBasicAuthentication -DisabledwithDisable-IisSecurityAuthentication -BasicSet-IisWindowsAuthenticationwithEnable-IisSecurityAuthentication -WindowsandSet-IisWindowsAuthentication -DisableKernelModeSet-IisWindowsAuthentication -UseKernelModewithSet-IisWindowsAuthenticationSet-IisWindowsAuthentication -DisabledwithDisable-IisSecurityAuthentication -WindowsUnlock-IisConfigSection -Name <string>withUnlock-IisConfigurationSection -SectionPath <string>(runappcmd.exe lock config -section:?for values to the newSectionPathparameter)Unlock-IisBasicAuthenticationwithUnlock-IisConfigurationSeciton -SectionPath 'system.webServer/security/authentication/basicAuthentication'Unlock-IisCgiwithUnlock-IisConfigurationSeciton -SectionPath 'system.webServer/cgi'Unlock-IisWindowsAuthenticationwithUnlock-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> -PassThruwithSplit-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
nulland 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
TrueorFalseif 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-WindowsFeaturewithTest-WindowsFeature -InstalledInstall-WindowsFeatureIiswithInstall-WindowsFeature -IisInstall-WindowsFeatureIis -HttpRedirectionwithInstall-WindowsFeature -Iis -IisHttpRedirectionInstall-WindowsFeatureMsmqwithInstall-WindowsFeature -MsmqInstall-WindowsFeatureMsmq -HttpSupportwithInstall-WindowsFeature -Msmq -MsmqHttpSupportInstall-WindowsFeatureMsmq -ActiveDirectoryIntegrationwithInstall-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.AppPoolobject 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-SslCertificateBindinginto Get-SslCertificateBindings. Can now filter byIPAddressand/orPort. - Get-SslCertificateBindings now returns
Carbon.Certificates.SslCertificateBindingobjects. All information displayed by thenetsh http show sslcertcommand is returned as part of those objects. - Get-SslCertificateBindings now supports filtering by
IPAddressandPortseparately, instead of requiring both. The oldIPPortparameter is replaced withIPAddressandPortparameters. - Test-SslCertificateBinding now supports testig by
IPAddressandPortseparately, instead of requiring both. The oldIPPortparameter is replaced withIPAddressandPortparameters. - Replaced
IPPortparameter onGet-SslCertificateBindingwith separateIPAddressandPortparameters on Get-SslCertificateBindings. SetIPAddressonly if you want to bind to a specific IP address (i.e. not 0.0.0.0). SetPortif not binding to port 443. - Replaced
IPPortparameter on Remove-SslCertificateBinding with separateIPAddressandPortparameters. SetIPAddressonly if you want to remove a binding for a specific IP address (i.e. not 0.0.0.0). SetPortif the binding is not on port 443. - Renamed
Remove-Certificateto Uninstall-Certificate (added backwards-compatible alias in v0.5.0.1).
Computer
- Replaced the
Scopeparameter on Set-EnvironmentVariable and Remove-EnvironmentVariable with scope-specificForProcess,ForUser, andForComputerswitches.
Cryptography
- Replaced Protect-String’s
Scopeparameteter with theForUserorForComputerscope-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.IniNodeobjects 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
PassThruswitch is no longer needed for this behaviro). This makes it more PowerShell-y. The old behavior of returning aHashtableis available be using the newAsHashtableswitch.
IIS
- Replaced
Set-IisAnonymousAuthenticationwith Enable-IisSecurityAuthentication and Disable-IisSecurityAuthentication. - Replaced
Set-IisBasicAuthenticationwith 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
DisableKernelModeswitch. - Renamed
Unlock-IisConfigSectionto Unlock-IisConfigurationSection. - Removed Unlock-IisConfigurationSection’s
Nameparameter and replaced it withSectionPath, which takes a list of full path to the configuration section(s) to unlock. - Removed
Unlock-IisBasicAuthenticationin favor ofUnlock-IisConfigurationSection -SectionPath 'system.webServer/security/authentication/basicAuthentication'. - Removed
Unlock-IisCgiin favor ofUnlock-IisConfigurationSection -SectionPath 'system.webServer/cgi'. - Removed
Unlock-IisWindowsAuthenticationin favor ofUnlock-IisConfigurationSection -SectionPath 'system.webServer/security/authentication/windowsAuthentication'. - Renamed
Remove-Serviceto Uninstall-Service (added backwards-compatible alias in v0.5.0.1). - Install-Service writes errors instead of throwing exceptions.
- Install-Service grants
ReadAndExecutefile system permissions on the service executable to the service identity instead ofFullControl. - Improved Install-Service’s
WhatIfsupport. - Renamed
Test-IisAppPoolExiststo Test-IisAppPool (added backwards-compatible alias in v0.5.0.1). - Renamed
Remove-IisWebsitewith 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
ServiceAccountparameter isn’t given. - Install-IisAppPool now starts an IIS application pool if it is stoppped.
- Get-IisHttpRedirect now returns a
Carbon.Iis.HttpRedirectConfigurationSectionobject. TheStatusCodeproperty on the old object is now namedHttpResponseStatus. - Renamed the
StatusCodeparameter on Set-IisHttpRedirect toHttpResponseStatus(added backwards-compatible alias in v0.5.0.1). - Get-IisWebsite now returns a
Microsoft.Web.Administration.Siteobject.
MSMQ
- Renamed
Remove-MsmqMessageQueueto Uninstall-MsmqMessageQueue (added backwards compatible alias in v0.5.0.1).
Path
- Renamed
Get-PathRelativeToto Resolve-RelativePath. Renamed itsToparameter toPath, and moved it to position 0. Replaced/combined theFromandFromTypeparameters withFromDirectoryandFromFileparameters. - Renamed
ConvertTo-FullPathto Resolve-FullPath (added backwards-compatible alias in v0.5.0.1). Added support for converting unrooted paths using the current location. - Renamed
Get-PathCanonicalCasewith Resolve-PathCase (added backwards-compatible alias in v0.5.0.1). Added support for piping inGet-ItemandGet-ChildItemoutput, e.g.Get-Item C:\WINDOWS | Resolve-PathCasereturns C:\Windows.
Performance Counters
- Get-PerformanceCounters now returns nothing/
nullor 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/
nullif 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 returnsTrueif the user has privileges.
Shares
- Replaced the
Permissionsparameter on Install-SmbShare withFullAccess,ChangeAccess, andReadAccessparameters. Previously, to set share permissions, you passed in specially-formatted values to thePermissionparameter, e.g."MyGroup,FULL","MyOtherGroup,READ". Now, just pass a list of identity name(s) to theFullAccess,ChangeAccess, orReadAccessparameters to grant those identies full, change, or read access, e.g.-FullAccess MyGroup -ReadAccess MyOtherGroup.
Users and Groups
- Renamed
Remove-Userto 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
Installedswitch to detect if a feature exists and if it is installed. - Renamed
Install-WindowsFeaturesto Install-WindowsFeature (added backwards-compatible alias in v0.5.0.1). - Renamed Install-WindowsFeature’s
Featuresparameter toName(added backwards-compatible alias in v0.5.0.1). - Removed
Install-WindowsFeatureIisand replaced withIisandIisHttpRedirectionswitches on Install-WindowsFeature. - Removed
Install-WindowsFeatureMsmqand replaced withMsmq,MsmqHttpSupport, andMsmqActiveDirectoryIntegrationswitches on Install-WindowsFeature. - Renamed
Uninstall-WindowsFeaturesto Uninstall-WindowsFeature (added backwards-compatible alias in v0.5.0.1). - Renamed Uninstall-WindowsFeature’s
Featuresparameter toName(added backwards-compatible alias in v0.5.0.1). - Added
Iis,IisHttpRedirection,Msmq,MsmqHttpSupport, andHttpActiveDirectoryIntegrationswitches 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.