Find Jobs
Hire Freelancers

Powershell Script that finds unpaired files

$15 USD

Selesai
Disiarkan sekitar 5 tahun yang lalu

$15 USD

Dibayar semasa penghantaran
I need a Powershell script that scans a folder, and for each ' .BP' file in the folder, checks whether there is a file with the same name, but ending in '[login to view URL]'. Example: A file exists in this folder with the following name: 20190307_1343 - [login to view URL] Check whether a file with the name '20190307_1343 - [login to view URL]' exists. For each .BP file found in this folder for which there is not also another file with the same name but ending in '[login to view URL]', the filenames should be collected, and stored in a variable in XML format. The XML should look like: <UnpairedFileList> <File><Name>20190307_1343 - [login to view URL]</Name></File> ......... </UnpairedFileList> The XML variable's contents should be written to a file path. The file path should be sent to this powershell script via a COMMANDLINE argument. Another app will be running this powershell script and sending the file path for where the results should be saved.
ID Projek: 19210726

Tentang projek

7 cadangan
Projek jarak jauh
Aktif 5 tahun yang lalu

Ingin menjana wang?

Faedah membida di Freelancer

Tetapkan bajet dan garis masa anda
Dapatkan bayaran untuk kerja anda
Tuliskan cadangan anda
Ianya percuma untuk mendaftar dan membida pekerjaan
Dianugerahkan kepada:
Avatar Pengguna
Hi, Here is the script: # param ( [Parameter(Mandatory=$true)][string]$InFolderPath, [Parameter(Mandatory=$true)][string]$XMLFilePath ) $InFolderPath = $InFolderPath + "\*" #Array of [login to view URL] $RollBackFiles = Get-ChildItem -Path $InFolderPath -Include "*[login to view URL]" |%{ $[login to view URL] -replace "_rollback", ""} #Array of base .bp $BPFiles = Get-ChildItem -Path $InFolderPath -Include "*.bp" -Exclude "*[login to view URL]" |%{ $[login to view URL]} #Create XML Doc [xml]$XMLDoc = New-Object [login to view URL] #Add Declaration to the XML Doc $Declaration = $[login to view URL]("1.0","UTF-8",$null) $[login to view URL]($Declaration) |Out-Null #Add Root Node to the XML Doc (UnpairedFileList) $UnpairedListRoot = $[login to view URL]("element","UnpairedFileList",$null) #Add File and Name nodes foreach unpaired base file foreach ($file in $BPFiles | where {$_ -notin $RollBackFiles}) { #Create File node $FileNode = $[login to view URL]("element","File",$null) #Create Name element and set its value to the file $NameNode = $[login to view URL]("Name") $[login to view URL] = $file +".bp" #Add Name as child to the File $[login to view URL]($NameNode) | Out-Null #Add File as child to the Root $[login to view URL]($FileNode) | Out-Null } #Add Root to the XML Document $[login to view URL]($UnpairedListRoot) | Out-Null #Save $[login to view URL]($XMLFilePath) #to call it: [login to view URL] -noexit -file "C:\[login to view URL]" "C:\Inputs" "C:\[login to view URL]" Hope it helps Regards Marcin
$15 USD dalam 0 hari
0.0 (0 ulasan)
0.0
0.0
7 pekerja bebas membida secara purata $28 USD untuk pekerjaan ini
Avatar Pengguna
Hi, I have over five years experience automating tasks with powershell, I can do this job. Please see my work history for relevant feedback.
$35 USD dalam 2 hari
5.0 (20 ulasan)
4.7
4.7
Avatar Pengguna
Hey, I'm Romain, a french Microsoft certified guy (MCSA and MSCE) I can do this script for you please contact me for informations. Best regards, Romain
$30 USD dalam 1 hari
5.0 (3 ulasan)
2.7
2.7
Avatar Pengguna
Hey there, I'm a System Engineer with coding skills. I had developed tons of scripts using PowerShell. I can help. Regards.
$35 USD dalam 1 hari
5.0 (5 ulasan)
2.5
2.5
Avatar Pengguna
I could pair the BP files for you with powershell :) I'm doing this kind of work on a daily basis for my job and I can complete this task. the only thing I need to know is when you need it done.
$20 USD dalam 10 hari
5.0 (4 ulasan)
1.8
1.8
Avatar Pengguna
Hello, my name is Kabir Lovero, and I have 5+ years of experience of working as a Support Engineer, and programmer. Powershell is my scripting language of choice, and I've completed various projects relatedd to this. Such as looking through log files for specific tags, and performed actions accordingly, sorting files and checked system data and triggered functions, also encryption of data and various others. I believe that i will be able to write the code for you in about 4 days, so that enough testing will be done to give you a complete product. Let's discuss this further best regards
$35 USD dalam 1 hari
0.0 (0 ulasan)
0.0
0.0
Avatar Pengguna
Hello I have 5 years of development and automating experience and have worked on multiple automation projects for public cloud services provider I can deliver your project as per your requirements lets start chat to discuss this
$25 USD dalam 1 hari
0.0 (0 ulasan)
0.0
0.0

Tentang klien

Bendera UNITED STATES
Kingwood, United States
5.0
6
Kaedah pembayaran disahkan
Ahli sejak Jul 21, 2018

Pengesahan Klien

Terima kasih! Kami telah menghantar pautan melalui e-mel kepada anda untuk menuntut kredit percuma anda.
Sesuatu telah berlaku semasa menghantar e-mel anda. Sila cuba lagi.
Pengguna Berdaftar Jumlah Pekerjaan Disiarkan
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuatkan pratonton
Kebenaran diberikan untuk Geolocation.
Sesi log masuk anda telah luput dan telah dilog keluar. Sila log masuk sekali lagi.