- Update `installpsh-suse.sh` to work with the .tar.gz binary archive.
- Remove `download.sh` as it's not used anywhere now. (checked with PowerShellGet and OneGet, they are using a local copy of download.sh).
* Add Remove-Alias Command. Add Remove-Alias Test. Add Remove-Alias to .psd1.
* Fix code-formatting. Fix ErrorAction on Remove-Alias instead of preference variable. Remove unnecessary Get-Alias calls. Switch Force parameter to auto property. Add ValueFromPipeline to Remove-Alias Name parameter.
* Remove empty lines. Add Remove-Alias to Unix Module .psd1. Add Remove-Alias to approved Commands test. Remove Try/Catch for SessionstateException. Add WriteError for aliasnotfound exception.
* Add ErrorAction Stop to all Get-Alias and Set-Alias Cmdlets in all tests for consistency. Add Should BeNullOrEmpty to "should throw if alias does not exist" test to verify that foo alias really is not there before removing it.
* Changed Remove-Alias parameter Name to String-Array. Changed Cmdlet Process Logic to work with String Array. Added Alias named "ral". Added test case for Alias "ral". Added "ral" Alias to list of approved Aliases. Replaced foo and bar values in all tests with better names.
* Remove "ral"-alias test as this is covered in DefaultCommands.Tests.ps1. Add test for removing multiple alias at once. Fix wrong curly braces positioning.
* Remove $FullCLR in DefaultCommands.Tests.ps1 for Remove-Alias and "ral" alias.
* Add Alias "ral" to Remove-Alias Cmdlet.
* Remove "ral" alias as this is handled by using the [Alias()] attribute on the Remove-Alias Cmdlet.
* Replace alias names used in Remove-Alias Cmdlet tests with GUIDs to avoid collisions
This replaces the code that scanned a script block for suspicious strings.
The previous implementation:
* Tokenized input (generating many strings for garbage collection)
* Used multiple threads
This approach is based on Rubin-Karp and does not allocate any memory
other than a small array to hold the running hash values.
I tested the new and old approaches on 2200 files in the PowerShell repo.
The old code ran in about 1.8-2.1s (ignoring time spent reading files)
The new code runs in about 0.6s and is more stable due to no garbage.
small fixes found while doing current work item
-replace expects a regex when I wanted to do a literal replace.
Have Sync-PSTags fix any issues it find
Using the assembly name to hint at the source of the classes was
problematic in multiple ways.
This change stores the actual filename in an attribute on the assembly.
So for a given type, one can get the assembly this way:
[SomeType].Assembly.GetCustomAttributes() |
? { $_ -is [System.Management.Automation.DynamicClassImplementationAssemblyAttribute] } |
% { $_.ScriptFile }
Since DCOM is not supported in corefx there was a great deal of dead code in the computer cmdlets.
This PR removes all vestiges of DCOM support from:
- Rename-Computer
- Restart-Computer
- Stop-Computer
removing about 4500 lines of dead code. Also, tests are updated to provide more complete coverage.
I also removed test-connection completely to make way for @iSazonov upcoming PR to improve coverage in tests, I created some test hook code which will test the cmdlet code without actually calling the WMI method to restart/rename/stop the system
Previously we used IScriptPosition for context (e.g. error reporting)
during parameter binding, but in some cases we want more information, so
we'll use the Ast instead.
This change just adds the Ast, it doesn't make explicit use of it.
* fix sparse-checkout list
* Run powershell.exe in OpenCover since it will be in the path.
* If there's an error in Start-CodeCoverageRun be sure to log as much as possible
* Make the directory removal code common
* Remove AllScope from most default aliases
To speed up scope creation, I removed AllScope from most default
aliases.
This results in a 15-20% speedup for:
function foo {}
for ($i = 0; $i -lt 100kb; $i++) { & { foo } }
I left AllScope of a few frequently used aliases because it does
make command lookup faster. If we introduce something like dynamic
sites for command lookup, then we could probably remove the rest
of the AllScope aliases.
This is a low-risk breaking change. One can ask for aliases at
a particular scope:
Get-Alias -Scope 1 nsn
This could now fail if the scope number doesn't correspond to global
scope.
The class CommandFactory served no real purpose in command lookup
other than to unnecessarily add a few frames to the call stack,
introduce an extra indirection, and add a couple of unnecessary
checks that essential instances like ExecutionContext are not null.
if something goes wrong during the build, we might exit and not update the badge or fire the webhook.
Enable the after_success and after_failure stages of the travis-ci build so we can have a better chance of getting these done.
pwsh.exe today doesn't contain file version information and the icon is only associated with the shortcut file and not the exe
Fix is to use rcedit to embed:
icon
product version
file version
product name
copyright
Fix#2883Fix#5166Fix#5034