Part of my script looks as follows:
move-item -path $_.FullName+"\*.7z" -destination "$destination"
it returns error:
Move-Item : A positional parameter cannot be found that accepts argument '+*.7z'. At line:32 char:4 + move-item -path $_.FullName+"*.7z" -destination "$destin ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Move-Item], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.MoveItemCommand
But, if I change that variable to exact value, that works:
move-item -path "D:\test1\test2\test3\test4\*.7z" -destination "$destination"
What is the problem?