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.
This topic is 4 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by jvierra »

Please download the PSF I posted. It has all of the various ways to do this. Take your pick.
mikarin
Posts: 10
Last visit: Thu Oct 22, 2020 6:18 am

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by mikarin »

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 1600 times
deneme.psf
(22.52 KiB) Downloaded 69 times
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by jvierra »

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: 10
Last visit: Thu Oct 22, 2020 6:18 am

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by mikarin »

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 1594 times
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by jvierra »

Please do not post images of code or errors. They are unreadable in any browser.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by jvierra »

How do you know it is not completing?
mikarin
Posts: 10
Last visit: Thu Oct 22, 2020 6:18 am

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by mikarin »

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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: SharePoint Commands Run itself bu Not with Powershell Studio

Post by jvierra »

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.
This topic is 4 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked