Application not working in Windows 10

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 8 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
User avatar
tirwin@iot.in.gov
Posts: 40
Last visit: Tue Mar 14, 2017 9:54 am

Application not working in Windows 10

Post by tirwin@iot.in.gov »

I have created an app for back up and restore of computers. I also allows modification of ADObjects through the use of custom Profile.ps1 file. The app runs fine in the ISE with no errors and works properly no errors in Windows 7. However when I try to run it in a newly imaged Windows 10 machine I get "Property Can Not Be Found" errors on all my object propertys. The thing is I can read all the propetys when I fill comboboxes fine. The error only occurs when the form is submitted. I will attach 1 of the forms I am having a problem with. Again it runs fine in Windows 7 But not Windows 10. could this be a problem with Microsoft updates. Also "Yes" I am setting "Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted". Thanks
Attachments
No.psf
(105.87 KiB) Downloaded 179 times
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Application not working in Windows 10

Post by jvierra »

You cannot set execution policy inside of a script.

From an elevated prompt run this:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned


Then run your script in PowerShell CLI and note all errors.
User avatar
tirwin@iot.in.gov
Posts: 40
Last visit: Tue Mar 14, 2017 9:54 am

Re: Application not working in Windows 10

Post by tirwin@iot.in.gov »

With all do respect I did do that, and my application runs with no errors in Windows 7 but has multiple errors on all of the object propertys in Windows 10. That is my problem. I there a method to send you the intire .exe and a .ps1 file that goes with it? I attempted to upload and it will not take it.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Application not working in Windows 10

Post by jvierra »

What are the errors? What is the exact first error? What do you see when you run the ps1 from powershell CLI.

You can get the errors from $error

THe errors will tell you want is missing. I suspect you do not have RSAT installed.
This topic is 8 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