SharePoint Commands Run itself bu Not with Powershell Studio

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
jvierra
Posts: 14145
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by jvierra » Sun Jan 26, 2020 5:16 am

Please download the PSF I posted. It has all of the various ways to do this. Take your pick.

mikarin
Posts: 6
Joined: Sat Jan 25, 2020 5:51 am

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by mikarin » Sun Jan 26, 2020 12:02 pm

Still stucking at same point.
I quite a new on this and running out of idea about what to do.
Attachments
Untitled.png
Untitled.png (4.91 KiB) Viewed 129 times
deneme.psf
(22.52 KiB) Downloaded 6 times

jvierra
Posts: 14145
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by jvierra » Sun Jan 26, 2020 12:25 pm

Sorry - I had a typo/defficiency.

This line:
$textboxCorrelationID.Text = [Microsoft.VisualBasic.Interaction]::InputBox('Correlation', 'Enter the CorrelationID:')

Should be:
$textboxCorrelationID.Text = [Microsoft.VisualBasic.Interaction]::InputBox('Correlation', 'Enter the CorrelationID:')

Also - why did you add these two lines. They are unneccesary.
[b}$user = $env:USERNAME
$path = [void][Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic')
[/b]

mikarin
Posts: 6
Joined: Sat Jan 25, 2020 5:51 am

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by mikarin » Sun Jan 26, 2020 1:56 pm

I corrected the mistakes but i don`t know why it not completing the cmdlet. I thought its just basic project where i can perform daily basis but it seems that will be harder every step.
The account have every permissions.
More than about cmdlet , i think something need to be checked at the end of the script but my knowledge not enough the figure out what :)
Attachments
Untitled.png
Untitled.png (67.17 KiB) Viewed 123 times

jvierra
Posts: 14145
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by jvierra » Sun Jan 26, 2020 2:55 pm

Please do not post images of code or errors. They are unreadable in any browser.

jvierra
Posts: 14145
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by jvierra » Sun Jan 26, 2020 2:56 pm

How do you know it is not completing?

mikarin
Posts: 6
Joined: Sat Jan 25, 2020 5:51 am

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by mikarin » Sun Jan 26, 2020 3:08 pm

Because its not creating a file where it supposed to be on desktop. -path C:\user..... The screenshot i added because more than error, i wanted to show that progress bar. That stucks all time at same point.

jvierra
Posts: 14145
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by jvierra » Sun Jan 26, 2020 3:18 pm

What progress bar? The progress bar indicates that the command is running. It can take a lot of time.
Be sure you test the command at a prompt. Also test the command with a hard coded value that you know works.

Also try what Alex posted and be sure to set the threading model.

Locked