> pshdo

Carbon 2.5.0 Released

Carbon 2.5.0 is out. You can download Carbon as a .ZIP archive, NuGet package, Chocolatey package, or from the PowerShell Gallery. It may take a week or two for the package to show up at chocolatey.org.

Enhancements

  • Added DelayedAutoStart boolean property to objects returned by Get-ServiceConfiguration. This flag is true when a service is set to start automatically, delayed. False otherwise. Added extended
  • The Install-Service function and the Carbon_Service DSC resource can now set a service’s startup type to Automatic (Delayed). Pass Automatic to the StartupType parameter and use the new Delayed switch. The Delayed switch is ignored unless StartupType is Automatic. Fixes issue #216.
  • The Uninstall-Certificate function can now delete a certificate by just its thumbprint. The certificate will be uninstalled from all stores. You can pipe the thumbprint or a certificate object to Uninstall-Certificate.
  • Added an EnsureRunning switch to Install-Service function to ensure that any service is started after configuring. (By default, Install-Service leaves a service stopped if it was stopped when Install-Service begins.)
  • Added IsSymbolicLink extended type property to directory and file objects (i.e. System.IO.DirectoryInfo and System.IO.FileInfo objects).
  • Added TargetPath extended type property to file (i.e. System.IO.FileInfo) objects. If a file is a symbolic link, this property will return the file the link points to.
  • The TargetPath extended type property on directory (i.e. `System.IO.DirectoryInfo) objects now returns target paths when a directory is a symbolic link.
  • Initiazlie-Lcm can’t be used on Windows Server 2016 and later to put the DSC local configuration manager into pull mode. Initialize-Lcm now writes an error when you try.

Bug Fixes

  • Install-Service and the Carbon_Service DSC resource write errors when a service is running and its startup type is changed to Disabled.
  • The Carbon_ScheduledTask DSC resource writes incorrect information to verbose log when the current and desired credential for the scheduled task are different.
  • The Carbon_ScheduledTask DSC resource doesn’t correctly detect when a task’s identity has changed (it wasn’t converting usernames to their canonical representation before comparing the existing identity with the desired identity).
  • Fixed: Importing Carbon in 32-bit PowerShell fails on a 64-bit operating system. DSC isn’t available so the Initialize-Lcm function can’t be exported. Thanks to Anders Andersson for contribuging the fix.
  • Fixed: Install-Service and Carbon_Service DSC resource fail to change the identity a service runs as if switching from a custom account to the default NetworkService account.
  • Fixed: Get-PowerShellModuleInstallPath returns nothing when run under 32-bit (x86) PowerShell on 64-bit Windows.Fixed: Get-PowerShellModuleInstallPath returns nothing when run under 32-bit (x86) PowerShell on 64-bit Windows.

Carbon 2.4.1 Released

Carbon 2.4.1 is out. You can download Carbon as a .ZIP archive, NuGet package, Chocolatey package, or from the PowerShell Gallery. It may take a week or two for the package to show up at chocolatey.org.

Bug Fixes

  • Fixed: Carbon_Permission fails when revoking permissions and the Permissions property doesn’‘t have a value.
  • Fixed: Protect-String doesn’t convert secure strings properly so they get encrypted with extra bytes in them.
  • Fixed: `Revoke-Permission’ fails when an identity has multiple access control entries on an item. Thanks to [bozho](https://bitbucket.org/bozho/) for reporting issue #221 and contributing the fix.
  • Fixed: Compress-Item’ writes an error when using the WhatIf switch.
  • Fixed: Install-IisWebsite help examples contain invalid/broken code (thanks to John Mitchell for reporting).
  • Fixed: Install-Service fails when password contains double quote character, i.e. " (fixes issue #219).
  • Fixed: Read-File and Write-File fail to retry writing to a locked file when $Global:Error is full. Fixes issue #217.
  • Fixed: Get-FirewallRule sets the EdgeTraversalPolicy to DeferUser on rules whose policy is “defer to application”.
  • Fixed: Get-FirewallRule fails on non-english-speaking computers. (It was parsing the output of netsh advfirewall. Now it uses the Windows Firewall with Advanced Security API.) [Fixes issue #208.
  • Fixed: Get-FirewallRule incorrectly parsed interface types. It assumed interface type was one of multiple values. In reality, it can be set to one or more different values. The underlying enumeration and its values have been updated to be a set of flags (i.e. a bit field).
  • Fixed: Carbon_FirewallRule fails when Profile property has more than one value.
  • Fixed: Get-ScheduledTask doesn’t handle when a scheduled task doesn’t exist on Windows 2008.

Carbon 2.4.0 Released

Carbon 2.4.0 is out. You can download Carbon as a .ZIP archive, NuGet package, Chocolatey package, or from the PowerShell Gallery. It may take a week or two for the package to show up at chocolatey.org.

Enhancements

  • Protect-String can now encrypt a SecureString. The String parameter’s type was changed to [object]. When you pass in a SecureString, it is converted to an array of bytes, encrypted, and the array of bytes are cleared from memory.
  • Renamed Protect-Acl to Disable-AclInheritance to make it clearer what the function does. Created a Protect-Acl alias in place to preserve backwards-compatability.
  • Disable-AclInheritance only disables inheritance if it is currently enabled.
  • Created Enable-AclInheritance to re-enable access rule inheritance on file system and registry ACLs. This function is paired with Disable-AclInheritance.

Bug Fixes

  • Fixed: Get-ProgramInstallInfo fails when a program’s Version registry key value can’t be converted into a Version object.
  • Fixed: Test-Service failed to detect if a device driver service is installed.
  • Fixed: Install-Service fails if a service depends on a device driver. (Note: in our testing, we can’t get a device driver set as a dependency. If you know what the secret sauce is to get this to work with sc.exe (or another means), please let us know.)
  • Fixed: Disable-AclInheritance (ne Protect-Acl) fails when piped a registry key.
  • Fixed: Get-PathProvider fails when passed a fully-qualified registry key PowerShell path, e.g. Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\Software.

Carbon 2.3.0 Released

Carbon 2.3.0 is out. You can download Carbon as a .ZIP archive, NuGet package, Chocolatey package, or from the PowerShell Gallery. It may take a week or two for the package to show up at chocolatey.org.

Enhancements

  • Protect-String can now encrypt with a key, password, or passphrase (i.e. it can now encrypt with symmetric encryption).
  • Unprotect-String can now decrypt with a key, password, or passphrase (i.e. it can now decrypt using symmetric encryption).
  • Set-HostsEntry now supports IPv6 addresses (fixes issue).
  • Grant-Permission now supports creating Deny access rules. Use the new Type parameter. Fixes issue #152.
  • Set-EnvironmentVariable:
    • Added -Force switch to make all variable modifications immediately visible in the current PowerShell process’s env: drive. Restarts are no longer required.
    • You can now set an environment variable for other users. Use the Credential parameter to specify the user’s credentials. Fixes issue #151.
  • Remove-EnvironmentVariable:
    • Added -Force switch to make all variable removals immediately visible in the current PowerShell process’s env: drive. Restarts are no longer required.
    • You can now remove variables from multiple targets/scopes at once.
    • You can now remove an environment variable for other users. Use the Credential parameter to specify the user’s credentials.
  • Invoke-PowerShell:
    • It now runs PowerShell commands. Pass a string of PowerShell code with the Command parameter.
    • It now runs encoded PowerShell commands. Pass the string of PowerShell code with the Command parameter and use the -Encode switch.
    • It now runs scripts and commands as another user. Use the Credential parameter to pass the user’s credentials along with the FilePath and Command parameters to run scripts and commands, respectively.

Bug Fixes

  • Fixed: Set-RegistryKeyValue fails when -String parameter’s value is $null or empty (fixes issue #211).
  • Fixed: Can’t import Carbon in a 32-bit PowerShell 4 session on a 64-bit operating system (fixes issue #199).
  • Fixed: Documentation for the Install-ScheduledTask function’s HighestAvailableRunLevel is lying (fixes issue #205).
  • Fixed: Carbon_FirewallRule fails when Profile property set to multiple values (fixes issue #209).
  • Fixed: Install-IisAppPool can’t set .NET framework version to No Managed Code (fixes issue #210).
  • Fixed: Get-SslCertificateBinding fails if the operating system’s culture is not en-US (fixes issue #171).
  • Fixed: Install-ScheduledTask fails when creating a task that runs during a specific week of the month on Sundays. (You’re going to love this: the underlying int value for [DayOfWeek]::Sunday is 0, so when testing if a DayOfWeek typed variable set to Sunday has a value, it returns $false. This made Install-ScheduledTask add the /D parameter without a value.

Carbon 2.2.0 Released

Carbon 2.2.0 is out. You can download Carbon as a .ZIP archive, NuGet package, Chocolatey package, or from the PowerShell Gallery. It may take a week or two for the package to show up at chocolatey.org.

Enhancements

  • Aded a LiteralPath parameter to Test-PathIsJunction for testing paths that contain wildcard characters (e.g. [, ], etc.).
  • Remove-Junction now supports removing multiple junctions with wildcards.
  • Added a LiteralPath parameter to Remove-Junction for deleting junctions whose paths contain wildcard characters (e.g. [, ], etc.).
  • Added a LiteralPath parameter to Uninstall-Junction for deleting junctions whose paths contain wildcard characters (e.g. [, ], etc.).
  • Created Remove-DotNetAppSetting function for removing app settings from .NET framework machine.config files.
  • Created Read-File function for reading text files and retrying if the read fails. Good for reading files that get intermittently locked, like the Windows hosts file.
  • Created Write-File function for writing text files and retrying if the write fails. Good for writing files that get intermittently locked, like the Windows hosts file.
  • Made the following functions obsolete:
    • Get-WindowsFeature
    • Install-Msmq
    • Install-WindowsFeature
    • Resolve-WindowsFeatureName
    • Uninstall-WindowsFeature

Bug Fixes

  • Fixed: Add-GroupMember, over PowerShell remoting, fails to add a member to groups that have non-local users/groups (fixes issue #187: Add-GroupMember fails when using PowerShell Remoting)
  • Fixed: Remove-GroupMember, over PowerShell remoting, fails to remove a member from groups that have non-local users/groups.
  • Fixed: Test-PathIsJunction returns multiple results if the Path parameter contains wildcards and matches multiple items.
  • Fixed: Install-Junction can’t install a junction whose path contains wildcard characters (fixes issue #190).
  • Fixed: New-Junction writes wrong error when creating an existing junction whose path contains wildcard characters.
  • Fixed: Install-Service doesn’t update/change an existing service’s account when using the Credential parameter (fixes issue #185).
  • Fixed: Uninstall-FileShare fails if a share’s physical path doesn’t exist.
  • Fixed (hopefully): Get-FileSharePermission writes an error if a share’s security information is corrupted (fixes issue #188). I was unable to reproduce the error, and the error was reported anonyously, so I did my best.
  • Fixed: Get-PowerShellModuleInstallPath returns multiple paths if the standard PowerShell module path is listed twice in the PSModulePath environment variable.
  • Fixed: Chocolatey package fails if the standard PowerShell module path is listed twice in thePSModulePath environment (fixes issue #192).
  • Fixed: Get-PowerShellModuleInstallPath doesn’t return the module install path if it doesn’t exist. Sometimes it doesn’t yet.
  • Fixed: Carbon_ScheduledTask and Carbon_IniFile DSC resources’ Get-TargetResource functions don’t return correct resource properties and causes Get-DscConfiguration to fail (fixes issue #193).
  • Fixed: Carbon_FirewallRule DSC resource always re-installs a firewall rule if Profile property contains multiple values (i.e. it doesn’t properly parse netsh output).
  • Fixed: about_Carbon_Installation help topic had a typo.
  • Fixed: Set-HostsEntry fails to stop when the hosts file is in use and can’t be read.

Carbon 2.1.1 Released

Carbon 2.1.1 is out. You can download Carbon as a .ZIP archive, NuGet package, Chocolatey package, or from the PowerShell Gallery. It may take a week or two for the package to show up at chocolatey.org.

Bug Fixes

  • Fixed: unable to publish module to PowerShell Gallery because RequiredAssemblies module manifest data used an absolute path generated with Join-Path and $PSScriptRoot, which aren’t allowed in module manifests.
  • Fixed: missing PowerShell Gallery tags, license URI, project URI, and release notes metadata.
  • Fixed: copyright date in module manifest is 2015.
  • Fixed: PowerShell gallery missing function list.
  • Fixed: Restricted user accounts can’t import Carbon (issue #180).
  • Fixed: Carbon_Privilege DSC resource fails to remove all a user’s privileges (issue #178).
  • Fixed: Remove-IniEntry fails to remove last INI entry in a file (issue #179).

Carbon 2.1.0 Released

Carbon 2.1.0 is out. You can download Carbon as a .ZIP archive, NuGet package, Chocolatey package, or from the PowerShell Gallery. It may take a week or two for the package to show up at chocolatey.org.

New Functions

  • Get-HttpUrlAcl: uses Windows API to return HTTP URL ACLs; replaces the netsh http show urlacl command.
  • Grant-HttpUrlPermission: uses Windows API to grant listen/delegate permissions on HTTP URLs; replaces the netsh http add urlacl command.
  • Revoke-HttpUrlPermission: uses Windows API to revoke all a user or group’s permissions on HTTP URLs; replaces the netsh http delete urlacl command.
  • Install-Directory: creates a directory (and any missing parents), if it doesn’t exist already. Finally!
  • Uninstall-Directory: removes a directory, if it exists. Finally!
  • Uninstall-Group: uses the DirectoryServices.AccountManagement .NET API to remove a group, if it exists.
  • Test-GroupMember: uses the DirectoryServices.AccountManagemetn .NET API to test if a principal is a member of a group.

New DSC Resource

  • Carbon_Group: resource for configuring local groups.

Bug Fixes

  • Fixed: Install-FileShare always re-configures existing shares; it doesn’t properly detect permissions that need to be removed.
  • Fixed: Set-IniEntry fails to preserve unicode characters with diacritics in INI entry names and values.
  • Fixed: Remove-IniEntry fails to preserve unicode characters with diacritics in INI entry names and values.
  • Fixed: Set-HostsEntry leaves trailing tabs and whitespace after all but the last line.
  • Fixed: Get-PowerShellModuleInstallPath returns wrong path for PowerShell 4.
  • Fixed: Protect-String fails when Carbon is installed in a module path that contains spaces (fixes issue #174).
  • Fixed: New-RsaKeyPair generates a key pair that isn’t supported for encrypting/decrypting DSC credentials or supported by the CMS message cmdlets.
  • Fixed: Get-ScheduledTask returns invalid task commands when those commands contain quotes (works around an issue where schtasks.exe CSV output can’t be parsed correctly by ConvertFrom-Csv).
  • Fixed: Add-GroupMember and Remove-GroupMember fail when adding Everyone or NT Service\* accounts to a group (fixes issue #177).
  • Fixed: Get-SheduledTask writes an error if a scheduled task’s XML definition is for an executable and doesn’t contain an arguments element.

Other Improvements

  • Obsolete function parameters will no longer show in Intellisense (added the DontShow parameter property).
  • Test-AdminPrivilege: changed its verbose message to a debug message.
  • Set-HostsEntry:
    • only updates hosts file if it needs to change
    • added an improved verbose message when setting a hosts entry
    • improved error handling when hosts file can’t be opened for reading
  • Install-Certificate can now install a certificate on a remote computer.
  • Initialize-Lcm now uses Install-Certificate to install the decryption certificate on the remote computer.
  • Uninstall-Certificate can now uninstall a certificate on a remote computer.
  • The following functions now write warning if you pass them a plain-text password. You should pass a SecureString instead.
    • Install-Certificate
    • Initialize-Lcm
  • New-RsaKeyPair:
    • Refactored to use certreq.exe instead of makecert.exe and pvk2pfx.exe.
    • Can now run non-interactively: added a -Password parameter used to protect the private key (it used to prompt you).
    • Fixed: generates a key pair that isn’t supported for encrypting/decrypting DSC credentials or supported by the CMS message cmdlets.
    • Made the -ValidFrom and -Authority parameters obsolete.
  • Added some verbose messages to Install-Group and Add-MemberToGroup when they create/modify their objects.
  • Install-Group only saves changes to a group if changes were made.

Carbon 2.0.1 Released

Carbon 2.0.1 is out. You can download Carbon as a .ZIP archive, NuGet package, Chocolatey package, or from the PowerShell Gallery. It may take a week or two for the package to show up at chocolatey.org.