to find all directories with more than 10 files which have had files added since the beginning of the year, sort them by directory size in ascending order and report the directory size, number of files, smallest, largest and average file size along with the last modification time and the full directory path in a sensibly formatted table.
Because PSH passes along the directory object (onto which Measure-Directory has grafted a set of metrics) the pipeline can refine the search using any of the directory properties (timestamps, attributes, etc) and output as many or as few as desired.
PSH has its problems, not least is the fact that all those familiar utilities are no longer the best solutions when working in an object shell, yet in most cases replacements have not been written by MS or the community. It should be remembered that the only complete toolchain developed for PSH so far targeted MS Exchange.
It also has its (lets be kind) idiosyncrasies - compare the slow performance of gci *.exe versus the cmd.exe like performance of gci . *.exe - that make you wonder whether it is overly developed for manipulating system configurations at the expense of care and feeding of a directory hierarchy.
Despite some reservations though, I'd have to say it is an immensely logical shell and while I wouldn't go without the gnu toolchain at the moment, I am curious as to see how PSH compares when it (eventually) gets its own complete toolchain.
"Find me critical bug reports from people on a team with a project due for delivery in 2 weeks"
Where:
the Bug Store contains bug, submitter, project and severity.
the Staff Store contains team assignments
the Project Plan contains team and delivery dates
In other words join.
However, if I am reading between the lines correctly, that may be the tip of the iceberg.
WinFS should not be viewed in isolation from the.NET CLR/CLI and other elements like Monad/MSH.
In the same way as MS is looking to refactor code across language boundaries from shell scripting up to core systems programming, they are now looking to refactor data stores from document browsing up to business critical databases.
The story they are telling developers is all about data refactoring and recombination in value-add data views. Its all about the platform. The CLR(WinFX) and WinFS are targeted at Developers.
Funny, I seem to remember someone at MS making a hullabaloo about developers a while back.
as the software version proposed for use at the forthcoming elections is not as yet finalised, it is impossible for anyone to certify its accuracy;
the issues set out above in relation to the testing of the system make it impossible to determine its accuracy in the context of this report;
certain of the tests performed at the request of the Commission identified an error in the count software which could lead to incorrect distributions of surpluses; there is a possibility that further testing will uncover further software errors;
while eliminating the possibility of certain types of inadvertent voter error, the chosen system introduces the possibility of new types of error in the use by electors of the voting machine, particularly in the context of a number of simultaneous polls;
there is a possibility of interference with the voting machine, ballot module and hardened PC:
in particular, experts retained by the Commission found it very easy to bypass electronic
security measures and gain complete control of the "hardened" PC, overwrite the software,
and thereby in theory to gain complete control over the count in a given constituency,
the examinations carried out by the Commission's experts suggests that these "hardened" PCs are the weakest link in the security of the proposed system and it is significant that there
appears to have been no systematic testing and certification of the "hardening" of the PCs
notwithstanding their susceptibility to either inadvertent error or deliberate manipulation by
those with access to them;
the system allows the inadvertent use of outdated versions of the software, as well as the
overwriting of the software with replacement software;
Larger cars are safer than smaller cars not because they weigh more, but because they have more room to let the car crumple to absorb the energy created by a collision.
Not necessarily so.
BBC's Top Gear programme recently blew large holes in this idea.
They had several vehicles on the show which had been through crash tests.
The differences were plain to see, most graphically through the "close the door test".
A modern small car had a crushed bonnet area, yet it was possible to open and close the door and there was still room to sit into the car.
A large SUV had a somewhat crumpled bonnet. However its door wouldn't close. When they pulled it open the reason was obvious. The steering wheel was pushed back towards the seat, the pedals were almost touching it and the door frame had buckled and was bent downwards.
The difference was the ability of the passenger area to channel energy around the passenger while maintaining integrity. Design is more important than both weight and size.
Given that the majority of the inertia in this vehicle is below the floor of the passenger compartment, a design where this shears away may even be possible.
In that case being inside a dense bullet that diverts the other cars inertia around me, so that the only inertia I have to worry about is the inertia of my own passenger compartment, sounds like a good place to be.
Powershell doesn't have a du command as standard - however I knocked together this script:
e ,fullname -auto -wrap
function global:Measure-Directory
{
param (
[string]$Path = (write-error `
"Usage: Measure-Directory [-Path] path [-Recurse]"),
[switch]$Recurse = $false
)
process {
gci $Path -Rec:$Recurse |
? { $_.psiscontainer } |
% { $dir=$_; gci $_.fullname |
? { -not $_.psiscontainer } |
measure -sum -average -minimum -maximum length |
% {
add-member -name Length -value $_.Sum -membertype NoteProperty -pass -inp $dir |
add-member -name Count -value $_.Count -membertype NoteProperty -pass |
add-member -name Average -value $_.Average -membertype NoteProperty -pass |
add-member -name Minimum -value $_.Minimum -membertype NoteProperty -pass |
add-member -name Maximum -value $_.Maximum -membertype NoteProperty -pass
}
}
}
}
set-alias du Measure-Directory
that would allow me to issue:
du -r / |sort length -desc > mem.txt
But it would also allow me to issue:
du / -rec |? {$_.count -gt 10}|? {$_.LastWriteTime -gt "2007-01"} |sort length |ft Length,Count,Minimum,Maximum,Average,LastWriteTim
to find all directories with more than 10 files which have had files added since the beginning of the year, sort them by directory size in ascending order and report the directory size, number of files, smallest, largest and average file size along with the last modification time and the full directory path in a sensibly formatted table.
Because PSH passes along the directory object (onto which Measure-Directory has grafted a set of metrics) the pipeline can refine the search using any of the directory properties (timestamps, attributes, etc) and output as many or as few as desired.
PSH has its problems, not least is the fact that all those familiar utilities are no longer the best solutions when working in an object shell, yet in most cases replacements have not been written by MS or the community. It should be remembered that the only complete toolchain developed for PSH so far targeted MS Exchange.
It also has its (lets be kind) idiosyncrasies - compare the slow performance of gci *.exe versus the cmd.exe like performance of gci . *.exe - that make you wonder whether it is overly developed for manipulating system configurations at the expense of care and feeding of a directory hierarchy.
Despite some reservations though, I'd have to say it is an immensely logical shell and while I wouldn't go without the gnu toolchain at the moment, I am curious as to see how PSH compares when it (eventually) gets its own complete toolchain.
"Find me critical bug reports from people on a team with a project due for delivery in 2 weeks"
Where:
In other words join.
However, if I am reading between the lines correctly, that may be the tip of the iceberg.
WinFS should not be viewed in isolation from the .NET CLR/CLI and other elements like Monad/MSH.
In the same way as MS is looking to refactor code across language boundaries from shell scripting up to core systems programming, they are now looking to refactor data stores from document browsing up to business critical databases.
The story they are telling developers is all about data refactoring and recombination in value-add data views. Its all about the platform. The CLR(WinFX) and WinFS are targeted at Developers.
Funny, I seem to remember someone at MS making a hullabaloo about developers a while back.
- as the software version proposed for use at the forthcoming elections is not as yet finalised, it is impossible for anyone to certify its accuracy;
- the issues set out above in relation to the testing of the system make it impossible to determine its accuracy in the context of this report;
- certain of the tests performed at the request of the Commission identified an error in the count software which could lead to incorrect distributions of surpluses; there is a possibility that further testing will uncover further software errors;
- while eliminating the possibility of certain types of inadvertent voter error, the chosen system introduces the possibility of new types of error in the use by electors of the voting machine, particularly in the context of a number of simultaneous polls;
- there is a possibility of interference with the voting machine, ballot module and hardened PC:
- in particular, experts retained by the Commission found it very easy to bypass electronic
security measures and gain complete control of the "hardened" PC, overwrite the software,
and thereby in theory to gain complete control over the count in a given constituency,
- the examinations carried out by the Commission's experts suggests that these "hardened" PCs are the weakest link in the security of the proposed system and it is significant that there
appears to have been no systematic testing and certification of the "hardening" of the PCs
notwithstanding their susceptibility to either inadvertent error or deliberate manipulation by
those with access to them;
- the system allows the inadvertent use of outdated versions of the software, as well as the
overwriting of the software with replacement software;
Accurate from what they've seen so far?Not necessarily so.
BBC's Top Gear programme recently blew large holes in this idea.
They had several vehicles on the show which had been through crash tests. The differences were plain to see, most graphically through the "close the door test".
A modern small car had a crushed bonnet area, yet it was possible to open and close the door and there was still room to sit into the car.
A large SUV had a somewhat crumpled bonnet. However its door wouldn't close. When they pulled it open the reason was obvious. The steering wheel was pushed back towards the seat, the pedals were almost touching it and the door frame had buckled and was bent downwards.
The difference was the ability of the passenger area to channel energy around the passenger while maintaining integrity. Design is more important than both weight and size.
Given that the majority of the inertia in this vehicle is below the floor of the passenger compartment, a design where this shears away may even be possible.
In that case being inside a dense bullet that diverts the other cars inertia around me, so that the only inertia I have to worry about is the inertia of my own passenger compartment, sounds like a good place to be.