PS2EXE和Active Directory集成 [英] PS2EXE and Active Directory Integration

查看:266
本文介绍了PS2EXE和Active Directory集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我已经试过包装我的剧本到一个EXE使用PS2EXE之一,它的伟大工程!但由于某些原因,使用AD功能时,它给了我一大堆背景的文本,从而使通过脚本几乎是不可能的互动!看到图片如下: href="http://i.stack.imgur.com/41ThH.png" rel="nofollow">

我做我的研究,只找到一个其他的论坛,任何人都有这个问题,也没有解决。这似乎只当使用AD功能,并导入AD模块之后发生的。我试过重新我所有的错误和警告动作preferences,它并不会影响本以任何方式。我认为这只是信息,但它使人们难以看到需要确认或输入,除非我回去改变前景色所有我写主机文本的文本。

有没有人见过这个,或者对如何晚饭preSS的信息输出的任何想法?

谢谢!

解决方案

我不熟悉PS2EXE但看着截图,我认为这是从进度流呼应的数据。两件事情,我会建议:

  1. 如果你不使用AD驱动器(AD:>在PowerShell中),禁用它。它需要永远载入,这就是的发电屏幕上的东西。将这个线你​​的脚本的顶部,这样做的:

$ ENV:ADPS_LoadDefaultDrive = 0

<醇开始=2>
  • 您可以通过加入这一行隐藏一般在你的脚本进度信息:
  • $进展preference = SilentlyContinue

    So I've tried wrapping one of my scripts into an exe using PS2EXE, and it works great! But for some reason, when using AD functions, it gives me a whole bunch of background text which makes interacting with the script nearly impossible! See the pictures below:

    I've done my research, and have only found one other forum where anybody had this issue, and there was no resolution. This only seems to happen when using AD functions, and after importing the AD Module. I've tried resetting all of my error and warning action preferences and it does not affect this in any way. I think it's just informative, but it makes it difficult to see the text requiring acknowledgement or input unless I go back and change the foreground color on all of my write-host text.

    Has anybody seen this before, or have any ideas on how to suppress the informative output?

    Thanks!

    解决方案

    I am not familiar with PS2EXE but looking at the screenshot, I think it's echoing data from the progress stream. Two things I would recommend:

    1. If you're not using the AD drive (AD:> in PowerShell), disable it. It takes forever to load and that's what's generating the stuff on the screen. Put this line at the top of your script to do so:

    $Env:ADPS_LoadDefaultDrive = 0

    1. You can hide progress info in general in your script by adding this line:

    $ProgressPreference = SilentlyContinue

    这篇关于PS2EXE和Active Directory集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆