Writing to output file fails after build

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 3 years and 10 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
IanUoY
Posts: 91
Last visit: Wed Sep 20, 2023 2:44 am

Writing to output file fails after build

Post by IanUoY »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: Powershell Studio 2020
32 or 64 bit version of product: 64
Operating system: Windows 10 Enterprise
32 or 64 bit OS: 64

*** Please add details and screenshots as needed below. ***

I've been working on a utility that deals with user management, and I want to record changes to a log file, a simple text file.

Quite simply I've defined the file eg:

$disableInactiveLogFile = "I:\Powershell\ExStaff\DisableInactiveUsers.txt"

When I run the applicaion, everything works fine. The information is appended to the file. However, in Deploy if I build and Run, the application runs fine, except it does not append any information to the above log file.

I've no idea why this is and cannot located a reason.

Regards

Ian


DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Writing to output file fails after build

Post by Alexander Riedel »

[Topic moved by moderator]
Please provide some code how you write to that file. Most commonly you do not not have permission from the process or the drive letter simply is not mapped.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 3 years and 10 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