Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* stable: (GH-1203) Ensure PowerShell uses CRLF (GH-1200) Export built-in functions early (maint) Update NuGet.Core (maint) update scenarios (GH-1054) Document requested execution levels (GH-1054) Externalize the app.manifest
- Loading branch information
Showing
48 changed files
with
1,319 additions
and
1,297 deletions.
There are no files selected for viewing
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
Binary file not shown.
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<assemblyIdentity version="1.0.0.0" name="choco.app"/> | ||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> | ||
<security> | ||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
<!-- UAC Manifest Options | ||
Specifying requestedExecutionLevel node (below) will disable file and | ||
registry virtualization. | ||
Set level to "asInvoker" when you want choco to run under the context | ||
of the user invoking. This is the same as Chocolatey behavior prior | ||
to 0.10.4. | ||
Set level to "requireAdministrator" to only allow administrators to | ||
run Chocolatey. | ||
Set level to "highestAvailable" to allow non-admins to run in | ||
non-administrative context, but require administrators to always run | ||
with administrative privileges. This is the recommended and default | ||
behavior of Chocolatey v0.10.4+. | ||
NOTE: Currently you will need to make this change every time | ||
Chocolatey is re-installed or upgraded (every new version). At least | ||
for now - https://github.com/chocolatey/choco/issues/1206 | ||
The following is an unsupported use case: If you want to utilize File | ||
and Registry Virtualization for backward compatibility then delete | ||
the requestedExecutionLevel node. | ||
--> | ||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" /> | ||
</requestedPrivileges> | ||
</security> | ||
</trustInfo> | ||
|
||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> | ||
<application> | ||
<!-- Windows 10 / Windows Server 2016 --> | ||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" /> | ||
<!-- Windows 8.1 / Windows Server 2012 R2 --> | ||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> | ||
<!-- Windows 8 / Windows Server 2012 --> | ||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> | ||
<!-- Windows 7 / Windows Server 2008 R2 --> | ||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> | ||
<!-- Windows Vista / Windows Server 2008 --> | ||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> | ||
</application> | ||
</compatibility> | ||
</asmv1:assembly> |
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
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
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
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
126 changes: 63 additions & 63 deletions
126
src/chocolatey.resources/helpers/functions/Format-FileSize.ps1
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,63 @@ | ||
# Copyright © 2011 - Present RealDimensions Software, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
Function Format-FileSize { | ||
<# | ||
.SYNOPSIS | ||
DO NOT USE. Not part of the public API. | ||
.DESCRIPTION | ||
Formats file size into a human readable format. | ||
.NOTES | ||
Available in 0.9.10+. | ||
This function is not part of the API. | ||
.INPUTS | ||
None | ||
.OUTPUTS | ||
Returns a string representation of the file size in a more friendly | ||
format based on the passed in bytes. | ||
.PARAMETER Size | ||
The size of a file in bytes. | ||
.PARAMETER IgnoredArguments | ||
Allows splatting with arguments that do not apply. Do not use directly. | ||
.EXAMPLE | ||
Format-FileSize -Size $fileSizeBytes | ||
.LINK | ||
Get-WebFile | ||
#> | ||
param ( | ||
[Parameter(Mandatory=$true, Position=0)][double] $size, | ||
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments | ||
) | ||
|
||
# Do not log function call, it interrupts the single line download progress output. | ||
|
||
Foreach ($unit in @('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB')) { | ||
If ($size -lt 1024) { | ||
return [string]::Format("{0:0.##} {1}", $size, $unit) | ||
} | ||
$size /= 1024 | ||
} | ||
|
||
return [string]::Format("{0:0.##} YB", $size) | ||
} | ||
# Copyright © 2011 - Present RealDimensions Software, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
Function Format-FileSize { | ||
<# | ||
.SYNOPSIS | ||
DO NOT USE. Not part of the public API. | ||
.DESCRIPTION | ||
Formats file size into a human readable format. | ||
.NOTES | ||
Available in 0.9.10+. | ||
This function is not part of the API. | ||
.INPUTS | ||
None | ||
.OUTPUTS | ||
Returns a string representation of the file size in a more friendly | ||
format based on the passed in bytes. | ||
.PARAMETER Size | ||
The size of a file in bytes. | ||
.PARAMETER IgnoredArguments | ||
Allows splatting with arguments that do not apply. Do not use directly. | ||
.EXAMPLE | ||
Format-FileSize -Size $fileSizeBytes | ||
.LINK | ||
Get-WebFile | ||
#> | ||
param ( | ||
[Parameter(Mandatory=$true, Position=0)][double] $size, | ||
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments | ||
) | ||
|
||
# Do not log function call, it interrupts the single line download progress output. | ||
|
||
Foreach ($unit in @('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB')) { | ||
If ($size -lt 1024) { | ||
return [string]::Format("{0:0.##} {1}", $size, $unit) | ||
} | ||
$size /= 1024 | ||
} | ||
|
||
return [string]::Format("{0:0.##} YB", $size) | ||
} |
2 changes: 1 addition & 1 deletion
2
src/chocolatey.resources/helpers/functions/Get-CheckSumValid.ps1
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
2 changes: 1 addition & 1 deletion
2
src/chocolatey.resources/helpers/functions/Get-ChocolateyUnzip.ps1
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
Oops, something went wrong.