Hey all, I'm new to Powershell (but who isn't, eh?), but I've been writing all sorts of management scripts in VBScript for years now, and I need help with a script. I have a VBScript that crawls a directory tree and, checks for files that haven't been accessed in over a year, and then outputs the name and path of all of these files to a text file. The main reason that I'm converting it to Powershell is that PS doesn't appear to be having trouble with foreign characters, specifically Japanese, whereas I can't get VBScript to do anything but crash when it gets to Japanese characters.
At any rate, I've just gotten started and below is all of the code that I have so far:
I'm probably making this far too complicated, but the issue that I have at the moment is that when it puts the output to a text file I get the same text as I would on the screen rather than the full text. For example, if I have a particularly long path in the filename, when it gets to character 117 or so on that line it just substitutes "..." for the remainder of the name. Since this output file will be parsed by an archive process later, I actually do need the full path and filenames. Anyone know how I can make it output all of the data instead of doing a "yadda yadda yadda" to me?
At any rate, I've just gotten started and below is all of the code that I have so far:
Code:
$target = $args[0]
$age = $args[1]
function crawltree($folder)
{
$dirs = get-childitem $target -Recurse | Where {$_.psIsContainer -eq $true}
$dirs | select-object FullName -verbose | out-file -filepath results.txt
}
crawltree($target)
I'm probably making this far too complicated, but the issue that I have at the moment is that when it puts the output to a text file I get the same text as I would on the screen rather than the full text. For example, if I have a particularly long path in the filename, when it gets to character 117 or so on that line it just substitutes "..." for the remainder of the name. Since this output file will be parsed by an archive process later, I actually do need the full path and filenames. Anyone know how I can make it output all of the data instead of doing a "yadda yadda yadda" to me?