Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Powershell foreach but string gets cut off

$
0
0

Hello,

I am writing a powershell script, that queries a table, brings back results, but i am doing a foreach so it can run a SQL command for each database. That part works fine, however when i look at the error message it says:

Cannot find path: Z:\Home\Backups\Database_1\Database_1

_001001.trn

So it seems either the string is getting cut off or is putting it on the next line... which is causing it not to backup because then it says "Path not found", is there something i can use to make sure the string is complete like this below:

Z:\Home\Backups\Database_1\Database_1_001001.trn

i did see a -AutoSize... but not sure how or where to implement it on the foreach loop or string etc.?


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>