-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path_movefiles.ps1
34 lines (31 loc) · 961 Bytes
/
_movefiles.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function MoveQBasic
{
$list = Get-ChildItem -Filter *.bas
foreach ($file in $list)
{
$c = Get-Content $file -totalcount 5 # read first 5 lines
if ($c[0] -notmatch '^\d' -AND $c[1] -notmatch '^\d' -AND $c[2] -notmatch '^\d')
{
Move-Item $file -Destination _QB\ #-WhatIf
}
#Write-Host $file + " => " + $n
#Move-Item $n -Destination asc\ #-WhatIf
#Move-Item $file -Destination 1\ #-WhatIf
}
}
function MoveGWBasic
{
$list = Get-ChildItem -Filter *.bas
foreach ($file in $list)
{
$c = Get-Content $file -totalcount 5 # read first 5 lines
if ($c[0] -match '^\d' -AND $c[1] -match '^\d' -AND $c[2] -match '^\d')
{
Move-Item $file -Destination 1\ #-WhatIf
}
#Write-Host $file + " => " + $n
#Move-Item $n -Destination asc\ #-WhatIf
#Move-Item $file -Destination 1\ #-WhatIf
}
}
MoveQBasic