Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I Want front end coding for below powershell script

Thanks

N Mayilazhagan


$ServerName= read-host "Please enter your Server Name:"
$UserName=read-host "Please enter your user name"
$EncrPassword=Read-Host "Enter Password" -assecurestring 
$Password=[System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($EncrPassword))
$databaseName= read-host "Please enter your database Name"

write-host ""
$out="D:\tools\ExecutionLog.txt"
$FolderPath= "D:\tools\test"
$SQLFiles = Get-ChildItem $FolderPath | where {!$_.PsIsContainer} 
foreach($file in $SQLFiles) 
{
    write-host ""
	write-host $file
    $file.Name | Out-File -Filepath $out -append
	$file=$FolderPath+"\"+$file
    
    sqlcmd -U $UserName -P $Password -b -S $ServerName -d $databaseName -i $file

    if($LASTEXITCODE -eq 0)
    {
        write-host ""
        write-host "Success"
        "Success" | Out-File -FilePath $out  -append
    	"" | Out-File -FilePath $out  -append
    	write-host ""
    }
    else
    {
        Get-Content $out
    	Get-Content $out | Out-File -FilePath $out  -append
    	"" | Out-File -FilePath $out  -append
    }
}

Start-Process notepad -WindowStyle normal $out
Posted
Updated 2-Dec-14 5:50am
v4
Comments
Richard MacCutchan 2-Dec-14 11:38am    
What do you mean by "front end coding"?
Member 11280427 2-Dec-14 11:58am    
I want gui
Richard MacCutchan 2-Dec-14 12:32pm    
Then you should start writing one.

1 solution

It doesn't quite work like that.
We do not do your work for you.
If you want someone to write your code, you have to pay - I suggest you go to Freelancer.com and ask there.

But be aware: you get what you pay for. Pay peanuts, get monkeys.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900