> pshdo

Carbon v0.5.0.0 Released

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 with Get-SslCertificateBindings
  • Get-SslCertificateBinding -IPPort '0.0.0.0:443' with Get-SslCertificateBindings
  • Get-SslCertificateBinding -IPPort '10.1.1.1:8001 with Get-SslCertificateBindings -IPAddress '10.1.1.1' -Port 8001
  • Test-SslCertificateBinding -IPPort '0.0.0.0:443 with Test-SslCertificateBinding
  • Test-SslCertificateBinding -IPPort '10.1.1.1:8001 with Test-SslCertificateBinding -IPAddress '10.1.1.1' -Port 8001
  • Set-SslCertificateBinding -IPPort '0.0.0.0:443 with Set-SslCertificateBinding
  • Set-SslCertificateBinding -IPort '1.2.3.4:8001' withSet-SslCertificateBinding -IPAddress ‘1.2.3.4’ -Port 8001
  • Remove-SslCertificateBinding -IPPort '0.0.0.0:443 with Remove-SslCertificateBinding
  • Remove-SslCertificateBinding -IPPort '10.1.1.1:8001 with Remove-SslCertificateBinding -IPAddress '10.1.1.1' -Port 8001

Computer

Replace usages of

  • Set-EnvironmentVariable -Scope 'Process' with Set-EnvironmentVariable -ForProcess
  • Set-EnvironmentVariable -Scope 'User' with Set-EnvironmentVariable -ForUser
  • Set-EnvironmentVariable -Scope 'ForComputer' with Set-EnvironmentVariable -ForComputer

Cryptography

  • Protect-String -Scope CurrentUser with Protect-String -ForUser
  • Protect-String -Scope LocalMachine with Protect-String -ForComputer

IIS

  • Renamed the StatusCode property on the object returned by Get-IisHttpRedirect to HttpResponseStatus. Update usages accordingly.
  • The Bindings property returned by Get-IisWebsite is now a collection of Microsoft.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 with Enable-IisSecurityAuthentication -Anonymous
  • Set-IisAnonymousAuthentication -Disabled with Disable-IisSecurityAuthentication -Anonymous
  • Set-IisBasicAuthentication with Enable-IisSecurityAuthentication -Basic
  • Set-IisBasicAuthentication -Disabled with Disable-IisSecurityAuthentication -Basic
  • Set-IisWindowsAuthentication with Enable-IisSecurityAuthentication -Windows and Set-IisWindowsAuthentication -DisableKernelMode
  • Set-IisWindowsAuthentication -UseKernelMode with Set-IisWindowsAuthentication
  • Set-IisWindowsAuthentication -Disabled with Disable-IisSecurityAuthentication -Windows
  • Unlock-IisConfigSection -Name <string> with Unlock-IisConfigurationSection -SectionPath <string> (run appcmd.exe lock config -section:? for values to the new SectionPath parameter)
  • Unlock-IisBasicAuthentication with Unlock-IisConfigurationSeciton -SectionPath 'system.webServer/security/authentication/basicAuthentication'
  • Unlock-IisCgi with Unlock-IisConfigurationSeciton -SectionPath 'system.webServer/cgi'
  • Unlock-IisWindowsAuthentication with Unlock-IisConfigurationSeciton -SectionPath 'system.webServer/security/authentication/windowsAuthentication'

INI

Replace usages of:

  • Split-Ini -Path <string> with Split-Ini -Path <string> -AsHashtable (hashtable is no longer returned by default)
  • Split-Ini -Path <string> -PassThru with Split-Ini -Path <string> (per-line objects are now returned by default)

Path

Replace usages of

  • Get-PathRelativeTo -To <string> -From <string>' with Resolve-RelativePath -Path <string> -FromDirectory <string>
  • Get-PathRelativeTo -To <string> -From <string> -FromType 'File' with Resolve-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 or False 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 with Assert-AdminPrivileges -ErrorAction Stop.

Shares

Replace usages of:

  • Install-Share -Permissions '"ShareAdmins,FULL"','"ShareWriters,CHANGE"','"ShareReaders,READ"' with Install-SmbShare -FullAccess ShareAdmins -ChangeAccess ShareWriters -ReadAccess ShareReaders.

Windows Features

Replace usages of:

  • Test-WindowsFeature with Test-WindowsFeature -Installed
  • Install-WindowsFeatureIis with Install-WindowsFeature -Iis
  • Install-WindowsFeatureIis -HttpRedirection with Install-WindowsFeature -Iis -IisHttpRedirection
  • Install-WindowsFeatureMsmq with Install-WindowsFeature -Msmq
  • Install-WindowsFeatureMsmq -HttpSupport with Install-WindowsFeature -Msmq -MsmqHttpSupport
  • Install-WindowsFeatureMsmq -ActiveDirectoryIntegration with Install-WindowsFeature -MsmqActiveDirectoryIntegration

New Features

IIS

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 by IPAddress and/or Port.
  • Get-SslCertificateBindings now returns Carbon.Certificates.SslCertificateBinding objects. All information displayed by the netsh http show sslcert command is returned as part of those objects.
  • Get-SslCertificateBindings now supports filtering by IPAddress and Port separately, instead of requiring both. The old IPPort parameter is replaced with IPAddress and Port parameters.
  • Test-SslCertificateBinding now supports testig by IPAddress and Port separately, instead of requiring both. The old IPPort parameter is replaced with IPAddress and Port parameters.
  • Replaced IPPort parameter on Get-SslCertificateBinding with separate IPAddress and Port parameters on Get-SslCertificateBindings. Set IPAddress only if you want to bind to a specific IP address (i.e. not 0.0.0.0). Set Port if not binding to port 443.
  • Replaced IPPort parameter on Remove-SslCertificateBinding with separate IPAddress and Port parameters. Set IPAddress only if you want to remove a binding for a specific IP address (i.e. not 0.0.0.0). Set Port if the binding is not on port 443.
  • Renamed Remove-Certificate to Uninstall-Certificate (added backwards-compatible alias in v0.5.0.1).

Computer

Cryptography

  • Replaced Protect-String’s Scope parameteter with the ForUser or ForComputer 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 a Hashtable is available be using the new AsHashtable switch.

IIS

MSMQ

Path

  • Renamed Get-PathRelativeTo to Resolve-RelativePath. Renamed its To parameter to Path, and moved it to position 0. Replaced/combined the From and FromType parameters with FromDirectory and FromFile 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 in Get-Item and Get-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 returns True if the user has privileges.

Shares

  • Replaced the Permissions parameter on Install-SmbShare with FullAccess, ChangeAccess, and ReadAccess parameters. Previously, to set share permissions, you passed in specially-formatted values to the Permission parameter, e.g. "MyGroup,FULL","MyOtherGroup,READ". Now, just pass a list of identity name(s) to the FullAccess, ChangeAccess, or ReadAccess 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

Miscellaneous

  • Replaced all instances where functions were throwing exceptions with Write-Error.
  • The Carbon assembly is now versioned and signed.