1
I am trying to create a powershell script to manipulate the files in a directory, but when using the parameter -Recurse I haven’t been getting the sub-folders items
    # onde $source = C:\Files
    # e dentro de Files tem mais duas pastas 001 e 002 com arquivos dentros
    Get-ChildItem -Path $source -Recurse -Filter * |
    ForEach-Object {
        #Recupera a data atual da movimentação
        $date = (Get-Date).ToString();
        #Adiciona conteúdo ao arquivo $log com a data atual da movimentação
        Add-Content -Path $log " $date - O arquivo $_ foi transferido de $source para $target";
        #Escreve em tela
        Write-Host " $date - O arquivo $_ foi transferido de $source para $target";
        #Realiza a copia dos itens
        Move-Item $_.FullName $target;
    }
when I test the command Get-ChildItem -Path $source -Recurse ... in the cmdlet of the powershell it runs normal, but within the ps1 script it does not
Try running Ise as administrator ... not sure if it will solve. Ta talking powershell questions here :P
– rray
i am as administrator already and the script is with rights too
– Tafarel Chicotti