Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在具有HTML标记的Powershell脚本中设置编码UTF8以在HTML页面中显示波斯字符?_Html_Powershell_Encoding_Utf 8 - Fatal编程技术网

如何在具有HTML标记的Powershell脚本中设置编码UTF8以在HTML页面中显示波斯字符?

如何在具有HTML标记的Powershell脚本中设置编码UTF8以在HTML页面中显示波斯字符?,html,powershell,encoding,utf-8,Html,Powershell,Encoding,Utf 8,我是powershell的初学者。我想用powershell创建一个网页,并将HTML标记放入powershell脚本中,如下所示: Import-Module ActiveDirectory '<!doctype html> <html lang="fa"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, us

我是powershell的初学者。我想用powershell创建一个网页,并将HTML标记放入powershell脚本中,如下所示:

Import-Module ActiveDirectory

'<!doctype html>
<html lang="fa">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.2.1/themes/default/style.min.css"/>
    <link rel="stylesheet" href="/assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="/assets/css/style.css">
    <link rel="stylesheet" href="//cdn.rawgit.com/morteza/bootstrap-rtl/master/dist/css/bootstrap-rtl.min.css">
    <title>جستجو</title>
</head>

<body>
<div class="container-fluid">
    <h2>فهرست همه کاربران</h2>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>نام</th>
            <th>نام خانوادگی</th>
            <th>نام کاربری</th>
            <th>واحد سازمانی</th>
            <th>دپارتمان</th>
            <th>عنوان شغلی</th>
            <th>آدرس ایمیل</th>
            <th>شماره تلفن</th>
            <th>وضعیت اکانت</th>

        </tr>
        </thead>
        <tbody>
        <tr>
            <td><input type="text" class="form-control"></td>
            <td><input type="text" class="form-control"></td>
            <td><input type="text" class="form-control"></td>
            <td><input type="text" class="form-control"></td>
            <td><input type="text" class="form-control"></td>
            <td><input type="text" class="form-control"></td>
            <td><input type="text" class="form-control"></td>
            <td><input type="text" class="form-control"></td>
            <td><input type="text" class="form-control"></td>
        </tr>
        <tr>
            <td>firstName</td>
            <td>lastName</td>
            <td>userName</td>
            <td>OU</td>
            <td>Department</td>
            <td>jobTitle</td>
            <td>emailAd</td>
            <td>phonNo</td>
            <td>Enabled</td>
        </tr>

        </tbody>
    </table>
</div>

</body>
</html>'
导入模块ActiveDirectory
'
جستجو
فهرست همه کاربران
نام
نام خانوادگی
نام کاربری
واحد سازمانی
دپارتمان
عنوان شغلی
آدرس ایمیل
شماره تلفن
وضعیت اکانت
名字
姓氏
用户名
欧点
部门
职务
电子邮件广告
芬诺
启用
'

我将HTML标记放在powershell脚本(.ps1文件)的“”中。它显示的一切都是正确的,但我想找到一种方法,将编码设置为UTF8以显示多语言字符。非常感谢您的帮助。

您的意思是希望使用UTF-8编码将整个HTML内容写入文件,对吗

通过管道将整个字符串传递给
Out File-Encoding utf8
命令

'
...
“| Out File-Encoding utf8-Path index.html

您的意思是要使用UTF-8编码将整个HTML内容写入文件,对吗

通过管道将整个字符串传递给
Out File-Encoding utf8
命令

'
...
“| Out File-Encoding utf8-Path index.html